resource-item: Codereduktion

git-svn-id: svn://svn.c3d2.de/c3d2-web/trunk@997 31f61c52-7bfb-0310-b897-fc00f8a278f0
This commit is contained in:
astro 2007-08-17 13:46:01 +00:00
parent 9c6e8397e5
commit 0f397efdc7
1 changed files with 10 additions and 16 deletions

View File

@ -426,31 +426,25 @@ div#akct a#akpeel:hover {
</xsl:template>
<xsl:template match="resource" mode="resources-in-news">
<li>
<!-- MIME-Type ist nützlich z.B. für ftp:// URLs -->
<a href="{@url}" type="{@type}" class="mime">
<xsl:choose>
<xsl:when test="@title"><xsl:value-of select="@title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@url"/></xsl:otherwise>
</xsl:choose>
</a>
(<xsl:call-template name="mime-for-human">
<xsl:with-param name="mime" select="@type"/>
</xsl:call-template>, <xsl:call-template name="format-filesize">
<xsl:with-param name="value" select="@size"/>
</xsl:call-template>)
</li>
<xsl:call-template name="resource-item"/>
<xsl:apply-templates select="alternative" mode="resources-in-news"/>
</xsl:template>
<xsl:template match="resource/alternative" mode="resources-in-news">
<xsl:call-template name="resource-item">
<xsl:with-param name="title" select="../@title"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="resource-item">
<xsl:param name="title" select="@title"/>
<li>
<!-- MIME-Type ist nützlich z.B. für ftp:// URLs -->
<a href="{@url}" type="{@type}" class="mime">
<xsl:choose>
<xsl:when test="../@title"><xsl:value-of select="../@title"/></xsl:when>
<xsl:when test="string-length(string($title))"><xsl:value-of select="$title"/></xsl:when>
<xsl:otherwise><xsl:value-of select="@url"/></xsl:otherwise>
</xsl:choose>
</a>