diff options
author | lpsolit%gmail.com <> | 2006-08-22 05:52:31 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-08-22 05:52:31 +0200 |
commit | 23d260a3178402d13df57cc94b7216bd5fb54e0a (patch) | |
tree | 3bbf2dc29219b4d4c35645591ab822c752cfe0e7 /template | |
parent | 61d670d96ed244a6ea724ff88fd7523b3fd172ea (diff) | |
download | bugzilla-23d260a3178402d13df57cc94b7216bd5fb54e0a.tar.gz bugzilla-23d260a3178402d13df57cc94b7216bd5fb54e0a.tar.xz |
Bug 344435: Let me remove bugs from saved buglists - Patch by Frédéric Buclin <LpSolit@gmail.com> r=bkor a=myk
Diffstat (limited to 'template')
-rw-r--r-- | template/en/default/global/per-bug-queries.html.tmpl | 81 | ||||
-rw-r--r-- | template/en/default/global/user-error.html.tmpl | 16 |
2 files changed, 81 insertions, 16 deletions
diff --git a/template/en/default/global/per-bug-queries.html.tmpl b/template/en/default/global/per-bug-queries.html.tmpl index 9c0fc114d..c288e0cbc 100644 --- a/template/en/default/global/per-bug-queries.html.tmpl +++ b/template/en/default/global/per-bug-queries.html.tmpl @@ -15,28 +15,79 @@ #%] [% IF user.id && user.settings.per_bug_queries.value == "on" %] + <script type="text/javascript"> + <!-- + function update_text() { + // 'lob' means list_of_bugs. + var lob_action = document.getElementById('lob_action'); + var action = lob_action.options[lob_action.selectedIndex].value; + var text = document.getElementById('lob_direction'); + var new_query_text = document.getElementById('lob_new_query_text'); + + if (action == "add") { + text.innerHTML = "to"; + new_query_text.style.display = 'inline'; + } + else { + text.innerHTML = "from"; + new_query_text.style.display = 'none'; + } + } + + function manage_old_lists() { + var old_lists = document.getElementById('oldqueryname'); + // If there is no saved searches available, returns. + if (!old_lists) return; + + var new_query = document.getElementById('newqueryname').value; + + if (new_query != "") { + old_lists.disabled = true; + } + else { + old_lists.disabled = false; + } + } + //--> + </script> + + [%# Get existing lists of bugs for this user %] + [% lists_of_bugs = [] %] + [% FOREACH q = user.queries %] + [% NEXT UNLESS q.query_type == constants.LIST_OF_BUGS %] + [% lists_of_bugs.push(q.name) %] + [% END %] + <div id="links-special"> <div class="label"> </div> <div class="links"> - <form action="buglist.cgi" method="get"> + <hr> + <form id="list_of_bugs" action="buglist.cgi" method="get"> <input type="hidden" name="cmdtype" value="doit"> <input type="hidden" name="remtype" value="asnamed"> - <input type="hidden" name="add_bugids" value="1"> - <input type="submit" value="Add" id="add"> [% terms.bugs %] - <input type="text" name="bug_ids" size="8" maxlength="80"> to - [% foundq = 0 %] - [% FOREACH q = user.queries %] - [% NEXT UNLESS q.query_type == constants.LIST_OF_BUGS %] - [% IF !foundq %] - [% foundq = 1 %] - <select name="oldqueryname"> + <input type="hidden" name="list_of_bugs" value="1"> + <select id="lob_action" name="action" onchange="update_text();"> + <option value="add">Add</option> + [% IF lists_of_bugs.size %] + <option value="remove">Remove</option> [% END %] - <option value="[% q.name FILTER html %]"> - [% q.name FILTER html %]</option> + </select> + [%+ terms.bugs %] + <input type="text" name="bug_ids" size="12" maxlength="80"> + <span id="lob_direction">to</span> + [% IF lists_of_bugs.size %] + <select id="oldqueryname" name="oldqueryname"> + [% FOREACH query = lists_of_bugs %] + <option value="[% query FILTER html %]">[% query FILTER html %]</option> + [% END %] + </select> [% END %] - [% "</select> or to " IF foundq %] - the new saved search: - <input type="text" name="newqueryname" size="20" maxlength="64"> + <span id="lob_new_query_text"> + [% " or to" IF lists_of_bugs.size %] the new saved search: + <input type="text" id="newqueryname" name="newqueryname" size="20" maxlength="64" + onkeyup="manage_old_lists();"> + </span> + <input type="submit" value="Commit" id="commit_list_of_bugs"> </form> </div> </div> diff --git a/template/en/default/global/user-error.html.tmpl b/template/en/default/global/user-error.html.tmpl index e07be8846..4a5634d4a 100644 --- a/template/en/default/global/user-error.html.tmpl +++ b/template/en/default/global/user-error.html.tmpl @@ -1002,7 +1002,21 @@ [% ELSIF error == "no_bug_ids" %] [% title = BLOCK %]No [% terms.Bugs %] Chosen[% END %] - You didn't choose any [% terms.bugs %] to add to the saved search. + You didn't choose any [% terms.bugs %] to + [% IF action == "add" %] add to [% ELSE %] remove from [% END %] + the saved search. + + [% ELSIF error == "no_bugs_in_list" %] + [% title = "Delete Saved Search?" %] + You are going to remove all [% terms.bugs %] from the '[% saved_search FILTER html %]' + saved search. This will delete this saved search completely. Click + <a href="buglist.cgi?cmdtype=dorem&remaction=forget&namedcmd= + [%- saved_search FILTER url_quote %]">here</a> if you really want to + remove it. + + [% ELSIF error == "no_bugs_to_remove" %] + [% title = "No Saved Search Selected" %] + You didn't select any saved search to remove [% terms.bugs %] from. [% ELSIF error == "no_component_change_for_multiple_products" %] [% title = "Action Not Permitted" %] |