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.

fsfe.xsl 54KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3. xmlns:dt="http://xsltsl.org/date-time"
  4. exclude-result-prefixes="dt"
  5. xmlns:str="http://exslt.org/strings"
  6. extension-element-prefixes="str">
  7. <xsl:import href="tools/xsltsl/translations.xsl" />
  8. <xsl:import href="tools/xsltsl/static-elements.xsl" />
  9. <!-- HTML 5 compatibility doctype, since our XSLT parser doesn't support disabling output escaping -->
  10. <xsl:output method="html" encoding="utf-8" indent="yes" doctype-system="about:legacy-compat" />
  11. <xsl:variable name="mode">
  12. <xsl:value-of select="'normal'" /> <!-- can be either 'normal' or 'valentine' -->
  13. </xsl:variable>
  14. <!-- The top level element of the input file is "buildinfo" -->
  15. <xsl:template match="/">
  16. <xsl:apply-templates select="buildinfo/document"/>
  17. </xsl:template>
  18. <!-- The actual HTML tree is in "buildinfo/document" -->
  19. <xsl:template match="buildinfo/document">
  20. <xsl:element name="html">
  21. <xsl:attribute name="lang">
  22. <xsl:value-of select="/buildinfo/@language"/>
  23. </xsl:attribute>
  24. <xsl:if test="/buildinfo/@language='ar'">
  25. <xsl:attribute name="dir">rtl</xsl:attribute>
  26. </xsl:if>
  27. <!--<xsl:apply-templates select="node()"/>-->
  28. <xsl:apply-templates select="head" />
  29. <xsl:call-template name="fsfe-body" />
  30. </xsl:element>
  31. </xsl:template>
  32. <!-- HTML head -->
  33. <xsl:template match="head">
  34. <head>
  35. <xsl:call-template name="fsfe-head" />
  36. </head>
  37. </xsl:template>
  38. <xsl:template name="fsfe-head">
  39. <!-- Don't let search engine robots index untranslated pages -->
  40. <xsl:element name="meta">
  41. <xsl:attribute name="name">robots</xsl:attribute>
  42. <xsl:attribute name="content">
  43. <xsl:choose>
  44. <xsl:when test="/buildinfo/@language=/buildinfo/document/@language">index, follow</xsl:when>
  45. <xsl:otherwise>noindex</xsl:otherwise>
  46. </xsl:choose>
  47. </xsl:attribute>
  48. </xsl:element>
  49. <!-- For pages used on external web servers, load the CSS from absolute URL -->
  50. <xsl:variable name="urlprefix"><xsl:if test="/buildinfo/document/@external">https://fsfe.org</xsl:if></xsl:variable>
  51. <xsl:element name="link">
  52. <xsl:attribute name="rel">stylesheet</xsl:attribute>
  53. <xsl:attribute name="media">all</xsl:attribute>
  54. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/generic.css</xsl:attribute>
  55. <xsl:attribute name="type">text/css</xsl:attribute>
  56. </xsl:element>
  57. <xsl:if test="$mode = 'valentine'">
  58. <xsl:element name="link">
  59. <xsl:attribute name="rel">stylesheet</xsl:attribute>
  60. <xsl:attribute name="media">all</xsl:attribute>
  61. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/genericv.css</xsl:attribute>
  62. <xsl:attribute name="type">text/css</xsl:attribute>
  63. </xsl:element>
  64. </xsl:if>
  65. <xsl:element name="link">
  66. <xsl:attribute name="rel">stylesheet</xsl:attribute>
  67. <xsl:attribute name="media">print</xsl:attribute>
  68. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/print.css</xsl:attribute>
  69. <xsl:attribute name="type">text/css</xsl:attribute>
  70. </xsl:element>
  71. <xsl:if test="/buildinfo/@language='ar'">
  72. <xsl:element name="link">
  73. <xsl:attribute name="rel">stylesheet</xsl:attribute>
  74. <xsl:attribute name="media">all</xsl:attribute>
  75. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/rtl.css</xsl:attribute>
  76. <xsl:attribute name="type">text/css</xsl:attribute>
  77. </xsl:element>
  78. </xsl:if>
  79. <xsl:element name="link">
  80. <xsl:attribute name="rel">icon</xsl:attribute>
  81. <xsl:attribute name="href">
  82. <xsl:value-of select="$urlprefix"/>
  83. <xsl:choose>
  84. <xsl:when test="$mode = 'valentine'">/graphics/fsfev.png</xsl:when>
  85. <xsl:otherwise>/graphics/fsfe.ico</xsl:otherwise>
  86. </xsl:choose>
  87. </xsl:attribute>
  88. <xsl:attribute name="type">image/x-icon</xsl:attribute>
  89. </xsl:element>
  90. <link rel="apple-touch-icon" href="{$urlprefix}/graphics/touch-icon.png" type="image/png" />
  91. <link rel="apple-touch-icon-precomposed" href="{$urlprefix}/graphics/touch-icon.png" type="image/png" />
  92. <xsl:element name="link">
  93. <xsl:attribute name="rel">alternate</xsl:attribute>
  94. <xsl:attribute name="title">FSFE <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'menu1/news'" /></xsl:call-template></xsl:attribute>
  95. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/news/news.<xsl:value-of select="/buildinfo/@language"/>.rss</xsl:attribute>
  96. <xsl:attribute name="type">application/rss+xml</xsl:attribute>
  97. </xsl:element>
  98. <xsl:element name="link">
  99. <xsl:attribute name="rel">alternate</xsl:attribute>
  100. <xsl:attribute name="title">FSFE <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'menu1/events'" /></xsl:call-template></xsl:attribute>
  101. <xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/events/events.<xsl:value-of select="/buildinfo/@language"/>.rss</xsl:attribute>
  102. <xsl:attribute name="type">application/rss+xml</xsl:attribute>
  103. </xsl:element>
  104. <xsl:for-each select="/buildinfo/trlist/tr">
  105. <xsl:sort select="@id"/>
  106. <xsl:element name="link">
  107. <xsl:attribute name="type">text/html</xsl:attribute>
  108. <xsl:attribute name="rel">alternate</xsl:attribute>
  109. <xsl:attribute name="hreflang"><xsl:value-of select="@id" /></xsl:attribute>
  110. <xsl:attribute name="lang"><xsl:value-of select="@id" /></xsl:attribute>
  111. <xsl:attribute name="href"><xsl:value-of select="/buildinfo/@filename"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
  112. <xsl:attribute name="title"><xsl:value-of select="." disable-output-escaping="yes" /></xsl:attribute>
  113. </xsl:element>
  114. </xsl:for-each>
  115. <xsl:for-each select="/buildinfo/document/author">
  116. <xsl:variable name="id">
  117. <xsl:value-of select="@id" />
  118. </xsl:variable>
  119. <xsl:element name="meta">
  120. <xsl:attribute name="name">author</xsl:attribute>
  121. <xsl:attribute name="content">
  122. <xsl:choose>
  123. <xsl:when test="@id and document('about/people/people.en.xml')/personset/person[@id=$id]">
  124. <xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/name" />
  125. </xsl:when>
  126. <xsl:otherwise>
  127. <xsl:value-of select="name" />
  128. </xsl:otherwise>
  129. </xsl:choose>
  130. </xsl:attribute>
  131. </xsl:element>
  132. </xsl:for-each>
  133. <script src="/scripts/jquery.js"></script>
  134. <script src="/scripts/master.js"></script>
  135. <script src="/scripts/placeholder.js"></script>
  136. <script src="/scripts/highlight.pack.js"></script>
  137. <script>
  138. hljs.tabReplace = " ";
  139. // hljs.initHighligtingOnLoad();
  140. // above line throws error: Uncaught TypeError: Object [object Object] has no method 'initHighligtingOnLoad'
  141. </script>
  142. <xsl:comment>
  143. <![CDATA[
  144. [if lt IE 8]>
  145. <script src="http://ie7-js.googlecode.com/svn/version/2.1(beta4)/IE8.js"></script>
  146. <![endif]
  147. ]]>
  148. </xsl:comment>
  149. <xsl:apply-templates select="@*|node()"/>
  150. </xsl:template>
  151. <!-- Modify H1 -->
  152. <xsl:template match="h1">
  153. <!-- Apply news page PRE-rules -->
  154. <xsl:if test="string(/buildinfo/document/@newsdate) and
  155. (not(string(/buildinfo/document/@type)) or
  156. /buildinfo/document/@type != 'newsletter')">
  157. <!-- add link to press/press.xx.html -->
  158. <xsl:element name="p">
  159. <xsl:attribute name="id">category</xsl:attribute>
  160. <xsl:element name="a">
  161. <xsl:attribute name="href">/press/press.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
  162. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'press'" /></xsl:call-template>
  163. </xsl:element>
  164. </xsl:element>
  165. </xsl:if>
  166. <!-- Apply newsletter page PRE-rules -->
  167. <xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'newsletter'">
  168. <xsl:element name="p">
  169. <xsl:attribute name="id">category</xsl:attribute>
  170. <xsl:element name="a">
  171. <xsl:attribute name="href">/news/newsletter.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
  172. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'newsletter'" /></xsl:call-template>
  173. </xsl:element>
  174. </xsl:element>
  175. </xsl:if>
  176. <!-- auto generate ID for headings if it doesn't already exist -->
  177. <xsl:call-template name="generate-id" />
  178. <!-- Apply news page rules -->
  179. <xsl:if test="string(/buildinfo/document/@newsdate) and
  180. (not(string(/buildinfo/document/@type)) or
  181. /buildinfo/document/@type != 'newsletter')">
  182. <!-- Social Links -->
  183. <xsl:variable name="original_file"
  184. select="concat(substring(string(/buildinfo/@filename), 2), '.' ,string(/buildinfo/@original), '.xhtml')"
  185. as="xs:string" />
  186. <xsl:variable name="originalDocument" select="document($original_file)/html" />
  187. <xsl:element name="a">
  188. <xsl:attribute name="class">social-link</xsl:attribute>
  189. <xsl:attribute name="href">https://flattr.com/submit/auto?user_id=fsfe&amp;url=http://fsfe.org/<xsl:value-of select="/buildinfo/@filename" />.html&amp;title=<xsl:value-of select="$originalDocument/head/title" />&amp;description=<xsl:value-of select="$originalDocument/body/p[@newsteaser]" />&amp;tags=<xsl:for-each select="$originalDocument/tags/tag"><xsl:value-of select="node()" />,</xsl:for-each>&amp;category=text</xsl:attribute>
  190. <xsl:element name="img">
  191. <xsl:attribute name="src">/graphics/flattr-badge-large.png</xsl:attribute>
  192. <xsl:attribute name="alt">Flattr this</xsl:attribute>
  193. </xsl:element>
  194. </xsl:element>
  195. <xsl:element name="a">
  196. <xsl:attribute name="class">social-link</xsl:attribute>
  197. <xsl:attribute name="href">/support?pr</xsl:attribute>
  198. <xsl:element name="img">
  199. <xsl:attribute name="src">/graphics/supporter/FSFE_plus1_48x22_b.png</xsl:attribute>
  200. <xsl:attribute name="alt">Support FSFE</xsl:attribute>
  201. </xsl:element>
  202. </xsl:element>
  203. <!-- End Social Links -->
  204. <!-- add publishing information (author, date) -->
  205. <xsl:element name="div">
  206. <xsl:attribute name="id">article-metadata</xsl:attribute>
  207. <xsl:element name="p">
  208. <span class="label"> <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'published'" /></xsl:call-template>: </span><xsl:value-of select="/buildinfo/document/@newsdate" />
  209. </xsl:element>
  210. </xsl:element>
  211. </xsl:if>
  212. <!-- End apply news page rules -->
  213. <!-- Apply newsletter page -->
  214. <xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'newsletter'">
  215. <!-- Social Links -->
  216. <xsl:variable name="original_file"
  217. select="concat(substring(string(/buildinfo/@filename), 2), '.' ,string(/buildinfo/@original), '.xhtml')"
  218. as="xs:string" />
  219. <xsl:variable name="originalDocument" select="document($original_file)/html" />
  220. <xsl:element name="a">
  221. <xsl:attribute name="class">social-link</xsl:attribute>
  222. <xsl:attribute name="href">https://flattr.com/submit/auto?user_id=fsfe&amp;url=http://fsfe.org/<xsl:value-of select="/buildinfo/@filename" />.html&amp;title=<xsl:value-of select="$originalDocument/head/title" />&amp;description=<xsl:value-of select="$originalDocument/body/p[@newsteaser]" />&amp;tags=<xsl:for-each select="$originalDocument/tags/tag"><xsl:value-of select="node()" />,</xsl:for-each>&amp;category=text</xsl:attribute>
  223. <xsl:element name="img">
  224. <xsl:attribute name="src">/graphics/flattr-badge-large.png</xsl:attribute>
  225. <xsl:attribute name="alt">Flattr this</xsl:attribute>
  226. </xsl:element>
  227. </xsl:element>
  228. <xsl:element name="a">
  229. <xsl:attribute name="class">social-link</xsl:attribute>
  230. <xsl:attribute name="href">/support?pr</xsl:attribute>
  231. <xsl:element name="img">
  232. <xsl:attribute name="src">/graphics/supporter/FSFE_plus1_48x22_b.png</xsl:attribute>
  233. <xsl:attribute name="alt">Support FSFE</xsl:attribute>
  234. </xsl:element>
  235. </xsl:element>
  236. <!-- End Social Links -->
  237. <xsl:call-template name="subscribe-nl" />
  238. </xsl:if>
  239. <!-- End apply newsletter page rules -->
  240. <!-- Depreciated- see next block: Apply article rules -->
  241. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
  242. <xsl:element name="div">
  243. <xsl:attribute name="id">article-metadata</xsl:attribute>
  244. <xsl:element name="p">
  245. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-1']/@content)">
  246. <span class="label"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'author'" /></xsl:call-template>: </span>
  247. <xsl:choose>
  248. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-1']">
  249. <xsl:variable name="author-link-1" select="/buildinfo/document/head/meta[@name='author-link-1']/@content" />
  250. <a rel='author' href='{$author-link-1}'>
  251. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" /> </a>
  252. </xsl:when>
  253. <xsl:otherwise>
  254. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-1']/@content" />
  255. </xsl:otherwise>
  256. </xsl:choose>
  257. </xsl:if>
  258. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-2']/@content)">
  259. <xsl:choose>
  260. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-2']">
  261. <xsl:variable name="author-link-2" select="/buildinfo/document/head/meta[@name='author-link-2']/@content" />
  262. , <a rel='author' href='{$author-link-2}'>
  263. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" /> </a>
  264. </xsl:when>
  265. <xsl:otherwise>
  266. , <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-2']/@content" />
  267. </xsl:otherwise>
  268. </xsl:choose>
  269. </xsl:if>
  270. <xsl:if test = "string(/buildinfo/document/head/meta[@name='author-name-3']/@content)">
  271. <xsl:choose>
  272. <xsl:when test="/buildinfo/document/head/meta[@name='author-link-3']">
  273. <xsl:variable name="author-link-3" select="/buildinfo/document/head/meta[@name='author-link-3']/@content" />
  274. , <a rel='author' href='{$author-link-3}'>
  275. <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" /> </a>
  276. </xsl:when>
  277. <xsl:otherwise>
  278. , <xsl:value-of select="/buildinfo/document/head/meta[@name='author-name-3']/@content" />
  279. </xsl:otherwise>
  280. </xsl:choose>
  281. </xsl:if>
  282. <span class="label">&#160;<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'published'" /></xsl:call-template>: </span><xsl:value-of select="/buildinfo/document/head/meta[@name='publication-date']/@content" />
  283. <xsl:if test = "string(/buildinfo/document/head/meta[@name='pdf-link']/@content)">
  284. <span class="label">&#160;PDF: </span>
  285. <xsl:variable name="pdf-link" select="/buildinfo/document/head/meta[@name='pdf-link']/@content" />
  286. <a href='{$pdf-link}'>download</a>
  287. </xsl:if>
  288. </xsl:element> <!-- </p> -->
  289. </xsl:element> <!-- </div> -->
  290. </xsl:if>
  291. <!-- End Apply article rules -->
  292. <!--Article authors, date -->
  293. <xsl:if test="/buildinfo/document/author or /buildinfo/document/date or /buildinfo/document/download">
  294. <xsl:element name="div">
  295. <xsl:attribute name="id">article-metadata</xsl:attribute>
  296. <xsl:if test="/buildinfo/document/author">
  297. <span class="label"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'writtenby'" /></xsl:call-template>&#160;</span>
  298. <xsl:for-each select="/buildinfo/document/author">
  299. <xsl:variable name="id">
  300. <xsl:value-of select="@id" />
  301. </xsl:variable>
  302. <xsl:choose>
  303. <xsl:when test="@id and document('about/people/people.en.xml')/personset/person[@id=$id]">
  304. <!-- if the author is in fsfe's people.xml then we take information from there -->
  305. <xsl:choose>
  306. <xsl:when test="document('about/people/people.en.xml')/personset/person[@id=$id]/link">
  307. <xsl:element name="a">
  308. <xsl:attribute name="class">author</xsl:attribute>
  309. <xsl:attribute name="rel">author</xsl:attribute>
  310. <xsl:attribute name="href"><xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/link" /></xsl:attribute>
  311. <xsl:if test="document('about/people/people.en.xml')/personset/person[@id=$id]/avatar">
  312. <xsl:element name="img">
  313. <xsl:attribute name="alt"></xsl:attribute>
  314. <xsl:attribute name="src"><xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/avatar" /></xsl:attribute>
  315. </xsl:element>
  316. </xsl:if>
  317. <xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/name" />
  318. </xsl:element>&#160;
  319. </xsl:when>
  320. <xsl:otherwise>
  321. <xsl:if test="document('about/people/people.en.xml')/personset/person[@id=$id]/avatar">
  322. <xsl:element name="img">
  323. <xsl:attribute name="alt"></xsl:attribute>
  324. <xsl:attribute name="src"><xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/avatar" /></xsl:attribute>
  325. </xsl:element>
  326. </xsl:if>
  327. <span class="author">
  328. <xsl:value-of select="document('about/people/people.en.xml')/personset/person[@id=$id]/name" />&#160;
  329. </span>
  330. </xsl:otherwise>
  331. </xsl:choose>
  332. </xsl:when>
  333. <xsl:otherwise>
  334. <xsl:choose>
  335. <xsl:when test="link">
  336. <xsl:element name="a">
  337. <xsl:attribute name="class">author</xsl:attribute>
  338. <xsl:attribute name="rel">author</xsl:attribute>
  339. <xsl:attribute name="href"><xsl:value-of select="link" /></xsl:attribute>
  340. <xsl:if test="avatar">
  341. <xsl:element name="img">
  342. <xsl:attribute name="alt"></xsl:attribute>
  343. <xsl:attribute name="src"><xsl:value-of select="avatar" /></xsl:attribute>
  344. </xsl:element>
  345. </xsl:if>
  346. <xsl:value-of select="name" />
  347. </xsl:element>&#160;
  348. </xsl:when>
  349. <xsl:otherwise>
  350. <xsl:if test="avatar">
  351. <xsl:element name="img">
  352. <xsl:attribute name="alt"></xsl:attribute>
  353. <xsl:attribute name="src"><xsl:value-of select="avatar" /></xsl:attribute>
  354. </xsl:element>
  355. </xsl:if>
  356. <span class="author">
  357. <xsl:value-of select="name" />&#160;
  358. </span>
  359. </xsl:otherwise>
  360. </xsl:choose>
  361. </xsl:otherwise>
  362. </xsl:choose>
  363. </xsl:for-each>
  364. </xsl:if>
  365. <xsl:if test="/buildinfo/document/date">
  366. <span class="label"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'published'" /></xsl:call-template>&#160;</span>
  367. <xsl:value-of select="/buildinfo/document/date/original/@content" />&#160;
  368. <xsl:if test="/buildinfo/document/date/revision">
  369. (<span class="label"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'revision'" /></xsl:call-template></span>
  370. <xsl:for-each select="/buildinfo/document/date/revision">
  371. &#160;<xsl:value-of select="@content" />
  372. </xsl:for-each>)&#160;
  373. </xsl:if>
  374. </xsl:if>
  375. <xsl:if test="/buildinfo/document/download">
  376. <span class="label"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'download'" /></xsl:call-template>&#160;</span>
  377. <xsl:element name="a">
  378. <xsl:attribute name="href"><xsl:value-of select="/buildinfo/document/download/@content" /></xsl:attribute>
  379. <xsl:value-of select="/buildinfo/document/download/@type" />
  380. </xsl:element>
  381. </xsl:if>
  382. </xsl:element>
  383. </xsl:if>
  384. <!--End Article authors, date-->
  385. </xsl:template>
  386. <!-- End modifications to H1 -->
  387. <!-- Modify H2 -->
  388. <xsl:template match="h2">
  389. <!-- auto generate ID for headings if it doesn't already exist -->
  390. <xsl:call-template name="generate-id" />
  391. </xsl:template>
  392. <!-- Modify H3 -->
  393. <xsl:template match="h3">
  394. <!-- auto generate ID for headings if it doesn't already exist -->
  395. <xsl:call-template name="generate-id" />
  396. </xsl:template>
  397. <!-- Modify H4 -->
  398. <xsl:template match="h4">
  399. <!-- auto generate ID for headings if it doesn't already exist -->
  400. <xsl:call-template name="generate-id" />
  401. </xsl:template>
  402. <!-- Modify H4 -->
  403. <xsl:template match="h4">
  404. <!-- auto generate ID for headings if it doesn't already exist -->
  405. <xsl:call-template name="generate-id" />
  406. </xsl:template>
  407. <!-- Modify H5 -->
  408. <xsl:template match="h5">
  409. <!-- auto generate ID for headings if it doesn't already exist -->
  410. <xsl:call-template name="generate-id" />
  411. </xsl:template>
  412. <!-- Modify H6 -->
  413. <xsl:template match="h6">
  414. <!-- auto generate ID for headings if it doesn't already exist -->
  415. <xsl:call-template name="generate-id" />
  416. </xsl:template>
  417. <!-- Apply support page -->
  418. <xsl:template match="support-portal-javascript">
  419. <xsl:call-template name="support-portal-javascript" />
  420. </xsl:template>
  421. <xsl:template match="support-form-javascript">
  422. <xsl:call-template name="support-form-javascript" />
  423. </xsl:template>
  424. <xsl:template match="country-list-europe">
  425. <xsl:call-template name="country-list-europe" />
  426. </xsl:template>
  427. <xsl:template match="country-list-other-continents">
  428. <xsl:call-template name="country-list-other-continents" />
  429. </xsl:template>
  430. <!-- End apply support page rules -->
  431. <!-- HTML body -->
  432. <!--<xsl:template match="body">-->
  433. <xsl:template name="fsfe-body">
  434. <body>
  435. <!-- For pages used on external web servers, use absolute URLs -->
  436. <xsl:variable name="urlprefix"><xsl:if test="/buildinfo/document/@external">https://fsfe.org</xsl:if></xsl:variable>
  437. <!-- First of all, a comment to make clear this is generated -->
  438. <xsl:comment>This file was generated by an XSLT script. Please do not edit.</xsl:comment>
  439. <!-- Service notice (for downtime, upgrades, etc. enable this)
  440. <div id="service-notice">
  441. <div class="close">
  442. <a title="dismiss this notification">×</a>
  443. </div>
  444. <div class="text">
  445. <h1>Site currently under development</h1>
  446. <p>
  447. If you want to help out, <a
  448. href="/contribute/web/web.en.html">consider joining the
  449. web team</a>.
  450. </p>
  451. </div>
  452. </div>-->
  453. <xsl:element name="div">
  454. <xsl:attribute name="id">wrapper</xsl:attribute>
  455. <xsl:element name="div">
  456. <xsl:attribute name="id">wrapper-inner</xsl:attribute>
  457. <xsl:comment>Unnecessary div, for IE only</xsl:comment>
  458. <xsl:element name="p">
  459. <xsl:attribute name="class">n</xsl:attribute>
  460. <xsl:comment>Give non-graphical browsers a way to skip the menu.</xsl:comment>
  461. <xsl:element name="a">
  462. <xsl:attribute name="href">#content</xsl:attribute>
  463. <xsl:text>Skip menu</xsl:text>
  464. </xsl:element>
  465. </xsl:element>
  466. <!-- Page header -->
  467. <xsl:element name="div">
  468. <xsl:attribute name="id">header</xsl:attribute>
  469. <!-- Logo -->
  470. <xsl:element name="div">
  471. <xsl:attribute name="id">logo</xsl:attribute>
  472. <xsl:element name="a">
  473. <xsl:attribute name="href">/</xsl:attribute>
  474. <xsl:element name="img">
  475. <xsl:attribute name="alt">FSFE Logo</xsl:attribute>
  476. <xsl:attribute name="src">
  477. <xsl:value-of select="$urlprefix"/>
  478. <xsl:choose>
  479. <xsl:when test="$mode = 'valentine'">/graphics/logov.png</xsl:when>
  480. <xsl:otherwise>/graphics/logo_transparent.png</xsl:otherwise>
  481. </xsl:choose>
  482. </xsl:attribute>
  483. </xsl:element>
  484. </xsl:element>
  485. </xsl:element>
  486. <!-- Statement -->
  487. <xsl:element name="p">
  488. <xsl:attribute name="id">statement</xsl:attribute>
  489. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'statement1'" /></xsl:call-template>
  490. <xsl:element name="a">
  491. <xsl:attribute name="href">/freesoftware/index.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
  492. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'statement-fs'" /></xsl:call-template>
  493. </xsl:element>
  494. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'statement2'" /></xsl:call-template>.<!--intentional full stop goes here-->
  495. <xsl:element name="a">
  496. <xsl:attribute name="href">/about</xsl:attribute>
  497. <xsl:attribute name="style">padding-left: 1em;</xsl:attribute>
  498. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'learn-more'" />
  499. </xsl:call-template>
  500. </xsl:element>.<!--intentional full stop goes here-->
  501. </xsl:element>
  502. </xsl:element><!-- end Page header -->
  503. <!-- Sidebar -->
  504. <xsl:element name="div">
  505. <xsl:attribute name="id">sidebar</xsl:attribute>
  506. <!-- Menu -->
  507. <xsl:element name="div">
  508. <xsl:attribute name="id">menu</xsl:attribute>
  509. <xsl:element name="ul">
  510. <!-- FSFE portal menu -->
  511. <xsl:element name="li">
  512. <xsl:attribute name="class">fsfe</xsl:attribute>
  513. <xsl:element name="a">
  514. <xsl:attribute name="href">/</xsl:attribute>
  515. FSFE
  516. </xsl:element>
  517. <xsl:element name="ul">
  518. <xsl:variable name="menu"><xsl:value-of select="@id" /></xsl:variable>
  519. <xsl:for-each select="/buildinfo/menuset/menu[@parent='fsfe']">
  520. <!--<xsl:sort select="@id"/>-->
  521. <xsl:sort select="@priority" />
  522. <xsl:variable name="id"><xsl:value-of select="@id" /></xsl:variable>
  523. <xsl:element name="li">
  524. <xsl:choose>
  525. <xsl:when test="not(string(.))">
  526. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  527. </xsl:when>
  528. <xsl:when test=". = concat(/buildinfo/@filename ,'.html')">
  529. <xsl:element name="span">
  530. <xsl:attribute name="id">selected</xsl:attribute>
  531. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  532. </xsl:element>
  533. </xsl:when>
  534. <xsl:otherwise>
  535. <xsl:element name="a">
  536. <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  537. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  538. </xsl:element>
  539. </xsl:otherwise>
  540. </xsl:choose>
  541. </xsl:element> <!-- /li -->
  542. </xsl:for-each>
  543. </xsl:element>
  544. </xsl:element> <!-- /li -->
  545. <!-- Support portal menu item -->
  546. <xsl:element name="li">
  547. <xsl:attribute name="class">support</xsl:attribute>
  548. <xsl:element name="a">
  549. <xsl:attribute name="href">/support/</xsl:attribute>
  550. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'support/support'" /></xsl:call-template>
  551. </xsl:element>
  552. </xsl:element> <!-- /li -->
  553. <!-- Fellowship portal menu -->
  554. <xsl:element name="li">
  555. <xsl:attribute name="class">fellowship</xsl:attribute>
  556. <xsl:element name="a">
  557. <xsl:attribute name="href">http://fellowship.fsfe.org/</xsl:attribute>
  558. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'fellowship/fellowship'" /></xsl:call-template>
  559. </xsl:element>
  560. <xsl:element name="ul">
  561. <xsl:variable name="menu"><xsl:value-of select="@id" /></xsl:variable>
  562. <xsl:for-each select="/buildinfo/menuset/menu[@parent='fellowship']">
  563. <!--<xsl:sort select="@id"/>-->
  564. <xsl:sort select="@priority" />
  565. <xsl:variable name="id"><xsl:value-of select="@id" /></xsl:variable>
  566. <xsl:element name="li">
  567. <xsl:choose>
  568. <xsl:when test="not(string(.))">
  569. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  570. </xsl:when>
  571. <xsl:when test=". = concat(/buildinfo/@filename ,'.html')">
  572. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  573. </xsl:when>
  574. <xsl:otherwise>
  575. <xsl:element name="a">
  576. <xsl:attribute name="href"><xsl:value-of select="." /></xsl:attribute>
  577. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="$id" /></xsl:call-template>
  578. </xsl:element>
  579. </xsl:otherwise>
  580. </xsl:choose>
  581. </xsl:element> <!-- /li -->
  582. </xsl:for-each>
  583. </xsl:element><!-- end li -->
  584. </xsl:element><!-- end ul -->
  585. <!-- Planet portal menu -->
  586. <xsl:element name="li">
  587. <xsl:attribute name="class">planet</xsl:attribute>
  588. <xsl:element name="a">
  589. <xsl:attribute name="href">http://planet.fsfe.org/</xsl:attribute>
  590. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'planet/blogs'" /></xsl:call-template>
  591. </xsl:element>
  592. <!-- causes validation errors, needs li to pass validator?
  593. <xsl:element name="ul">
  594. </xsl:element>-->
  595. </xsl:element>
  596. <!-- Wiki -->
  597. <xsl:element name="li">
  598. <xsl:attribute name="class">wiki</xsl:attribute>
  599. <xsl:element name="a">
  600. <xsl:attribute name="href">http://wiki.fsfe.org/</xsl:attribute>
  601. Wiki
  602. </xsl:element>
  603. </xsl:element> <!-- /li -->
  604. </xsl:element> <!-- /ul -->
  605. </xsl:element><!-- end menu -->
  606. <xsl:element name="div">
  607. <xsl:attribute name="id">search</xsl:attribute>
  608. <xsl:element name="h2">
  609. <xsl:attribute name="class">n</xsl:attribute>
  610. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'search'" /></xsl:call-template>
  611. </xsl:element>
  612. <xsl:element name="form">
  613. <xsl:attribute name="method">get</xsl:attribute>
  614. <xsl:attribute name="action">http://fsfe.yacy.net/yacysearch.html</xsl:attribute>
  615. <xsl:element name="input">
  616. <xsl:attribute name="type">hidden</xsl:attribute>
  617. <xsl:attribute name="name">verify</xsl:attribute>
  618. <xsl:attribute name="value">true</xsl:attribute>
  619. </xsl:element>
  620. <xsl:element name="input">
  621. <xsl:attribute name="type">hidden</xsl:attribute>
  622. <xsl:attribute name="name">maximumRecords</xsl:attribute>
  623. <xsl:attribute name="value">10</xsl:attribute>
  624. </xsl:element>
  625. <xsl:element name="input">
  626. <xsl:attribute name="type">hidden</xsl:attribute>
  627. <xsl:attribute name="name">meanCount</xsl:attribute>
  628. <xsl:attribute name="value">5</xsl:attribute>
  629. </xsl:element>
  630. <xsl:element name="input">
  631. <xsl:attribute name="type">hidden</xsl:attribute>
  632. <xsl:attribute name="name">resource</xsl:attribute>
  633. <xsl:attribute name="value">local</xsl:attribute>
  634. </xsl:element>
  635. <xsl:element name="input">
  636. <xsl:attribute name="type">hidden</xsl:attribute>
  637. <xsl:attribute name="name">prefermaskfilter</xsl:attribute>
  638. <xsl:attribute name="value">.*.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
  639. </xsl:element>
  640. <xsl:element name="input">
  641. <xsl:attribute name="type">hidden</xsl:attribute>
  642. <xsl:attribute name="name">prefermaskfilter</xsl:attribute>
  643. <xsl:attribute name="value">.*</xsl:attribute>
  644. </xsl:element>
  645. <xsl:element name="input">
  646. <xsl:attribute name="type">hidden</xsl:attribute>
  647. <xsl:attribute name="name">display</xsl:attribute>
  648. <xsl:attribute name="value">2</xsl:attribute>
  649. </xsl:element>
  650. <xsl:element name="input">
  651. <xsl:attribute name="type">hidden</xsl:attribute>
  652. <xsl:attribute name="name">nav</xsl:attribute>
  653. <xsl:attribute name="value">hosts</xsl:attribute>
  654. </xsl:element>
  655. <xsl:element name="p">
  656. <xsl:element name="input">
  657. <xsl:attribute name="type">image</xsl:attribute>
  658. <xsl:attribute name="src">/graphics/icons/search-button.png</xsl:attribute>
  659. <xsl:attribute name="alt">
  660. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'submit'" /></xsl:call-template>
  661. </xsl:attribute>
  662. </xsl:element>
  663. <xsl:element name="input">
  664. <xsl:attribute name="type">text</xsl:attribute>
  665. <xsl:attribute name="name">query</xsl:attribute>
  666. <xsl:attribute name="placeholder">
  667. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'search'" /></xsl:call-template>
  668. </xsl:attribute>
  669. </xsl:element>
  670. <!--
  671. <xsl:element name="input">
  672. <xsl:attribute name="type">submit</xsl:attribute>
  673. <xsl:attribute name="name">search</xsl:attribute>
  674. <xsl:attribute name="value">
  675. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'submit'" /></xsl:call-template>
  676. </xsl:attribute>
  677. </xsl:element>
  678. -->
  679. </xsl:element>
  680. </xsl:element>
  681. </xsl:element><!-- End search -->
  682. <!-- Newsletter form
  683. <xsl:element name="div">
  684. <xsl:attribute name="id">newsletter</xsl:attribute>
  685. <xsl:element name="h2">
  686. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'receive-newsletter'" /></xsl:call-template>
  687. </xsl:element>
  688. <xsl:element name="form">
  689. <xsl:attribute name="method">get</xsl:attribute>
  690. <xsl:attribute name="action">http://fsfe.yacy.net/yacysearch.html</xsl:attribute>
  691. <xsl:element name="p">
  692. <xsl:element name="select">
  693. <xsl:attribute name="name">lang</xsl:attribute>
  694. <option><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'language'" /></xsl:call-template></option>
  695. </xsl:element>
  696. </xsl:element>
  697. <xsl:element name="p">
  698. <xsl:element name="input">
  699. <xsl:attribute name="type">image</xsl:attribute>
  700. <xsl:attribute name="src">/graphics/icons/search-button.png</xsl:attribute>
  701. </xsl:element>
  702. <xsl:element name="input">
  703. <xsl:attribute name="type">text</xsl:attribute>
  704. <xsl:attribute name="name">query</xsl:attribute>
  705. <xsl:attribute name="placeholder">
  706. email@example.org
  707. </xsl:attribute>
  708. </xsl:element>
  709. </xsl:element>
  710. </xsl:element>
  711. </xsl:element>
  712. end Newsletter form -->
  713. <!-- translations -->
  714. <xsl:element name="div">
  715. <xsl:attribute name="id">translations</xsl:attribute>
  716. <xsl:element name="ul">
  717. <xsl:for-each select="/buildinfo/trlist/tr">
  718. <xsl:sort select="@id"/>
  719. <xsl:choose>
  720. <xsl:when test="@id=/buildinfo/@language">
  721. <xsl:element name="li">
  722. <xsl:value-of select="." disable-output-escaping="yes"/>
  723. </xsl:element>
  724. </xsl:when>
  725. <xsl:otherwise>
  726. <xsl:element name="li">
  727. <xsl:element name="a">
  728. <xsl:attribute name="href"><xsl:value-of select="/buildinfo/@filename"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
  729. <xsl:value-of select="." disable-output-escaping="yes"/>
  730. </xsl:element>
  731. </xsl:element>
  732. </xsl:otherwise>
  733. </xsl:choose>
  734. </xsl:for-each>
  735. </xsl:element><!-- end translations -->
  736. </xsl:element><!-- End sidebar -->
  737. </xsl:element>
  738. <xsl:element name="div">
  739. <xsl:attribute name="id">content</xsl:attribute>
  740. <!-- Outdated note -->
  741. <xsl:if test="/buildinfo/@outdated='yes'">
  742. <xsl:element name="p">
  743. <xsl:attribute name="class">warning red</xsl:attribute>
  744. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'outdated'" /></xsl:call-template>
  745. </xsl:element>
  746. </xsl:if>
  747. <!-- Missing translation note -->
  748. <xsl:if test="/buildinfo/@language!=/buildinfo/document/@language">
  749. <xsl:element name="p">
  750. <xsl:attribute name="class">warning red</xsl:attribute>
  751. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'notranslation'" /></xsl:call-template>
  752. </xsl:element>
  753. </xsl:if>
  754. <!-- Info box -->
  755. <xsl:element name="div">
  756. <xsl:attribute name="id">infobox</xsl:attribute>
  757. <!-- Add under construction message -->
  758. <xsl:if test = "/buildinfo/document/head/meta[@name='under-construction' and @content='true']">
  759. <xsl:element name="p">
  760. <xsl:attribute name="class">warning yellow</xsl:attribute>
  761. <xsl:call-template name="fsfe-gettext">
  762. <xsl:with-param name="id" select="'under-construction'" />
  763. </xsl:call-template>
  764. </xsl:element>
  765. </xsl:if>
  766. <!-- Add project completed message -->
  767. <xsl:if test = "/buildinfo/document/head/meta[@name='project-complete' and @content='true']">
  768. <xsl:element name="p">
  769. <xsl:attribute name="class">warning green</xsl:attribute>
  770. <xsl:call-template name="fsfe-gettext">
  771. <xsl:with-param name="id" select="'project-complete'" />
  772. </xsl:call-template>
  773. </xsl:element>
  774. </xsl:if>
  775. </xsl:element>
  776. <!-- Fundraising box
  777. <xsl:element name="div">
  778. <xsl:attribute name="id">fundraising</xsl:attribute>
  779. <xsl:element name="h2">
  780. <xsl:apply-templates select="/buildinfo/fundraising/call1/node()"/>
  781. </xsl:element>
  782. <xsl:element name="div">
  783. <xsl:attribute name="class">button</xsl:attribute>
  784. <xsl:apply-templates select="/buildinfo/fundraising/call2/node()"/>
  785. </xsl:element>
  786. <xsl:element name="div">
  787. <xsl:attribute name="class">button</xsl:attribute>
  788. <xsl:apply-templates select="/buildinfo/fundraising/call3/node()"/>
  789. </xsl:element>
  790. <xsl:element name="img">
  791. <xsl:attribute name="src">/graphics/wreath.png</xsl:attribute>
  792. <xsl:attribute name="alt">wreath</xsl:attribute>
  793. <xsl:attribute name="class">right</xsl:attribute>
  794. </xsl:element>
  795. <xsl:element name="p">
  796. <xsl:attribute name="class">call4</xsl:attribute>
  797. <xsl:apply-templates select="/buildinfo/fundraising/call4/node()"/>
  798. </xsl:element>
  799. disabling the progress bar
  800. <xsl:if test="/buildinfo/fundraising/current">
  801. <xsl:element name="div">
  802. <xsl:attribute name="class">percentbox</xsl:attribute>
  803. <xsl:element name="div">
  804. <xsl:attribute name="class">percentbar</xsl:attribute>
  805. <xsl:attribute name="style">width: 45.9%</xsl:attribute>
  806. </xsl:element>
  807. </xsl:element>
  808. <xsl:element name="p">
  809. <xsl:attribute name="class">current</xsl:attribute>
  810. <xsl:apply-templates select="/buildinfo/fundraising/current/node()"/>
  811. <xsl:text>€ 45 860</xsl:text>
  812. </xsl:element>
  813. <xsl:element name="p">
  814. <xsl:attribute name="class">target</xsl:attribute>
  815. <xsl:text>€ 100 000</xsl:text>
  816. </xsl:element>
  817. </xsl:if> c
  818. </xsl:element>-->
  819. <!-- End Fundraising box -->
  820. <!-- Here goes the actual content of the <body> node of the input file -->
  821. <xsl:apply-templates select="body | /buildinfo/document/event/body | /buildinfo/document/news/body" />
  822. <!-- Link to top -->
  823. <xsl:element name="p">
  824. <xsl:attribute name="class">n</xsl:attribute>
  825. <xsl:element name="a">
  826. <xsl:attribute name="href">#top</xsl:attribute>
  827. <xsl:text>To top</xsl:text>
  828. </xsl:element>
  829. </xsl:element>
  830. </xsl:element>
  831. <!-- End Content -->
  832. </xsl:element><!--end wrapper-inner-->
  833. <!-- licenses -->
  834. <xsl:if test = "/buildinfo/document/legal">
  835. <div id="legal">
  836. <p>
  837. <xsl:choose>
  838. <xsl:when test = "/buildinfo/document/legal/license">
  839. <xsl:element name="a">
  840. <xsl:attribute name="href">
  841. <xsl:value-of select="/buildinfo/document/legal/license"/>
  842. </xsl:attribute>
  843. <xsl:attribute name="rel">license</xsl:attribute>
  844. <xsl:if test ="/buildinfo/document/legal/@type='cc-license'">
  845. <xsl:element name="img">
  846. <xsl:attribute name="src">/graphics/cc-logo.png</xsl:attribute>
  847. <xsl:attribute name="alt">
  848. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'creative-commons-license'" /></xsl:call-template>
  849. </xsl:attribute>
  850. </xsl:element>
  851. </xsl:if>
  852. <xsl:value-of select="/buildinfo/document/legal/notice"/>
  853. </xsl:element>
  854. </xsl:when>
  855. <xsl:otherwise>
  856. <xsl:value-of select="/buildinfo/document/legal/notice"/>
  857. </xsl:otherwise>
  858. </xsl:choose>
  859. </p>
  860. </div>
  861. </xsl:if>
  862. <!--Depreciated: it's here only for "backward compatibility" cc license way-->
  863. <xsl:if test = "string(/buildinfo/document/head/meta[@name='cc-license']/@content)">
  864. <xsl:element name="div">
  865. <xsl:attribute name="id">cc-licenses</xsl:attribute>
  866. <xsl:element name="p">
  867. <xsl:element name="img">
  868. <xsl:attribute name="src">/graphics/cc-logo.png</xsl:attribute>
  869. <xsl:attribute name="alt">Creative Commons logo</xsl:attribute>
  870. </xsl:element> <!-- </img> -->
  871. <xsl:for-each select="/buildinfo/document/head/meta[@name='cc-license']">
  872. <xsl:value-of select="@content"/> •
  873. </xsl:for-each>
  874. <!--<xsl:value-of select="/buildinfo/document/head/meta[@name='cc-license-1']/@content" /> • -->
  875. </xsl:element> <!-- </p> -->
  876. </xsl:element> <!-- </div> -->
  877. </xsl:if>
  878. <!-- End cc licenses -->
  879. <!-- Footer -->
  880. <div id="footer">
  881. <div id="notice">
  882. <p>
  883. Copyright © 2001-2013 <a href="/">Free Software
  884. Foundation Europe</a>.
  885. <span id="contact-us-link">
  886. <strong>
  887. <a href="/contact/contact.html">
  888. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'contact-us'" /></xsl:call-template>
  889. </a>
  890. </strong>
  891. </span>
  892. .<br />
  893. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'permission'" /></xsl:call-template><br />
  894. <!-- "Last changed" magic -->
  895. <xsl:variable name="timestamp">
  896. <xsl:value-of select="/buildinfo/document/timestamp"/>
  897. </xsl:variable>
  898. <!-- FIXME: over time, all pages should have the timestamp -->
  899. <!-- tags, so this conditional could be removed -->
  900. <xsl:if test="string-length($timestamp) &gt; 0">
  901. <xsl:variable name="Date">
  902. <xsl:value-of select="substring-before(substring-after($timestamp, 'Date: '), ' $')"/>
  903. </xsl:variable>
  904. <xsl:variable name="Author">
  905. <xsl:value-of select="substring-before(substring-after($timestamp, 'Author: '), ' $')"/>
  906. </xsl:variable>
  907. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'lastchanged'" /></xsl:call-template>
  908. <xsl:value-of select="translate ($Date, '/', '-')"/>
  909. (<xsl:value-of select="$Author"/>)
  910. </xsl:if>
  911. </p>
  912. <ul>
  913. <li>
  914. <!-- Link to the XHTML source -->
  915. <xsl:element name="a">
  916. <xsl:attribute name="href">
  917. <xsl:text>/source</xsl:text>
  918. <xsl:value-of select="/buildinfo/@filename"/>
  919. <xsl:text>.</xsl:text>
  920. <xsl:value-of select="/buildinfo/document/@language"/>
  921. <xsl:text>.xhtml</xsl:text>
  922. </xsl:attribute>
  923. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'source'" /></xsl:call-template>
  924. </xsl:element>
  925. </li>
  926. <li>
  927. <a href="/contribute/translators/">
  928. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translate'" /></xsl:call-template>
  929. </a>
  930. </li>
  931. <li>
  932. <a href="/about/legal/imprint.html">
  933. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'imprint'" /></xsl:call-template>
  934. </a>
  935. </li>
  936. </ul>
  937. <p>
  938. <!-- Insert the appropriate translation notice -->
  939. <xsl:if test="/buildinfo/document/@language!=/buildinfo/@original">
  940. <xsl:choose>
  941. <xsl:when test="/buildinfo/document/translator">
  942. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator1a'" /></xsl:call-template>
  943. <xsl:value-of select="/buildinfo/document/translator"/>
  944. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator1b'" /></xsl:call-template>
  945. </xsl:when>
  946. <xsl:otherwise>
  947. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator2'" /></xsl:call-template>
  948. </xsl:otherwise>
  949. </xsl:choose>
  950. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator3a'" /></xsl:call-template>
  951. <xsl:element name="a">
  952. <xsl:attribute name="href">
  953. <xsl:value-of select="/buildinfo/@filename"/>
  954. <xsl:text>.en.html</xsl:text>
  955. </xsl:attribute>
  956. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator3b'" /></xsl:call-template>
  957. </xsl:element>
  958. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator3c'" /></xsl:call-template>
  959. </xsl:if>
  960. </p>
  961. </div> <!-- /#notice -->
  962. <!-- Sister organizations -->
  963. <xsl:element name="div">
  964. <xsl:attribute name="id">sister-organisations</xsl:attribute>
  965. <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'fsfnetwork'" /></xsl:call-template>
  966. </xsl:element>
  967. </div> <!-- /#footer -->
  968. <!-- Piwik -->
  969. <script type="text/javascript">
  970. //enable piwik on plain text page only
  971. pkBaseURL = "http://piwik.fsfe.org/";
  972. if ("http:" == document.location.protocol) {
  973. document.write(unescape("%3Cscript src='" + pkBaseURL + "piwik.js' type='text/javascript'%3E%3C/script%3E"));
  974. }
  975. </script>
  976. <script type="text/javascript">
  977. try {
  978. var piwikTracker = Piwik.getTracker(pkBaseURL + "piwik.php", 4);
  979. piwikTracker.trackPageView();
  980. piwikTracker.enableLinkTracking();
  981. } catch( err ) {}
  982. </script>
  983. <!-- End Piwik Tracking Code -->
  984. </xsl:element>
  985. </body>
  986. </xsl:template>
  987. <!-- Insert local menu -->
  988. <xsl:template match="localmenu">
  989. <xsl:variable name="set">
  990. <xsl:choose>
  991. <xsl:when test="@set">
  992. <xsl:value-of select="@set"/>
  993. </xsl:when>
  994. <xsl:otherwise>
  995. <xsl:text>0</xsl:text>
  996. </xsl:otherwise>
  997. </xsl:choose>
  998. </xsl:variable>
  999. <xsl:variable name="dir">
  1000. <xsl:value-of select="/buildinfo/@dirname"/>
  1001. </xsl:variable>
  1002. <xsl:variable name="language">
  1003. <xsl:value-of select="/buildinfo/@language"/>
  1004. </xsl:variable>
  1005. <xsl:element name="div">
  1006. <xsl:attribute name="class">localmenu</xsl:attribute>
  1007. <xsl:element name="p">
  1008. <xsl:text>[ </xsl:text>
  1009. <xsl:for-each select="/buildinfo/localmenuset/localmenuitems/menu[@dir=$dir and @set=$set]">
  1010. <xsl:sort select="@id"/>
  1011. <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
  1012. <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
  1013. <xsl:variable name="localmenutext">
  1014. <xsl:choose>
  1015. <xsl:when
  1016. test="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language=$language]">
  1017. <xsl:value-of
  1018. select="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language=$language]"/>
  1019. </xsl:when>
  1020. <xsl:otherwise>
  1021. <xsl:value-of
  1022. select="/buildinfo/localmenuset/translate/lang_part[@dir=$dir and @id=$id and @language='en']"/>
  1023. </xsl:otherwise>
  1024. </xsl:choose>
  1025. </xsl:variable>
  1026. <xsl:element name="span">
  1027. <xsl:attribute name="class">local_menu_item</xsl:attribute>
  1028. <xsl:choose>
  1029. <xsl:when test="not(substring-before(concat(/buildinfo/@filename ,'.html'), string(.)))">
  1030. <xsl:element name="a">
  1031. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  1032. <xsl:value-of select="$localmenutext"/>
  1033. </xsl:element>
  1034. </xsl:when>
  1035. <xsl:otherwise>
  1036. <xsl:attribute name="href">bamboo</xsl:attribute>
  1037. <xsl:value-of select="$localmenutext"/>
  1038. </xsl:otherwise>
  1039. </xsl:choose>
  1040. </xsl:element>
  1041. <xsl:if test="position()!=last()">
  1042. <xsl:choose>
  1043. <xsl:when test="$style='number'">
  1044. <xsl:text> | </xsl:text>
  1045. </xsl:when>
  1046. <xsl:otherwise>
  1047. <xsl:text> ] [ </xsl:text>
  1048. </xsl:otherwise>
  1049. </xsl:choose>
  1050. </xsl:if>
  1051. </xsl:for-each>
  1052. <xsl:text> ]</xsl:text>
  1053. </xsl:element><!--end wrapper-->
  1054. </xsl:element>
  1055. </xsl:template>
  1056. <!-- Ignore "latin" tags, used only for pritable material -->
  1057. <xsl:template match="latin">
  1058. <xsl:apply-templates select="@*|node()"/>
  1059. </xsl:template>
  1060. <!-- If no template matching <body> is found in the current page's XSL file, this one will be used -->
  1061. <xsl:template match="body" priority="-1">
  1062. <xsl:apply-templates />
  1063. </xsl:template>
  1064. <!-- Do not copy non-HTML elements to output -->
  1065. <xsl:template match="timestamp|
  1066. buildinfo/document/translator|
  1067. buildinfo/set|
  1068. buildinfo/textset|
  1069. buildinfo/textsetbackup|
  1070. buildinfo/menuset|
  1071. buildinfo/trlist|
  1072. buildinfo/fundraising|
  1073. buildinfo/localmenuset|
  1074. buildinfo/document/tags|
  1075. buildinfo/document/legal|
  1076. buildinfo/document/author|
  1077. buildinfo/document/date|
  1078. buildinfo/document/download"/>
  1079. <xsl:template match="set | tags | text"/>
  1080. <!-- For all other nodes, copy verbatim -->
  1081. <xsl:template match="@*|node()" priority="-1">
  1082. <xsl:copy>
  1083. <xsl:apply-templates select="@* | node()"/>
  1084. </xsl:copy>
  1085. </xsl:template>
  1086. <xsl:template match="@dt:*">
  1087. <xsl:attribute name="{local-name()}">
  1088. <xsl:value-of select="." />
  1089. </xsl:attribute>
  1090. </xsl:template>
  1091. <!--
  1092. <xsl:template match="@x:*">
  1093. <xsl:attribute name="{local-name()}">
  1094. <xsl:value-of select="." />
  1095. </xsl:attribute>
  1096. </xsl:template>
  1097. -->
  1098. </xsl:stylesheet>