-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MIR-1409 Added separate stylesheets for badges and xslInclude:solrRes…
…ponseBadges to response-mir.xsl
- Loading branch information
Showing
6 changed files
with
119 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
mir-module/src/main/resources/xsl/response-mir-hit-date.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
exclude-result-prefixes="xsl"> | ||
|
||
<xsl:template name="hit-date"> | ||
<xsl:if test="str[@name='mods.dateIssued'] or str[@name='mods.dateIssued.host']"> | ||
<div class="hit_date"> | ||
<xsl:variable name="date"> | ||
<xsl:choose> | ||
<xsl:when test="str[@name='mods.dateIssued']"> | ||
<xsl:value-of select="str[@name='mods.dateIssued']"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:value-of select="str[@name='mods.dateIssued.host']"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</xsl:variable> | ||
<span class="badge badge-primary"> | ||
<xsl:value-of select="$date"/> | ||
</span> | ||
</div> | ||
</xsl:if> | ||
</xsl:template> | ||
</xsl:stylesheet> |
31 changes: 31 additions & 0 deletions
31
mir-module/src/main/resources/xsl/response-mir-hit-licence.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation" | ||
xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions" | ||
exclude-result-prefixes="i18n mcrxsl xsl"> | ||
|
||
<xsl:template name="hit-licence"> | ||
<xsl:if test="arr[@name='category.top']/str[contains(text(), 'mir_licenses:')]"> | ||
<div class="hit_license"> | ||
<span class="badge badge-primary"> | ||
<xsl:variable name="accessCondition"> | ||
<xsl:value-of | ||
select="substring-after(arr[@name='category.top']/str[contains(text(), 'mir_licenses:')][last()],':')"/> | ||
</xsl:variable> | ||
<xsl:choose> | ||
<xsl:when test="contains($accessCondition, 'rights_reserved')"> | ||
<xsl:value-of select="i18n:translate('component.mods.metaData.dictionary.rightsReserved')"/> | ||
</xsl:when> | ||
<xsl:when test="contains($accessCondition, 'oa_nlz')"> | ||
<xsl:value-of select="i18n:translate('component.mods.metaData.dictionary.oa_nlz.short')"/> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<xsl:value-of select="mcrxsl:getDisplayName('mir_licenses',$accessCondition)"/> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
</span> | ||
</div> | ||
</xsl:if> | ||
</xsl:template> | ||
</xsl:stylesheet> |
24 changes: 24 additions & 0 deletions
24
mir-module/src/main/resources/xsl/response-mir-hit-state.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:i18n="xalan://org.mycore.services.i18n.MCRTranslation" | ||
xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions" | ||
exclude-result-prefixes="i18n mcrxsl xsl"> | ||
|
||
<xsl:template name="hit-state"> | ||
<xsl:if test="not (mcrxsl:isCurrentUserGuestUser())"> | ||
<div class="hit_state"> | ||
<xsl:variable name="status-i18n"> | ||
<!-- template in mir-utils.xsl --> | ||
<xsl:call-template name="get-doc-state-label"> | ||
<xsl:with-param name="state-categ-id" select="str[@name='state']"/> | ||
</xsl:call-template> | ||
</xsl:variable> | ||
<span class="badge mir-{str[@name='state']}" | ||
title="{i18n:translate('component.mods.metaData.dictionary.status')}"> | ||
<xsl:value-of select="$status-i18n"/> | ||
</span> | ||
</div> | ||
</xsl:if> | ||
</xsl:template> | ||
</xsl:stylesheet> |
28 changes: 28 additions & 0 deletions
28
mir-module/src/main/resources/xsl/response-mir-hit-type.xsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<xsl:stylesheet version="1.0" | ||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||
xmlns:mcrxsl="xalan://org.mycore.common.xml.MCRXMLFunctions" | ||
exclude-result-prefixes="mcrxsl xsl"> | ||
|
||
<xsl:template name="hit-type"> | ||
<xsl:choose> | ||
<xsl:when test="arr[@name='mods.genre']"> | ||
<xsl:for-each select="arr[@name='mods.genre']/str"> | ||
<div class="hit_type"> | ||
<span class="badge badge-info"> | ||
<xsl:value-of select="mcrxsl:getDisplayName('mir_genres',.)"/> | ||
</span> | ||
</div> | ||
</xsl:for-each> | ||
</xsl:when> | ||
<xsl:otherwise> | ||
<div class="hit_type"> | ||
<span class="badge badge-info"> | ||
<xsl:value-of select="mcrxsl:getDisplayName('mir_genres','article')"/> | ||
</span> | ||
</div> | ||
</xsl:otherwise> | ||
</xsl:choose> | ||
|
||
</xsl:template> | ||
</xsl:stylesheet> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters