From ef96ae157223b3309f7703798b32b0b386b2edff Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 10 Mar 2015 13:07:56 +0800 Subject: Bug 1003701: add the ability for users to prevent review/feedback/needinfo requests --- .../template/en/default/bug/needinfo.html.tmpl | 54 +++++++++++++--------- 1 file changed, 31 insertions(+), 23 deletions(-) (limited to 'extensions/Needinfo/template/en/default/bug') 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 @@ -- cgit v1.2.3-24-g4f1b