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