From 80c6d150b42ae5d9ba7464c5e20023cc90388259 Mon Sep 17 00:00:00 2001 From: Max Kanat-Alexander Date: Tue, 9 Aug 2011 14:19:43 -0700 Subject: Bug 636416: Use the standard value-controller javascript to control the drop-down fields on the Advanced Search page. r=glob, a=mkanat --- template/en/default/search/field.html.tmpl | 79 +++++++++++++--- template/en/default/search/form.html.tmpl | 104 +++------------------ .../en/default/search/search-advanced.html.tmpl | 12 +-- .../default/search/search-create-series.html.tmpl | 2 +- .../default/search/search-report-graph.html.tmpl | 2 +- .../default/search/search-report-table.html.tmpl | 2 +- 6 files changed, 82 insertions(+), 119 deletions(-) (limited to 'template/en/default/search') diff --git a/template/en/default/search/field.html.tmpl b/template/en/default/search/field.html.tmpl index defc94cc3..c237ac16c 100644 --- a/template/en/default/search/field.html.tmpl +++ b/template/en/default/search/field.html.tmpl @@ -121,22 +121,71 @@ [% legal_values = ${"component_"} %] [% END %] [% FOREACH current_value = legal_values %] - [% IF current_value.id %] - [%# current_value is a hash instead of a value which - only applies for Resolution really, everywhere else current_value - is just the value %] - [% v = current_value.name OR '---' -%] - - [% ELSE %] - - [% END %] + [% SET v = current_value.name OR '---' -%] + [% SET display = display_value(field.name, current_value.name) %] + [% END %] + + [% IF value_controllers.${field.name}.defined %] + + [% END %] + [% IF duplicates.${field.name}.keys.size %] + [% SET field_dups = duplicates.${field.name} %] + [% SET dup_counts = duplicate_count.${field.name} %] + + [% END %] + + [% END %] +[%# END OF SWITCH %] + +[% BLOCK controller_js %] + [%# If there are selected values already, we need to fire the + # "change" event once the page has loaded, so we can set all + # the values in all the other