Bugzilla – Attachment 169878 Details for
Bug 37515
Add common class to all places where an item type image is shown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37515: Add common class to all places where an item type image is shown
Bug-37515-Add-common-class-to-all-places-where-an-.patch (text/plain), 25.03 KB, created by
Roman Dolny
on 2024-07-30 20:52:32 UTC
(
hide
)
Description:
Bug 37515: Add common class to all places where an item type image is shown
Filename:
MIME Type:
Creator:
Roman Dolny
Created:
2024-07-30 20:52:32 UTC
Size:
25.03 KB
patch
obsolete
>From 68727e747dc59531e4d5c94bde6d1ae33508ad34 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Mon, 29 Jul 2024 18:28:00 +0000 >Subject: [PATCH] Bug 37515: Add common class to all places where an item type > image is shown > >This patch adds an "itemtype-image" class to templates in all places >where we show itemtype images. This patch affects both the OPAC and the >staff client. > >To test you should have icons associated with multiple item types. > >- Apply the patch and go to Administration -> System preferences >- Search for "itemtype" > - noItemTypeImages should be set to "Show" > - OpacNoItemTypeImages should be set to "Show" > - BiblioItemtypeInfo should be set to "Show" >- Search for "usercss" > - Add an obvious style rule for item type images to IntranetUserCSS > and OPACUserCSS, e.g. > > .itemtype-image { border: 3px solid orange; } > >- In the staff interface, check the following pages to confirm that your > custom style is visible: > > - Administration -> Item types > -> Edit > - Administration -> Authorized values -> CCODE -> Edit a CCODE > - Advanced search > - Search results > - Bibliographic details > - Place hold > - Lists -> List contents view (must set the item-level_itypes > preference to "bibliographic record") > >- In the OPAC: > - Advanced search > - Search results > - Bibliographic details > - Place hold > - Log in as a user with checkouts -> > - View the checkouts tab on the patron summary page > - Lists -> List contents view (must set the item-level_itypes > preference to "bibliographic record") > >Sponsored-by: Athens County Public Libraries >Signed-off-by: Roman Dolny <roman.dolny@jezuici.pl> >--- > .../intranet-tmpl/prog/en/includes/admin-icon-selection.inc | 2 +- > .../includes/html_helpers/tables/items/catalogue_detail.inc | 2 +- > .../prog/en/modules/admin/authorised_values.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt | 4 ++-- > .../intranet-tmpl/prog/en/modules/catalogue/advsearch.tt | 2 +- > koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt | 4 ++-- > .../intranet-tmpl/prog/en/modules/catalogue/results.tt | 4 ++-- > koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt | 4 ++-- > .../intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 4 ++-- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt | 2 +- > koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt | 6 +++--- > 15 files changed, 23 insertions(+), 23 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc >index 826ca3ea95..905b5b5496 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/admin-icon-selection.inc >@@ -48,7 +48,7 @@ > [% FOREACH image IN imageset.images %] > <label> > [% IF image.StaffImageUrl %] >- <img src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> >+ <img class="itemtype-image" src="[% image.StaffImageUrl | html %]" alt="[% image.StaffImageUrl | html %]" title="[% image.StaffImageUrl | html %]" /> > [% END %] > [% IF image.checked %] > <input type="radio" name="image" value="[% image.KohaImage | html %]" checked="checked" /> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >index 191fc386ff..ece6f86fd2 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/html_helpers/tables/items/catalogue_detail.inc >@@ -349,7 +349,7 @@ > [% UNLESS noItemTypeImages %] > let image_location = item_type_image_locations[row.item_type_id]; > node += image_location >- ? '<img src="%s" alt="%s" title="%s" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) >+ ? '<img class="itemtype-image" src="%s" alt="%s" title="%s" /> '.format(escape_str(image_location), escape_str(item_type_description), escape_str(item_type_description)) > : ''; > [% END %] > node += '<span class="itypedesc itypetext">%s</span>'.format(escape_str(item_type_description)); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >index 3203d1c61b..d39aaa6acb 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/authorised_values.tt >@@ -307,7 +307,7 @@ > <td>[% loo.lib | html %]</td> > <td>[% loo.lib_opac | html %]</td> > <td> >- [% IF ( loo.image ) %]<img src="[% loo.image | url %]" alt=""/>[% ELSE %] [% END %]</td> >+ [% IF ( loo.image ) %]<img class="itemtype-image" src="[% loo.image | url %]" alt=""/>[% ELSE %] [% END %]</td> > <td> > [% IF loo.branches.size > 0 %] > [% branches_str = "" %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >index b9ea060e30..b5c4e1cd7d 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt >@@ -368,7 +368,7 @@ > <th scope="row">Image</th> > <td> > [% SET image_location = itemtype.image_location('intranet') %] >- [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% END %] >+ [% IF image_location %]<img class="itemtype-image" src="[% image_location | html %]" alt="" />[% END %] > </td> > </tr> > [% END %] >@@ -414,7 +414,7 @@ > [% UNLESS Koha.Preference('noItemTypeImages') && Koha.Preference('OpacNoItemTypeImages') %] > <td> > [% SET image_location = itemtype.image_location('intranet') %] >- [% IF image_location %]<img src="[% image_location | html %]" alt="" />[% ELSE %] [% END %] >+ [% IF image_location %]<img class="itemtype-image" src="[% image_location | html %]" alt="" />[% ELSE %] [% END %] > </td> > [% END %] > <td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >index 0d0ec4ce3f..22f1ba5b07 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/advsearch.tt >@@ -247,7 +247,7 @@ > <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> > [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] > [% IF ( itemtypeloo.imageurl ) %] >- <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> >+ <img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> > [% END %] > > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >index 4642696270..f417a82d04 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/detail.tt >@@ -156,11 +156,11 @@ > <span class="label">MARC framework:</span> > <span class="frameworkcode">[% Frameworks.GetName(biblio.frameworkcode) | html %]</span> > </span> >- [% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %] >+ [% IF !item_level_itypes || Koha.Preference("BiblioItemtypeInfo") %] > <span class="results_summary itemtype"> > <span class="label">Itemtype:</span> > [% IF ( !noItemTypeImages && imageurl ) %] >- <img src="[% imageurl | html %]" alt="" /> >+ <img class="itemtype-image" src="[% imageurl | html %]" alt="" /> > [% END %] > [% IF ( description ) %] > <span class="itypetext">[% description | html %]</span> >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 91db336895..99e6e6a5b6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tt >@@ -544,7 +544,7 @@ > [% IF ( !item_level_itypes ) || Koha.Preference('BiblioItemtypeInfo') %] > <div class="result-biblio-itemtype"> > [% IF !noItemTypeImages && SEARCH_RESULT.imageurl %] >- <img src="[% SEARCH_RESULT.imageurl | html %]" alt="[% SEARCH_RESULT.description | html %]" /> >+ <img class="itemtype-image" src="[% SEARCH_RESULT.imageurl | html %]" alt="[% SEARCH_RESULT.description | html %]" /> > [% END %] > <span class="itypetext">[% SEARCH_RESULT.description | html %]</span> > </div> >@@ -632,7 +632,7 @@ > [% 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 %]" /> >+ <img class="itemtype-image" src="[% items_loo.imageurl | html %]" title="[% items_loo.description | html %]" alt="[% items_loo.description | html %]" /> > [% ELSE %] > <li> > [% END %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >index 1568430954..cdd3198549 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt >@@ -421,7 +421,7 @@ > </td> > [% UNLESS Koha.Preference('item-level_itypes') %] > <td> >- <img src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" /> >+ <img class="itemtype-image" src="[% biblioloo.itemtype.image_location| html %]" alt="[% biblioloo.itemtype.translated_description | html %]" title="[% biblioloo.itemtype.translated_description | html %]" /> > </td> > [% END %] > <td>[% biblioloo.rank | html %]</td> >@@ -926,7 +926,7 @@ > [% IF Koha.Preference('item-level_itypes') %] > <td> > [% UNLESS ( noItemTypeImages ) %] >- [% IF ( itemloo.itemtype.image_location) %]<img src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %] >+ [% IF ( itemloo.itemtype.image_location) %]<img class="itemtype-image" src="[% itemloo.itemtype.image_location | html %]" alt="" /> <br /> [% END %] > [% END %] > <span class="itypetext">[% itemloo.itemtype.translated_description | html %]</span> > </td> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 4a0d749579..8603400141 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -327,7 +327,7 @@ > [% UNLESS ( item_level_itypes ) %] > <td> > [% UNLESS ( noItemTypeImages || !itemsloo.imageurl ) %] >- <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> >+ <img class="itemtype-image" src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> > [% END %] > <span class="itypetext">[% itemsloo.description | html %]</span> > </td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >index 21d4d1b025..ab93842e25 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt >@@ -186,7 +186,7 @@ > <label for="[% itemtypeloo.ccl FILTER remove(',') | html %]-[% itemtypeloo.number | html %]"> > [% UNLESS ( Koha.Preference('OpacNoItemTypeImages')) %] > [% IF ( itemtypeloo.imageurl ) %] >- <img src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> >+ <img class="itemtype-image" src="[% itemtypeloo.imageurl | html %]" alt="[% itemtypeloo.description | html %]" /> > [% END %] > > [% END %] >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >index 7dd44416f5..9fd4d0ff23 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-detail.tt >@@ -166,7 +166,7 @@ > [% IF ( !item_level_itypes || Koha.Preference('BiblioItemtypeInfo') ) %] > <span class="results_summary itemtype"><span class="label">Item type: </span> > [% IF ( imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %] >- <img src="[% imageurl | html %]" alt="" /> >+ <img class="itemtype-image" src="[% imageurl | html %]" alt="" /> > [% END %] > [% IF ( description ) %] > <span class="itypetext">[% description | html %]</span> >@@ -1245,7 +1245,7 @@ > <td class="itype"> > [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] > [% IF ( ITEM_RESULT.imageurl ) %] >- <img src="[% ITEM_RESULT.imageurl | html %]" title="[% ITEM_RESULT.description | html %]" alt="[% ITEM_RESULT.description | html %]" /> >+ <img class="itemtype-image" src="[% ITEM_RESULT.imageurl | html %]" title="[% ITEM_RESULT.description | html %]" alt="[% ITEM_RESULT.description | html %]" /> > [% END %] > [% END %] > <span class="itypetext">[% ITEM_RESULT.description | html %]</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index 4451b46802..78db93ddbb 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -244,7 +244,7 @@ > [% UNLESS ( item_level_itypes ) %] > <li class="itype"> > <span class="label">Item type: </span> >- [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl | html %]" alt="" />[% END %] >+ [% IF ( bibitemloo.imageurl ) %]<img class="itemtype-image" src="[% bibitemloo.imageurl | html %]" alt="" />[% END %] > <span class="itypetext">[% bibitemloo.translated_description | html %]</span> > </li> > [% END %] >@@ -435,7 +435,7 @@ > <td class="itype"> > [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] > [% IF ( itemLoo.imageurl ) %] >- <img src="[% itemLoo.imageurl | html %]" alt="" /> >+ <img class="itemtype-image" src="[% itemLoo.imageurl | html %]" alt="" /> > [% END %] > [% END %] > <span class="itypetext">[% itemLoo.translated_description | html %]</span> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >index c92819eebf..c1212c3757 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-results.tt >@@ -244,7 +244,7 @@ > [% # Cell 3: Show item type image %] > <td class="itypecol"> > [% IF ( SEARCH_RESULT.imageurl ) %] >- <img src="[% SEARCH_RESULT.imageurl | html %]" title="[% SEARCH_RESULT.description | html %]" alt="[% SEARCH_RESULT.description | html %]" /> >+ <img class="itemtype-image" src="[% SEARCH_RESULT.imageurl | html %]" title="[% SEARCH_RESULT.description | html %]" alt="[% SEARCH_RESULT.description | html %]" /> > [% END %] > [% IF ( SEARCH_RESULT.score_avg ) %] > <img src="[% themelang | html %]/../images/bonus.png" title="bonus" style="max-height: 35px;"/> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >index d1fc75c883..9659abe19a 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-shelves.tt >@@ -377,7 +377,7 @@ > [% UNLESS ( item_level_itypes ) %] > <td> > [% UNLESS ( Koha.Preference('OpacNoItemTypeImages') ) %] >- <img src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> >+ <img class="itemtype-image" src="[% itemsloo.imageurl | html %]" alt="[% itemsloo.description | html %]" title="[% itemsloo.description | html %]" /> > [% END %] > <span class="itypetext">[% itemsloo.description | html %]</span> > </td> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >index a5d392d0ce..a07af4b106 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt >@@ -335,7 +335,7 @@ > <th class="all anti-the">Title</th> > <th>Author</th> > <th class="psort">Due</th> >- [% UNLESS ( item_level_itypes ) %] >+ [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] > <th>Item type</th> > [% END %] > [% IF ( show_barcode ) %] >@@ -426,11 +426,11 @@ > [% ISSUE.date_due | $KohaDates as_due_date => 1 %] > </td> > [% END %] >- [% UNLESS ( item_level_itypes ) %] >+ [% IF ( Koha.Preference('BiblioItemtypeInfo') || !item_level_itypes ) %] > <td class="itype"> > <span class="tdlabel">Item type:</span> > [% IF ( ISSUE.imageurl && !Koha.Preference('OpacNoItemTypeImages') ) %] >- <img src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" /> >+ <img class="itemtype-image" src="[% ISSUE.imageurl | html %]" title="[% ISSUE.description | html %]" alt="[% ISSUE.description | html %]" /> > [% END %] <span class="itypetext">[% ISSUE.description | html %]</span> > </td> > [% END %] >-- >2.39.2
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 37515
:
169863
| 169878