summaryrefslogtreecommitdiffstats
path: root/template
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2008-12-06 20:44:42 +0100
committermkanat%bugzilla.org <>2008-12-06 20:44:42 +0100
commitcce0280bc6d98dbe6ba73e59b092e469f3435dd0 (patch)
treebf9b3549632f768b714370c5f8a16af59972eb47 /template
parent33429813a654f7a93a7be40b35e9fb7629d74dab (diff)
downloadbugzilla-cce0280bc6d98dbe6ba73e59b092e469f3435dd0.tar.gz
bugzilla-cce0280bc6d98dbe6ba73e59b092e469f3435dd0.tar.xz
Bug 463002 - Show a description of what you searched for, at the top of buglist.cgi
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=bbaetz, a=mkanat
Diffstat (limited to 'template')
-rw-r--r--template/en/default/global/field-descs.none.tmpl28
-rw-r--r--template/en/default/list/list.html.tmpl27
-rw-r--r--template/en/default/search/boolean-charts.html.tmpl58
-rw-r--r--template/en/default/search/form.html.tmpl62
-rw-r--r--template/en/default/search/type-select.html.tmpl29
5 files changed, 130 insertions, 74 deletions
diff --git a/template/en/default/global/field-descs.none.tmpl b/template/en/default/global/field-descs.none.tmpl
index 7d89bd5c2..324edb592 100644
--- a/template/en/default/global/field-descs.none.tmpl
+++ b/template/en/default/global/field-descs.none.tmpl
@@ -99,6 +99,34 @@
[% END %]
[% END %]
+[% SET search_descs = {
+ "noop" => "---",
+ "equals" => "is equal to",
+ "notequals" => "is not equal to",
+ "anyexact" => "is equal to any of the strings",
+ "substring" => "contains the string",
+ "casesubstring" => "contains the string (exact case)",
+ "notsubstring" => "does not contain the string",
+ "anywordssubstr" => "contains any of the strings",
+ "allwordssubstr" => "contains all of the strings",
+ "nowordssubstr" => "contains none of the strings",
+ "regexp" => "matches regular expression",
+ "notregexp" => "does not match regular expression",
+ "lessthan" => "is less than",
+ "lessthaneq" => "is less than or equal to",
+ "greaterthan" => "is greater than",
+ "greaterthaneq" => "is greater than or equal to",
+ "anywords" => "contains any of the words",
+ "allwords" => "contains all of the words",
+ "nowords" => "contains none of the words",
+ "changedbefore" => "changed before",
+ "changedafter" => "changed after",
+ "changedfrom" => "changed from",
+ "changedto" => "changed to",
+ "changedby" => "changed by",
+ "matches" => "matches",
+} %]
+
[% field_types = { ${constants.FIELD_TYPE_UNKNOWN} => "Unknown Type",
${constants.FIELD_TYPE_FREETEXT} => "Free Text",
${constants.FIELD_TYPE_SINGLE_SELECT} => "Drop Down",
diff --git a/template/en/default/list/list.html.tmpl b/template/en/default/list/list.html.tmpl
index 8d67e6c41..467e4dfc7 100644
--- a/template/en/default/list/list.html.tmpl
+++ b/template/en/default/list/list.html.tmpl
@@ -28,7 +28,7 @@
[%# Template Initialization #%]
[%############################################################################%]
-[% PROCESS global/variables.none.tmpl %]
+[% PROCESS "global/field-descs.none.tmpl" %]
[% title = "$terms.Bug List" %]
[% IF searchname || defaultsavename %]
@@ -58,11 +58,6 @@
</span>
[% IF debug %]
- <p class="bz_query_debug">
- [% FOREACH debugline = debugdata %]
- [% debugline FILTER html %]<br>
- [% END %]
- </p>
<p class="bz_query">[% query FILTER html %]</p>
[% IF query_explain.defined %]
<pre class="bz_query_explain">[% query_explain FILTER html %]</pre>
@@ -85,6 +80,26 @@
</h2>
[% END %]
+[% SET shown_types = [
+ 'notequal', 'regexp', 'notregexp', 'lessthan', 'lessthaneq',
+ 'greaterthan', 'greaterthaneq', 'changedbefore', 'changedafter',
+ 'changedfrom', 'changedto', 'changedby',
+] %]
+<ul class="search_description">
+[% FOREACH desc_item = search_description %]
+ <li>
+ <strong>[% field_descs.${desc_item.field} FILTER html %]:</strong>
+ [% IF shown_types.contains(desc_item.type) || debug %]
+ ([% search_descs.${desc_item.type} FILTER html %])
+ [% END %]
+ [%+ desc_item.value FILTER html %]
+ [% IF debug %]
+ (<code>[% desc_item.term FILTER html %]</code>)
+ [% END %]
+ </li>
+[% END %]
+</ul>
+
<hr>
[%############################################################################%]
diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl
index 97a10d4ab..db21be681 100644
--- a/template/en/default/search/boolean-charts.html.tmpl
+++ b/template/en/default/search/boolean-charts.html.tmpl
@@ -17,31 +17,34 @@
#
# Contributor(s): Gervase Markham <gerv@gerv.net>
#%]
+
+[% PROCESS "global/field-descs.none.tmpl" %]
[% types = [
- { name => "noop", description => "---" },
- { name => "equals", description => "is equal to" },
- { name => "notequals", description => "is not equal to" },
- { name => "anyexact", description => "is equal to any of the strings" },
- { name => "substring", description => "contains the string" },
- { name => "casesubstring", description => "contains the string (exact case)" },
- { name => "notsubstring", description => "does not contain the string" },
- { name => "anywordssubstr", description => "contains any of the strings" },
- { name => "allwordssubstr", description => "contains all of the strings" },
- { name => "nowordssubstr", description => "contains none of the strings" },
- { name => "regexp", description => "contains regexp" },
- { name => "notregexp", description => "does not contain regexp" },
- { name => "lessthan", description => "is less than" },
- { name => "greaterthan", description => "is greater than" },
- { name => "anywords", description => "contains any of the words" },
- { name => "allwords", description => "contains all of the words" },
- { name => "nowords", description => "contains none of the words" },
- { name => "changedbefore", description => "changed before" },
- { name => "changedafter", description => "changed after" },
- { name => "changedfrom", description => "changed from" },
- { name => "changedto", description => "changed to" },
- { name => "changedby", description => "changed by" },
- { name => "matches", description => "matches" } ] %]
+ "noop",
+ "equals",
+ "notequals",
+ "anyexact",
+ "substring",
+ "casesubstring",
+ "notsubstring",
+ "anywordssubstr",
+ "allwordssubstr",
+ "nowordssubstr",
+ "regexp",
+ "notregexp",
+ "lessthan",
+ "greaterthan",
+ "anywords",
+ "allwords",
+ "nowords",
+ "changedbefore",
+ "changedafter",
+ "changedfrom",
+ "changedto",
+ "changedby",
+ "matches",
+] %]
<p>
<strong>
@@ -80,12 +83,9 @@
[% END %]
</select>
- <select name="[% "type${chartnum}-${rownum}-${colnum}" %]">
- [% FOREACH type = types %]
- <option value="[% type.name %]"
- [%- " selected" IF type.name == col.type %]>[% type.description %]</option>
- [% END %]
- </select>
+ [% INCLUDE "search/type-select.html.tmpl"
+ name = "type${chartnum}-${rownum}-${colnum}",
+ types = types, selected = col.type %]
<input name="[% "value${chartnum}-${rownum}-${colnum}" %]"
value="[% col.value FILTER html %]">
diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl
index 05b52dca4..46df426c1 100644
--- a/template/en/default/search/form.html.tmpl
+++ b/template/en/default/search/form.html.tmpl
@@ -20,6 +20,8 @@
# Gervase Markham <gerv@gerv.net>
#%]
+[% PROCESS "global/field-descs.none.tmpl" %]
+
<script type="text/javascript">
var first_load = true; [%# is this the first time we load the page? %]
@@ -103,20 +105,16 @@ function doOnSelectProduct(selectmode) {
</script>
-
-[% PROCESS global/variables.none.tmpl %]
-
-[% query_variants = [
- { value => "allwordssubstr", description => "contains all of the words/strings" },
- { value => "anywordssubstr", description => "contains any of the words/strings" },
- { value => "substring", description => "contains the string" },
- { value => "casesubstring", description => "contains the string (exact case)" },
- { value => "allwords", description => "contains all of the words" },
- { value => "anywords", description => "contains any of the words" },
- { value => "regexp", description => "matches the regexp" },
- { value => "notregexp", description => "doesn't match the regexp" } ] %]
-
-[% PROCESS "global/field-descs.none.tmpl" %]
+[% query_types = [
+ "allwordssubstr",
+ "anywordssubstr",
+ "substring",
+ "casesubstring",
+ "allwords",
+ "anywords",
+ "regexp",
+ "notregexp",
+] %]
[%# If we resubmit to ourselves, we need to know if we are using a format. %]
[% thisformat = query_format != '' ? query_format : format %]
@@ -130,12 +128,9 @@ function doOnSelectProduct(selectmode) {
<label for="short_desc" accesskey="s"><u>S</u>ummary</label>:
</th>
<td>
- <select name="short_desc_type">
- [% FOREACH qv = query_variants %]
- <option value="[% qv.value %]"
- [% " selected" IF default.short_desc_type.0 == qv.value %]>[% qv.description %]</option>
- [% END %]
- </select>
+ [% INCLUDE "search/type-select.html.tmpl"
+ name = "short_desc_type",
+ types = query_types, selected = default.short_desc_type.0 %]
</td>
<td>
<input name="short_desc" id="short_desc" size="40"
@@ -265,7 +260,7 @@ function doOnSelectProduct(selectmode) {
[%# *** Comment URL Whiteboard Keywords *** %]
[% FOREACH field = [
- { name => "long_desc", description => "A&nbsp;<u>C</u>omment",
+ { name => "longdesc", description => "A&nbsp;<u>C</u>omment",
accesskey => 'c' },
{ name => "bug_file_loc", description => "The&nbsp;<u>U</u>RL",
accesskey => 'u' },
@@ -278,13 +273,9 @@ function doOnSelectProduct(selectmode) {
<label for="[% field.name %]" accesskey="[% field.accesskey %]">[% field.description %]</label>:
</th>
<td>
- <select name="[% field.name %]_type">
- [% FOREACH qv = query_variants %]
- [% type = "${field.name}_type" %]
- <option value="[% qv.value %]"
- [% " selected" IF default.$type.0 == qv.value %]>[% qv.description %]</option>
- [% END %]
- </select>
+ [% INCLUDE "search/type-select.html.tmpl"
+ name = field.name _ "_type",
+ types = query_types, selected = default.$type.0 %]
</td>
<td><input name="[% field.name %]" id="[% field.name %]" size="40"
value="[% default.${field.name}.0 FILTER html %]">
@@ -300,17 +291,10 @@ function doOnSelectProduct(selectmode) {
<label for="keywords" accesskey="k"><a href="describekeywords.cgi"><u>K</u>eywords</a></label>:
</th>
<td>
- <select name="keywords_type">
- [% FOREACH qv = [
- { name => "allwords", description => "contains all of the keywords" },
- { name => "anywords", description => "contains any of the keywords" },
- { name => "nowords", description => "contains none of the keywords" } ] %]
-
- <option value="[% qv.name %]"
- [% " selected" IF default.keywords_type.0 == qv.name %]>
- [% qv.description %]</option>
- [% END %]
- </select>
+ [% INCLUDE "search/type-select.html.tmpl"
+ name = "keywords_type",
+ types = ['allwords', 'anywords', 'nowords'],
+ selected = default.keywords_type.0 %]
</td>
<td>
<input name="keywords" id="keywords" size="40"
diff --git a/template/en/default/search/type-select.html.tmpl b/template/en/default/search/type-select.html.tmpl
new file mode 100644
index 000000000..e74cc3cd3
--- /dev/null
+++ b/template/en/default/search/type-select.html.tmpl
@@ -0,0 +1,29 @@
+[%# The contents of this file are subject to the Mozilla Public
+ # License Version 1.1 (the "License"); you may not use this file
+ # except in compliance with the License. You may obtain a copy of
+ # the License at http://www.mozilla.org/MPL/
+ #
+ # Software distributed under the License is distributed on an "AS
+ # IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
+ # implied. See the License for the specific language governing
+ # rights and limitations under the License.
+ #
+ # The Original Code is the Bugzilla Bug Tracking System.
+ #
+ # The Initial Developer of the Original Code is the San Jose State
+ # University Foundation. Portions created by the Initial Developer are
+ # Copyright (C) 2008 the Initial Developer. All Rights Reserved.
+ #
+ # Contributor(s):
+ # Max Kanat-Alexander <mkanat@bugzilla.org>
+ #%]
+
+[% PROCESS "global/field-descs.none.tmpl" %]
+
+<select name="[% name FILTER html %]">
+ [% FOREACH type = types %]
+ <option value="[% type FILTER html %]"
+ [%- ' selected="selected"' IF type == selected %]>
+ [%- search_descs.$type %]</option>
+ [% END %]
+</select>