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.
 
 
 
 
 
 

136 lines
5.0 KiB

  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. <!-- ==================================================================== -->
  5. <!-- Dynamic list of news items -->
  6. <!-- ==================================================================== -->
  7. <xsl:template match="dynamic-content-news">
  8. <xsl:for-each select="/buildinfo/document/set/news[
  9. translate(@date, '-', '') &lt;= translate(/buildinfo/@date, '-', '')
  10. ]">
  11. <xsl:sort select="@date" order="descending"/>
  12. <xsl:if test="position() &lt;= 3">
  13. <xsl:element name="div">
  14. <xsl:attribute name="class">column</xsl:attribute>
  15. <xsl:element name="div">
  16. <xsl:attribute name="class">row</xsl:attribute>
  17. <!-- Image (with or without link) -->
  18. <xsl:element name="div">
  19. <xsl:attribute name="class">image</xsl:attribute>
  20. <xsl:call-template name="news-image"/>
  21. </xsl:element><!-- div/image -->
  22. <xsl:element name="div">
  23. <xsl:attribute name="class">text</xsl:attribute>
  24. <!-- Title (with or without link) -->
  25. <xsl:element name="h3">
  26. <xsl:call-template name="news-title"/>
  27. </xsl:element><!-- h3 -->
  28. <!-- Date -->
  29. <xsl:element name="p">
  30. <xsl:attribute name="class">date</xsl:attribute>
  31. <xsl:call-template name="news-date"/>
  32. </xsl:element><!-- p/date -->
  33. <!-- Teaser -->
  34. <xsl:call-template name="news-teaser"/>
  35. </xsl:element><!-- div/text -->
  36. </xsl:element><!-- div/row -->
  37. </xsl:element><!-- div/column -->
  38. </xsl:if>
  39. </xsl:for-each>
  40. </xsl:template>
  41. <!-- ==================================================================== -->
  42. <!-- Dynamic list of testimonial quotes -->
  43. <!-- ==================================================================== -->
  44. <xsl:template match="dynamic-content-testimonials">
  45. <xsl:for-each select="/buildinfo/document/set/quote[@frontpage]">
  46. <xsl:element name="div">
  47. <xsl:attribute name="class">column</xsl:attribute>
  48. <xsl:element name="div">
  49. <xsl:attribute name="class">row</xsl:attribute>
  50. <!-- Image with link -->
  51. <xsl:element name="div">
  52. <xsl:attribute name="class">image</xsl:attribute>
  53. <xsl:element name="a">
  54. <xsl:attribute name="href">
  55. <xsl:text>/about/people/testimonials.html#</xsl:text>
  56. <xsl:value-of select="@id"/>
  57. </xsl:attribute>
  58. <xsl:element name="img">
  59. <xsl:attribute name="class">img-circle</xsl:attribute>
  60. <xsl:attribute name="src">
  61. <xsl:value-of select="@image"/>
  62. </xsl:attribute>
  63. <xsl:attribute name="alt">
  64. <xsl:value-of select="/buildinfo/document/text[@id='photograph']"/>
  65. </xsl:attribute>
  66. </xsl:element><!-- img -->
  67. </xsl:element><!-- a -->
  68. </xsl:element><!-- div/image -->
  69. <!-- Text and source -->
  70. <xsl:element name="div">
  71. <xsl:attribute name="class">text</xsl:attribute>
  72. <xsl:element name="p">
  73. <xsl:apply-templates select="text/node()"/>
  74. </xsl:element><!-- p -->
  75. <xsl:element name="p">
  76. <xsl:attribute name="class">source</xsl:attribute>
  77. <xsl:element name="a">
  78. <xsl:attribute name="href">
  79. <xsl:text>/about/people/testimonials.html#</xsl:text>
  80. <xsl:value-of select="@id"/>
  81. </xsl:attribute>
  82. <xsl:apply-templates select="name/node()"/>
  83. </xsl:element><!-- a -->
  84. </xsl:element><!-- p/source -->
  85. </xsl:element><!-- div/text -->
  86. </xsl:element><!-- div/row -->
  87. </xsl:element><!-- div/column -->
  88. </xsl:for-each>
  89. </xsl:template>
  90. <!-- ==================================================================== -->
  91. <!-- Dynamic list of events -->
  92. <!-- ==================================================================== -->
  93. <xsl:template match="dynamic-content-events">
  94. <xsl:for-each select="/buildinfo/document/set/event[
  95. translate (@end, '-', '') &gt;= translate (/buildinfo/@date, '-', '')
  96. ]">
  97. <xsl:sort select="@start"/>
  98. <xsl:if test="position() &lt;= 3">
  99. <!-- Date -->
  100. <xsl:element name="p">
  101. <xsl:attribute name="class">date</xsl:attribute>
  102. <xsl:call-template name="event-date"/>
  103. </xsl:element><!-- p/date -->
  104. <!-- Description -->
  105. <xsl:element name="p">
  106. <xsl:value-of select="title"/>
  107. </xsl:element><!-- p -->
  108. </xsl:if>
  109. </xsl:for-each>
  110. </xsl:template>
  111. </xsl:stylesheet>