From 8532de99d9b6d1a1ec53e9fb2f6ef7374fab4674 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Tue, 31 May 2011 09:24:17 -0700 Subject: Bug 647649: Change the old "Boolean Charts" UI into the new AND/OR "Custom Search" UI. r=timello, a=mkanat --- .../en/default/search/boolean-charts.html.tmpl | 186 ++++++++++++--------- template/en/default/search/form.html.tmpl | 3 +- .../en/default/search/search-specific.html.tmpl | 4 +- template/en/default/search/type-select.html.tmpl | 3 +- 4 files changed, 113 insertions(+), 83 deletions(-) (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 90b5c790d..82c779612 100644 --- a/template/en/default/search/boolean-charts.html.tmpl +++ b/template/en/default/search/boolean-charts.html.tmpl @@ -48,96 +48,124 @@ "matches", "notmatches", ] %] - +
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 %] +
+
+ [% SET indent_level = 0 %] + [% FOREACH condition = default.custom_search %] + [% SET cond_num = loop.count - 1 %] + [% PROCESS one_condition with_buttons = 0 %] + [% END %] + [% PROCESS one_condition + with_buttons = 1 + condition = { f => 'noop' } + cond_num = cond_num + 1 %] + + +
-[% jsmagic = "onclick=\"this.form.action='query.cgi#chart'; this.form.method='POST'; return 1;\"" %] -[% FOREACH chart = default.charts %] - [% chartnum = loop.count - 1 %] - - - - - [% FOREACH row = chart.rows %] - [% rownum = loop.count - 1 %] - - [% FOREACH col = row %] - [% colnum = loop.count - 1 %] - - - [% UNLESS loop.last %] - - - - [% ELSE %] - - [% END %] - - [% END %] - + [% IF condition.f == "CP" %] + [% indent_level = indent_level - 1 %] + [% END %] + +
- [% UNLESS loop.last %] -
- - + [% IF previous_condition.f == "OP" %] + [% INCLUDE any_all_select + name = "j" _ (cond_num - 1) id = "j" _ (cond_num - 1) + selected = previous_condition.j %] + [% END %] + + [% IF with_buttons %] + + [% END %] + + [% UNLESS condition.f == "CP" %] + + + + + [% END %] + + [% IF condition.f == "OP" %] + + ( + [% indent_level = indent_level + 1 %] + [% ELSIF condition.f == "CP" %] + + ) [% ELSE %] - - - + + + [% INCLUDE "search/type-select.html.tmpl" + name = "o${cond_num}", class = "custom_search_form_field" + types = types, selected = condition.o %] + + [% END %] - [% END %] -
- - -
- +[% BLOCK one_condition %] + [%# Skip any conditions that don't have a field defined. %] + [% RETURN IF !condition.f %] + + [% IF !top_level_any_shown %] + [% INCLUDE any_all_select + name = "j_top" id = "j_top" selected = default.j_top.0 %] + [% top_level_any_shown = 1 %] + [% END %] - [% INCLUDE "search/type-select.html.tmpl" - name = "type${chartnum}-${rownum}-${colnum}", - types = types, selected = col.type %] - - - Or -
- [% newor = colnum + 1 %] - -
And
- [% newand = rownum + 1; newchart = chartnum + 1 %] - -       - -       -
- [% "
" IF NOT loop.last %] + [% IF with_buttons %] + + + + + [% END %] + + + [% previous_condition = condition %] +[% END %] + +[% BLOCK any_all_select %] +
+ +
[% 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 f3104203c..41e116518 100644 --- a/template/en/default/search/form.html.tmpl +++ b/template/en/default/search/form.html.tmpl @@ -395,7 +395,8 @@ TUI_hide_default('information_query'); and
+ value="[% default.chfieldto.0 || "Now" FILTER html %]" + onchange="updateCalendarFromField(this)"> diff --git a/template/en/default/search/search-specific.html.tmpl b/template/en/default/search/search-specific.html.tmpl index 776554a64..1d7229cf7 100644 --- a/template/en/default/search/search-specific.html.tmpl +++ b/template/en/default/search/search-specific.html.tmpl @@ -75,7 +75,7 @@ for "crash secure SSL flash". [% FOREACH p = user.get_selectable_products(c.id) %] [% IF p.components.size %] [% END %] @@ -85,7 +85,7 @@ for "crash secure SSL flash". [% ELSE %] [% FOREACH p = product %] [% END %] diff --git a/template/en/default/search/type-select.html.tmpl b/template/en/default/search/type-select.html.tmpl index 043c4194a..6da88202e 100644 --- a/template/en/default/search/type-select.html.tmpl +++ b/template/en/default/search/type-select.html.tmpl @@ -20,7 +20,8 @@ [% PROCESS "global/field-descs.none.tmpl" %] - [% FOREACH type = types %]