xsl/common: render item/event as one <dl/>

This commit is contained in:
Astro 2011-09-25 02:56:17 +02:00
parent 0c9951801a
commit 8d9f032348
1 changed files with 45 additions and 42 deletions

View File

@ -265,60 +265,63 @@
<!-- Support für <event/> bzw. Microformats -->
<xsl:include href="date.xsl" />
<xsl:template match="item/event">
<dl>
<xsl:apply-templates/>
</dl>
</xsl:template>
<xsl:template match="item/event/start">
<xsl:variable name="start" select="."/>
<xsl:variable name="end" select="../end"/>
<dl>
<dt>Datum</dt>
<dd>
<abbr class="dtstart">
<xsl:attribute name="title">
<xsl:call-template name="date-to-hevent">
<xsl:with-param name="date" select="$start"/>
</xsl:call-template>
</xsl:attribute>
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="$start"/>
</xsl:call-template>
</abbr>
<dt>Datum</dt>
<dd>
<abbr class="dtstart">
<xsl:attribute name="title">
<xsl:call-template name="date-to-hevent">
<xsl:with-param name="date" select="$start"/>
</xsl:call-template>
</xsl:attribute>
<xsl:if test="$end">
bis
<abbr class="dtend">
<xsl:attribute name="title">
<xsl:call-template name="date-to-hevent">
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="$start"/>
</xsl:call-template>
</abbr>
<xsl:if test="$end">
bis
<abbr class="dtend">
<xsl:attribute name="title">
<xsl:call-template name="date-to-hevent">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</xsl:attribute>
<xsl:choose>
<!-- Ends on same day it starts? -->
<xsl:when test="date:date($start) = date:date($end)">
<xsl:call-template name="get-timestring">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</xsl:attribute>
<xsl:choose>
<!-- Ends on same day it starts? -->
<xsl:when test="date:date($start) = date:date($end)">
<xsl:call-template name="get-timestring">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</xsl:when>
<!-- Event spans days -->
<xsl:otherwise>
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</abbr>
</xsl:if>
</dd>
</dl>
</xsl:when>
<!-- Event spans days -->
<xsl:otherwise>
<xsl:call-template name="get-datestring">
<xsl:with-param name="date" select="$end"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</abbr>
</xsl:if>
</dd>
</xsl:template>
<xsl:template match="item/event/end">
<!-- Output already for item/event/start above -->
</xsl:template>
<xsl:template match="item/event/location">
<dl>
<dt>Ort</dt>
<dd class="location"><xsl:apply-templates/></dd>
</dl>
<dt>Ort</dt>
<dd class="location"><xsl:apply-templates/></dd>
</xsl:template>