From 3ac701266452d3509776fe58f9e1b2b8e9f33c1e Mon Sep 17 00:00:00 2001 From: Byron Jones Date: Tue, 24 Mar 2015 13:45:44 +0800 Subject: Bug 1096798: prototype modal show_bug view --- .../template/en/default/bug_modal/flags.html.tmpl | 162 +++++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 extensions/BugModal/template/en/default/bug_modal/flags.html.tmpl (limited to 'extensions/BugModal/template/en/default/bug_modal/flags.html.tmpl') diff --git a/extensions/BugModal/template/en/default/bug_modal/flags.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/flags.html.tmpl new file mode 100644 index 000000000..4f2381913 --- /dev/null +++ b/extensions/BugModal/template/en/default/bug_modal/flags.html.tmpl @@ -0,0 +1,162 @@ +[%# 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. + #%] + +[%# + # types: array of flag_type objects + # no_label: if set to a true value, flag name and status will not be outputted (default: false) + # read_only: if true, don't output edit ui (default: false) + #%] + +[% IF read_only %] +
+ [% FOREACH type IN types %] + [% FOREACH flag IN type.flags %] +
+ [% UNLESS no_label %] + [% INCLUDE bug_modal/user.html.tmpl u=flag.setter nick_only=1 %] + [%+ flag.type.name FILTER html %][% flag.status FILTER none %] + [% END %] + [% IF flag.requestee %] + [%+ INCLUDE bug_modal/user.html.tmpl u=flag.requestee nick_only=1 %] + [% END %] +
+ [% END %] + [% END %] +
+ [% RETURN %] +[% END %] + +
+ + [% + FOREACH type IN types; + FOREACH flag IN type.flags; + IF flag.requestee && flag.requestee.id == user.id; + INCLUDE edit_flag t=type f=flag; + ELSE; + %] + + [% INCLUDE view_flag t=type f=flag %] + + + [% INCLUDE edit_flag t=type f=flag %] + + [% + END; + END; + END; + %] + + [% + FOREACH type IN types; + NEXT IF !type.is_active || type.flags.size; + INCLUDE edit_flag t=type; + END; + + FOREACH type IN types; + NEXT IF !type.is_active || !type.is_multiplicable; + INCLUDE edit_flag t=type; + END; + %] + +
+
+ +[% BLOCK view_flag %] + + + [% INCLUDE bug_modal/user.html.tmpl u=f.setter nick_only=1 %] + + + + + [% f.type.name FILTER html %] + + + + + [% f.status FILTER html %] + + + [% IF f.requestee %] + + [% INCLUDE bug_modal/user.html.tmpl u=f.requestee nick_only=1 %] + + [% END %] + +[% END %] + +[% BLOCK edit_flag %] +[% + can_edit = !f || (f.setter_id == user.id || (f.requestee_id && f.requestee_id == user.id)) + flag_id = f ? "flag-$f.id" : "flag_type-$t.id"; +%] + + + [% IF f %] + [% INCLUDE bug_modal/user.html.tmpl u=flag.setter nick_only=1 %] + [% ELSIF t.flags.size %] + addl. + [% END %] + + + + + + + + + + + [% IF (t.is_requestable && t.is_requesteeble) || (f && f.requestee) %] + + [% flag_name = f ? "requestee-$f.id" : "requestee_type-$t.id" %] + + + [% END %] + + +[% END %] -- cgit v1.2.3-24-g4f1b