From 3c8b3befff4c91cfc8527b66e5d199b767b0c23b Mon Sep 17 00:00:00 2001 From: Terran McCanna Date: Thu, 6 May 2021 16:05:54 -0400 Subject: [PATCH] OPAC Tweaks in Response to Patron & Library Feedback 1. OPAC Filter Display Issue (the OPAC search results bar was losing some of the search filters at some window widths) 2. Missing Cover Art Issue (if there is added content, but the added content has no cover, the cover art box showed alt text) 3. Group Formats and Editions Wording (change wording to 'Combine Same Title' and add contextual help pop-up) 4. Add contextual help popups to search bar fields. 5. Add contextual help popups to hold placement page. 6. Add contextual help to search preferences page. 7. Add contextual help to Items Checked Out page. 8. Charges Table Issue (fixed problem where table rows and headers weren't matching up on mobile devices if online payment was not enabled) 9. Record Summary Display (broke out of "More Details" so that it is more visible) 10. Account Summary Display (bold links if there are items out or holds ready) 11. Patron Messages Display (preserve line breaks) 12. Search Results Display (add "More info" button") 13. Address on Library Info page (was only showing mailing address - now shows physical/billing address and shows mailing address only if different from billing address) Signed-off-by: Terran McCanna --- .../lib/OpenILS/WWW/EGCatLoader/Library.pm | 10 +++- .../opac/css/mediaQuery.css.tt2 | 6 +-- .../src/templates-bootstrap/opac/css/style.css.tt2 | 9 ++++ .../templates-bootstrap/opac/myopac/charges.tt2 | 54 ++++++++++--------- .../src/templates-bootstrap/opac/myopac/circs.tt2 | 1 + .../opac/myopac/messages/single_message.tt2 | 2 +- .../opac/myopac/prefs_settings.tt2 | 3 +- .../opac/parts/library/core_info.tt2 | 26 +++++++-- .../templates-bootstrap/opac/parts/place_hold.tt2 | 6 ++- .../opac/parts/record/contents-summaryonly.tt2 | 62 ++++++++++++++++++++++ .../opac/parts/record/contents.tt2 | 4 -- .../opac/parts/record/summary.tt2 | 1 + .../opac/parts/result/table.tt2 | 24 +++++---- .../templates-bootstrap/opac/parts/searchbar.tt2 | 14 ++--- Open-ILS/src/templates-bootstrap/opac/results.tt2 | 5 +- 15 files changed, 166 insertions(+), 61 deletions(-) create mode 100644 Open-ILS/src/templates-bootstrap/opac/parts/record/contents-summaryonly.tt2 diff --git a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Library.pm b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Library.pm index d0b17a6898..4e82fa77d2 100644 --- a/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Library.pm +++ b/Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Library.pm @@ -43,7 +43,7 @@ sub load_library { if ($address) { $ctx->{mailing_address} = $address; } elsif (!$address && $aou->mailing_address) { - # We didn't get cached hours, so hit the database + # We didn't get cached address, so hit the database my $session = OpenSRF::AppSession->create("open-ils.actor"); $ctx->{mailing_address} = $session->request('open-ils.actor.org_unit.address.retrieve', @@ -51,6 +51,14 @@ sub load_library { $library_cache->put_cache($address_cache_key, OpenSRF::Utils::JSON->perl2JSON($ctx->{mailing_address}), 360); } + # PINES: Get physical address too + if ($aou->billing_address) { + my $session = OpenSRF::AppSession->create("open-ils.actor"); + $ctx->{billing_address} = + $session->request('open-ils.actor.org_unit.address.retrieve', + $aou->billing_address)->gather(1); + } + # Get current hours of operation my $hours_cache_key = "TPAC_aouhoo_cache_$lib_id"; my $hours = OpenSRF::Utils::JSON->JSON2perl($library_cache->get_cache($hours_cache_key)); diff --git a/Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2 b/Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2 index 56bea568c7..44de1646cf 100644 --- a/Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/css/mediaQuery.css.tt2 @@ -85,19 +85,19 @@ only screen and (max-width: 650px) { .holdingsTable td:nth-of-type(3):before { content: "Call number"; display: flex;} .holdingsTable td:nth-of-type(4):before { content: "Status"; display: flex;} - .chargesTable td:nth-of-type(1):before { content: "Select"; display: flex; } + .chargesTable td:nth-of-type(1):before { content: ""; display: flex; } .chargesTable td:nth-of-type(2):before { content: "Owed"; display: flex; } .chargesTable td:nth-of-type(3):before { content: "Billing Type"; display: flex;} .chargesTable td:nth-of-type(4):before { content: "Note"; display: flex;} .chargesTable td:nth-of-type(5):before { content: "Date"; display: flex;} - .chargesMainTable td:nth-of-type(1):before { content: "Select"; display: flex; } + .chargesMainTable td:nth-of-type(1):before { content: ""; display: flex; } .chargesMainTable td:nth-of-type(2):before { content: "Owed"; display: flex; } .chargesMainTable td:nth-of-type(3):before { content: "Billing Type"; display: flex;} .chargesMainTable td:nth-of-type(4):before { content: "Title"; display: flex;} .chargesMainTable td:nth-of-type(5):before { content: "Checkout"; display: flex;} .chargesMainTable td:nth-of-type(6):before { content: "Due"; display: flex;} - .chargesMainTable td:nth-of-type(7):before { content: "Returned/Renewed"; display: flex;} + .chargesMainTable td:nth-of-type(7):before { content: "Status"; display: flex;} .activeHoldstable td:nth-of-type(1):before { content: "Select"; display: flex; } .activeHoldstable td:nth-of-type(2):before { content: "Cover"; display: flex; } 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 3926b32a82..ab2fd2cab2 100755 --- a/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/css/style.css.tt2 @@ -3907,6 +3907,15 @@ select option:disabled { background-color: #ddd; } +pre { + overflow-x: auto; + white-space: pre-wrap; + white-space: -moz-pre-wrap; + white-space: -pre-wrap; + white-space: -o-pre-wrap; + word-wrap: break-word; +} + @media only screen and (max-width: 1200px) { .carousel { margin-left: 430px; diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 index 5cc61a4f76..451fc0c170 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2 @@ -13,6 +13,11 @@
[% END %] +

+ [% l("Charges On Your Account") %] +

+
[% l("PINES Account Tips") %]
+ [% IF ctx.fines.circulation.size > 0 %]
@@ -24,30 +29,26 @@ [% l("Circulation Charges") %] [% END %] -
- - +
- - [% IF myopac_cc_allowed %] - - [% END %] - @@ -59,15 +60,16 @@ attrs.title = f.xact.reservation.target_resource_type.name; END %] - [% IF myopac_cc_allowed %] + - [% END %] - - [% END %] @@ -126,11 +127,17 @@ [% IF ctx.fines.grocery.size > 0 %] -
-

