diff --git a/dspace-xmlui/src/main/webapp/themes/mobile/mobile.xsl b/dspace-xmlui/src/main/webapp/themes/mobile/mobile.xsl index ca6b5e34f9993a9ef00f58e3e289cec848568630..460d9ba209fd1b8f817734b74cf49e12425e6b56 100755 --- a/dspace-xmlui/src/main/webapp/themes/mobile/mobile.xsl +++ b/dspace-xmlui/src/main/webapp/themes/mobile/mobile.xsl @@ -72,6 +72,9 @@ <xsl:call-template name="buildHeader"/> --> + <!--The trail is built by applying a template over pageMeta's trail children. --> + <xsl:call-template name="buildTrail"/> + <!-- Goes over the document tag's children elements: body, options, meta. The body template generates the ds-body div that contains all the content. The options template generates @@ -803,4 +806,80 @@ <xsl:template match="dri:options">  </xsl:template> + +<!-- ******************************************************************** --> + <xsl:template name="buildTrail"> + <div id="ds-trail-wrapper"> + <ul id="ds-trail"> + <!-- Display a language selection if more than 1 language is supported --> + <xsl:if + test="count(/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']) > 1"> + <div id="ds-language-selection"> + <xsl:for-each + select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='page'][@qualifier='supportedLocale']"> + <xsl:variable name="locale" select="." /> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="concat($context-path,'/?locale-attribute=')" /> + <xsl:value-of select="$locale" /> + </xsl:attribute> + <xsl:value-of + select="/dri:document/dri:meta/dri:pageMeta/dri:metadata[@element='supportedLocale'][@qualifier=$locale]" /> + </a> + </xsl:for-each> + </div> + </xsl:if> + + <xsl:choose> + <xsl:when test="starts-with($request-uri, 'page/about')"> + <li class="ds-trail-link first-link"> + <i18n:text>xmlui.structure.AboutRepositoryTrail</i18n:text> + </li> + </xsl:when> + <xsl:when test="count(/dri:document/dri:meta/dri:pageMeta/dri:trail) = 0"> + <li class="ds-trail-link first-link">-</li> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates select="/dri:document/dri:meta/dri:pageMeta/dri:trail"/> + </xsl:otherwise> + </xsl:choose> + </ul> + </div> + </xsl:template> + + <xsl:template match="dri:trail"> + <!--put an arrow between the parts of the trail--> + <xsl:if test="position()>1"> + <li class="ds-trail-arrow"> + <xsl:text>→</xsl:text> + </li> + </xsl:if> + <li> + <xsl:attribute name="class"> + <xsl:text>ds-trail-link </xsl:text> + <xsl:if test="position()=1"> + <xsl:text>first-link </xsl:text> + </xsl:if> + <xsl:if test="position()=last()"> + <xsl:text>last-link</xsl:text> + </xsl:if> + </xsl:attribute> + <!-- Determine whether we are dealing with a link or plain text trail link --> + <xsl:choose> + <xsl:when test="./@target"> + <a> + <xsl:attribute name="href"> + <xsl:value-of select="./@target"/> + </xsl:attribute> + <xsl:apply-templates /> + </a> + </xsl:when> + <xsl:otherwise> + <xsl:apply-templates /> + </xsl:otherwise> + </xsl:choose> + </li> + </xsl:template> +<!-- ******************************************************************** --> + </xsl:stylesheet>