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.

thankgnus.xsl 3.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:import href="../fsfe.xsl" />
  4. <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
  5. <!-- $today = current date (given as <html date="...">) -->
  6. <xsl:variable name="today">
  7. <xsl:value-of select="/buildinfo/@date"/>
  8. </xsl:variable>
  9. <!-- $frommonth = date from which the list should start -->
  10. <xsl:variable name="frommonth">
  11. <xsl:value-of select="concat(substring($today,1,4)-1,substring($today,5,4),'01')"/>
  12. </xsl:variable>
  13. <!-- Fill dynamic content -->
  14. <xsl:template match="dynamic-content">
  15. <xsl:variable name="group"><xsl:value-of select="@group"/></xsl:variable>
  16. <xsl:choose>
  17. <xsl:when test="$group='gold'">
  18. <xsl:element name="table">
  19. <xsl:attribute name="id">gold-donors</xsl:attribute>
  20. <xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
  21. <xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  22. <xsl:element name="tr">
  23. <xsl:element name="td">
  24. <xsl:element name="img">
  25. <xsl:attribute name="src"><xsl:value-of select="@img"/></xsl:attribute>
  26. <xsl:attribute name="alt"><xsl:value-of select="node()"/></xsl:attribute>
  27. </xsl:element>
  28. </xsl:element>
  29. <xsl:element name="td">
  30. <xsl:value-of select="node()"/>
  31. <xsl:if test="@mark">
  32. <xsl:element name="span">
  33. <xsl:attribute name="style">color:red</xsl:attribute>
  34. <xsl:text>*</xsl:text>
  35. </xsl:element>
  36. </xsl:if>
  37. </xsl:element>
  38. </xsl:element>
  39. </xsl:for-each>
  40. </xsl:element>
  41. </xsl:when>
  42. <xsl:when test="$group='silver'">
  43. <xsl:element name="table">
  44. <xsl:attribute name="id">silver-donors</xsl:attribute>
  45. <xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
  46. <xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  47. <xsl:element name="tr">
  48. <xsl:element name="td">
  49. <xsl:element name="img">
  50. <xsl:attribute name="src"><xsl:value-of select="@img"/></xsl:attribute>
  51. <xsl:attribute name="alt"><xsl:value-of select="node()"/></xsl:attribute>
  52. </xsl:element>
  53. </xsl:element>
  54. <xsl:element name="td">
  55. <xsl:value-of select="node()"/>
  56. </xsl:element>
  57. </xsl:element>
  58. </xsl:for-each>
  59. </xsl:element>
  60. </xsl:when>
  61. <xsl:otherwise>
  62. <xsl:element name="ul">
  63. <xsl:for-each select="/buildinfo/document/set/*[name(.)=$group]/donor[translate(@date,'-','')&gt;=translate($frommonth,'-','')]">
  64. <xsl:sort select="translate(node(),'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')"/>
  65. <xsl:element name="li">
  66. <xsl:apply-templates select="node()"/>
  67. </xsl:element>
  68. </xsl:for-each>
  69. </xsl:element>
  70. </xsl:otherwise>
  71. </xsl:choose>
  72. </xsl:template>
  73. </xsl:stylesheet>