Bugzilla – Attachment 187490 Details for
Bug 30148
Pipe separated contents are hard to customize (staff interface)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30148: Apply CSS-based separators to all classification fields
Bug-30148-Apply-CSS-based-separators-to-all-classi.patch (text/plain), 7.82 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-10-06 18:20:05 UTC
(
hide
)
Description:
Bug 30148: Apply CSS-based separators to all classification fields
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-10-06 18:20:05 UTC
Size:
7.82 KB
patch
obsolete
>From 62499e646f03c37ef9b30623fb35e6d75673996c Mon Sep 17 00:00:00 2001 >From: =?UTF-8?q?Tom=C3=A1s=20Cohen=20Arazi?= <tomascohen@theke.io> >Date: Mon, 6 Oct 2025 14:51:52 -0300 >Subject: [PATCH] Bug 30148: Apply CSS-based separators to all classification > fields > >This patch changes the classification display from hardcoded pipe >separators to CSS pseudo-elements, following the same approach as >Bug 27613 for the OPAC. > >Changes: >- Wrap each field occurrence in <li> elements within <ul> >- Remove hardcoded delimeter parameter from subfieldSelect >- Add CSS rules to display pipe separators via ::after pseudo-elements >- LOC classification (050) >- Publisher number (028) >- DDC classification (082) >- NLM classification (060) >- Other classification (084) > >This allows libraries to customize the separator display via CSS. > >It also provides consistent behavior and customization options across >all repeatable classification fields in the staff interface. > >To test: >1. Create a record with multiple 050 fields: > 050 4 $aE337.5 $b.O54 2025 > 050 4 $aE415.7 $b.A44 2025 >2. View the record in staff interface >=> SUCCESS: Classification looks ok: > >``` >E337.5 .O54 2025 | E415.7 .A44 2025 >``` > >3. Apply this patch >4. Run: > $ ktd --shell > k$ yarn build >5. Refresh the page >=> SUCCESS: It still looks correct! >6. Sign off :-D > >Extends the CSS-based separator approach to all classification fields >that were using hardcoded pipe separators: >--- > .../prog/css/src/staff-global.scss | 21 +++++ > .../en/xslt/MARC21slim2intranetDetail.xsl | 84 ++++++++++--------- > 2 files changed, 66 insertions(+), 39 deletions(-) > >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 f8c9cefcd75..c20295d0503 100644 >--- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >+++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss >@@ -4932,3 +4932,24 @@ div .suggestion_note { > text-align: left; > } > */ >+// Repeatable fields display (Bug 30148) >+.resource_list { >+ display: inline-block; >+ margin: 0; >+ padding-left: 0; >+ >+ li { >+ display: inline-block; >+ white-space: nowrap; >+ >+ &::after { >+ content: " | "; >+ } >+ >+ &:last-child { >+ &::after { >+ content: ""; >+ } >+ } >+ } >+} >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >index be69a2094ae..5f30f98d982 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetDetail.xsl >@@ -875,12 +875,15 @@ > <xsl:if test="marc:datafield[@tag=028]"> > <span class="results_summary publisher_number "> > <span class="label">Publisher number: </span> >- <xsl:for-each select="marc:datafield[@tag=028]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">abq</xsl:with-param> >- <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param> >- </xsl:call-template> >- </xsl:for-each> >+ <ul class="resource_list"> >+ <xsl:for-each select="marc:datafield[@tag=028]"> >+ <li> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">abq</xsl:with-param> >+ </xsl:call-template> >+ </li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >@@ -888,16 +891,15 @@ > <xsl:if test="marc:datafield[@tag=082]"> > <span class="results_summary ddc"> > <span class="label">DDC classification: </span> >- <xsl:for-each select="marc:datafield[@tag=082]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">a</xsl:with-param> >- <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param> >- </xsl:call-template> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <ul class="resource_list"> >+ <xsl:for-each select="marc:datafield[@tag=082]"> >+ <li> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a</xsl:with-param> >+ </xsl:call-template> >+ </li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >@@ -905,12 +907,15 @@ > <xsl:if test="marc:datafield[@tag=050]"> > <span class="results_summary loc"> > <span class="label">LOC classification: </span> >- <xsl:for-each select="marc:datafield[@tag=050]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">ab</xsl:with-param> >- </xsl:call-template> >- <xsl:if test="not(position()=last())"><xsl:text> | </xsl:text></xsl:if> >- </xsl:for-each> >+ <ul class="resource_list"> >+ <xsl:for-each select="marc:datafield[@tag=050]"> >+ <li> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">ab</xsl:with-param> >+ </xsl:call-template> >+ </li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >@@ -918,13 +923,15 @@ > <xsl:if test="marc:datafield[@tag=060]"> > <span class="results_summary nlm"> > <span class="label">NLM classification: </span> >- <xsl:for-each select="marc:datafield[@tag=060]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">a</xsl:with-param> >- <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param> >- </xsl:call-template> >- <xsl:if test="not(position()=last())"><xsl:text> | </xsl:text></xsl:if> >- </xsl:for-each> >+ <ul class="resource_list"> >+ <xsl:for-each select="marc:datafield[@tag=060]"> >+ <li> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a</xsl:with-param> >+ </xsl:call-template> >+ </li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >@@ -932,16 +939,15 @@ > <xsl:if test="marc:datafield[@tag=084]"> > <span class="results_summary oc"> > <span class="label">Other classification: </span> >- <xsl:for-each select="marc:datafield[@tag=084]"> >- <xsl:call-template name="subfieldSelect"> >- <xsl:with-param name="codes">a</xsl:with-param> >- <xsl:with-param name="delimeter"><xsl:text> | </xsl:text></xsl:with-param> >- </xsl:call-template> >- <xsl:choose> >- <xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when> >- <xsl:otherwise> | </xsl:otherwise> >- </xsl:choose> >- </xsl:for-each> >+ <ul class="resource_list"> >+ <xsl:for-each select="marc:datafield[@tag=084]"> >+ <li> >+ <xsl:call-template name="subfieldSelect"> >+ <xsl:with-param name="codes">a</xsl:with-param> >+ </xsl:call-template> >+ </li> >+ </xsl:for-each> >+ </ul> > </span> > </xsl:if> > >-- >2.51.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 30148
:
187486
|
187487
|
187488
|
187490
|
187491
|
187492
|
187497
|
187498
|
187499