Bug 37515

Summary: Add common class to all places where an item type image is shown
Product: Koha Reporter: Owen Leonard <oleonard>
Component: TemplatesAssignee: Owen Leonard <oleonard>
Status: Pushed to main --- QA Contact: Katrin Fischer <katrin.fischer>
Severity: enhancement    
Priority: P5 - low    
Version: Main   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=35189
Change sponsored?: --- Patch complexity: Small patch
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
24.11.00
Circulation function:
Attachments: 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 item type image is shown

Description Owen Leonard 2024-07-29 18:20:28 UTC
Related to Bug 35189, it would be useful to put a common class on all <img> tags showing item type images. This would allow libraries to consistently apply custom styles.
Comment 1 Owen Leonard 2024-07-30 13:59:42 UTC
Created attachment 169863 [details] [review]
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
Comment 2 Roman Dolny 2024-07-30 20:52:32 UTC
Created attachment 169878 [details] [review]
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>
Comment 3 Katrin Fischer 2024-09-02 09:30:47 UTC
QA'd by RM. Minor rebase in results.tt.
Comment 4 Katrin Fischer 2024-09-02 10:21:38 UTC
Pushed for 24.11!

Well done everyone, thank you!