- [% l("Charges On Your Account") %] -

-
[% l("PINES Account Tips") %]
+
+
+ + + [% IF myopac_cc_allowed %] + [% l("Pay Other Selected Charges") %] + [% ELSE %] + [% l("Other Charges") %] + [% END %] + +
[% IF myopac_cc_allowed %]
@@ -145,14 +152,13 @@
- + [% IF myopac_cc_allowed %] + + [% END %] [% l("Owed") %] [% l("Billing Type") %] [% l("Title") %] [% l("Checkout") %] [% l("Due ") %] [% l("Returned/Renewed") %]
- + [% END %] + [% money(f.xact.balance_owed) %] @@ -114,7 +116,6 @@ [% l('(fines accruing)') %] [% END %]
- - [% IF myopac_cc_allowed %] - [% END %] @@ -166,12 +172,12 @@ [% FOR f IN ctx.fines.grocery %] [% c = c + 1; %] - [% IF myopac_cc_allowed %] - [% END %] [%- setting = 'opac.default_search_location'; -%] - + + + + + [%- END; %] + [%- END; %] +[%- END %] + +[%- content_html = PROCESS render_all_contents; + IF content_html.length > 0; +%] + +

Summary

+

[%- content_html %]

+ +[%- END %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/contents.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/contents.tt2 index c642096aa0..5db63f784e 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/contents.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/contents.tt2 @@ -52,10 +52,6 @@ contents = [ label => l('Date/Time and Place of an Event Note: '), xpath => '//*[@tag="518"]' }, { - display_field => 'abstract', - label => l('Summary, etc.: '), - xpath => '//*[@tag="520"]' - }, { label => l('Target Audience Note: '), xpath => '//*[@tag="521"]' }, { diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 index d279970f3e..d7fb6d4209 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/summary.tt2 @@ -69,6 +69,7 @@ ctx.metalinks.push(' END; -%] [%- INCLUDE "opac/parts/record/authors.tt2" %] + [%- INCLUDE "opac/parts/record/contents-summaryonly.tt2" %]
diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/result/table.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/result/table.tt2 index cbabfa49c8..95563c060d 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/result/table.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/result/table.tt2 @@ -99,9 +99,8 @@
- [% attrs.title | html;%]
+
@@ -176,11 +175,7 @@ [%- END; END; -%]
- [%- IF !show_detail_view AND args.holdings.size > 0 %] -
- [% l('Call number:') %] [% args.holdings.0.label | html %] -
- [% END %] + [% IF rec.popularity > 0.0 AND ctx.hide_badge_scores != 'true' %]
[% l('Popularity:') %] [% rec.popularity %] / 5.0
@@ -387,7 +382,7 @@ - + @@ -397,6 +392,8 @@ [%- END -%] + + [%- IF ebook_api.enabled == 'true' && args.ebook %] @@ -405,8 +402,7 @@ ['query','tag','subfield','term','_special','sort','page']) %]" [% html_text_attr('title', l('Check Out [_1]', attrs.title)) %] class="btn btn-action" role="button" rel="nofollow" vocab=""> [% l('Check Out E-Item') %] - - + + + + [% l("More Info") %] + [% IF ENV.OILS_CONTENT_CAFE_USER %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 index 2ef8a3be47..fff99d5764 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/searchbar.tt2 @@ -67,7 +67,7 @@ END;
@@ -102,11 +102,12 @@ END;
@@ -171,16 +172,11 @@ END; [% END %] [% END %] - [% IF fcount > 0 %] - - [% END %] - [% IF ctx.query_struct.filters.size > 0 %] + [% IF fcount > 2 %] [% stuff = INCLUDE 'opac/parts/result/adv_filter.tt2' %] [% IF stuff %]

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

-
+
[% l('Filtered by:') %]
[% stuff %]
diff --git a/Open-ILS/src/templates-bootstrap/opac/results.tt2 b/Open-ILS/src/templates-bootstrap/opac/results.tt2 index 7b10786fa6..02b06d3890 100755 --- a/Open-ILS/src/templates-bootstrap/opac/results.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/results.tt2 @@ -116,7 +116,10 @@ name="modifier" value="metabib" onchange="search_modifier_onchange('metabib', this, true)" [% CGI.param('modifier').grep('metabib').size ? ' checked="checked"' : '' %] /> - [% l('Group By Formats and Editions') %] + [% l('Combine Same Title') %] + + +
[% END %] -- 2.11.0
+ [% IF myopac_cc_allowed %] + [% END %] [% l("Owed") %] [% l("Billing Type") %] [% l("Note") %]
+ [% IF myopac_cc_allowed %] + [% END %] Amount Owed diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2 index 77cae5248f..3b9c1f78b5 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/circs.tt2 @@ -6,6 +6,7 @@ parent="circs"; %]

