Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/ https://fsfe.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

78 lines
3.4 KiB

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="../fsfe.xsl" />
<xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
<!-- $today = current date (given as <html date="...">) -->
<xsl:variable name="today">
<xsl:value-of select="/buildinfo/@date"/>
</xsl:variable>
<!-- $frommonth = date from which the list should start -->
<xsl:variable name="frommonth">
<xsl:value-of select="concat(substring($today,1,4)-1,substring($today,5,4),'01')"/>
</xsl:variable>
<!-- Fill dynamic content -->
<xsl:template match="dynamic-content">
<xsl:variable name="group"><xsl:value-of select="@group"/></xsl:variable>
<xsl:choose>
<xsl:when test="$group='gold'">
<xsl:element name="table">
<xsl:attribute name="id">gold-donors</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
<xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of select="@img"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="node()"/></xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="node()"/>
<xsl:if test="@mark">
<xsl:element name="span">
<xsl:attribute name="style">color:red</xsl:attribute>
<xsl:text>*</xsl:text>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:when>
<xsl:when test="$group='silver'">
<xsl:element name="table">
<xsl:attribute name="id">silver-donors</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
<xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:element name="tr">
<xsl:element name="td">
<xsl:element name="img">
<xsl:attribute name="src"><xsl:value-of select="@img"/></xsl:attribute>
<xsl:attribute name="alt"><xsl:value-of select="node()"/></xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="td">
<xsl:value-of select="node()"/>
</xsl:element>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="ul">
<xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
<xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
<xsl:element name="li">
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:for-each>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>