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.

spreadtheword.xsl 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. <?xml version="1.0"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <xsl:import href="../fsfe.xsl" />
  4. <xsl:import href="../tools/xsltsl/countries.xsl" />
  5. <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
  6. <!-- Fill dynamic content -->
  7. <xsl:template match="dynamic-content">
  8. <xsl:variable name="type"><xsl:value-of select="@type"/></xsl:variable>
  9. <xsl:for-each select="/buildinfo/document/set/item [@type = $type]">
  10. <xsl:sort select="@order" order="ascending"/>
  11. <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
  12. <xsl:choose>
  13. <!-- item is just an introductionary text -->
  14. <xsl:when test="@introduction = 'yes'">
  15. <xsl:element name="p">
  16. <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
  17. <xsl:attribute name="style">clear: both;</xsl:attribute>
  18. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/text" />
  19. </xsl:element>
  20. </xsl:when>
  21. <xsl:otherwise>
  22. <!-- item is a normal promo item -->
  23. <!-- Full Item -->
  24. <xsl:element name="div">
  25. <xsl:attribute name="class">left break margin-vertical</xsl:attribute>
  26. <xsl:attribute name="id"><xsl:value-of select="$id"/></xsl:attribute>
  27. <xsl:variable name="year"><xsl:value-of select="@year"/></xsl:variable>
  28. <!-- Name -->
  29. <xsl:element name="p">
  30. <xsl:element name="strong">
  31. <xsl:value-of select="/buildinfo/document/set/info[@id=$id]/name" />
  32. </xsl:element>
  33. </xsl:element>
  34. <!-- / Name -->
  35. <!-- Image -->
  36. <xsl:for-each select="image">
  37. <!-- <xsl:element name="a">
  38. <xsl:attribute name="href">
  39. <xsl:value-of select="@imglarge" />
  40. </xsl:attribute>
  41. <xsl:attribute name="title">
  42. <xsl:value-of select="/buildinfo/document/set/info[@id=$id]/name" />
  43. </xsl:attribute> -->
  44. <xsl:element name="img">
  45. <xsl:attribute name="class">left grid-30</xsl:attribute>
  46. <xsl:attribute name="src">
  47. <xsl:value-of select="@imgsmall" />
  48. </xsl:attribute>
  49. </xsl:element> <!-- /img -->
  50. <!-- </xsl:element> --> <!-- /a -->
  51. </xsl:for-each>
  52. <!-- /Image -->
  53. <!-- Description -->
  54. <xsl:element name="p">
  55. <xsl:attribute name="class">right grid-70</xsl:attribute>
  56. <xsl:attribute name="style">margin-top:0;</xsl:attribute>
  57. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/description" />
  58. </xsl:element>
  59. <!-- / Description -->
  60. <!-- Printed version -->
  61. <xsl:if test="/buildinfo/document/set/info[@id=$id]/printed != ''">
  62. <xsl:element name="p">
  63. <xsl:attribute name="class">right grid-70</xsl:attribute>
  64. <!--<xsl:attribute name="style">font-size:0.8em</xsl:attribute>-->
  65. <xsl:element name="abbr"> <!-- mouseover info text -->
  66. <xsl:attribute name="title">
  67. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-printed-tooltip'" /></xsl:call-template>
  68. </xsl:attribute>
  69. <xsl:element name="strong"> <!-- Field name -->
  70. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-printed'" /></xsl:call-template>
  71. </xsl:element> <!-- /strong -->
  72. </xsl:element> <!-- /abbr -->
  73. <xsl:text>: </xsl:text>
  74. <xsl:element name="br"></xsl:element>
  75. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/printed" /> <!-- Dynamic value of the field -->
  76. </xsl:element> <!-- /p -->
  77. <!--<xsl:element name="br"></xsl:element>-->
  78. </xsl:if>
  79. <!-- Details -->
  80. <xsl:element name="p">
  81. <xsl:attribute name="class">right grid-70</xsl:attribute>
  82. <!-- Type -->
  83. <xsl:if test="/buildinfo/document/set/info[@id=$id]/type != ''">
  84. <xsl:element name="strong">
  85. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-type'" /></xsl:call-template>
  86. <xsl:text>: </xsl:text>
  87. </xsl:element>
  88. <xsl:value-of select="/buildinfo/document/set/info[@id=$id]/type" />
  89. <xsl:element name="br"></xsl:element>
  90. </xsl:if>
  91. <!-- Size -->
  92. <xsl:if test="/buildinfo/document/set/info[@id=$id]/size != ''">
  93. <xsl:element name="strong">
  94. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-size'" /></xsl:call-template>
  95. <xsl:text>: </xsl:text>
  96. </xsl:element>
  97. <xsl:value-of select="/buildinfo/document/set/info[@id=$id]/size" />
  98. <xsl:element name="br"></xsl:element>
  99. </xsl:if>
  100. <!-- Context (e.g Campaign) -->
  101. <xsl:if test="/buildinfo/document/set/info[@id=$id]/context != ''">
  102. <xsl:element name="strong">
  103. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-context'" /></xsl:call-template>
  104. <xsl:text>: </xsl:text>
  105. </xsl:element>
  106. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/context" />
  107. <xsl:element name="br"></xsl:element>
  108. </xsl:if>
  109. <!-- Languages -->
  110. <xsl:if test="/buildinfo/document/set/info[@id=$id]/languages != ''">
  111. <xsl:element name="span">
  112. <!--<xsl:attribute name="style">font-size:0.8em</xsl:attribute>-->
  113. <xsl:element name="abbr"> <!-- mouseover info text -->
  114. <xsl:attribute name="title">
  115. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-languages-tooltip'" /></xsl:call-template>
  116. </xsl:attribute>
  117. <xsl:element name="strong"> <!-- Field name -->
  118. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-languages'" /></xsl:call-template>
  119. </xsl:element> <!-- /strong -->
  120. </xsl:element> <!-- /abbr -->
  121. <xsl:text>: </xsl:text>
  122. <xsl:element name="br"></xsl:element>
  123. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/languages" /> <!-- Dynamic value of the field -->
  124. </xsl:element> <!-- /span -->
  125. <xsl:element name="br"></xsl:element>
  126. </xsl:if>
  127. <!-- License -->
  128. <xsl:if test="/buildinfo/document/set/info[@id=$id]/license != ''">
  129. <xsl:element name="strong">
  130. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-license'" /></xsl:call-template>
  131. <xsl:text>: </xsl:text>
  132. </xsl:element>
  133. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/license" />
  134. <xsl:element name="br"></xsl:element>
  135. </xsl:if>
  136. <!-- Author -->
  137. <xsl:if test="/buildinfo/document/set/info[@id=$id]/author != ''">
  138. <xsl:element name="strong">
  139. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-author'" /></xsl:call-template>
  140. <xsl:text>: </xsl:text>
  141. </xsl:element>
  142. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/author" />
  143. <xsl:element name="br"></xsl:element>
  144. </xsl:if>
  145. <!-- Year -->
  146. <xsl:if test="/buildinfo/document/set/info[@id=$id]/year != ''">
  147. <xsl:element name="strong">
  148. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-year'" /></xsl:call-template>
  149. <xsl:text>: </xsl:text>
  150. </xsl:element>
  151. <xsl:value-of select="$year"/>
  152. <xsl:element name="br"></xsl:element>
  153. </xsl:if>
  154. <!-- SMALLER TEXT -->
  155. <!-- Source -->
  156. <xsl:if test="/buildinfo/document/set/info[@id=$id]/source != ''">
  157. <xsl:element name="span">
  158. <xsl:attribute name="style">font-size:0.8em</xsl:attribute>
  159. <xsl:element name="abbr"> <!-- mouseover info text -->
  160. <xsl:attribute name="title">
  161. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-source-tooltip'" /></xsl:call-template>
  162. </xsl:attribute>
  163. <xsl:element name="strong"> <!-- Field name -->
  164. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-source'" /></xsl:call-template>
  165. </xsl:element> <!-- /strong -->
  166. </xsl:element> <!-- /abbr -->
  167. <xsl:text>: </xsl:text>
  168. <xsl:element name="br"></xsl:element>
  169. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/source" /> <!-- Dynamic value of the field -->
  170. </xsl:element> <!-- /span -->
  171. <xsl:element name="br"></xsl:element>
  172. </xsl:if>
  173. <!-- Printready -->
  174. <xsl:if test="/buildinfo/document/set/info[@id=$id]/printready != ''">
  175. <xsl:element name="span">
  176. <xsl:attribute name="style">font-size:0.8em</xsl:attribute>
  177. <xsl:element name="abbr"> <!-- mouseover info text -->
  178. <xsl:attribute name="title">
  179. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-printready-tooltip'" /></xsl:call-template>
  180. </xsl:attribute>
  181. <xsl:element name="strong"> <!-- Field name -->
  182. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'stw-printready'" /></xsl:call-template>
  183. </xsl:element> <!-- /strong -->
  184. </xsl:element> <!-- /abbr -->
  185. <xsl:text>: </xsl:text>
  186. <xsl:element name="br"></xsl:element>
  187. <xsl:copy-of select="/buildinfo/document/set/info[@id=$id]/printready" /> <!-- Dynamic value of the field -->
  188. </xsl:element> <!-- /span -->
  189. <xsl:element name="br"></xsl:element>
  190. </xsl:if>
  191. </xsl:element>
  192. <!-- / Details -->
  193. </xsl:element>
  194. <!-- / Full Item -->
  195. </xsl:otherwise>
  196. </xsl:choose>
  197. </xsl:for-each>
  198. </xsl:template>
  199. <!-- Dropdown list of countries requiring a choice -->
  200. <!-- when copying this, remember importing the xsl, and editing the .source file -->
  201. <xsl:template match="country-list">
  202. <xsl:call-template name="country-list">
  203. <xsl:with-param name="required" select="'yes'"/>
  204. </xsl:call-template>
  205. </xsl:template>
  206. <!-- Add a hidden field to the form to identify the language used. -->
  207. <xsl:template match="add-language">
  208. <xsl:element name="input">
  209. <xsl:attribute name="type">hidden</xsl:attribute>
  210. <xsl:attribute name="name">language</xsl:attribute>
  211. <xsl:attribute name="value">
  212. <xsl:value-of select="/buildinfo/document/@language" />
  213. </xsl:attribute>
  214. </xsl:element>
  215. </xsl:template>
  216. </xsl:stylesheet>