Koha/koha-tmpl/intranet-tmpl/prog/en/xslt/plainMARC.xsl
Owen Leonard 142e6098a9 Bug 13151 - staff marc preview not wrapping
The MARC preview available on the staff client detail page doesn't wrap
long lines of text because it uses a huge block of whitespace-formatted
text in a <pre> tag. The OPAC doesn't have this problem because the MARC
preview is formated in a table.

This patch copies the OPAC's "plainMARC.xsl" file for use in the staff
client. The preview modal has been converted to use Bootstrap following
the method used in Bug 12755

To test, apply the patch and clear your browser cache. View the
detail page for a bibliographic record in the staff client. Click the
link to show the MARC preview. Confirm that the modal looks correct,
works correctly, and adapts gracefully to different browser widths.

Confirm that the MARC preview and Card links still work from Z39.50
searches.

Note: This patch assumes that UNIMARC records display correctly using
xslt/plainMARC.xsl. Please let me know if that is wrong.

Signed-off-by: Frederic Demians <f.demians@tamil.fr>

I confirm it works: nice modal dialog box; display aligned on opac display;
works also with Unimarc biblios.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@gmail.com>
2014-11-21 15:04:00 -03:00

59 lines
1.8 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE stylesheet [<!ENTITY nbsp "&#160;" >]>
<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8"/>
<xsl:template match="/">
<html>
<head><title>MARC View</title></head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="marc:record">
<table>
<tr>
<th style="white-space:nowrap">
000
</th>
<td colspan="2"></td>
<td>
<xsl:value-of select="marc:leader"/>
</td>
</tr>
<xsl:apply-templates select="marc:datafield|marc:controlfield"/>
</table>
</xsl:template>
<xsl:template match="marc:controlfield">
<tr>
<th style="white-space:nowrap">
<xsl:value-of select="@tag"/>
</th>
<td colspan="2"></td>
<td>
<xsl:value-of select="."/>
</td>
</tr>
</xsl:template>
<xsl:template match="marc:datafield">
<tr>
<th style="white-space:nowrap">
<xsl:value-of select="@tag"/>
</th>
<td><xsl:value-of select="@ind1"/></td>
<td><xsl:value-of select="@ind2"/></td>
<td><xsl:apply-templates select="marc:subfield"/></td>
</tr>
</xsl:template>
<xsl:template match="marc:subfield">
<strong>_<xsl:value-of select="@code"/></strong> <xsl:value-of select="."/>
<xsl:choose>
<xsl:when test="position()=last()"><xsl:text> </xsl:text></xsl:when><xsl:otherwise><br /></xsl:otherwise></xsl:choose>
</xsl:template>
</xsl:stylesheet>