Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
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.

index.xsl 7.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243
  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="tools/xsltsl/static-elements.xsl" />
  4. <xsl:import href="fsfe.xsl" />
  5. <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
  6. <xsl:template match="body">
  7. <div id="frontpage">
  8. <xsl:apply-templates />
  9. </div>
  10. </xsl:template>
  11. <!--xsl:template match="quote-box">
  12. <xsl:call-template name="quote-box">
  13. <xsl:with-param name="tag" select="@tag" />
  14. </xsl:call-template>
  15. </xsl:template-->
  16. <xsl:template match="label-ourwork2011">
  17. <xsl:call-template name="gettext">
  18. <xsl:with-param name="id" select="'support'" />
  19. </xsl:call-template>
  20. </xsl:template>
  21. <!--display dynamic list of news items-->
  22. <xsl:template match="all-news">
  23. <xsl:call-template name="fetch-news">
  24. <xsl:with-param name="tag">front-page</xsl:with-param>
  25. <xsl:with-param name="nb-items" select="4" />
  26. <xsl:with-param name="show-date" select="'yes'" />
  27. <!--TODO enable a "Read More" link with class "learn-more" at the end of newsteaser-->
  28. </xsl:call-template>
  29. </xsl:template>
  30. <!--display dynamic list of event items-->
  31. <xsl:template match="all-events">
  32. <!-- Current events -->
  33. <xsl:call-template name="fetch-events">
  34. <xsl:with-param name="wanted-time" select="'present'" />
  35. <xsl:with-param name="tag">front-page</xsl:with-param>
  36. <xsl:with-param name="display-details" select="'yes'" />
  37. </xsl:call-template>
  38. <!-- Future events -->
  39. <xsl:call-template name="fetch-events">
  40. <xsl:with-param name="wanted-time" select="'future'" />
  41. <xsl:with-param name="tag">front-page</xsl:with-param>
  42. <xsl:with-param name="display-details" select="'yes'" />
  43. <xsl:with-param name="nb-items" select="3" />
  44. <!--FIXME ↑ why is it showing one more?-->
  45. </xsl:call-template>
  46. <xsl:element name="p">
  47. <xsl:element name="a">
  48. <xsl:attribute name="href">/events/events.html</xsl:attribute>
  49. <xsl:attribute name="class">learn-more</xsl:attribute>
  50. <xsl:call-template name="more-events" /><xsl:text></xsl:text>
  51. </xsl:element>
  52. </xsl:element>
  53. </xsl:template>
  54. <!-- display campaign box 3 -->
  55. <xsl:template match="campaign-box-3">
  56. <xsl:element name="a">
  57. <xsl:attribute name="href">/campaigns/ilovefs/ilovefs<xsl:value-of select="/buildinfo/@language" />.html</xsl:attribute>
  58. <xsl:variable name="lang" select="/buildinfo/@language" />
  59. <xsl:variable name="img-path"
  60. select="concat( '/campaigns/valentine/valentine-358x60-', substring($lang, 2, 2) , '.png' )" />
  61. <xsl:element name="img">
  62. <xsl:attribute name="src">
  63. <xsl:value-of select="$img-path" />
  64. </xsl:attribute>
  65. <!-- And on error (if previous file does not exist), we load our default image -->
  66. <!-- xsl:attribute name="onerror">
  67. <xsl:text>this.src='/campaigns/valentine/valentine-358x60-en.png';</xsl:text>
  68. </xsl:attribute -->
  69. <xsl:attribute name="alt"
  70. value="No picture" />
  71. </xsl:element>
  72. </xsl:element>
  73. </xsl:template>
  74. <xsl:template match="campaigns">
  75. <div
  76. id="campaigns-boxes"
  77. class="cycle-slideshow"
  78. data-cycle-log="false"
  79. data-cycle-pause-on-hover="true"
  80. data-cycle-speed="500"
  81. data-cycle-timeout="6000"
  82. data-cycle-slides="a"
  83. data-cycle-fx="scrollHorz"
  84. data-cycle-swipe="true">
  85. <div class="cycle-pager"/>
  86. <xsl:for-each select="/buildinfo/document/set/campaign[@running = 'yes']">
  87. <xsl:apply-templates select="." mode="slideshow" />
  88. </xsl:for-each>
  89. </div>
  90. </xsl:template>
  91. <xsl:template match="campaign" mode="slideshow">
  92. <a href="{link}" class="campaign-box">
  93. <xsl:attribute name="id"><xsl:value-of select="@id" /></xsl:attribute>
  94. <!-- If you use the content tag, you can define boxes arbitrarily,
  95. but you shouldn't use photo/author/copyright then -->
  96. <xsl:if test=" content != '' ">
  97. <xsl:apply-templates select="content/@* | content/node()"/>
  98. </xsl:if>
  99. <xsl:if test=" photo != '' "><img src="{photo}" alt="" /></xsl:if>
  100. <xsl:if test=" text != '' ">
  101. <p class="text"><xsl:value-of select="text" /></p>
  102. </xsl:if>
  103. <xsl:if test=" text2 != '' ">
  104. <p class="text2"><xsl:value-of select="text2" /></p>
  105. </xsl:if>
  106. <!-- Author (if existing) -->
  107. <xsl:if test="author != ''">
  108. <span class="author"><xsl:value-of select="author" /></span>
  109. </xsl:if>
  110. <!-- Copyright notice (if existing) -->
  111. <xsl:if test="copyright != ''">
  112. <span class="copyright"><xsl:value-of select="copyright" /></span>
  113. </xsl:if>
  114. </a>
  115. </xsl:template>
  116. <!-- display campaign box 4 -->
  117. <xsl:template match="campaign-box4">
  118. </xsl:template>
  119. <!--display labels-->
  120. <!--translated word "newsletter"-->
  121. <xsl:template match="newsletter-label">
  122. <xsl:call-template name="gettext">
  123. <xsl:with-param name="id" select="'newsletter'" />
  124. </xsl:call-template>
  125. </xsl:template>
  126. <!--translated sentence "receive-newsletter"-->
  127. <xsl:template match="receive-newsletter">
  128. <xsl:call-template name="gettext">
  129. <xsl:with-param name="id" select="'receive-newsletter'" />
  130. </xsl:call-template>
  131. </xsl:template>
  132. <!--translated word "news"-->
  133. <xsl:template match="news-label">
  134. <xsl:call-template name="gettext">
  135. <xsl:with-param name="id" select="'news'" />
  136. </xsl:call-template>
  137. </xsl:template>
  138. <!--translated word "events"-->
  139. <xsl:template match="events-label">
  140. <xsl:call-template name="gettext">
  141. <xsl:with-param name="id" select="'events'" />
  142. </xsl:call-template>
  143. </xsl:template>
  144. <!--translated word "more"-->
  145. <xsl:template match="more-label">
  146. <xsl:call-template name="more-label" /><xsl:text></xsl:text>
  147. </xsl:template>
  148. <xsl:template name="more-label">
  149. <xsl:call-template name="gettext">
  150. <xsl:with-param name="id" select="'more'" />
  151. </xsl:call-template>
  152. </xsl:template>
  153. <!--translated word "more news"-->
  154. <xsl:template match="more-news">
  155. <xsl:call-template name="more-news" /><xsl:text></xsl:text>
  156. </xsl:template>
  157. <xsl:template name="more-news">
  158. <xsl:call-template name="gettext">
  159. <xsl:with-param name="id" select="'morenews'" />
  160. </xsl:call-template>
  161. </xsl:template>
  162. <!--translated word "more events"-->
  163. <xsl:template match="more-events">
  164. <xsl:call-template name="more-events" /><xsl:text></xsl:text>
  165. </xsl:template>
  166. <xsl:template name="more-events">
  167. <xsl:call-template name="gettext">
  168. <xsl:with-param name="id" select="'moreevents'" />
  169. </xsl:call-template>
  170. </xsl:template>
  171. <!--translated word "donate"-->
  172. <xsl:template match="donate-label">
  173. <xsl:call-template name="gettext">
  174. <xsl:with-param name="id" select="'donate'" />
  175. </xsl:call-template>
  176. </xsl:template>
  177. <!--translated word "join"-->
  178. <xsl:template match="join-label">
  179. <xsl:call-template name="gettext">
  180. <xsl:with-param name="id" select="'join'" />
  181. </xsl:call-template>
  182. </xsl:template>
  183. <!--translated word "support"-->
  184. <xsl:template match="support-label">
  185. <xsl:call-template name="gettext">
  186. <xsl:with-param name="id" select="'support'" />
  187. </xsl:call-template>
  188. </xsl:template>
  189. <xsl:template match="about-work-label">
  190. <xsl:call-template name="gettext">
  191. <xsl:with-param name="id" select="'about-work'" />
  192. </xsl:call-template>
  193. </xsl:template>
  194. <xsl:template match="subscribe-nl">
  195. <xsl:call-template name="subscribe-nl" />
  196. </xsl:template>
  197. </xsl:stylesheet>