2b40d41c1a
git-svn-id: http://yolanda.mister-muffin.de/svn@226 7eef14d0-6ed0-489d-bf55-20463b2d70db
135 lines
4.2 KiB
XML
135 lines
4.2 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<xsl:stylesheet version="1.0"
|
|
xmlns="http://www.w3.org/1999/xhtml"
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
xmlns:cc="http://web.resource.org/cc/"
|
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
>
|
|
|
|
<xsl:template name="innerresults">
|
|
|
|
<xsl:for-each select="//results/result">
|
|
<div class="result">
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="rdf:RDF/cc:Work/dc:identifier" />
|
|
</xsl:attribute>
|
|
<img>
|
|
<xsl:attribute name="src">
|
|
<xsl:value-of select="@thumbnail" />
|
|
</xsl:attribute>
|
|
<xsl:attribute name="alt">
|
|
<xsl:value-of select="rdf:RDF/cc:Work/dc:title" />
|
|
</xsl:attribute>
|
|
</img>
|
|
</a>
|
|
<br />
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="rdf:RDF/cc:Work/dc:identifier" />
|
|
</xsl:attribute>
|
|
<xsl:value-of select="rdf:RDF/cc:Work/dc:title" />
|
|
</a>
|
|
<br />
|
|
<xsl:variable name="hours" select="floor(@duration div 3600)" />
|
|
<xsl:variable name="minutes" select="floor((@duration - $hours*3600) div 60)" />
|
|
<xsl:variable name="seconds" select="@duration - $minutes*60 - $hours*3600" />
|
|
<xsl:choose>
|
|
<xsl:when test="$hours=0">
|
|
(<xsl:value-of select="concat(format-number($minutes, '00'), ':', format-number($seconds, '00'))" />)
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
(<xsl:value-of select="concat($hours, ':', format-number($minutes, '00'), ':', format-number($seconds, '00'))" />)
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</div>
|
|
</xsl:for-each>
|
|
</xsl:template>
|
|
|
|
|
|
<xsl:template name="results">
|
|
|
|
<div>
|
|
<span class="heading">
|
|
<xsl:value-of select="$locale_strings[@id='results_heading_1']" /> 
|
|
<xsl:value-of select="//results/@pagesize * (//results/@currentpage - 1) + 1" /> 
|
|
<xsl:value-of select="$locale_strings[@id='results_heading_2']" /> 
|
|
<xsl:choose>
|
|
<xsl:when test="(//results/@pagesize * //results/@currentpage) < //results/@resultcount">
|
|
<xsl:value-of select="//results/@pagesize * //results/@currentpage" />
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of select="//results/@resultcount" />
|
|
</xsl:otherwise>
|
|
</xsl:choose> 
|
|
<xsl:value-of select="$locale_strings[@id='results_heading_3']" /> 
|
|
<xsl:value-of select="//results/@resultcount" /> 
|
|
<xsl:value-of select="$locale_strings[@id='results_heading_4']" />
|
|
</span>
|
|
</div>
|
|
|
|
<xsl:call-template name="innerresults"/>
|
|
|
|
<xsl:if test="//results/@lastpage > 1">
|
|
<xsl:call-template name="pagination-arrows"/>
|
|
</xsl:if>
|
|
|
|
</xsl:template>
|
|
|
|
<xsl:template name="pagination-arrows">
|
|
<xsl:variable name="query_string" select="concat($site_strings[@id='page_results'], //results/@query, '&pagesize=', //results/@pagesize)" />
|
|
<div>
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="concat($query_string, '&page=1')" />
|
|
</xsl:attribute>
|
|
<xsl:if test="//results/@currentpage<=1">
|
|
<xsl:attribute name="style">
|
|
visibility: hidden;
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<img src="./images/tango/go-first.png" />
|
|
</a>
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="concat($query_string, '&page=', //results/@currentpage - 1)" />
|
|
</xsl:attribute>
|
|
<xsl:if test="//results/@currentpage<=1">
|
|
<xsl:attribute name="style">
|
|
visibility: hidden;
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<img src="./images/tango/go-previous.png" />
|
|
</a>
|
|
|
|
<div class="page-number">
|
|
<xsl:value-of select="//results/@currentpage" />
|
|
</div>
|
|
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="concat($query_string, '&page=', //results/@currentpage + 1)" />
|
|
</xsl:attribute>
|
|
<xsl:if test="//results/@lastpage<=//results/@currentpage">
|
|
<xsl:attribute name="style">
|
|
visibility: hidden;
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<img src="./images/tango/go-next.png" />
|
|
</a>
|
|
<a>
|
|
<xsl:attribute name="href">
|
|
<xsl:value-of select="concat($query_string, '&page=', //results/@lastpage)" />
|
|
</xsl:attribute>
|
|
<xsl:if test="//results/@lastpage<=//results/@currentpage">
|
|
<xsl:attribute name="style">
|
|
visibility: hidden;
|
|
</xsl:attribute>
|
|
</xsl:if>
|
|
<img src="./images/tango/go-last.png" />
|
|
</a>
|
|
</div>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|