summaryrefslogtreecommitdiffstats
path: root/extensions/Needinfo/template
diff options
context:
space:
mode:
authorByron Jones <glob@mozilla.com>2015-03-10 06:07:56 +0100
committerByron Jones <glob@mozilla.com>2015-03-10 06:07:56 +0100
commitef96ae157223b3309f7703798b32b0b386b2edff (patch)
treecd0f3c6f234d40998fa6e85ad32c3cac025b610a /extensions/Needinfo/template
parent9250c96075fda4a6a11b0f09e42423c650debcec (diff)
downloadbugzilla-ef96ae157223b3309f7703798b32b0b386b2edff.tar.gz
bugzilla-ef96ae157223b3309f7703798b32b0b386b2edff.tar.xz
Bug 1003701: add the ability for users to prevent review/feedback/needinfo requests
Diffstat (limited to 'extensions/Needinfo/template')
-rw-r--r--extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl54
-rw-r--r--extensions/Needinfo/template/en/default/hook/account/prefs/account-field.html.tmpl25
-rw-r--r--extensions/Needinfo/template/en/default/hook/global/setting-descs-settings.none.tmpl11
-rw-r--r--extensions/Needinfo/template/en/default/hook/global/user-error-errors.html.tmpl4
4 files changed, 71 insertions, 23 deletions
diff --git a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
index 5edd70f72..7e32509bf 100644
--- a/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
+++ b/extensions/Needinfo/template/en/default/bug/needinfo.html.tmpl
@@ -6,22 +6,24 @@
# defined by the Mozilla Public License, v. 2.0.
#%]
-[% needinfo_flagtype = "" %]
-[% needinfo_flags = [] %]
+[%
+ needinfo_flagtype = "";
+ needinfo_flags = [];
-[% FOREACH type = bug.flag_types %]
- [% IF type.name == 'needinfo' %]
- [% needinfo_flagtype = type %]
- [% FOREACH flag = type.flags %]
- [% IF flag.status == '?' %]
- [% needinfo_flags.push(flag) %]
- [% END %]
- [% END %]
- [% LAST IF needinfo_flagtype %]
- [% END %]
-[% END %]
+ FOREACH type = bug.flag_types;
+ IF type.name == 'needinfo';
+ needinfo_flagtype = type;
+ FOREACH flag = type.flags;
+ IF flag.status == '?';
+ needinfo_flags.push(flag);
+ END;
+ END;
+ LAST IF needinfo_flagtype;
+ END;
+ END;
+
+ available_mentors = bug.mentors( exclude_needinfo_blocked => 1 );
-[%
BLOCK needinfo_comment_div;
match = needinfo_flags.last.creation_date.match('^(\d{4})\.(\d{2})\.(\d{2})(.+)$');
date = "$match.0-$match.1-$match.2$match.3";
@@ -131,9 +133,9 @@
identity = '[% bug.qa_contact.realname || bug.qa_contact.login FILTER html FILTER js %]';
} else if (role == 'user') {
identity = '[% user.realname || user.login FILTER html FILTER js %]';
- [% FOREACH mentor = bug.mentors %]
+ [% FOREACH mentor = available_mentors %]
} else if (role == '[% mentor.login FILTER js %]') {
- identity = '[% mentor.realname || mentor.login FILTER html FILTER js +%] [%+ IF bug.mentors.size > 1 %](mentor)[% END %]';
+ identity = '[% mentor.realname || mentor.login FILTER html FILTER js +%] [%+ IF available_mentors.size > 1 %](mentor)[% END %]';
[% END %]
}
YAHOO.util.Dom.get('needinfo_role_identity').innerHTML = identity;
@@ -167,15 +169,21 @@
<label for="needinfo">Need more information from</label>
<select name="needinfo_role" id="needinfo_role" onchange="needinfo_role_changed()">
<option value="other">other</option>
- <option value="reporter">reporter</option>
- <option value="assigned_to">assignee</option>
- [% IF Param('useqacontact') && bug.qa_contact.login != "" %]
+ [% IF NOT bug.reporter.needinfo_blocked %]
+ <option value="reporter">reporter</option>
+ [% END %]
+ [% IF NOT bug.assigned_to.needinfo_blocked %]
+ <option value="assigned_to">assignee</option>
+ [% END %]
+ [% IF Param('useqacontact') && bug.qa_contact.login != "" && !bug.qa_contact.needinfo_blocked %]
<option value="qa_contact">qa contact</option>
[% END %]
- <option value="user">myself</option>
- [% FOREACH mentor = bug.mentors %]
- <option [% IF bug.mentors.size > 1 %]title="mentor"[% END %] value="[% mentor.login FILTER html %]">
- [% bug.mentors.size == 1 ? "mentor" : mentor.login FILTER html %]
+ [% IF NOT user.needinfo_blocked %]
+ <option value="user">myself</option>
+ [% END %]
+ [% FOREACH mentor = available_mentors %]
+ <option [% IF available_mentors.size > 1 %]title="mentor"[% END %] value="[% mentor.login FILTER html %]">
+ [% available_mentors.size == 1 ? "mentor" : mentor.login FILTER html %]
</option>
[% END %]
</select>
diff --git a/extensions/Needinfo/template/en/default/hook/account/prefs/account-field.html.tmpl b/extensions/Needinfo/template/en/default/hook/account/prefs/account-field.html.tmpl
new file mode 100644
index 000000000..4e0253610
--- /dev/null
+++ b/extensions/Needinfo/template/en/default/hook/account/prefs/account-field.html.tmpl
@@ -0,0 +1,25 @@
+[%# 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.
+ #%]
+
+<tr>
+ [%# this section is shared by both the needinfo and review extensions %]
+ [%# only show the label once %]
+ [% IF request_blocked_header %]
+ <td></td>
+ [% ELSE %]
+ [% request_blocked_header = 1 %]
+ <th align="right" valign="top">Request blocking:</th>
+ [% END %]
+ <td>
+ <input type="checkbox" id="block_needinfo" name="block_needinfo" value="1"
+ [% " checked" IF user.settings.block_needinfo.value == "on" %]>
+ <label for="block_needinfo">
+ Block needinfo requests
+ </label>
+ </td>
+</tr>
diff --git a/extensions/Needinfo/template/en/default/hook/global/setting-descs-settings.none.tmpl b/extensions/Needinfo/template/en/default/hook/global/setting-descs-settings.none.tmpl
new file mode 100644
index 000000000..ec435e58b
--- /dev/null
+++ b/extensions/Needinfo/template/en/default/hook/global/setting-descs-settings.none.tmpl
@@ -0,0 +1,11 @@
+[%# 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.
+ #%]
+
+[%
+ setting_descs.block_needinfo = "Block needinfo requests"
+%]
diff --git a/extensions/Needinfo/template/en/default/hook/global/user-error-errors.html.tmpl b/extensions/Needinfo/template/en/default/hook/global/user-error-errors.html.tmpl
index f1241bc61..42d47e928 100644
--- a/extensions/Needinfo/template/en/default/hook/global/user-error-errors.html.tmpl
+++ b/extensions/Needinfo/template/en/default/hook/global/user-error-errors.html.tmpl
@@ -10,4 +10,8 @@
[% title = 'Needinfo Illegal Change' %]
Only the requestee or a user with the required permissions can clear a
needinfo flag.
+[% ELSIF error == "needinfo_blocked" %]
+ [% title = "Needinfo Request Blocked" %]
+ [% user.identity FILTER html %] is not currently accepting "needinfo"
+ requests.
[% END %]