summaryrefslogtreecommitdiffstats
path: root/template/en/default/bug/knob.html.tmpl
diff options
context:
space:
mode:
authorguy.pyrzak%gmail.com <>2008-04-10 23:33:15 +0200
committerguy.pyrzak%gmail.com <>2008-04-10 23:33:15 +0200
commitd06db94e9793766ba8b67fcf6602f6d87bd624d4 (patch)
tree6d2045b1abb60d2fbd0fd86d77ecb57f23794366 /template/en/default/bug/knob.html.tmpl
parent09e9e8b9dba58ae262c0ce664561373f4380205f (diff)
downloadbugzilla-d06db94e9793766ba8b67fcf6602f6d87bd624d4.tar.gz
bugzilla-d06db94e9793766ba8b67fcf6602f6d87bd624d4.tar.xz
Bug 414236 Ð show_bug.cgi: Remove the knob in favor of normal <select> boxes
Patch By Guy Pyrzak<guy.pyrzak@gmail.com> r=mkanat, a=LpSolit. Removes knob from edit single and edit multiple bugs.
Diffstat (limited to 'template/en/default/bug/knob.html.tmpl')
-rw-r--r--template/en/default/bug/knob.html.tmpl142
1 files changed, 86 insertions, 56 deletions
diff --git a/template/en/default/bug/knob.html.tmpl b/template/en/default/bug/knob.html.tmpl
index 432e9b309..4cf6031e7 100644
--- a/template/en/default/bug/knob.html.tmpl
+++ b/template/en/default/bug/knob.html.tmpl
@@ -18,15 +18,16 @@
# Contributor(s): Gervase Markham <gerv@gerv.net>
# Vaskin Kissoyan <vkissoyan@yahoo.com>
# Frédéric Buclin <LpSolit@gmail.com>
+ # Guy Pyrzak <guy.pyrzak@gmail.com>
#%]
[% PROCESS global/variables.none.tmpl %]
-
-<br>
-<div id="knob">
- <div id="knob-options">
+<div id="status">
[% initial_action_shown = 0 %]
+ [% show_resolution = 0 %]
+ [% bug_status_select_displayed = 0 %]
+ [% closed_status_array = [] %]
[%# These actions are based on the current custom workflow. %]
[% FOREACH bug_status = bug.status.can_change_to %]
[% NEXT IF bug.isunconfirmed && bug_status.is_open && !bug.user.canconfirm %]
@@ -36,85 +37,114 @@
# for compatibility with older versions. %]
[% NEXT IF !bug.isopened && (bug.everconfirmed && bug_status.name == "UNCONFIRMED"
|| !bug.everconfirmed && bug_status.name == "REOPENED") %]
+ [% IF NOT bug_status_select_displayed %]
+ <select name="bug_status" id="bug_status">
+ [% bug_status_select_displayed = 1 %]
+ [% END %]
[% PROCESS initial_action %]
[% NEXT IF bug_status.name == bug.bug_status %]
- <input type="radio" id="knob_[% bug_status.id FILTER html %]" name="knob"
- value="[% bug_status.name FILTER html %]">
- <label for="knob_[% bug_status.id FILTER html %]">
- Change status to <b>[% get_status(bug_status.name) FILTER html %]</b>
- </label>
- [% IF bug.isopened && !bug_status.is_open %]
- and set the resolution to [% PROCESS select_resolution field = "knob_${bug_status.id}" %]
+ <option value="[% bug_status.name FILTER html %]">
+ [% get_status(bug_status.name) FILTER html %]
+ </option>
+ [% IF !bug_status.is_open %]
+ [% show_resolution = 1 %]
+ [% filtered_status = bug_status.name FILTER js %]
+ [% closed_status_array.push( filtered_status ) %]
[% END %]
- <br>
[% END %]
[%# These actions are special and are independent of the workflow. %]
[% IF bug.user.canedit || bug.user.isreporter %]
+ [% IF NOT bug_status_select_displayed %]
+ <select name="bug_status" id="bug_status">
+ [% bug_status_select_displayed = 1 %]
+ [% END %]
[% IF bug.isopened %]
[% IF bug.resolution %]
[% PROCESS initial_action %]
- <input type="radio" id="knob-clear" name="knob" value="clearresolution">
- <label for="knob-clear">
- Clear the resolution (remove the current resolution of
- <b>[% get_resolution(bug.resolution) FILTER html %]</b>)
- </label>
- <br>
[% END %]
- [% ELSE %]
- [% IF bug.resolution != "MOVED" || bug.user.canmove %]
+ [% ELSIF bug.resolution != "MOVED" || bug.user.canmove %]
[% PROCESS initial_action %]
- <input type="radio" id="knob_change_resolution" name="knob" value="change_resolution">
- <label for="knob_change_resolution">
- Change <a href="page.cgi?id=fields.html#resolution">resolution</a> to
- </label>
- [% PROCESS select_resolution field = "knob_change_resolution" %]
- <br>
- [% END %]
+ [% show_resolution = 1 %]
[% END %]
-
- [% PROCESS duplicate %]
+ [% END %]
+ [% IF bug_status_select_displayed %]
+ </select>
+ [% ELSE %]
+ [% get_status(bug.bug_status) FILTER html %]
+ [% IF bug.resolution %]
+ [%+ get_resolution(bug.resolution) FILTER html %]
+ [% IF bug.dup_id %]
+ <span id="duplicate_display">of
+ [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]</span>
+ [% END %]
+ [% END %]
[% END %]
- </div>
-
- <div id="knob-buttons">
- <input type="submit" value="Commit" id="commit">
- [% IF bug.user.canmove %]
- <input type="submit" name="action" id="action" value="[% Param("move-button-text") %]">
+ [% IF bug.user.canedit || bug.user.isreporter %]
+ [% IF show_resolution %]
+ <noscript><br>resolved&nbsp;as&nbsp;</noscript>
+ <span id="resolution_settings">[% PROCESS select_resolution %]</span>
[% END %]
- </div>
+ <noscript><br> duplicate</noscript>
+
+ <span id="duplicate_settings">of
+ <span id="dup_id_container" class="bz_default_hidden">
+ [% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]
+ (<a href="#" id="dup_id_edit_action">edit</a>)
+ </span
+ ><input id="dup_id" name="dup_id" size="6"
+ value="[% bug.dup_id FILTER html %]">
+ </span>
+ <div id="dup_id_discoverable" class="bz_default_hidden">
+ <a href="#" id="dup_id_discoverable_action">Mark as Duplicate</a>
+ </div>
+ [% END %]
</div>
+<script type="text/javascript">
+ var close_status_array = new Array("[% closed_status_array.join('", "') FILTER replace(',$', '')
+ FILTER none %]");
+ YAHOO.util.Dom.setStyle('dup_id_discoverable', 'display', 'block');
+ hideEditableField( "dup_id_container", "dup_id", 'dup_id_edit_action',
+ 'dup_id', '[% bug.dup_id FILTER js %]' )
+ showHideStatusItems( "", ['[% "is_duplicate" IF bug.dup_id %]',
+ '[% bug.bug_status FILTER js %]']);
+ YAHOO.util.Event.addListener( 'bug_status', "change", showHideStatusItems,
+ ['[% "is_duplicate" IF bug.dup_id %]',
+ '[% bug.bug_status FILTER js %]']);
+ YAHOO.util.Event.addListener( 'resolution', "change", showDuplicateItem);
+ YAHOO.util.Event.addListener( 'dup_id_discoverable_action',
+ 'click',
+ setResolutionToDuplicate,
+ '[% Param('duplicate_or_move_bug_status')
+ FILTER js %]');
+ YAHOO.util.Event.addListener( window, 'load', showHideStatusItems,
+ ['[% "is_duplicate" IF bug.dup_id %]',
+ '[% bug.bug_status FILTER js %]'] );
+</script>
[%# Common actions %]
[% BLOCK initial_action %]
- [%# Only show 'Leave as' action in combination with another knob %]
[% IF !initial_action_shown %]
- <input type="radio" id="knob-leave" name="knob" value="none" checked="checked">
- <label for="knob-leave">
- Leave as <b>[% get_status(bug.bug_status) FILTER html %]&nbsp;
- [% get_resolution(bug.resolution) FILTER html %]</b>
- </label>
- <br>
+ <option selected value="[% bug.bug_status FILTER html %]">
+ [% get_status(bug.bug_status) FILTER html %]
+ </option>
+ [% IF !bug.isopened %]
+ [% show_resolution = 1 %]
+ [% filtered_status = bug.bug_status FILTER js %]
+ [% closed_status_array.push(filtered_status) %]
+ [% END %]
[% initial_action_shown = 1 %]
[% END %]
[% END %]
[% BLOCK select_resolution %]
- <select name="resolution_[% field FILTER html %]"
- onchange="document.forms['changeform'].[% field FILTER html %].checked=true">
+ <select name="resolution" id="resolution">
[% FOREACH r = bug.choices.resolution %]
- <option value="[% r FILTER html %]">[% get_resolution(r) FILTER html %]</option>
+ [% NEXT IF r == "MOVED" && bug.resolution != "MOVED" %]
+ <option value="[% r FILTER html %]"
+ [% "selected" IF r == bug.resolution %]>
+ [% get_resolution(r) FILTER html %]</option>
[% END %]
</select>
[% END %]
-
-[% BLOCK duplicate %]
- <input type="radio" id="knob_duplicate" name="knob" value="duplicate">
- <label for="knob_duplicate">
- Mark the [% terms.bug %] as duplicate of [% terms.bug %] #
- </label>
- <input name="dup_id" size="6"
- onchange="if (this.value != '') {document.forms['changeform'].knob_duplicate.checked=true}">
- <br>
-[% END %]