[% l('Current Items Checked Out') %]

+

[% l("Do you want to save a list of items you check out? Enable that feature by going to Preferences > Search & History.") %]

[% l("PINES Account Tips") %]
diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/messages/single_message.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/messages/single_message.tt2 index 38c19eeaf4..a5de1ad2fd 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/messages/single_message.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/messages/single_message.tt2 @@ -39,7 +39,7 @@
[% l("Message") %] - [% ctx.patron_messages.0.message | html %] +
[% ctx.patron_messages.0.message | html %]
diff --git a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_settings.tt2 b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_settings.tt2 index b3efce2379..da968afe49 100755 --- a/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_settings.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/myopac/prefs_settings.tt2 @@ -54,7 +54,8 @@

+

Hint: The list of libraries is organized by regional library system, then the names of the branches within that system. If you are not sure which library is closest to you, use the Library Locations Map to find the name of your local library system and branch.

[%- thang = ctx.user.home_ou.id; IF ctx.user_setting_map.$setting; diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/library/core_info.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/library/core_info.tt2 index 220118badc..c7c98769a3 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/library/core_info.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/library/core_info.tt2 @@ -15,18 +15,36 @@

[% ctx.library.name | html %]

- [%- IF ctx.library.mailing_address; %] + [%- IF ctx.billing_address; %] +
+
+

[% l('Address') %]

+ [% IF ctx.mailing_address.street1 != ctx.billing_address.street1; %] +

[% l('Building Location') %]

+ [% END %] + + [% ctx.billing_address.street1 | html %] + [%- IF ctx.billing_address.street2; "
"; ctx.billing_address.street2 | html; END; %] +

+ [% ctx.billing_address.city | html %], + [% ctx.billing_address.state | html %] + [% ctx.billing_address.post_code | html %]
+ Map / Directions +
+
+ [%- END; %] + + + [%- IF ctx.mailing_address AND (ctx.mailing_address.street1 != ctx.billing_address.street1); %]
-

[% l('Location') %]

+

[% l('Mailing Address') %]

[% ctx.mailing_address.street1 | html %] [%- IF ctx.mailing_address.street2; "
"; ctx.mailing_address.street2 | html; END; %]

[% ctx.mailing_address.city | html %], [% ctx.mailing_address.state | html %] [% ctx.mailing_address.post_code | html %]
-
- Map / Directions
[%- END; %] diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 index 0a149b2fd9..a19fe303cb 100755 --- a/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 +++ b/Open-ILS/src/templates-bootstrap/opac/parts/place_hold.tt2 @@ -173,9 +173,9 @@ function maybeToggleNumCopies(obj) { [% IF hdata.parts.size > 0 %]
[% IF enable.radio.parts == 'true' %] -
[% IF !hdata.part_required %] @@ -229,6 +229,7 @@ function maybeToggleNumCopies(obj) {

[%- org_select_id = 'pickup_lib'; -%] + [% PROCESS "opac/parts/org_selector.tt2"; INCLUDE build_org_selector name='pickup_lib' value=ctx.default_pickup_lib id=org_select_id @@ -236,6 +237,7 @@ function maybeToggleNumCopies(obj) {

[% l('Notify when hold is ready for pickup?') %] +

diff --git a/Open-ILS/src/templates-bootstrap/opac/parts/record/contents-summaryonly.tt2 b/Open-ILS/src/templates-bootstrap/opac/parts/record/contents-summaryonly.tt2 new file mode 100644 index 0000000000..ec55b67fc7 --- /dev/null +++ b/Open-ILS/src/templates-bootstrap/opac/parts/record/contents-summaryonly.tt2 @@ -0,0 +1,62 @@ +[%- +contents = [ + { + display_field => 'abstract', + label => l('Summary: '), + xpath => '//*[@tag="520"]' + } +]; + +BLOCK render_contents; + xpath = xpath || '//*[starts-with(@tag,"520")]'; + FOR node IN ctx.marc_xml.findnodes(xpath); + all_content = []; + graphics = []; + FOR subfield IN node.childNodes; + NEXT UNLESS subfield.nodeName == "subfield"; + code = subfield.getAttribute('code'); + IF code == '6'; + linked_fields = [subfield.textContent()]; + target_field = node.getAttribute('tag'); + get_linked_880s; + END; + NEXT UNLESS code.match('[a-z]'); + all_content.push(subfield.textContent); + END; + total_contents = all_content.join(" ").replace('\s+$', ''); + %] [% "
"; total_contents | html ; "
"; + FOREACH link880 IN graphics; + '
'; + link880.value | html; + '
'; + END; + END; +END; + +BLOCK render_all_contents; + FOREACH cont IN contents; + content = ''; + df = cont.display_field; + IF df AND attrs.hl.$df.size; + content = '' _ attrs.hl.$df.join('
'); + ELSE; + content = PROCESS render_contents(xpath=cont.xpath); + END; + IF content.match('\S'); +-%] +
[% cont.label %][% content %]