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 ++++++++++++--------- 1 file changed, 107 insertions(+), 79 deletions(-) (limited to 'template/en/default/search/boolean-charts.html.tmpl') 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 -- cgit v1.2.3-24-g4f1b