From 9fd857307079b57f515fa394cd8f0aefc64336e0 Mon Sep 17 00:00:00 2001 From: Guy Pyrzak Date: Sun, 6 Jun 2010 01:40:18 -0700 Subject: Bug 450301: What Simplify searching UI, initial improvements to the advanced search ui. r=mkanat, a=mkanat --- .../en/default/search/boolean-charts.html.tmpl | 7 +- template/en/default/search/field.html.tmpl | 117 ++++ template/en/default/search/form.html.tmpl | 673 +++++++-------------- .../en/default/search/search-advanced.html.tmpl | 6 +- .../default/search/search-create-series.html.tmpl | 3 +- .../default/search/search-report-graph.html.tmpl | 3 +- .../default/search/search-report-table.html.tmpl | 3 +- 7 files changed, 360 insertions(+), 452 deletions(-) create mode 100644 template/en/default/search/field.html.tmpl (limited to 'template/en/default/search') diff --git a/template/en/default/search/boolean-charts.html.tmpl b/template/en/default/search/boolean-charts.html.tmpl index a8d018556..404e77f07 100644 --- a/template/en/default/search/boolean-charts.html.tmpl +++ b/template/en/default/search/boolean-charts.html.tmpl @@ -50,7 +50,9 @@ ] %]

- Advanced Searching Using Boolean Charts + Custom Search Didn't find what + you're looking for above? This area allows for ANDs, ORs + and other more complex searches.

