From e0894f4e7604487e0ed67a055a1b4d80a6c06bf4 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. Signed-off-by: David Nind --- .../prog/css/src/staff-global.scss | 49 +++++- .../prog/en/modules/catalogue/results.tt | 166 +++++++----------- .../prog/en/modules/circ/reserveratios.tt | 2 +- .../intranet-tmpl/prog/img/item-bullet.gif | Bin 59 -> 0 bytes .../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 9d8f5e8069..cdd7739f3d 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2070,12 +2070,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; } } } @@ -4471,6 +4477,47 @@ div .suggestion_note { padding: 2px 4px; } +.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 ) %] -
    - [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %] - [% IF item_level_itypes && !noItemTypeImages && available_items_loo.imageurl %] -
  • - [% available_items_loo.description | html %] - [% ELSE %] -
  • - [% END %] - [% IF ( available_items_loo.branchname ) %] - [% available_items_loo.branchname | html %] - [% END %] - [% IF ( available_items_loo.location ) %] - [% available_items_loo.location | html %] - [% END %] - [% IF ( available_items_loo.itemcallnumber ) %] - [[% available_items_loo.itemcallnumber | html %]] - [% END %] - ([% available_items_loo.count | html %]) - [% IF item_level_itypes && available_items_loo.description %] -
    [% available_items_loo.description | html %] - [% END %] -
  • - [% END # /FOREACH available_items_loo %] -
- [% END # /IF SEARCH_RESULT.availablecount %] - - [% IF ( SEARCH_RESULT.onloancount ) %] - [% SEARCH_RESULT.onloancount | html %] on loan: -
    - [% FOREACH onloan_items_loo IN SEARCH_RESULT.onloan_items_loop %] - [% IF item_level_itypes && !noItemTypeImages && onloan_items_loo.imageurl %] -
  • - [% onloan_items_loo.description | html %] - [% ELSE %] -
  • - [% END %] - [% IF ( onloan_items_loo.branchname ) %] - [% onloan_items_loo.branchname | html %] - [% END %] - [% IF ( onloan_items_loo.location ) %] - [% onloan_items_loo.location | html %] - [% END %] - [% IF ( onloan_items_loo.itemcallnumber ) %] - [[% onloan_items_loo.itemcallnumber | html %]] - [% END %] - ([% onloan_items_loo.count | html %][% IF ( onloan_items_loo.longoverdue ) %], [% onloan_items_loo.longoverdue | html %] long overdue[% END %]) date due: [% onloan_items_loo.due_date | $KohaDates %] - [% IF item_level_itypes && onloan_items_loo.description %] -
    [% onloan_items_loo.description | html %] + [% BLOCK search_result_items %] + [% IF status_count == "onloancount" %] + [% IF SEARCH_RESULT.${status_count} > 0 %] +
    [% SEARCH_RESULT.${status_count} | html %] checked out:
    [% END %] -
  • - [% END # /FOREACH onloan_items_loo %] -
- [% 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 %] +
    + [% FOREACH items_loo IN SEARCH_RESULT.${items_loop} %] + [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] +
  • + [% items_loo.description | html %] + [% ELSE %] +
  • + [% END %] + [% IF ( items_loo.branchname ) %] + [% items_loo.branchname | html %] + [% END %] + [% IF ( items_loo.location ) %] + [% items_loo.location | html %] + [% END %] + + • + [% IF ( items_loo.itemcallnumber ) %] + [% items_loo.itemcallnumber | html %] + [% END %] +
    + [% IF ( items_loo.withdrawn ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => items_loo.withdrawn ) | html %]) + [% END %] + [% IF ( items_loo.itemlost ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => items_loo.itemlost ) | html %]) + [% END %] + [% IF ( items_loo.damaged ) %] + ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => items_loo.damaged ) | html %]) + [% END %] + [% IF ( items_loo.intransit ) %] + (In transit) + [% END %] + [% IF ( items_loo.onhold ) %] + (On hold) + [% END %] + [% IF ( items_loo.notforloan ) %] + [% items_loo.notforloan | html %] + [% END %] + [% items_loo.count | html %] +
    + [% IF item_level_itypes && items_loo.description %] + [% items_loo.description | html %] + [% END %] +
  • + [% END # /FOREACH other_items_loo %] +
+ [% 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: -
    - [% FOREACH other_items_loo IN SEARCH_RESULT.other_items_loop %] - [% IF item_level_itypes && !noItemTypeImages && other_items_loo.imageurl %] -
  • - [% other_items_loo.description | html %] - [% ELSE %] -
  • - [% END %] - [% IF ( other_items_loo.branchname ) %] - [% other_items_loo.branchname | html %] - [% END %] - [% IF ( other_items_loo.location ) %] - [% other_items_loo.location | html %] - [% END %] - [% IF ( other_items_loo.itemcallnumber ) %] - [[% other_items_loo.itemcallnumber | html %]] - [% END %] - [% IF ( other_items_loo.withdrawn ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.withdrawn', authorised_value => other_items_loo.withdrawn ) | html %]) - [% END %] - [% IF ( other_items_loo.itemlost ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.itemlost', authorised_value => other_items_loo.itemlost ) | html %]) - [% END %] - [% IF ( other_items_loo.damaged ) %] - ([% AuthorisedValues.GetDescriptionByKohaField( kohafield => 'items.damaged', authorised_value => other_items_loo.damaged ) | html %]) - [% END %] - [% IF ( other_items_loo.intransit ) %] - (In transit) - [% END %] - [% IF ( other_items_loo.onhold ) %] - (On hold) - [% END %] - [% IF ( other_items_loo.notforloan ) %] - [% other_items_loo.notforloan | html %] - [% END %] - ([% other_items_loo.count | html %]) - [% IF item_level_itypes && other_items_loo.description %] -
    [% other_items_loo.description | html %] - [% END %] -
  • - [% END # /FOREACH other_items_loo %] -
- [% 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 9f88b39591..c8df4d9816 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt @@ -12,7 +12,7 @@ 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.20.1