From 6193f9644d12d70bf87b61bb3e807fc24f168e84 Mon Sep 17 00:00:00 2001 From: Garry Collum Date: Thu, 14 Jul 2022 16:43:53 +0000 Subject: [PATCH] LP1980302 Bootstrap: applied search filters display oddly Moves the display of applied filters into bootstrap alert messages and aligns applied filters in a row, and utilizes more native bootstrap classes. Also, adds a label to the 'Locations' filter and code to implement an 'OR' separator, if more than one location is selected. To test: 1. Perform an advanced search in the bootstrap catalog and apply some filters. To test the locations, select several location options. 2. Notice the formatting of the 'Filtered by:' display data. Notice also the display of the locations filter without a label or a separator. 3. Apply the patch. 4. Repeat 2 to see the new formatting. Signed-off-by: Garry Collum Signed-off-by: Gina Monti Signed-off-by: Galen Charlton --- .../src/templates-bootstrap/opac/css/style.css.tt2 | 41 ++-------------------- .../opac/parts/result/adv_filter.tt2 | 31 ++++++++-------- .../templates-bootstrap/opac/parts/searchbar.tt2 | 6 +++- 3 files changed, 23 insertions(+), 55 deletions(-) diff --git a/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 b/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 index be545fe574..1a9e146acd 100755 --- a/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 @@ -1866,54 +1866,17 @@ div.adv_search_available { /* styling for advanced search filters that display with searchbar */ -#adv_filter_results_block h4 { display: inline; } - -#adv_filter_results_block { - margin-top: 6px; - text-align: center; -} - .adv_filter_results_block_label { font-weight:bold; [% IF rtl == 't' -%] - padding: 4px 12px 4px 0px; + padding: 0px 12px 4px 0px; [% ELSE -%] - padding: 4px 0px 4px 12px; + padding: 0px 0px 4px 12px; [% END -%] } .adv_filter_results_group { - font-size: 12px; - display: inline-block; background-color: [% css_colors.accent_lighter2 %]; - border-style: solid; - border-color: [% css_colors.accent_medium %]; - border-width: 1px; - border-radius: 4px; - padding: 2px 4px 2px 4px; -} - -.adv_filter_results_group_wrapper { - display: inline-block; - [% IF rtl == 't' -%] - margin-right: 1em; - [% ELSE -%] - margin-left: 1em; - [% END -%] - margin-bottom: 8px; -} - -.adv_filter_results_group_header { - display: inline-block; -} - -.adv_filter_results_group_values { - display: inline; -} - -.adv_search_result_filter { - display: inline-block; - font-size: 16px; } .remove_filter { diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/result/adv_filter.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/result/adv_filter.tt2 index 39a42073f7..380114092d 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/result/adv_filter.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/result/adv_filter.tt2 @@ -12,9 +12,9 @@ FOR filter IN ctx.query_struct.filters; remove_filter = 'fi:' _ fname; -%]
-
-
[% IF filter.negate; l('Not'); END %] [% (crad.description || crad.label) | html %]
-
[% temp = []; +
+ [% IF filter.negate; l('Not'); END %] [% (crad.description || crad.label) | html %]: + [% temp = []; FOR fval IN fvalues; thing = ctx.search_ccvm('ctype',fname,'code',fval).0; display_value = thing.search_label || thing.value; @@ -31,20 +31,18 @@ FOR filter IN ctx.query_struct.filters; [% l('OR') %] [% END %] [% END; # FOR %] -
- × + href="[% mkurl('', {}, [remove_filter]) %]" rel="nofollow" vocab="">
-
[%- END; # IF crad -%] [%- IF filter.name == 'locations'; locs = ctx.search_acpl('id',filter.args) -%]
-
-

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

+
+ [% IF filter.negate; l('Not'); END %] [% l('Locations') %]: [% temp = []; FOR loc IN locs; temp.push(loc.name); @@ -53,10 +51,13 @@ FOR filter IN ctx.query_struct.filters; [% display_name | html%] + [% UNLESS loop.last %] + [% l('OR') %] + [% END %] [% END; # FOR %] - × + href="[% mkurl('', {}, ['fi:locations']) %]" rel="nofollow" vocab="">
[%- END; # IF locations -%] @@ -66,8 +67,8 @@ FOR filter IN ctx.query_struct.filters; date2 = CGI.param('date2') | html; -%]
-
-
[% IF filter.negate; l('Not'); END %] [% l('Publication Year') %]
+
+ [% IF filter.negate; l('Not'); END %] [% l('Publication Year') %]: [% IF filter.name == 'date1' %][% l('[_1]', date1) %] [% ELSIF filter.name == 'before' %][% l('Before [_1]', date1) %] @@ -75,9 +76,9 @@ FOR filter IN ctx.query_struct.filters; [% ELSIF filter.name == 'between' %][% l('Between [_1] and [_2]', date1, date2) %] [% END %] - × + href="[% mkurl('', {}, ['pubdate', 'date1', 'date2']) %]" rel="nofollow" vocab="">
diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 index 67ac027aa6..bc8db2244a 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 @@ -180,9 +180,13 @@ END; [% stuff = INCLUDE 'opac/parts/result/adv_filter.tt2' %] [% IF stuff %]

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

+
- [% l('Filtered by:') %] +
[% l('Filtered by:') %]
+
[% stuff %] +
+
[% END %] [% END %] -- 2.11.0