[%# Whoever wrote the original version of boolean charts had a seriously twisted mind %] @@ -87,9 +89,8 @@ [% INCLUDE "search/type-select.html.tmpl" name = "type${chartnum}-${rownum}-${colnum}", types = types, selected = col.type %] - + value="[% col.value FILTER html %]"> [% UNLESS loop.last %] diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl new file mode 100644 index 000000000..63ef4530f --- /dev/null +++ b/template/en/default/search/field.html.tmpl @@ -0,0 +1,117 @@ +[%# 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 Guy Pyrzak + # Portions created by the Initial Developer are Copyright (C) 2010 the + # Initial Developer. All Rights Reserved. + # + # Contributor(s): Guy Pyrzak + # + #%] +[%# INTERFACE: + # field: a Bugzilla::Field object + # value: the value or values that should be used to prepopulate the field + # accesskey: the access key used to access the field more quickly + # onchange: js to run when the change event fires on the field + # type_selected: used by the free text to indicate which type of text + # search was selected for a particular field + #%] + +[% SWITCH field.type %] + [% CASE [ constants.FIELD_TYPE_FREETEXT, + constants.FIELD_TYPE_TEXTAREA, + constants.FIELD_TYPE_UNKNOWN ] %] + [% INCLUDE "bug/field-label.html.tmpl" + field = field + tag_name = "span" + editable = 1 + %] + + [% INCLUDE "search/type-select.html.tmpl" + name = field.name _ "_type", + types = types, + selected = type_selected %] + + + [% CASE constants.FIELD_TYPE_DATETIME %] + [% INCLUDE "bug/field-label.html.tmpl" + field = field + tag_name = "span" + editable = 1 + %] + from + +
+ to + + (YYYY-MM-DD or relative dates) + +
+ + [% CASE [ constants.FIELD_TYPE_SINGLE_SELECT, + constants.FIELD_TYPE_MULTI_SELECT ] %] +
+ [% INCLUDE "bug/field-label.html.tmpl" + field = field + editable = 1 + tag_name = "span" + %] + +
+ [% END %] + \ No newline at end of file diff --git a/template/en/default/search/form.html.tmpl b/template/en/default/search/form.html.tmpl index 63ca03565..c7e6f96a8 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -18,6 +18,7 @@ # Contributor(s): Chris Lahey [javascript fixes] # Christian Reis [javascript rewrite] # Gervase Markham + # Guy Pyrzak #%] [% PROCESS "global/field-descs.none.tmpl" %] @@ -103,6 +104,17 @@ function doOnSelectProduct(selectmode) { } } +// Hide the Advanced Fields by default, unless the user has a cookie +// that specifies otherwise. +// ▸ and ▾ are both utf8 escaped characters for right +// and down facing arrows respectivly. +TUI_alternates['history_query'] = '►'; +TUI_alternates['people_query'] = '►'; +TUI_alternates['information_query'] = '►'; + +TUI_hide_default('history_query'); +TUI_hide_default('people_query'); +TUI_hide_default('information_query'); [% query_types = [ @@ -122,383 +134,202 @@ function doOnSelectProduct(selectmode) { [%# *** Summary *** %] - - - - - - - + -[%# *** Classification Product Component Version Target *** %] - - - +[%# *** Classification Product Component *** %] + +[% Hook.process('before_selects_top') %] +[% IF Param('useclassification') %] + [% fake_classfication = { name => bug_fields.classification.name, + type => constants.FIELD_TYPE_SINGLE_SELECT } %] + [% INCLUDE "search/field.html.tmpl" + field => fake_classfication + accesskey => "c" + onchange => "doOnSelectProduct(1);" + value => default.classification + %] +[% END %] +[% INCLUDE "search/field.html.tmpl" + field => bug_fields.product + accesskey => "p" + onchange => "doOnSelectProduct(2);" + value => default.product +%] +[% INCLUDE "search/field.html.tmpl" + field => bug_fields.component + accesskey => "m" + onchange => "doOnSelectProduct(2);" + value => default.component +%] +[% INCLUDE "search/field.html.tmpl" + field => bug_fields.bug_status + accesskey => "a" + value => default.bug_status +%] +[% INCLUDE "search/field.html.tmpl" + field => bug_fields.resolution + accesskey => "r" + value => default.resolution +%] + +[% Hook.process('after_selects_top') %] + +
+
+ + Detailed [% terms.Bug %] Information + + Narrow results by the following fields: + [%+ field_descs.longdesc %]s, [%+ field_descs.bug_file_loc %], + [% IF Param('usestatuswhiteboard') %] [%+ field_descs.status_whiteboard %], [%+ END %] + [% IF use_keywords %] [%+ field_descs.keywords %], [%+ END %] + [% IF user.is_timetracker %] [%+ field_descs.deadline %], [%+ END %] + [% terms.Bug %] Numbers, [%+ field_descs.version %], + [% IF Param('usetargetmilestone') %] [%+ field_descs.target_milestone %], [%+ END %] + [% field_descs.bug_severity %], [%+ field_descs.priority%], [%+ field_descs.rep_platform %], + [%+ field_descs.op_sys %] + +
[%# *** Comment URL Whiteboard Keywords *** %] - +
[% SET freetext_fields = [ - { name => "longdesc", description => "A Comment", - accesskey => 'c' }, - { name => "bug_file_loc", description => "The URL", - accesskey => 'u' }, - { name => "status_whiteboard", description => "Whiteboard", - accesskey => 'w' } + { field => bug_fields.longdesc, accesskey => 'c' }, + { field => bug_fields.bug_file_loc, accesskey => 'u' }, + { field => bug_fields.status_whiteboard, accesskey => 'w' }, + { field => bug_fields.keywords, accesskey => 'k', + qtypes => ['allwords', 'anywords', 'nowords', 'regexp', 'notregexp'] } ] %] - [% Hook.process('before_freetext_fields') %] - [% FOREACH field = freetext_fields %] - [% NEXT IF field.name == 'status_whiteboard' + + [%# loop through a bunch of free text fields and print out their text stuff %] + [% FOREACH field_container = freetext_fields %] + [% NEXT IF field_container.field.name == 'status_whiteboard' AND NOT Param('usestatuswhiteboard') %] -
- - - - - - [% END %] - - [% IF use_keywords %] - - - - - + [% NEXT IF field_container.field.name == 'keywords' + AND NOT use_keywords + %] +
+ [% type = field_container.field.name _ "_type" %] + [% INCLUDE "search/field.html.tmpl" + field => field_container.field + types => field_container.qtypes || query_types + accesskey => field_container.accesskey + value => default.${field_container.field.name}.0 + type_selected => default.$type.0 + %] +
[% END %] [%# Deadline %] [% IF user.is_timetracker %] - - - - - +
+ [% INCLUDE "search/field.html.tmpl" + field = bug_fields.deadline + accesskey = "l" + value = [ default.deadlinefrom.0, default.deadlineto.0 ] + %] +
[% END %] +
+ +
+ +
(comma-separated list)
+
+ should be + the results +
+ [% Hook.process('after_freetext_fields') %] -
- : - - [% INCLUDE "search/type-select.html.tmpl" - name = "short_desc_type", - types = query_types, selected = default.short_desc_type.0 %] - - +
+ [% INCLUDE "search/field.html.tmpl" + field = bug_fields.short_desc + types = query_types + value = default.short_desc.0 + type_selected = default.short_desc_type.0 + accesskey = "s" + %] -
+ [% IF button_name %] [% END %] -
- - - [% Hook.process('before_selects_top') %] - [% IF Param('useclassification') %] - - [% END %] - - - - [% IF Param('usetargetmilestone') %] - - [% END %] - [% Hook.process('after_selects_top') %] - -
- - - - - - - -
- : -
- -
-
- - - - - - [%# Can't use the select block here because of the onChange %] - - -
- : -
- -
-
- - - - - - [%# Can't use the select block here because 'component' is a toolkit - reserved word - we use 'component_' instead. %] - - -
- : -
- -
-
- - - - - - [% PROCESS select sel = { name => 'version', - size => 5 } %] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'target_milestone', - size => 5 } %] - -
- : -
-
-
- : - - [% type = field.name _ "_type" %] - [% INCLUDE "search/type-select.html.tmpl" - name = type, - types = query_types, selected = default.$type.0 %] - -
- : - - [% INCLUDE "search/type-select.html.tmpl" - name = "keywords_type", - types = ['allwords', 'anywords', 'nowords', 'regexp', 'notregexp'], - selected = default.keywords_type.0 %] - - -
- : - - from - to - - (YYYY-MM-DD or relative dates) -
- -
- -[%# *** Status Resolution Severity Priority Hardware OS *** %] - - - + [%# *** Status Resolution Severity Priority Hardware OS *** %] +
[% Hook.process('before_selects_bottom') %] -
- - - - - + [% fake_version_field = { name => bug_fields.version.name, + type => constants.FIELD_TYPE_SINGLE_SELECT }%] + [% INCLUDE "search/field.html.tmpl" + field => fake_version_field + value => default.version + %] + [% IF Param('usetargetmilestone') %] + [% fake_target_milestone_field = { name => bug_fields.target_milestone.name , + type => constants.FIELD_TYPE_SINGLE_SELECT } %] + [% INCLUDE "search/field.html.tmpl" + field => fake_target_milestone_field + value => default.target_milestone + %] + [% END %] + [% INCLUDE "search/field.html.tmpl" + field => bug_fields.bug_severity + accesskey=> "v" + value => default.bug_severity + %] + [% INCLUDE "search/field.html.tmpl" + field => bug_fields.priority + accesskey => "i" + value => default.priority + %] + [% INCLUDE "search/field.html.tmpl" + field => bug_fields.rep_platform + accesskey =>"h" + value => default.rep_platform + %] + [% INCLUDE "search/field.html.tmpl" + field => bug_fields.op_sys + accesskey =>"o" + value => default.op_sys + %] [% Hook.process('after_selects_bottom') %] - -
- - - - - - [% PROCESS select sel = { name => 'bug_status', - size => 7 } %] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'resolution', - size => 7 } %] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'bug_severity', - size => 7 }%] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'priority', - size => 7 } %] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'rep_platform', - size => 7 } %] - -
- : -
-
- - - - - - [% PROCESS select sel = { name => 'op_sys', - size => 7 } %] - -
- : -
-
- + + [%# *** Email Numbering *** %] - - - - - + [% Hook.process('email_numbering_end') %] + [%# *** Bug Changes *** %] - - - -
-
- - Email Addresses and [% terms.Bug %] Numbers - - - - - - [% FOREACH n = [1, 2] %] - + + [% END %] - -
- - - - - - - - - - - - - [% IF Param('useqacontact') %] - - - - [% END %] - - - - - - - - - - - - -
+
+
+ Search By People + Narrow results to a role (ie. [% field_descs.assigned_to%], [% field_descs.reporter %], + [% field_descs.commenter %], etc.) a person has on a [% terms.bug %] + +
+
+ [% FOREACH n = [1, 2, 3] %] +
Any of: -
- - -
- - -
- - -
- - -
- - -
+ [% PROCESS role_types field = { count => n, name => "emailassigned_to", + label=> "the ${terms.Bug} ${field_descs.assigned_to}" } %] + [% PROCESS role_types field = { count => n, name => "emailreporter", + label=> "the ${field_descs.reporter}" } %] + [% IF Param('useqacontact') %] + [% PROCESS role_types field = { count => n, name => "emailqa_contact", + label=> "the ${field_descs.qa_contact}" } %] + [% END %] + [% PROCESS role_types field = { count => n, name => "emailcc", + label=> "a ${field_descs.cc} list member" } %] + [% PROCESS role_types field = { count => n, name => "emaillongdesc", + label=> " a ${field_descs.commenter}" } %] -
- -
- - -
-
- - - - - - - - - - [% Hook.process('email_numbering_end') %] -
- - : - - -
(comma-separated list)
- - -
-
-
- [% terms.Bug %] Changes - - -
-
- : -
-
- - and -
(YYYY-MM-DD or relative dates) -
-
- : -
-
+
+
+ Search By Change History + Narrow results to how fields have changed during a specific time period +
+
    +
  • + [%# Create array, so we can sort it by description #%] [% chfields = [] %] [% FOREACH field = chfield %] [% chfields.push({value => field, desc => (field_descs.$field || field) }) %] [% END %] - -
-
and :
-
+ +
  • + -
  • -
    - -
    -
    + +
  • + + + + and +
    + + +
    + (YYYY-MM-DD or relative dates) + +
  • + [%############################################################################%] -[%# Block for SELECT fields #%] +[%# Block for email role type use to select which email to search through #%] [%############################################################################%] - -[% BLOCK select %] - - - +[% BLOCK role_types %] +
    + + +
    [% END %] diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl index 3a4252c2d..4203d90a6 100644 --- a/template/en/default/search/search-advanced.html.tmpl +++ b/template/en/default/search/search-advanced.html.tmpl @@ -38,8 +38,10 @@ var queryform = "queryform" title = "Search for $terms.bugs" onload = "doOnSelectProduct(0); enableHelp();" javascript = js_data - javascript_urls = [ "js/productform.js" "js/util.js" "js/help.js" ] - style_urls = [ "skins/standard/help.css" ] + javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/util.js", + "js/help.js" , "js/TUI.js", "js/field.js"] + style_urls = [ "skins/standard/help.css" , "skins/standard/search_form.css", + "skins/standard/yui/calendar.css" ] doc_section = "query.html" style = "dl.bug_changes dt { margin-top: 15px; diff --git a/template/en/default/search/search-create-series.html.tmpl b/template/en/default/search/search-create-series.html.tmpl index da1011e10..82e656149 100644 --- a/template/en/default/search/search-create-series.html.tmpl +++ b/template/en/default/search/search-create-series.html.tmpl @@ -34,7 +34,8 @@ title = "Create New Data Set" onload = "doOnSelectProduct(0);" javascript = js_data - javascript_urls = [ "js/productform.js" ] + javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] doc_section = "reporting.html#charts-new-series" %] diff --git a/template/en/default/search/search-report-graph.html.tmpl b/template/en/default/search/search-report-graph.html.tmpl index 61dd3b5df..48d9561d6 100644 --- a/template/en/default/search/search-report-graph.html.tmpl +++ b/template/en/default/search/search-report-graph.html.tmpl @@ -33,7 +33,8 @@ var queryform = "reportform" title = "Generate Graphical Report" onload = "doOnSelectProduct(0); chartTypeChanged()" javascript = js_data - javascript_urls = [ "js/productform.js" ] + javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] doc_section = "reporting.html#reports" %] diff --git a/template/en/default/search/search-report-table.html.tmpl b/template/en/default/search/search-report-table.html.tmpl index 55d62a140..374630712 100644 --- a/template/en/default/search/search-report-table.html.tmpl +++ b/template/en/default/search/search-report-table.html.tmpl @@ -33,7 +33,8 @@ var queryform = "reportform" title = "Generate Tabular Report" onload = "doOnSelectProduct(0)" javascript = js_data - javascript_urls = [ "js/productform.js" ] + javascript_urls = [ "js/yui/calendar.js", "js/productform.js", "js/TUI.js", "js/field.js" ] + style_urls = [ "skins/standard/yui/calendar.css", "skins/standard/search_form.css" ] doc_section = "reporting.html#reports" %] -- cgit v1.2.3-24-g4f1b