From cc20ecfa1b8c151690e8d12c8ad5c544fa1a4a5a Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Thu, 18 Jul 2013 15:07:57 +0800 Subject: Bug 804708: Add a 'Review' extension to customise the review flag for Mozilla's workflow (make requestee/reviewer mandatory, provide review suggestions, etc) --- .../admin/components/edit-common-rows.html.tmpl | 22 ++++++ .../hook/admin/products/edit-common-rows.html.tmpl | 28 ++++++++ .../hook/admin/products/updated-changes.html.tmpl | 19 +++++ .../default/hook/attachment/create-end.html.tmpl | 20 ++++++ .../en/default/hook/attachment/edit-end.html.tmpl | 15 ++++ .../default/hook/bug/create/create-end.html.tmpl | 16 +++++ .../en/default/hook/flag/list-requestee.html.tmpl | 17 +++++ .../en/default/hook/global/header-start.html.tmpl | 81 ++++++++++++++++++++++ .../hook/global/user-error-errors.html.tmpl | 12 ++++ 9 files changed, 230 insertions(+) create mode 100644 extensions/Review/template/en/default/hook/admin/components/edit-common-rows.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/admin/products/edit-common-rows.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/admin/products/updated-changes.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/attachment/create-end.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/attachment/edit-end.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/bug/create/create-end.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/flag/list-requestee.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/global/header-start.html.tmpl create mode 100644 extensions/Review/template/en/default/hook/global/user-error-errors.html.tmpl (limited to 'extensions/Review/template/en/default') diff --git a/extensions/Review/template/en/default/hook/admin/components/edit-common-rows.html.tmpl b/extensions/Review/template/en/default/hook/admin/components/edit-common-rows.html.tmpl new file mode 100644 index 000000000..befb183b2 --- /dev/null +++ b/extensions/Review/template/en/default/hook/admin/components/edit-common-rows.html.tmpl @@ -0,0 +1,22 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + + + Suggested Reviewers: + + [% INCLUDE global/userselect.html.tmpl + id => "reviewers" + name => "reviewers" + value => comp.reviewers + size => 64 + emptyok => 1 + title => "One or more email address (comma delimited)" + placeholder => product.reviewers + %] + + diff --git a/extensions/Review/template/en/default/hook/admin/products/edit-common-rows.html.tmpl b/extensions/Review/template/en/default/hook/admin/products/edit-common-rows.html.tmpl new file mode 100644 index 000000000..da41f7dde --- /dev/null +++ b/extensions/Review/template/en/default/hook/admin/products/edit-common-rows.html.tmpl @@ -0,0 +1,28 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + + + Reviewer required: + + + + + + Suggested Reviewers: + + [% INCLUDE global/userselect.html.tmpl + id => "reviewers" + name => "reviewers" + value => product.reviewers + size => 64 + emptyok => 1 + title => "One or more email address (comma delimited)" + %] + + diff --git a/extensions/Review/template/en/default/hook/admin/products/updated-changes.html.tmpl b/extensions/Review/template/en/default/hook/admin/products/updated-changes.html.tmpl new file mode 100644 index 000000000..667848281 --- /dev/null +++ b/extensions/Review/template/en/default/hook/admin/products/updated-changes.html.tmpl @@ -0,0 +1,19 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% IF changes.reviewers.defined %] +

+ Updated suggested reviewers from '[% changes.reviewers.0 FILTER html %]' to + '[% product.reviewers FILTER html %]'. +

+[% END %] +[% IF changes.reviewer_required.defined %] +

+ [% changes.reviewer_required.1 ? "Enabled" : "Disabled" %] 'review required'. +

