From 005fa6b0eb4853e499b80ae60c52a37d5d479ed7 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 30 Apr 2021 10:36:42 +0000 Subject: [PATCH] Bug 28321: Use template block for display of items in search results This patch updates the staff interface catalog search results to use a new reusable BLOCK for displaying item information: Available items, checked-out items, and unavailable items. Some style has been updated, and an old GIF image has been replaced with an SVG. The hold ratios template has been updated to accommodate this change. To test, apply the patch and rebuild the staff interface CSS (https://wiki.koha-community.org/wiki/Working_with_SCSS_in_the_OPAC_and_staff_client). - Perform a catalog search in the staff interface which will return multiple results with multiple items each. For thorough testing, some records should have items which are checked out, available, or lost/notforloan. - On the search results page, confirm that item information is accurate and readable. - Test with item-level_itypes on and off. - Test with noItemTypeImages on and off. --- .../intranet-tmpl/prog/css/src/staff-global.scss | 49 +++++- .../prog/en/modules/catalogue/results.tt | 166 ++++++++------------- .../prog/en/modules/circ/reserveratios.tt | 2 +- koha-tmpl/intranet-tmpl/prog/img/item-bullet.gif | Bin 59 -> 0 bytes koha-tmpl/intranet-tmpl/prog/img/item-bullet.svg | 1 + 5 files changed, 116 insertions(+), 102 deletions(-) delete mode 100644 koha-tmpl/intranet-tmpl/prog/img/item-bullet.gif create mode 100644 koha-tmpl/intranet-tmpl/prog/img/item-bullet.svg diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index 6d9db96973..6a9e83e0a3 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2036,12 +2036,18 @@ li { li { clear: left; font-size: 90%; - list-style: url("../img/item-bullet.gif"); + list-style: url("../img/item-bullet.svg"); padding: .2em 0; + &.result_itype_image { + list-style: none; + list-style-type: none; + } + img { float: left; margin: 3px 5px 3px -5px; + max-width: 25px; } } } @@ -4426,6 +4432,47 @@ div .suggestion_note { } } +.availability { + .item_count { + font-weight: bold; + padding: 2px; + + &::after { + content: ")"; + } + + &::before { + content: "("; + } + } + + .item_counts { + font-weight: bold; + white-space: nowrap; + } + + .results_available_count { + font-weight: bold; + margin-bottom: .5em; + } + + .results_checkedout { + color: #900; + margin: .3em 0; + } + + .results_unavailable { + color: #555; + font-style: italic; + margin: .3em 0; + } + + .result_item_details { + display:inline-block; + white-space:nowrap + } +} + @media (min-width: 200px) { } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt index cbaec622ab..0bc20470b8 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt @@ -556,7 +556,7 @@
[% IF ( SEARCH_RESULT.items_count ) %] - +
[% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] [% END %] @@ -566,108 +566,74 @@ [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] [% END %] - +
- [% IF ( SEARCH_RESULT.availablecount ) %] - - [% END # /IF SEARCH_RESULT.availablecount %] - - [% IF ( SEARCH_RESULT.onloancount ) %] - [% SEARCH_RESULT.onloancount | html %] on loan: - - [% END # IF SEARCH_RESULT.onloancount %] + [% ELSIF status_count == "othercount" %] + [% IF SEARCH_RESULT.${status_count} > 0 %] +
[% SEARCH_RESULT.${status_count} | html %] unavailable:
+ [% END %] + [% END %] + [% IF SEARCH_RESULT.${items_loop}.size > 0 %] + + [% END # /IF SEARCH_RESULT.${items_loop}.size %] + [% END # /BLOCK search_result_items %] + + [% PROCESS search_result_items status_count="availablecount" items_loop="available_items_loop" %] + + [% PROCESS search_result_items status_count="onloancount" items_loop="onloan_items_loop" %] + + [% PROCESS search_result_items status_count="othercount" items_loop="other_items_loop" %] - [% IF ( SEARCH_RESULT.othercount ) %] - [% SEARCH_RESULT.othercount | html %] unavailable: - - [% END # /IF SEARCH_RESULT.othercount %] [% ELSE # /IF ( SEARCH_RESULT.items_count ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt index 6f049439ca..b9ac6126a7 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -14,7 +14,7 @@ .ulined { text-decoration: underline; } .ratiolimit:link { color: blue; cursor: pointer; } .ratiolimit:hover { color: blue; text-decoration: underline; } - #holdst ul li { list-style: outside url("[% interface | html %]/[% theme | html %]/img/item-bullet.gif") disc; } + #holdst ul li { list-style: outside url("[% interface | html %]/[% theme | html %]/img/item-bullet.svg") disc; } diff --git a/koha-tmpl/intranet-tmpl/prog/img/item-bullet.gif b/koha-tmpl/intranet-tmpl/prog/img/item-bullet.gif deleted file mode 100644 index eae920d001a46880af09818892e18bfe8e872e2e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmZ?wbhEHbWMyDyn8?KN|Ns9vhhG6n1_lPjpDc_F3``6 -- 2.11.0