Bug 29162 - Change template structure on OPAC library page so that a single library can easily be hidden
Summary: Change template structure on OPAC library page so that a single library can e...
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Marcel de Rooy
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-04 13:23 UTC by Katrin Fischer
Modified: 2021-10-22 14:56 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Text to go in the release notes:
This patch adds markup to the OPAC library page so that CSS or JS can more easily target elements of the page: - Each library section is wrapped in a div with a unique id - Classes are added to the paragraphs containing phone, fax, URL, and library description. - An ID has been added to the menu of libraries in the sidebar so that they can be targetted individually.
Version(s) released in:
21.11.00


Attachments
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden (6.80 KB, patch)
2021-10-04 19:29 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden (6.85 KB, patch)
2021-10-06 09:36 UTC, David Nind
Details | Diff | Splinter Review
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden (6.94 KB, patch)
2021-10-07 13:59 UTC, Marcel de Rooy
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Katrin Fischer 2021-10-04 13:23:53 UTC
At the moment the structur of the OPAC libraries page doesn't allow to change the information of one library easily or to hide one library using an id or similar as there is no "wrapping" HTML element for each entry.

It would be nice if a div or span could be added around each library element + hr.
Comment 1 Owen Leonard 2021-10-04 19:29:03 UTC
Created attachment 125713 [details] [review]
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden

This patch adds markup to the OPAC library page so that CSS or JS can
more easily target elements of the page:

- Each library is wrapped in a div, e.g. <div id="section_CPL">
- Classes are added to the paragraphs containing phone, fax, URL, and
  library description.
- An ID has been added to the menu of libraries in the sidebar so that
  they can be targetted individually.

To test, apply the patch and go to Administration -> System prefernces.

- Add some testing CSS to the OPACUserCSS system preference, if
  necessary replacing "CPL" with a branchcode in your system:

  div#section_CPL,
  li#menu_CPL {
     font-size: 80%;
  }

- In the OPAC, view the "Libraries" page.
- In the view of all libraries you should see your CSS reflected in the
  section for that library.
- In the individual library view you should see the menu item for that
  library affected by your custom CSS.
Comment 2 David Nind 2021-10-06 09:36:52 UTC
Created attachment 125760 [details] [review]
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden

This patch adds markup to the OPAC library page so that CSS or JS can
more easily target elements of the page:

- Each library is wrapped in a div, e.g. <div id="section_CPL">
- Classes are added to the paragraphs containing phone, fax, URL, and
  library description.
- An ID has been added to the menu of libraries in the sidebar so that
  they can be targetted individually.

To test, apply the patch and go to Administration -> System prefernces.

- Add some testing CSS to the OPACUserCSS system preference, if
  necessary replacing "CPL" with a branchcode in your system:

  div#section_CPL,
  li#menu_CPL {
     font-size: 80%;
  }

- In the OPAC, view the "Libraries" page.
- In the view of all libraries you should see your CSS reflected in the
  section for that library.
- In the individual library view you should see the menu item for that
  library affected by your custom CSS.

Signed-off-by: David Nind <david@davidnind.com>
Comment 3 Marcel de Rooy 2021-10-07 13:59:04 UTC
Created attachment 125884 [details] [review]
Bug 29162: Change template structure on OPAC library page so that a single library can easily be hidden

This patch adds markup to the OPAC library page so that CSS or JS can
more easily target elements of the page:

- Each library is wrapped in a div, e.g. <div id="section_CPL">
- Classes are added to the paragraphs containing phone, fax, URL, and
  library description.
- An ID has been added to the menu of libraries in the sidebar so that
  they can be targetted individually.

To test, apply the patch and go to Administration -> System prefernces.

- Add some testing CSS to the OPACUserCSS system preference, if
  necessary replacing "CPL" with a branchcode in your system:

  div#section_CPL,
  li#menu_CPL {
     font-size: 80%;
  }

- In the OPAC, view the "Libraries" page.
- In the view of all libraries you should see your CSS reflected in the
  section for that library.
- In the individual library view you should see the menu item for that
  library affected by your custom CSS.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Comment 4 Katrin Fischer 2021-10-07 17:48:59 UTC
Now I didn't even get a chance to help this along! Thx everyone!
Comment 5 Jonathan Druart 2021-10-12 09:19:14 UTC
Pushed to master for 21.11, thanks to everybody involved!