2020-07-15 17:12:44 +02:00
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version= "1.0" xmlns:xsl= "http://www.w3.org/1999/XSL/Transform" >
2021-01-19 19:50:40 +00:00
<xsl:import href= "../fsfe.xsl" />
2020-07-15 17:12:44 +02:00
<!-- Fill dynamic content -->
<xsl:template match= "activity-display" >
<xsl:variable name= "highlight" >
<xsl:value-of select= "@highlight" />
</xsl:variable>
<xsl:variable name= "tag" >
<xsl:value-of select= "@tag" />
</xsl:variable>
<xsl:element name= "div" >
<!-- different style and selection depending on $highlight -->
<xsl:choose>
<!-- highlighted activities in full width -->
<xsl:when test= "$highlight = 'yes'" >
2024-05-16 09:10:42 +00:00
<xsl:attribute name= "class" > icon-grid two-per-row</xsl:attribute>
2020-07-15 17:12:44 +02:00
<xsl:element name= "ul" >
<xsl:choose>
<!-- request certain tag -->
<xsl:when test= "$tag != ''" >
2024-05-16 09:10:42 +00:00
<xsl:for-each select= "/buildinfo/document/set/activity [(order/@highlight = 'yes') and (tags/tag/@key = $tag) and not (tags/tag/@key = 'hide')]" >
2020-07-15 17:12:44 +02:00
<xsl:sort select= "order/@priority" order= "descending" />
<xsl:sort select= "@date" order= "descending" />
<xsl:call-template name= "activity" />
</xsl:for-each>
</xsl:when>
<!-- all tags -->
<xsl:otherwise>
2024-05-16 09:10:42 +00:00
<xsl:for-each select= "/buildinfo/document/set/activity [(order/@highlight = 'yes') and not (tags/tag/@key = 'hide')]" >
2020-07-15 17:12:44 +02:00
<xsl:sort select= "order/@priority" order= "descending" />
<xsl:sort select= "@date" order= "descending" />
<xsl:call-template name= "activity" />
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:when>
<!-- non-highlighted activities -->
<xsl:otherwise>
<xsl:attribute name= "class" > icon-grid no-icons</xsl:attribute>
<xsl:element name= "ul" >
<xsl:choose>
<!-- request certain tag -->
<xsl:when test= "$tag != ''" >
2024-05-16 09:10:42 +00:00
<xsl:for-each select= "/buildinfo/document/set/activity [(order/@highlight != 'yes' or not(order/@highlight)) and tags/tag/@key = $tag and not (tags/tag/@key = 'hide')]" >
2020-07-15 17:12:44 +02:00
<xsl:sort select= "order/@priority" order= "descending" />
<xsl:sort select= "@date" order= "descending" />
<xsl:call-template name= "activity" />
</xsl:for-each>
</xsl:when>
<!-- all tags -->
<xsl:otherwise>
2024-05-16 09:10:42 +00:00
<xsl:for-each select= "/buildinfo/document/set/activity [(order/@highlight != 'yes' or not(order/@highlight)) and not (tags/tag/@key = 'hide')]" >
2020-07-15 17:12:44 +02:00
<xsl:sort select= "order/@priority" order= "descending" />
<xsl:sort select= "@date" order= "descending" />
<xsl:call-template name= "activity" />
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
</xsl:template>
<xsl:template name= "activity" >
<xsl:element name= "li" >
<!-- Logo -->
<xsl:if test= "image/@url" >
<xsl:element name= "img" >
<xsl:attribute name= "src" >
<xsl:value-of select= "image/@url" />
</xsl:attribute>
<xsl:attribute name= "alt" >
<xsl:text> Logo of </xsl:text>
<xsl:value-of select= "title" />
</xsl:attribute>
2024-05-16 09:10:42 +00:00
<xsl:attribute name= "class" > activitylogo</xsl:attribute>
2020-07-15 17:12:44 +02:00
</xsl:element>
</xsl:if>
<xsl:element name= "div" >
<!-- Title -->
<xsl:element name= "h3" >
<xsl:element name= "a" >
<xsl:attribute name= "href" >
<xsl:value-of select= "link/@href" />
</xsl:attribute>
<xsl:value-of select= "title" />
</xsl:element>
<xsl:if test= "@status = 'finished'" >
<xsl:element name= "span" >
<xsl:attribute name= "class" > status</xsl:attribute>
<xsl:call-template name= "fsfe-gettext" ><xsl:with-param name= "id" select= "'finished'" /></xsl:call-template>
</xsl:element>
</xsl:if>
</xsl:element>
<!-- Description -->
<xsl:element name= "p" >
<xsl:apply-templates select= "description/node()" />
</xsl:element>
</xsl:element> <!-- /div -->
</xsl:element> <!-- /li -->
</xsl:template>
</xsl:stylesheet>