From: Mike Rylander Date: Tue, 20 Dec 2016 20:29:50 +0000 (-0500) Subject: LP#1005040: Styling cleanup for filter display X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=f12cc285f3e68ebcb2f95d942556d3bd87e392dc;p=working%2FEvergreen.git LP#1005040: Styling cleanup for filter display 1) Use a unicode X instead of the string "Remove" 2) Provide a border around filters 3) Label filters with "Filtered by" 4) Only show "[X filters applied ]" when in mobile mode, and make it work like the "Refine these results" button. Signed-off-by: Mike Rylander --- diff --git a/Open-ILS/src/templates/opac/css/style.css.tt2 b/Open-ILS/src/templates/opac/css/style.css.tt2 index 77b3b628f9..413c3c92cb 100644 --- a/Open-ILS/src/templates/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates/opac/css/style.css.tt2 @@ -1073,6 +1073,14 @@ div#facet_sidebar { background: [% css_colors.background_invert %] !important; } +.filter_box_label { + color: [% css_colors.background_invert %]; + font-weight:bold; + padding-top:4px; + padding-bottom:4px; + padding-left:12px; +} + .facet_box_temp .header .title { float:left; padding-top:6px; @@ -1102,6 +1110,16 @@ div#facet_sidebar { overflow: hidden; } +.filter_box_wrapper { + margin-bottom: 3px; + padding: 2px; + border: 1px solid [% css_colors.background_invert %]; + -moz-border-radius: 3px; + border-radius: 3px; + font-weight:bold; + padding-top:4px; +} + .facet_template { box-sizing: border-box; -moz-box-sizing: border-box; @@ -1731,7 +1749,7 @@ a.preflib_change { clear: both; } -.small_view_only, #refine_hits, #return_to_hits { +.small_view_only, #filter_hits, #refine_hits, #return_to_hits { display: none; } @@ -1854,7 +1872,7 @@ a.preflib_change { #dash_wrapper .opac-button { top: 0px; } - .small_view_only { + .small_view_only, #filter_hits { display: inline !important; } #dash_identity a { 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 dbe712ffd4..07efb48498 100644 --- a/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/adv_filter.tt2 @@ -1,32 +1,21 @@ -
-[% - -# don't display a box for the search_format filter, -# as that's got its own widget -ignore_filters = ['search_format']; +[%- pubdate_filters = ['date1', 'before', 'after', 'between']; 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); # will be some special ones, like locations IF crad AND NOT pubdate_filters.grep('^' _ filter.name _ '$').size; remove_filter = 'fi:' _ fname; -%] +-%]
- [% l("Remove") %] - + href="[% mkurl('', {}, [remove_filter]) %]" rel="nofollow" vocab=""> ✘

[% IF filter.negate; l('Not'); END %] [% (crad.description || crad.label) | html %]

@@ -50,16 +39,14 @@ FOR filter IN ctx.query_struct.filters;
- [% END; # IF crad %] + [%- END; # IF crad -%] -[% IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) %] +[%- IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) -%]
- [% l("Remove") %] - + href="[% mkurl('', {}, ['fi:locations']) %]" rel="nofollow" vocab=""> ✘

[% IF filter.negate; l('Not'); END %] [% l('Locations') %]

@@ -78,19 +65,17 @@ FOR filter IN ctx.query_struct.filters;
-[% END; # IF locations %] +[%- END; # IF locations -%] -[% IF pubdate_filters.grep('^' _ filter.name _ '$').size; +[%- IF pubdate_filters.grep('^' _ filter.name _ '$').size; date1 = CGI.param('date1'); date2 = CGI.param('date2'); -%] +-%]
- [% l("Remove") %] - + href="[% mkurl('', {}, ['pubdate', 'date1', 'date2']) %]" rel="nofollow" vocab=""> ✘

[% IF filter.negate; l('Not'); END %] [% l('Publication Year') %]

@@ -103,8 +88,5 @@ FOR filter IN ctx.query_struct.filters;
-[% END; # IF pubdate_filters %] - -[% END; # FOR %] - - +[%- END; # IF pubdate_filters -%] +[%- END; # FOR -%] diff --git a/Open-ILS/src/templates/opac/parts/result/table.tt2 b/Open-ILS/src/templates/opac/parts/result/table.tt2 index 7e47daff7c..f4ff94a52f 100644 --- a/Open-ILS/src/templates/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates/opac/parts/result/table.tt2 @@ -8,6 +8,21 @@ result_count = ctx.result_start; + # don't display a box for the search_format filter, + # as that's got its own widget + ignore_filters = ['search_format']; + + trimmed_filters = []; + FOR filter IN ctx.query_struct.filters; + fname = filter.name; + IF ignore_filters.grep('^' _ fname _ '$').size; + NEXT; + END; + trimmed_filters.push(filter); + END; + + ctx.query_struct.filters = trimmed_filters; + %] [% PROCESS "opac/parts/result/paginate.tt2" %] @@ -25,8 +40,16 @@

[% l('Saved Searches') %]

[% INCLUDE "opac/parts/staff_saved_searches.tt2" %] [%- END %] -

[% l('Search Results filters') %]

- [% INCLUDE 'opac/parts/result/adv_filter.tt2' %] + [% IF ctx.query_struct.filters.size > 0 %] + [% stuff = INCLUDE 'opac/parts/result/adv_filter.tt2' %] + [% IF stuff %] +

[% l('Search Results filters') %]

+
+
[% l('Filtered By') %]
+ [% stuff %] +
+ [% END %] + [% END %]

[% l('Search Results facets') %]

[% INCLUDE 'opac/parts/result/facets.tt2' %]

[% l('Search Results List') %]

diff --git a/Open-ILS/src/templates/opac/parts/searchbar.tt2 b/Open-ILS/src/templates/opac/parts/searchbar.tt2 index 97517c04a4..9d6a0dd75f 100644 --- a/Open-ILS/src/templates/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates/opac/parts/searchbar.tt2 @@ -126,9 +126,9 @@ END; [% END %] [% IF (is_advanced AND NOT is_special) AND CGI.param('qtype') %] -