Bugzilla – Attachment 120862 Details for
Bug 28321
Use template block for display of items in search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 28321: Use template block for display of items in search results
Bug-28321-Use-template-block-for-display-of-items-.patch (text/plain), 24.43 KB, created by
Owen Leonard
on 2021-05-12 10:49:40 UTC
(
hide
)
Description:
Bug 28321: Use template block for display of items in search results
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2021-05-12 10:49:40 UTC
Size:
24.43 KB
patch
obsolete
>From 005fa6b0eb4853e499b80ae60c52a37d5d479ed7 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 @@ > <td> > <div class="availability"> > [% IF ( SEARCH_RESULT.items_count ) %] >- <strong> >+ <div class="results_available_count"> > [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] > <span class="blocker inaccurate-item-statuses" title="Item statuses may be inaccurate. Please view the record details for accurate item statuses"> > [% END %] >@@ -566,108 +566,74 @@ > [% IF MaxSearchResultsItemsPerRecordStatusCheck && SEARCH_RESULT.items_count > MaxSearchResultsItemsPerRecordStatusCheck %] > </span> > [% END %] >- </strong> >+ </div> <!-- /.results_available_count --> > >- [% IF ( SEARCH_RESULT.availablecount ) %] >- <ul> >- [% FOREACH available_items_loo IN SEARCH_RESULT.available_items_loop %] >- [% IF item_level_itypes && !noItemTypeImages && available_items_loo.imageurl %] >- <li style="list-style: none; list-style-type: none;"> >- <img src="[% available_items_loo.imageurl | html %]" title="[% available_items_loo.description | html %]" alt="[% available_items_loo.description | html %]" /> >- [% ELSE %] >- <li> >- [% END %] >- [% IF ( available_items_loo.branchname ) %] >- [% available_items_loo.branchname | html %] >- [% END %] >- [% IF ( available_items_loo.location ) %] >- <span class="shelvingloc">[% available_items_loo.location | html %]</span> >- [% END %] >- [% IF ( available_items_loo.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% available_items_loo.itemcallnumber |uri %]%22">[% available_items_loo.itemcallnumber | html %]</a>] >- [% END %] >- ([% available_items_loo.count | html %]) >- [% IF item_level_itypes && available_items_loo.description %] >- <br/>[% available_items_loo.description | html %] >- [% END %] >- </li> >- [% END # /FOREACH available_items_loo %] >- </ul> >- [% END # /IF SEARCH_RESULT.availablecount %] >- >- [% IF ( SEARCH_RESULT.onloancount ) %] >- <span class="status">[% SEARCH_RESULT.onloancount | html %] on loan:</span> >- <ul> >- [% FOREACH onloan_items_loo IN SEARCH_RESULT.onloan_items_loop %] >- [% IF item_level_itypes && !noItemTypeImages && onloan_items_loo.imageurl %] >- <li style="list-style: none; list-style-type: none;"> >- <img src="[% onloan_items_loo.imageurl | html %]" title="[% onloan_items_loo.description | html %]" alt="[% onloan_items_loo.description | html %]" /> >- [% ELSE %] >- <li> >- [% END %] >- [% IF ( onloan_items_loo.branchname ) %] >- [% onloan_items_loo.branchname | html %] >- [% END %] >- [% IF ( onloan_items_loo.location ) %] >- <span class="shelvingloc">[% onloan_items_loo.location | html %]</span> >- [% END %] >- [% IF ( onloan_items_loo.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% onloan_items_loo.itemcallnumber |uri %]%22">[% onloan_items_loo.itemcallnumber | html %]</a>] >- [% 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 %] >- <br/>[% onloan_items_loo.description | html %] >+ [% BLOCK search_result_items %] >+ [% IF status_count == "onloancount" %] >+ [% IF SEARCH_RESULT.${status_count} > 0 %] >+ <div class="results_checkedout">[% SEARCH_RESULT.${status_count} | html %] checked out:</div> > [% END %] >- </li> >- [% END # /FOREACH onloan_items_loo %] >- </ul> >- [% END # IF SEARCH_RESULT.onloancount %] >+ [% ELSIF status_count == "othercount" %] >+ [% IF SEARCH_RESULT.${status_count} > 0 %] >+ <div class="results_unavailable">[% SEARCH_RESULT.${status_count} | html %] unavailable:</div> >+ [% END %] >+ [% END %] >+ [% IF SEARCH_RESULT.${items_loop}.size > 0 %] >+ <ul class="[% items_loop | html %]_items"> >+ [% FOREACH items_loo IN SEARCH_RESULT.${items_loop} %] >+ [% IF item_level_itypes && !noItemTypeImages && items_loo.imageurl %] >+ <li class="result_itype_image"> >+ <img src="[% items_loo.imageurl | html %]" title="[% items_loo.description | html %]" alt="[% items_loo.description | html %]" /> >+ [% ELSE %] >+ <li> >+ [% END %] >+ [% IF ( items_loo.branchname ) %] >+ [% items_loo.branchname | html %] >+ [% END %] >+ [% IF ( items_loo.location ) %] >+ <span class="shelvingloc">[% items_loo.location | html %]</span> >+ [% END %] >+ >+ • >+ [% IF ( items_loo.itemcallnumber ) %] >+ <a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% items_loo.itemcallnumber |uri %]%22">[% items_loo.itemcallnumber | html %]</a> >+ [% END %] >+ <div class="result_item_details"> >+ [% 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 %] >+ <span class="item_count">[% items_loo.count | html %]</span> >+ </div> <!-- /.result_item_details --> >+ [% IF item_level_itypes && items_loo.description %] >+ <span class="item-itype-desc">[% items_loo.description | html %]</span> >+ [% END %] >+ </li> >+ [% END # /FOREACH other_items_loo %] >+ </ul> <!-- /.[% items_loop | html %]_items --> >+ [% 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 ) %] >- <span class="unavailable">[% SEARCH_RESULT.othercount | html %] unavailable:</span> >- <ul> >- [% FOREACH other_items_loo IN SEARCH_RESULT.other_items_loop %] >- [% IF item_level_itypes && !noItemTypeImages && other_items_loo.imageurl %] >- <li style="list-style: none; list-style-type: none;"> >- <img src="[% other_items_loo.imageurl | html %]" title="[% other_items_loo.description | html %]" alt="[% other_items_loo.description | html %]" /> >- [% ELSE %] >- <li> >- [% END %] >- [% IF ( other_items_loo.branchname ) %] >- [% other_items_loo.branchname | html %] >- [% END %] >- [% IF ( other_items_loo.location ) %] >- <span class="shelvingloc">[% other_items_loo.location | html %]</span> >- [% END %] >- [% IF ( other_items_loo.itemcallnumber ) %] >- [<a href="/cgi-bin/koha/catalogue/search.pl?idx=callnum&q=%22[% other_items_loo.itemcallnumber |uri %]%22">[% other_items_loo.itemcallnumber | html %]</a>] >- [% 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 %] >- <br/>[% other_items_loo.description | html %] >- [% END %] >- </li> >- [% END # /FOREACH other_items_loo %] >- </ul> >- [% 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; } > </style> > </head> > >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<KsEzNo`H#{N0n{j?uQ~N >KLNfyx7_0#*84!d3 > >diff --git a/koha-tmpl/intranet-tmpl/prog/img/item-bullet.svg b/koha-tmpl/intranet-tmpl/prog/img/item-bullet.svg >new file mode 100644 >index 0000000000..d437fcfe07 >--- /dev/null >+++ b/koha-tmpl/intranet-tmpl/prog/img/item-bullet.svg >@@ -0,0 +1 @@ >+<svg viewBox="0 0 1.322 2.147" height="8.116" width="4.997" xmlns="http://www.w3.org/2000/svg"><g stroke-width="4.526" fill="none" stroke="#9cc3ea" stroke-linejoin="round"><path d="M124.708 104l6.928-4 13.856 8-6.928 4z" transform="matrix(.05223 0 0 .05299 -6.396 -5.179)"/><path d="M124.708 128l13.856 8v-24l-13.856-8zM145.492 132v-24l-6.928 4v24z" transform="matrix(.05223 0 0 .05299 -6.396 -5.179)"/></g></svg> >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 28321
:
120862
|
125370
|
125398
|
125684