diff options
Diffstat (limited to 'extensions/BugModal/template/en/default/bug_modal/tracking_flags.html.tmpl')
-rw-r--r-- | extensions/BugModal/template/en/default/bug_modal/tracking_flags.html.tmpl | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/extensions/BugModal/template/en/default/bug_modal/tracking_flags.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/tracking_flags.html.tmpl new file mode 100644 index 000000000..5f22338cd --- /dev/null +++ b/extensions/BugModal/template/en/default/bug_modal/tracking_flags.html.tmpl @@ -0,0 +1,96 @@ +[%# 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. + #%] + +[%# + # type: tracking flag type (eg. "project", "tracking") + #%] + +[% + flags = []; + set_flags = []; + FOREACH flag IN tracking_flags; + NEXT UNLESS flag.flag_type == type; + flags.push(flag); + NEXT IF flag.bug_flag(bug.id).value == "---"; + set_flags.push(flag); + END; + RETURN UNLESS flags.size; +%] + +[%# view %] +[% IF set_flags.size %] + <div class="flags edit-hide"> + <table class="layout-table tracking-flags"> + [% IF type == "tracking" %] + <tr> + <th></th> + <th>Tracking</th> + <th>Status</th> + </tr> + [% END %] + [% FOREACH row IN tracking_flags_table %] + [% + NEXT UNLESS row.type == type; + tracking_value = row.tracking.bug_flag(bug_id).value || "---"; + status_value = row.status.bug_flag(bug_id).value || "---"; + NEXT IF tracking_value == "---" && status_value == "---"; + %] + <tr> + <td class="tracking-flag-name">[% row.name FILTER html %]</td> + [% IF type == "tracking" %] + <td class="tracking-flag-tracking">[% tracking_value FILTER html %]</td> + [% END %] + <td class="tracking-flag-status">[% status_value FILTER html %]</td> + </tr> + [% END %] + </table> + </div> +[% END %] + +[%# edit %] +<div class="flags edit-show" style="display:none"> + <table class="layout-table tracking-flags"> + [% IF type == "tracking" %] + <tr> + <th></th> + <th>Tracking</th> + <th>Status</th> + </tr> + [% END %] + [% FOREACH row IN tracking_flags_table %] + [% NEXT UNLESS row.type == type %] + <tr> + <td class="tracking-flag-name">[% row.name FILTER html %]</td> + [% IF type == "tracking" %] + <td class="tracking-flag-tracking">[% INCLUDE tf_select flag=row.tracking %]</td> + [% END %] + <td class="tracking-flag-status">[% INCLUDE tf_select flag=row.status %]</td> + </tr> + [% END %] + </table> +</div> + +[% BLOCK tf_select %] + [% RETURN UNLESS flag %] + <select id="[% flag.name FILTER html %]" name="[% flag.name FILTER html %]"> + [% + flag_bug_value = flag.bug_flag(bug_id).value; + FOREACH value IN flag.values; + IF value.name != flag_bug_value; + NEXT IF !value.is_active || !flag.can_set_value(value.name); + END; + %] + <option value="[% value.name FILTER html %]" + id="v[% value.id FILTER html %]_[% flag.name FILTER html %]" + [% " selected" IF flag_bug_value == value.name %] + > + [% value.name FILTER html %] + </option> + [% END %] + </select> +[% END %] |