Skip to content

Commit

Permalink
MIR-1409 Added stylesheet response-mir-hit-oa.xsl to enable applicati…
Browse files Browse the repository at this point in the history
…on modules overwriting of (open) access icon
  • Loading branch information
Possommi committed Nov 12, 2024
1 parent 7490930 commit 03ca091
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 21 deletions.
31 changes: 31 additions & 0 deletions mir-module/src/main/resources/xsl/response-mir-hit-oa.xsl
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"
exclude-result-prefixes="i18n xsl">

<xsl:template name="hit-oa">
<div class="hit_oa" data-toggle="tooltip">
<xsl:variable name="isOpenAccess" select="bool[@name='worldReadableComplete']='true'"/>

<xsl:choose>
<xsl:when test="$isOpenAccess">
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.response.openAccess.true')"/>
</xsl:attribute>
<span class="badge badge-success">
<i class="fas fa-unlock-alt" aria-hidden="true"/>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.response.openAccess.false')"/>
</xsl:attribute>
<span class="badge badge-warning">
<i class="fas fa-lock" aria-hidden="true"/>
</span>
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:template>
</xsl:stylesheet>
23 changes: 2 additions & 21 deletions mir-module/src/main/resources/xsl/response-mir.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

<xsl:include href="resource:xsl/csl-export-gui.xsl" />
<xsl:include href="resource:xsl/response-facets.xsl"/>
<xsl:include href="resource:xsl/response-mir-hit-oa.xsl" />
<xsl:include href="resource:xsl/response-mir-utils.xsl" />

<xsl:param name="UserAgent" />
Expand Down Expand Up @@ -541,27 +542,7 @@
<!-- hit type -->
<div class="hit_tnd_container">
<div class="hit_tnd_content">
<div class="hit_oa" data-toggle="tooltip">
<xsl:variable name="isOpenAccess" select="bool[@name='worldReadableComplete']='true'" />
<xsl:choose>
<xsl:when test="$isOpenAccess">
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.response.openAccess.true')" />
</xsl:attribute>
<span class="badge badge-success">
<i class="fas fa-unlock-alt" aria-hidden="true"></i>
</span>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="title">
<xsl:value-of select="i18n:translate('mir.response.openAccess.false')" />
</xsl:attribute>
<span class="badge badge-warning">
<i class="fas fa-lock" aria-hidden="true"></i>
</span>
</xsl:otherwise>
</xsl:choose>
</div>
<xsl:call-template name="hit-oa"/>
<xsl:choose>
<xsl:when test="arr[@name='mods.genre']">
<xsl:for-each select="arr[@name='mods.genre']/str">
Expand Down

0 comments on commit 03ca091

Please sign in to comment.