Bug 14156 - Add id tags to each MARC note in the display
Summary: Add id tags to each MARC note in the display
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks: 35689
  Show dependency treegraph
 
Reported: 2015-05-06 13:47 UTC by Nicole C. Engard
Modified: 2024-01-03 16:00 UTC (History)
6 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds id and class tags to each MARC note in the description tab for the staff interface bibliographic detail page. It adds a unique id for each note (for unique styling of each repeated tag), and a general and unique class for each tag (for consistent styling across the same tag number). An example of the HTML output: ``` <p id="marcnote-500-2" class="marcnote marcnote-500">...</p> ``` Styles can be defined for notes and individual tags in the `IntranetUserCSS` system preference - see the test plan for an example.
Version(s) released in:
23.11.00


Attachments
Bug 14156: Add id tags to each MARC note in the display (3.35 KB, patch)
2023-08-15 09:41 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 14156: Add id tags to each MARC note in the display (3.39 KB, patch)
2023-09-12 20:56 UTC, David Nind
Details | Diff | Splinter Review
Bug 14156: Add id tags to each MARC note in the display (3.45 KB, patch)
2023-09-13 23:05 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2015-05-06 13:47:28 UTC
Add ID tags to each note in the title notes tab. So here's a sample of the HTML:

<div id="marcnotes">
<p> Antonio Chavarrias</p>
<p>Tristan Ulloa, Unax Ugalde</p>
<p>The great virtue in this film is the persistent sense that something pretty bad is on it's way.</p>
</div>


Instead each p should have and ID of the MARC tag that note came from so it can be styled if need be.


<div id="marcnotes">
<p id='marc508'> Antonio Chavarrias</p>
<p id='marc511'>Tristan Ulloa, Unax Ugalde</p>
<p id='marc520'>The great virtue in this film is the persistent sense that something pretty bad is on it's way.</p>
</div>
Comment 1 Katrin Fischer 2015-12-10 12:19:37 UTC
I agree - the notes as they are are not very useful. They are not labelled and it's impossible to hide a specific one.
Comment 2 Owen Leonard 2015-12-11 16:52:58 UTC
Right now Biblio.pm doesn't pass the tag information to the template, so this can't be accomplished just on the front end. Seems like it should be a pretty trivial change but I'm not really sure what's going on in GetMarcNotes.
Comment 3 Nicole C. Engard 2016-07-27 14:55:38 UTC
This would still be very helpful - I could do the template changes, but need help on GetMarcNotes
Comment 4 Owen Leonard 2023-08-15 09:41:53 UTC
Created attachment 154422 [details] [review]
Bug 14156: Add id tags to each MARC note in the display

This patch adds tag number to the data which is returned by
$biblio->get_marc_notes(). The bibliographic detail page in the staff
client is modified to use the tag number in both a class (for consistent
styling across the same tag number) and id (for unique styling for each
repeated tag).

To test, apply the patch and restart services.

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the IntranetUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.
Comment 5 Owen Leonard 2023-08-15 09:42:56 UTC
Nicole, please come back and test this patch :D
Comment 6 David Nind 2023-09-12 20:56:13 UTC
Created attachment 155577 [details] [review]
Bug 14156: Add id tags to each MARC note in the display

This patch adds tag number to the data which is returned by
$biblio->get_marc_notes(). The bibliographic detail page in the staff
client is modified to use the tag number in both a class (for consistent
styling across the same tag number) and id (for unique styling for each
repeated tag).

To test, apply the patch and restart services.

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the IntranetUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 Lucas Gass 2023-09-13 23:04:49 UTC
Nice to see more ID's/classes for easy customization. The QA script is happy and the HTML generated looks good, no duplicate ID's or anything like that!
Comment 8 Lucas Gass 2023-09-13 23:05:23 UTC
Created attachment 155601 [details] [review]
Bug 14156: Add id tags to each MARC note in the display

This patch adds tag number to the data which is returned by
$biblio->get_marc_notes(). The bibliographic detail page in the staff
client is modified to use the tag number in both a class (for consistent
styling across the same tag number) and id (for unique styling for each
repeated tag).

To test, apply the patch and restart services.

- As a quick test for custom CSS, go to Administration -> System
  preferences and locate the IntranetUserCSS preference.
  - Add this testing CSS:

   .marcnote { font-size:140%; font-family: serif; }
   .marcnote-500 { background-color: #66FFCC; }
   .marcnote-511 { background-color: #99FFFF; }
   .marcnote-520 { background-color: #CCFF00; }
   .marcnote-521 { background-color: #CCFFFF; }
   .marcnote-538 { background-color: #FFCCCC; }
   .marcnote-546 { background-color: #FFFFCC; }

- Locate a record with multiple notes fields. In the sample data, record
  46, "Viridiana" is a good example which works well with the above CSS.
- On the bibliographic detail page for the record, click the
  "Descriptions" tab.
  - Each MARC note should be colored according to the tag it comes from.
  - Inspect the HTML to confirm that each paragraph also has its own
    unique ID.

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 9 Tomás Cohen Arazi 2023-09-15 14:58:23 UTC
Pushed to master for 23.11.

Nice work everyone, thanks!
Comment 10 Fridolin Somers 2023-09-18 08:42:30 UTC
Enhancement not pushed to 23.05.x
Comment 11 Katrin Fischer 2023-12-03 23:15:13 UTC
Why only staff interface?