From 8792d7e0b45de125973fbfbc49af52431e3a1174 Mon Sep 17 00:00:00 2001 From: Mike Rylander Date: Tue, 11 Oct 2016 11:36:42 -0400 Subject: [PATCH] LP#1005040: show number of filters applied If at least advanced search filter is applied, the number of them in force is displayed just below the search bar next to the refine search link. This patch also renames "opac-auto-102" CSS class to "refine_search" and tweaks its left padding. Signed-off-by: Galen Charlton --- Open-ILS/src/templates/opac/css/style.css.tt2 | 5 +++++ Open-ILS/src/templates/opac/parts/searchbar.tt2 | 25 +++++++++++++++++++++++-- Open-ILS/web/css/skin/default/opac/semiauto.css | 1 - 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index a6ba64e383..77b3b628f9 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -51,6 +51,11 @@ a { margin-left: 1em; } +.refine_search { + padding-bottom: 7px; + margin-left: 1em; +} + /* #search-wrapper select { border:0px solid [% css_colors.border_dark %]; diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 2c162fe6ea..fd867581e7 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -1,5 +1,18 @@

[% l('Catalog Search') %]

-[% PROCESS "opac/parts/org_selector.tt2" %] +[% PROCESS "opac/parts/org_selector.tt2"; + +# We need to ignore some filters in our count + +fignore = ['core_limit','limit','badge_orgs','badges','estimation_strategy','depth']; +fcount = 0; +FOR f IN ctx.query_struct.filters; + IF fignore.grep('^' _ f.name _ '$').size; + NEXT; + END; + fcount = fcount + 1; +END; + + %]
[% UNLESS took_care_of_form -%]
@@ -113,12 +126,20 @@
[% END %] [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %] -
+ [% END %] +