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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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/date-time.xsl" />
  4. <xsl:import href="tools/xsltsl/tagging.xsl" />
  5. <xsl:import href="tools/xsltsl/translations.xsl" />
  6. <xsl:import href="tools/xsltsl/static-elements.xsl" />
  7. <xsl:import href="tools/xsltsl/quotes.xsl" />
  8. <xsl:import href="fsfe.xsl" />
  9. <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
  10. <xsl:template match="body">
  11. <div id="frontpage">
  12. <xsl:apply-templates />
  13. </div>
  14. </xsl:template>
  15. <xsl:template match="quote-box">
  16. <xsl:call-template name="quote-box">
  17. <xsl:with-param name="tag" select="@tag" />
  18. </xsl:call-template>
  19. </xsl:template>
  20. <xsl:template match="label-ourwork2011">
  21. <xsl:call-template name="gettext">
  22. <xsl:with-param name="id" select="'support'" />
  23. </xsl:call-template>
  24. </xsl:template>
  25. <!--display dynamic list of news items-->
  26. <xsl:template match="all-news">
  27. <xsl:call-template name="fetch-news">
  28. <xsl:with-param name="tag">front-page</xsl:with-param>
  29. <xsl:with-param name="nb-items" select="5" />
  30. <xsl:with-param name="show-date" select="'no'" />
  31. </xsl:call-template>
  32. <xsl:element name="p">
  33. <xsl:element name="a">
  34. <xsl:attribute name="href">/news/news.html</xsl:attribute>
  35. <xsl:call-template name="more-label" /><xsl:text>…</xsl:text>
  36. </xsl:element>
  37. </xsl:element>
  38. </xsl:template>
  39. <!--display dynamic list of newsletters items-->
  40. <xsl:template match="all-newsletters">
  41. <xsl:call-template name="fetch-newsletters">
  42. <xsl:with-param name="nb-items" select="2" />
  43. </xsl:call-template>
  44. </xsl:template>
  45. <!--display dynamic list of event items-->
  46. <xsl:template match="all-events">
  47. <!-- Current events -->
  48. <xsl:call-template name="fetch-events">
  49. <xsl:with-param name="wanted-time" select="'present'" />
  50. <xsl:with-param name="tag">front-page</xsl:with-param>
  51. <xsl:with-param name="display-details" select="'yes'" />
  52. </xsl:call-template>
  53. <!-- Future events -->
  54. <xsl:call-template name="fetch-events">
  55. <xsl:with-param name="wanted-time" select="'future'" />
  56. <xsl:with-param name="tag">front-page</xsl:with-param>
  57. <xsl:with-param name="display-details" select="'yes'" />
  58. <xsl:with-param name="nb-items" select="4" />
  59. </xsl:call-template>
  60. <xsl:element name="p">
  61. <xsl:element name="a">
  62. <xsl:attribute name="href">/events/events.html</xsl:attribute>
  63. <xsl:call-template name="more-label" /><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. <!-- display campaign box 4 -->
  88. <xsl:template match="campaign-box4">
  89. <div id="campaign-box-4">
  90. <!--
  91. Here are two codes snippets that will provide for a graphical and a text banner.
  92. /!\ comment out one of the two, you probably only want one banner on the front page.
  93. -->
  94. <!-- graphical banner -->
  95. <!--<a href="/campaigns/ilovefs/ilovefs.html">
  96. <img src="/graphics/valentine.png" />
  97. </a>-->
  98. <!--
  99. Text banner
  100. The ids used here are needed to fetch the correct texts in /tools/texts-content.**.xml
  101. /!\ the text with given IDs *must* exist there!
  102. -->
  103. <!--div class="banner-border">
  104. <p>
  105. <a href="http://www.defectivebydesign.org/no-drm-in-html5">
  106. <xsl:call-template name="gettext">
  107. <xsl:with-param name="id" select="'no-drm-in-html5'" />
  108. </xsl:call-template>
  109. </a>
  110. </p>
  111. </div -->
  112. </div>
  113. </xsl:template>
  114. <!--display labels-->
  115. <!--translated word "newsletter"-->
  116. <xsl:template match="newsletter-label">
  117. <xsl:call-template name="gettext">
  118. <xsl:with-param name="id" select="'newsletter'" />
  119. </xsl:call-template>
  120. </xsl:template>
  121. <!--translated sentence "receive-newsletter"-->
  122. <xsl:template match="receive-newsletter">
  123. <xsl:call-template name="gettext">
  124. <xsl:with-param name="id" select="'receive-newsletter'" />
  125. </xsl:call-template>
  126. </xsl:template>
  127. <!--translated word "news"-->
  128. <xsl:template match="news-label">
  129. <xsl:call-template name="gettext">
  130. <xsl:with-param name="id" select="'news'" />
  131. </xsl:call-template>
  132. </xsl:template>
  133. <!--translated word "events"-->
  134. <xsl:template match="events-label">
  135. <xsl:call-template name="gettext">
  136. <xsl:with-param name="id" select="'events'" />
  137. </xsl:call-template>
  138. </xsl:template>
  139. <!--translated word "more"-->
  140. <xsl:template match="more-label">
  141. <xsl:call-template name="more-label" /><xsl:text>…</xsl:text>
  142. </xsl:template>
  143. <xsl:template name="more-label">
  144. <xsl:call-template name="gettext">
  145. <xsl:with-param name="id" select="'more'" />
  146. </xsl:call-template>
  147. </xsl:template>
  148. <!--translated word "donate"-->
  149. <xsl:template match="donate-label">
  150. <xsl:call-template name="gettext">
  151. <xsl:with-param name="id" select="'donate'" />
  152. </xsl:call-template>
  153. </xsl:template>
  154. <!--translated word "join"-->
  155. <xsl:template match="join-label">
  156. <xsl:call-template name="gettext">
  157. <xsl:with-param name="id" select="'join'" />
  158. </xsl:call-template>
  159. </xsl:template>
  160. <!--translated word "support"-->
  161. <xsl:template match="support-label">
  162. <xsl:call-template name="gettext">
  163. <xsl:with-param name="id" select="'support'" />
  164. </xsl:call-template>
  165. </xsl:template>
  166. <xsl:template match="about-work-label">
  167. <xsl:call-template name="gettext">
  168. <xsl:with-param name="id" select="'about-work'" />
  169. </xsl:call-template>
  170. </xsl:template>
  171. <xsl:template match="subscribe-nl">
  172. <xsl:call-template name="subscribe-nl" />
  173. </xsl:template>
  174. </xsl:stylesheet>