From 1327ff9a6a65b31d9cad315a968b6d3bdab54b89 Mon Sep 17 00:00:00 2001 From: Frédéric Buclin Date: Fri, 21 Mar 2014 11:58:45 +0100 Subject: Bug 294021: Allow requestees to set attachment flags even if they don't have editbugs privs r=gerv a=justdave --- template/en/default/flag/list.html.tmpl | 38 ++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 15 deletions(-) (limited to 'template') diff --git a/template/en/default/flag/list.html.tmpl b/template/en/default/flag/list.html.tmpl index 8acef5631..47406d6c0 100644 --- a/template/en/default/flag/list.html.tmpl +++ b/template/en/default/flag/list.html.tmpl @@ -6,7 +6,7 @@ # defined by the Mozilla Public License, v. 2.0. #%] -[% IF user.id && !read_only_flags && (!bug || bug.check_can_change_field('flagtypes.name', 0, 1)) %] +[% IF user.id && (!bug || bug.check_can_change_field('flagtypes.name', 0, 1)) %] [%# We list flags by looping twice over the flag types relevant for the bug. # In the first loop, we display existing flags and then, for active types, @@ -41,7 +41,9 @@ [% FOREACH flag = type.flags %] [% PROCESS flag_row flag = flag type = type %] [% END -%] + [% SET flag = "" %] + [% NEXT IF read_only_flags %] [%-# Step 1b: Display UI for setting flag. %] [% IF (!type.flags || type.flags.size == 0) && type.is_active %] @@ -49,16 +51,18 @@ [% END %] [% END %] - [%# Step 2: Display flag type again (if type is multiplicable). %] - [% FOREACH type = flag_types %] - [% NEXT UNLESS type.flags && type.flags.size > 0 && type.is_multiplicable && type.is_active %] - [% IF !separator_displayed %] - -
- - [% separator_displayed = 1 %] + [% IF !read_only_flags %] + [%# Step 2: Display flag type again (if type is multiplicable). %] + [% FOREACH type = flag_types %] + [% NEXT UNLESS type.flags && type.flags.size > 0 && type.is_multiplicable && type.is_active %] + [% IF !separator_displayed %] + +
+ + [% separator_displayed = 1 %] + [% END %] + [% PROCESS flag_row type = type addl_text = "addl." %] [% END %] - [% PROCESS flag_row type = type addl_text = "addl." %] [% END %] @@ -93,6 +97,7 @@ [% BLOCK flag_row %] [% RETURN IF !flag && !((type.is_requestable && user.can_request_flag(type)) || user.can_set_flag(type)) %] [% SET fid = flag ? "flag-$flag.id" : "flag_type-$type.id" %] + [% can_edit_flag = (!read_only_flags || (flag && (flag.setter_id == user.id || (flag.requestee_id && flag.requestee_id == user.id)))) ? 1 : 0 %] @@ -111,12 +116,13 @@