aboutsummaryrefslogtreecommitdiffstats
path: root/template/en/default/bug
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2011-12-14 16:57:00 -0500
committerDave Lawrence <dlawrence@mozilla.com>2011-12-14 16:57:00 -0500
commit9835ae424e63e5cb0615b06f45dbdd2561ebeaa0 (patch)
treedde6cd05e3ba2a258af8cb6c0fa5f18e67aa937e /template/en/default/bug
parentc5d33db7dbe5d310ad9e9574da030eadbd1c90d3 (diff)
downloadbugs-9835ae424e63e5cb0615b06f45dbdd2561ebeaa0.tar
bugs-9835ae424e63e5cb0615b06f45dbdd2561ebeaa0.tar.gz
bugs-9835ae424e63e5cb0615b06f45dbdd2561ebeaa0.tar.bz2
bugs-9835ae424e63e5cb0615b06f45dbdd2561ebeaa0.tar.xz
bugs-9835ae424e63e5cb0615b06f45dbdd2561ebeaa0.zip
Bug 424215 - show_bug.cgi should hide unset flags unless needing to edit them
r/a=LpSolit https://bugzilla.mozilla.org/show_bug.cgi?id=424125
Diffstat (limited to 'template/en/default/bug')
-rw-r--r--template/en/default/bug/edit.html.tmpl31
1 files changed, 30 insertions, 1 deletions
diff --git a/template/en/default/bug/edit.html.tmpl b/template/en/default/bug/edit.html.tmpl
index ecfac6f59..03b713913 100644
--- a/template/en/default/bug/edit.html.tmpl
+++ b/template/en/default/bug/edit.html.tmpl
@@ -842,11 +842,19 @@
[% BLOCK section_flags %]
[%# *** Flags *** %]
[% show_bug_flags = 0 %]
+ [% bug_flags_set = 0 %]
+ [% show_more_flags = 0 %]
[% FOREACH type = bug.flag_types %]
[% IF (type.flags && type.flags.size > 0) || (user.id && type.is_active) %]
[% show_bug_flags = 1 %]
- [% LAST %]
[% END %]
+ [% IF type.is_active && (!type.flags || type.is_multiplicable) %]
+ [% show_more_flags = 1 %]
+ [% END %]
+ [% IF type.flags && type.flags.size > 0 %]
+ [% bug_flags_set = 1 %]
+ [% END %]
+ [% LAST IF show_bug_flags && show_more_flags && bug_flags_set %]
[% END %]
[% IF show_bug_flags %]
<tr>
@@ -862,6 +870,27 @@
flag_types = bug.flag_types
any_flags_requesteeble = bug.any_flags_requesteeble %]
[% END %]
+ [% IF show_more_flags %]
+ <span id="bz_flags_more_container" class="bz_default_hidden">
+ [% IF !bug_flags_set %]<em>None yet set</em>[% END %]
+ (<a href="#" id="bz_flags_more_action">[% IF !bug_flags_set %]set[% ELSE %]more[% END %] flags</a>)
+ </span>
+ <script type="text/javascript">
+ YAHOO.util.Dom.removeClass('bz_flags_more_container', 'bz_default_hidden');
+ var table = YAHOO.util.Dom.get("flags");
+ var rows = YAHOO.util.Dom.getElementsByClassName('bz_flag_type', 'tbody', table);
+ for (var i = 0; i < rows.length; i++) {
+ YAHOO.util.Dom.addClass(rows[i], 'bz_default_hidden');
+ }
+ YAHOO.util.Event.addListener('bz_flags_more_action', 'click', function (e) {
+ YAHOO.util.Dom.addClass('bz_flags_more_container', 'bz_default_hidden');
+ for (var i = 0; i < rows.length; i++) {
+ YAHOO.util.Dom.removeClass(rows[i], 'bz_default_hidden');
+ }
+ YAHOO.util.Event.preventDefault(e);
+ });
+ </script>
+ [% END %]
</td>
</tr>
[% END %]