+[% END %] diff --git a/extensions/Review/template/en/default/hook/attachment/create-end.html.tmpl b/extensions/Review/template/en/default/hook/attachment/create-end.html.tmpl new file mode 100644 index 000000000..c8e2a68a1 --- /dev/null +++ b/extensions/Review/template/en/default/hook/attachment/create-end.html.tmpl @@ -0,0 +1,20 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% UNLESS bug %] + [% bug = attachment.bug %] +[% END %] + +[% IF bug.product_obj.reviewer_required %] + +[% END %] diff --git a/extensions/Review/template/en/default/hook/attachment/edit-end.html.tmpl b/extensions/Review/template/en/default/hook/attachment/edit-end.html.tmpl new file mode 100644 index 000000000..bc6230d1c --- /dev/null +++ b/extensions/Review/template/en/default/hook/attachment/edit-end.html.tmpl @@ -0,0 +1,15 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% IF attachment.bug.product_obj.reviewer_required %] + +[% END %] diff --git a/extensions/Review/template/en/default/hook/bug/create/create-end.html.tmpl b/extensions/Review/template/en/default/hook/bug/create/create-end.html.tmpl new file mode 100644 index 000000000..a59cef950 --- /dev/null +++ b/extensions/Review/template/en/default/hook/bug/create/create-end.html.tmpl @@ -0,0 +1,16 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + + diff --git a/extensions/Review/template/en/default/hook/flag/list-requestee.html.tmpl b/extensions/Review/template/en/default/hook/flag/list-requestee.html.tmpl new file mode 100644 index 000000000..a3f0e8a44 --- /dev/null +++ b/extensions/Review/template/en/default/hook/flag/list-requestee.html.tmpl @@ -0,0 +1,17 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% RETURN UNLESS type.name == 'review' %] + + +   (suggested reviewers) + + + diff --git a/extensions/Review/template/en/default/hook/global/header-start.html.tmpl b/extensions/Review/template/en/default/hook/global/header-start.html.tmpl new file mode 100644 index 000000000..6063aa920 --- /dev/null +++ b/extensions/Review/template/en/default/hook/global/header-start.html.tmpl @@ -0,0 +1,81 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% RETURN UNLESS template.name == 'attachment/edit.html.tmpl' + || template.name == 'attachment/create.html.tmpl' + || template.name == 'attachment/diff-header.html.tmpl' + || template.name == 'bug/create/create.html.tmpl' %] + +[% style_urls.push('extensions/Review/web/style/review.css') %] +[% javascript_urls.push('extensions/Review/web/js/review.js') %] + +[% IF bug %] + [%# create attachment %] + [% mentor = bug.mentor %] + [% product_obj = bug.product_obj %] + [% component_obj = bug.component_obj %] +[% ELSIF attachment.bug %] + [%# edit attachment %] + [% mentor = attachment.bug.mentor %] + [% product_obj = attachment.bug.product_obj %] + [% component_obj = attachment.bug.component_obj %] +[% ELSE %] + [%# create bug %] + [% mentor = '' %] + [% product_obj = product %] + [% component_obj = 0 %] +[% END %] + +[% review_js = BLOCK %] + review_suggestions = { + [% IF mentor %] + _mentor: [% PROCESS reviewer u = mentor %], + [% END %] + + [% IF product_obj.reviewers %] + _product: [ + [% FOREACH u = product_obj.reviewers_objs %] + [% PROCESS reviewer %][% "," UNLESS loop.last %] + [% END %] + ], + [% END %] + + [% IF component_obj %] + [%# single component (create/edit attachment) %] + '[% component_obj.name FILTER js %]': [ + [% FOREACH u = component_obj.reviewers_objs %] + [% PROCESS reviewer %][% "," UNLESS loop.last %] + [% END %] + ], + [% ELSE %] + [%# all components (create bug) %] + [% FOREACH c = product_obj.components %] + [% NEXT UNLESS c.reviewers %] + '[% c.name FILTER js %]': [ + [% FOREACH u = c.reviewers_objs %] + [% PROCESS reviewer %][% "," UNLESS loop.last %] + [% END %] + ], + [% END %] + [% END %] + + [%# to keep IE happy, no trailing commas %] + _end: 1 + }; + + [% IF component_obj %] + static_component = '[% component_obj.name FILTER js %]'; + [% ELSE %] + static_component = false; + [% END %] +[% END %] +[% javascript = javascript _ review_js %] + +[% BLOCK reviewer %] + { login: '[% u.login FILTER js%]', identity: '[% u.identity FILTER js %]' } +[% END %] diff --git a/extensions/Review/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/Review/template/en/default/hook/global/user-error-errors.html.tmpl new file mode 100644 index 000000000..4265f4b32 --- /dev/null +++ b/extensions/Review/template/en/default/hook/global/user-error-errors.html.tmpl @@ -0,0 +1,12 @@ +[%# This Source Code Form is subject to the terms of the Mozilla Public + # License, v. 2.0. If a copy of the MPL was not distributed with this + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + # This Source Code Form is "Incompatible With Secondary Licenses", as + # defined by the Mozilla Public License, v. 2.0. + #%] + +[% IF error == "reviewer_required" %] + [% title = "Reviewer Required" %] + You must provide a reviewer for review requests. +[% END %] -- cgit v1.2.3-24-g4f1b