From 73f702f26e4c9aba3157a1431b892b8ea9edd6c1 Mon Sep 17 00:00:00 2001 From: Galen Charlton Date: Tue, 4 Oct 2016 14:08:14 -0400 Subject: [PATCH] LP#1005040: various improvements to the filter control widgets * ensure that filter values are sorted * fix the link for removing location filters * don't display a filter box for search_format, as that already has a separate drop-down in the search bar Signed-off-by: Galen Charlton --- .../src/templates/opac/parts/result/adv_filter.tt2 | 28 ++++++++++++++++------ 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 b/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 index 6de6b2db2c..a70bd29190 100644 --- a/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 @@ -1,10 +1,15 @@
[% -ignore_filters = ['sort','statuses','site']; +# don't display a box for the search_format filter, +# as that's got its own widget +ignore_filters = ['search_format']; FOR filter IN ctx.query_struct.filters; fname = filter.name; + IF ignore_filters.grep('^' _ fname _ '$').size; + NEXT; + END; fvalues = filter.args; crad = ctx.get_crad(fname); @@ -23,16 +28,21 @@ FOR filter IN ctx.query_struct.filters;
- [% FOR fval IN fvalues; + [% temp = []; + FOR fval IN fvalues; thing = ctx.search_ccvm('ctype',fname,'code',fval).0; display_value = thing.search_label || thing.value; - IF display_value.defined; %] + IF display_value.defined; + temp.push(display_value); + END; + END; + FOR display_value IN temp.sort; + %]
[% display_value | html%]
- [% END; # IF %] [% END; # FOR %]
@@ -44,17 +54,21 @@ FOR filter IN ctx.query_struct.filters;
- [% FOR loc IN locs %] + [% temp = []; + FOR loc IN locs; + temp.push(loc.name); + END; + FOR display_name IN temp.sort; %]
- [% loc.name | html%] + [% display_name | html%]
[% END; # FOR %] -- 2.11.0