Small addition for Foundry: The end date of an event is only shown when it is not equal to the start date (can be overridden by the

show-always attribute)


git-svn-id: https://svn.libreccm.org/ccm/trunk@3550 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-08-05 17:08:34 +00:00
parent 0f2473a873
commit 049fb8e3bb
1 changed files with 41 additions and 17 deletions

View File

@ -77,6 +77,29 @@
<xsl:template match="/content-item-layout//end-date"> <xsl:template match="/content-item-layout//end-date">
<xsl:param name="contentitem-tree" tunnel="yes"/> <xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="start-date">
<xsl:choose>
<xsl:when test="$contentitem-tree/startDate">
<xsl:value-of select="$contentitem-tree/startDate"/>
</xsl:when>
<xsl:when test="$contentitem-tree/nav:attribute[@name = 'startDate']">
<xsl:value-of select="$contentitem-tree/nav:attribute[@name = 'startDate']"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:variable name="end-date">
<xsl:choose>
<xsl:when test="$contentitem-tree/endDate">
<xsl:value-of select="$contentitem-tree/endDate"/>
</xsl:when>
<xsl:when test="$contentitem-tree/nav:attribute[@name = 'endDate']">
<xsl:value-of select="$contentitem-tree/nav:attribute[@name = 'endDate']"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:if test="($start-date != $end-date) or foundry:boolean(./@show-always)">
<xsl:choose> <xsl:choose>
<xsl:when test="$contentitem-tree/endDate"> <xsl:when test="$contentitem-tree/endDate">
<xsl:call-template name="foundry:format-date"> <xsl:call-template name="foundry:format-date">
@ -92,6 +115,7 @@
</xsl:call-template> </xsl:call-template>
</xsl:when> </xsl:when>
</xsl:choose> </xsl:choose>
</xsl:if>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">