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 8.3KB

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