build/xslt (#5299)
continuous-integration/drone/push Build is passing

This properly separtes out the python build process (theoretically portable and useable for different sites) and the xslt (custom to the fsfe sites, not really portable as a whole)

It also moves some thirdparty tooling around to make it clearer its thirdparty and unify xslt sources.

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5299
Reviewed-by: tobiasd <tobiasd@fsfe.org>
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5299.
This commit is contained in:
2025-09-15 06:23:57 +00:00
committed by tobiasd
parent b195bb1f0f
commit 1315a7d481
55 changed files with 68 additions and 81 deletions
+3 -6
View File
@@ -110,12 +110,9 @@ def get_version(file: Path) -> int:
"""
Get the version tag of an xhtml|xml file
"""
xslt_tree = etree.parse(Path("build/xslt/get_version.xsl"))
transform = etree.XSLT(xslt_tree)
result_tree = transform(etree.parse(file))
result = str(result_tree).strip()
if result == "":
result = str(0)
xml = etree.parse(file)
result_list = xml.xpath("/*/version")
result = result_list[0].text if result_list else str(0)
logger.debug("Got version: %s", result)
return int(result)
-5
View File
@@ -1,5 +0,0 @@
this directory is reserved for xls files, that were developed for the fsfe page in particular
if you download xslt libraries from external sources, put them into
tools/xsltsl/ (deprecated)
build/xsltlib/
-6
View File
@@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="body_scripts">
<script src="{$urlprefix}/scripts/thirdparty/bootstrap-3.0.3.custom.js"/>
</xsl:template>
</xsl:stylesheet>
-78
View File
@@ -1,78 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- showing a dropdown select menu with all countries in /global/countries/*.**.xml -->
<xsl:template name="country-list">
<xsl:param name="required" select="'no'"/>
<xsl:param name="class" select="''"/>
<xsl:param name="subset" select="''"/>
<xsl:param name="twoletter" select="'no'"/>
<xsl:element name="select">
<xsl:attribute name="id">country</xsl:attribute>
<xsl:attribute name="name">country</xsl:attribute>
<!-- if called with a "class" value, set it as the CSS class -->
<xsl:choose>
<xsl:when test="$class != ''">
<xsl:attribute name="class">
<xsl:value-of select="$class"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<!-- when called with the required="yes" param, add the attribute
and an empty option -->
<xsl:choose>
<xsl:when test="$required = 'yes'">
<xsl:attribute name="required">required</xsl:attribute>
<option/>
<!-- this will force people to pick a choice actively -->
</xsl:when>
</xsl:choose>
<!-- loop over all countries in countries.**.xml -->
<xsl:choose>
<!-- if subset is defined, only display those that have as attribute: $subset="yes" -->
<xsl:when test="$subset != ''">
<xsl:for-each select="/buildinfo/document/set/country[@*[name() = $subset] = 'yes']">
<xsl:sort select="." lang="en"/>
<xsl:call-template name="country-list-options"/>
</xsl:for-each>
</xsl:when>
<!-- otherwise, just display all countries -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$twoletter = 'yes'">
<xsl:for-each select="/buildinfo/document/set/country">
<xsl:sort select="." lang="en"/>
<xsl:call-template name="country-list-options-2-letter"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="/buildinfo/document/set/country">
<xsl:sort select="." lang="en"/>
<xsl:call-template name="country-list-options"/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<!-- /select -->
</xsl:template>
<xsl:template name="country-list-options">
<!-- will output: <option value="ZZ|Fooland">Fooland</option> -->
<xsl:element name="option">
<xsl:attribute name="value"><xsl:value-of select="@id"/>|<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<!-- /option -->
</xsl:template>
<xsl:template name="country-list-options-2-letter">
<!-- will output: <option value="ZZ">Fooland</option> -->
<xsl:element name="option">
<xsl:attribute name="value">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:value-of select="."/>
</xsl:element>
<!-- /option -->
</xsl:template>
</xsl:stylesheet>
-104
View File
@@ -1,104 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- XML tag for obfuscating an email address against scaper bots -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" version="1.0">
<xsl:import href="../../tools/xsltsl/tokenize.xsl"/>
<!-- plain email is the input -->
<xsl:template name="email" match="email">
<xsl:param name="email" select="."/>
<xsl:param name="mailto" select="@mailto"/>
<xsl:param name="subject" select="@subject"/>
<!-- Split email on each character, creating a <token>character</token> element each -->
<xsl:variable name="email-tokens">
<xsl:call-template name="tokenize">
<xsl:with-param name="string" select="$email"/>
<xsl:with-param name="delimiters" select="''"/>
</xsl:call-template>
</xsl:variable>
<!-- Replace the most common characters (with 4 exceptions) with their respective HTML entity or Hex -->
<xsl:variable name="email-encoded">
<xsl:for-each select="exsl:node-set($email-tokens)/token">
<xsl:choose>
<!--
make sure only defined characters are replaced.
To increase confusion, we do not replace e, m, r, and .
-->
<xsl:when test="translate(text(), 'abcdfghijklnopqstuvwxyz0123456789+-@','xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') = 'x'">
<xsl:text>&amp;#</xsl:text>
<xsl:choose>
<!-- lowercase characters -->
<xsl:when test="text()='a'">x0061</xsl:when>
<xsl:when test="text()='b'">98</xsl:when>
<xsl:when test="text()='c'">x0063</xsl:when>
<xsl:when test="text()='d'">100</xsl:when>
<xsl:when test="text()='f'">102</xsl:when>
<xsl:when test="text()='g'">x0067</xsl:when>
<xsl:when test="text()='h'">104</xsl:when>
<xsl:when test="text()='i'">x0069</xsl:when>
<xsl:when test="text()='j'">106</xsl:when>
<xsl:when test="text()='k'">x006b</xsl:when>
<xsl:when test="text()='l'">108</xsl:when>
<xsl:when test="text()='n'">110</xsl:when>
<xsl:when test="text()='o'">x006f</xsl:when>
<xsl:when test="text()='p'">112</xsl:when>
<xsl:when test="text()='q'">x0071</xsl:when>
<xsl:when test="text()='s'">x0073</xsl:when>
<xsl:when test="text()='t'">116</xsl:when>
<xsl:when test="text()='u'">x0075</xsl:when>
<xsl:when test="text()='v'">118</xsl:when>
<xsl:when test="text()='w'">x0077</xsl:when>
<xsl:when test="text()='x'">120</xsl:when>
<xsl:when test="text()='y'">x0079</xsl:when>
<xsl:when test="text()='z'">122</xsl:when>
<!-- numbers -->
<xsl:when test="text()='0'">x0030</xsl:when>
<xsl:when test="text()='1'">49</xsl:when>
<xsl:when test="text()='2'">x0032</xsl:when>
<xsl:when test="text()='3'">51</xsl:when>
<xsl:when test="text()='4'">x0034</xsl:when>
<xsl:when test="text()='5'">53</xsl:when>
<xsl:when test="text()='6'">x0036</xsl:when>
<xsl:when test="text()='7'">55</xsl:when>
<xsl:when test="text()='8'">x0038</xsl:when>
<xsl:when test="text()='9'">57</xsl:when>
<!-- special chars relevant for emails -->
<xsl:when test="text()='+'">43</xsl:when>
<xsl:when test="text()='-'">x002d</xsl:when>
<xsl:when test="text()='@'">64</xsl:when>
</xsl:choose>
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable>
<!-- /$email-encoded -->
<!-- Output email address in desired form -->
<xsl:choose>
<!-- Should be a clickable mailto: link -->
<xsl:when test="$mailto = 'yes'">
<!--
Note: Super-ugly hack to avoid that HTML entities are escaped in the href
attribute. Therefore, the a element is created "manually"
-->
<xsl:text disable-output-escaping="yes">&lt;a href="mailto:</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text>?</xsl:text>
<xsl:if test="$subject">
<xsl:text>subject=</xsl:text>
<xsl:value-of select="$subject"/>
</xsl:if>
<xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">&lt;/a&gt;</xsl:text>
</xsl:when>
<!-- Default: just the obfuscated email address as string -->
<xsl:otherwise>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
-211
View File
@@ -1,211 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="http://xsltsl.org/date-time" version="1.0" exclude-result-prefixes="dt">
<xsl:import href="../../tools/xsltsl/date-time.xsl"/>
<!-- ==================================================================== -->
<!-- Event title with or without link -->
<!-- ==================================================================== -->
<xsl:template name="event-title">
<xsl:choose>
<xsl:when test="link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
</xsl:when>
<xsl:when test="page">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="page"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Event date, written out -->
<!-- ==================================================================== -->
<xsl:template name="event-date">
<!-- Create variables -->
<xsl:variable name="start">
<xsl:value-of select="@start"/>
</xsl:variable>
<xsl:variable name="start_time">
<xsl:choose>
<xsl:when test="string-length($start) &gt; 10">
<xsl:value-of select="substring($start,12,5)"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="start_day">
<xsl:value-of select="substring($start,9,2)"/>
</xsl:variable>
<xsl:variable name="start_month">
<xsl:call-template name="dt:get-month-name">
<xsl:with-param name="month" select="substring($start,6,2)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="end">
<xsl:value-of select="@end"/>
</xsl:variable>
<xsl:variable name="end_time">
<xsl:choose>
<xsl:when test="string-length($end) &gt; 10">
<xsl:value-of select="substring($end,12,5)"/>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="end_day">
<xsl:value-of select="substring($end,9,2)"/>
</xsl:variable>
<xsl:variable name="end_month">
<xsl:call-template name="dt:get-month-name">
<xsl:with-param name="month" select="substring($end,6,2)"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="end_year">
<xsl:value-of select="substring($end,1,4)"/>
</xsl:variable>
<!-- Compile the date -->
<xsl:choose>
<xsl:when test="$start != $end">
<xsl:if test="$start_time != $end_time">
<xsl:value-of select="$start_time"/>
</xsl:if>
<xsl:if test="$start_day != $end_day">
<xsl:value-of select="$start_day"/>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="$start_month != $end_month">
<xsl:value-of select="$start_month"/>
</xsl:if>
<xsl:text> </xsl:text>
<xsl:if test="$start_time != $end_time"><xsl:value-of select="$end_time"/> UTC
</xsl:if>
<xsl:value-of select="$end_day"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$end_month"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$end_year"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$start_day"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$start_month"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$end_year"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- Event information, with or without "read more" link -->
<!-- ==================================================================== -->
<xsl:template name="event-info">
<xsl:variable name="link">
<xsl:choose>
<xsl:when test="link">
<xsl:value-of select="link"/>
</xsl:when>
<xsl:when test="page">
<xsl:value-of select="page"/>
</xsl:when>
</xsl:choose>
</xsl:variable>
<xsl:for-each select="body/*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="position()=last() and $link != ''">
<xsl:text> </xsl:text>
<xsl:element name="a">
<xsl:attribute name="class">learn-more</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="$link"/>
</xsl:attribute>
</xsl:element>
<!-- a/learn-more -->
</xsl:if>
</xsl:copy>
</xsl:for-each>
</xsl:template>
<!-- ==================================================================== -->
<!-- List of events (as elements of an unsorted list) -->
<!-- ==================================================================== -->
<xsl:template name="event-list">
<!-- Number of events to display -->
<xsl:variable name="count">
<xsl:choose>
<xsl:when test="@count">
<xsl:value-of select="@count"/>
</xsl:when>
<xsl:otherwise>5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Build list -->
<xsl:element name="ul">
<xsl:attribute name="class">event-list</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/event[ translate(substring(@end,1,10),'-','') &gt;= translate(/buildinfo/@date,'-','') ]">
<xsl:sort select="@start"/>
<xsl:if test="position() &lt;= $count">
<xsl:element name="li">
<xsl:call-template name="event-title"/>
<xsl:text> </xsl:text>
<xsl:element name="span">
<xsl:attribute name="date"/>
<xsl:call-template name="event-date"/>
</xsl:element>
<!-- span -->
</xsl:element>
<!-- li -->
</xsl:if>
</xsl:for-each>
</xsl:element>
<!-- ul -->
</xsl:template>
<!-- ==================================================================== -->
<!-- Verbose event feed -->
<!-- ==================================================================== -->
<xsl:template name="event-feed">
<!-- Number of events to display -->
<xsl:variable name="count">
<xsl:choose>
<xsl:when test="@count">
<xsl:value-of select="@count"/>
</xsl:when>
<xsl:otherwise>5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Build list -->
<xsl:for-each select="/buildinfo/document/set/event[ translate(substring(@end,1,10),'-','') &gt;= translate(/buildinfo/@date,'-','') ]">
<xsl:sort select="@start"/>
<xsl:if test="position() &lt;= $count">
<xsl:element name="article">
<xsl:attribute name="class">event</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="@filename"/>
</xsl:attribute>
<!-- Title -->
<xsl:element name="h3">
<xsl:call-template name="event-title"/>
</xsl:element>
<!-- Date -->
<xsl:element name="p">
<xsl:attribute name="class">meta</xsl:attribute>
<xsl:call-template name="event-date"/>
</xsl:element>
<!-- Details -->
<xsl:call-template name="event-info"/>
</xsl:element>
<!-- article -->
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-29
View File
@@ -1,29 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Helper stylesheets to include referrer for fsfe-cd -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Hidden input field with referrer for https://my.fsfe.org/subscribe -->
<xsl:template match="fsfe-cd-referrer-input">
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">referrer</xsl:attribute>
<xsl:attribute name="value">
<xsl:text>https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Button with referrer for https://my.fsfe.org/donate -->
<xsl:template match="fsfe-cd-donate-link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>https://my.fsfe.org/donate?referrer=https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-30
View File
@@ -1,30 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="fsfe_pageclass.xsl"/>
<xsl:include href="fsfe_topbanner.xsl"/>
<xsl:include href="translation_list.xsl"/>
<xsl:include href="fsfe_pageheader.xsl"/>
<xsl:include href="notifications.xsl"/>
<xsl:include href="fsfe_mainsection.xsl"/>
<xsl:include href="fsfe_followupsection.xsl"/>
<xsl:include href="fsfe_pagefooter.xsl"/>
<xsl:include href="body_scripts.xsl"/>
<!-- HTML body -->
<!--<xsl:template match="body">-->
<xsl:template name="page-body">
<xsl:element name="body">
<xsl:call-template name="fsfe_pageclass"/>
<!-- First of all, a comment to make clear this is generated -->
<xsl:comment>This file was generated by an XSLT script. Please do not edit.</xsl:comment>
<xsl:call-template name="translation_list"/>
<xsl:call-template name="fsfe_pageheader"/>
<!--<xsl:call-template name="fsfe_topbanner" /> -->
<!-- trigger to show/hide topbanner -->
<xsl:call-template name="notifications"/>
<xsl:call-template name="fsfe_mainsection"/>
<xsl:call-template name="fsfe_followupsection"/>
<xsl:call-template name="fsfe_pagefooter"/>
<xsl:call-template name="body_scripts"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-21
View File
@@ -1,21 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<xsl:apply-templates select="buildinfo/document"/>
</xsl:template>
<!-- The actual HTML tree is in "buildinfo/document" -->
<xsl:template match="buildinfo/document">
<xsl:element name="html">
<xsl:attribute name="lang">
<xsl:value-of select="/buildinfo/@language"/>
</xsl:attribute>
<xsl:attribute name="class"><xsl:value-of select="/buildinfo/@language"/> no-js
</xsl:attribute>
<xsl:if test="/buildinfo/@language = 'ar' or /buildinfo/@language = 'fa' or /buildinfo/@language = 'he'">
<xsl:attribute name="dir">rtl</xsl:attribute>
</xsl:if>
<xsl:call-template name="page-head"/>
<xsl:call-template name="page-body"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-142
View File
@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="fsfe_followupsection">
<xsl:element name="aside">
<xsl:attribute name="id">followup</xsl:attribute>
<!--
TODO Okay, so the idea here is to be able to display different "followup" boxes. I would suggest doing it like this:
- the xml page should be able to say that it wants to show a
specific box and would contain e.g.
<followup>subscribe-newsletter</followup> so the page would show
the following box.
- if the xml page does not contain any <followup> variable, then we should be able to set a default followup box on our own.
This has the advantage that depending on priorities, we can show
a box in all our pages at the bottom. For instance, when we are
in the middle of our yearly fundraising, we could set the default
to a "fundraising" box.
For now, this is just a placeholder, so all pages show the
"Subscribe to newsletter" box. Below that, some examples of boxes we
should make.
-->
<xsl:choose>
<xsl:when test="/buildinfo/document/followup = 'subscribe-nl'">
<xsl:attribute name="class">subscribe-nl</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'subscribe-newsletter'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'subscribe-newsletter-text'"/>
</xsl:call-template>
<xsl:element name="span"><xsl:attribute name="style">font-size:0.8em</xsl:attribute>
(<xsl:element name="a"><xsl:attribute name="href">/about/legal/imprint.html#id-privacy-policy</xsl:attribute><xsl:element name="span"><xsl:attribute name="style">color:white; text-decoration: underline;</xsl:attribute><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'privacy-policy'"/></xsl:call-template></xsl:element></xsl:element>)
</xsl:element>
</xsl:element>
<xsl:call-template name="subscribe-nl"/>
</xsl:when>
<xsl:when test="/buildinfo/document/followup = 'support'">
<xsl:attribute name="class">support</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'show-support'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'show-support-paragraph'"/>
</xsl:call-template>
<br/>
<xsl:element name="a">
<xsl:attribute name="href">/support/?followupbox</xsl:attribute>
<xsl:attribute name="class">btn</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support-fsfe'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="/buildinfo/document/followup = 'donate'">
<xsl:attribute name="class">donate</xsl:attribute>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support-paragraph'"/>
</xsl:call-template>
<br/>
<xsl:element name="a">
<xsl:attribute name="href">https://my.fsfe.org/donate</xsl:attribute>
<xsl:attribute name="class">btn</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-heart-o fa-lg</xsl:attribute>
</xsl:element>
<xsl:text> </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'donate'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="/buildinfo/document/followup = 'join'">
<xsl:attribute name="class">join</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support/become'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support-paragraph'"/>
</xsl:call-template>
<br/>
<xsl:element name="a">
<xsl:attribute name="href">https://my.fsfe.org/support</xsl:attribute>
<xsl:attribute name="class">btn</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="/buildinfo/document/followup = 'press'">
<xsl:attribute name="class">join</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'followup/press-header'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="div">
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'followup/press-paragraph'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:when test="/buildinfo/document/followup = 'no'">
<xsl:attribute name="class">hide</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="class">subscribe-nl</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'subscribe-newsletter'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'subscribe-newsletter-text'"/>
</xsl:call-template>
<xsl:element name="span"><xsl:attribute name="style">font-size:0.8em</xsl:attribute>
(<xsl:element name="a"><xsl:attribute name="href">/about/legal/imprint.html#id-privacy-policy</xsl:attribute><xsl:element name="span"><xsl:attribute name="style">color:white; text-decoration: underline;</xsl:attribute><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'privacy-policy'"/></xsl:call-template></xsl:element></xsl:element>)
</xsl:element>
</xsl:element>
<xsl:call-template name="subscribe-nl"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<!--/aside#followup-->
</xsl:template>
</xsl:stylesheet>
-268
View File
@@ -1,268 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:variable name="mode">
<!-- here you can set the mode to switch between normal and IloveFS style -->
<xsl:value-of select="'normal'"/>
<!-- can be either 'normal' or 'valentine' -->
</xsl:variable>
<!-- Take /head/title and append " - FSFE", use this as $title -->
<xsl:variable name="title">
<xsl:choose>
<!-- On frontpage, use just <title> to allow custom display -->
<xsl:when test="/buildinfo/document/body/@class = 'frontpage'">
<xsl:value-of select="/buildinfo/document/head/title/text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/buildinfo/document/head/title/text()"/>
<xsl:text> - </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Replace head/title with the version where " - FSFE" has been appended -->
<xsl:template match="head/title">
<xsl:copy>
<xsl:value-of select="$title"/>
</xsl:copy>
</xsl:template>
<xsl:template name="page-head">
<xsl:element name="head">
<!-- Don't let search engine robots index untranslated pages -->
<xsl:element name="meta">
<xsl:attribute name="name">robots</xsl:attribute>
<xsl:attribute name="content">
<xsl:choose>
<xsl:when test="/buildinfo/@language=/buildinfo/document/@language">index, follow</xsl:when>
<xsl:otherwise>noindex</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<!-- For a mobile/tablet/etc. friendly website -->
<xsl:element name="meta">
<xsl:attribute name="name">viewport</xsl:attribute>
<xsl:attribute name="content">width=device-width, initial-scale=1.0"</xsl:attribute>
</xsl:element>
<!--For old versions of IE-->
<xsl:element name="meta">
<xsl:attribute name="http-equiv">X-UA-Compatible</xsl:attribute>
<xsl:attribute name="content">IE=edge</xsl:attribute>
</xsl:element>
<xsl:choose>
<xsl:when test="$mode = 'valentine'">
<xsl:element name="link">
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<xsl:attribute name="media">all</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/main.valentine.min.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<!-- not valentine -->
<xsl:element name="link">
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<xsl:attribute name="media">all</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/main.min.css?20230215</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<xsl:element name="link">
<xsl:attribute name="rel">stylesheet</xsl:attribute>
<xsl:attribute name="media">print</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/look/print.css</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
</xsl:element>
<xsl:element name="link">
<xsl:attribute name="rel">icon</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:choose>
<xsl:when test="$mode = 'valentine'">/graphics/fsfev.png</xsl:when>
<xsl:otherwise>/graphics/fsfe.ico</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="type">image/x-icon</xsl:attribute>
</xsl:element>
<link rel="apple-touch-icon" href="{$urlprefix}/graphics/touch-icon.png" type="image/png"/>
<link rel="apple-touch-icon-precomposed" href="{$urlprefix}/graphics/touch-icon.png" type="image/png"/>
<xsl:element name="link">
<xsl:attribute name="rel">alternate</xsl:attribute>
<xsl:attribute name="title">FSFE <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'menu1/news'"/></xsl:call-template></xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/news/news.<xsl:value-of select="/buildinfo/@language"/>.rss</xsl:attribute>
<xsl:attribute name="type">application/rss+xml</xsl:attribute>
</xsl:element>
<xsl:element name="link">
<xsl:attribute name="rel">alternate</xsl:attribute>
<xsl:attribute name="title">FSFE <xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'menu1/events'"/></xsl:call-template></xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/events/events.<xsl:value-of select="/buildinfo/@language"/>.rss</xsl:attribute>
<xsl:attribute name="type">application/rss+xml</xsl:attribute>
</xsl:element>
<xsl:for-each select="/buildinfo/trlist/tr">
<xsl:sort select="@id"/>
<xsl:element name="link">
<xsl:attribute name="type">text/html</xsl:attribute>
<xsl:attribute name="rel">alternate</xsl:attribute>
<xsl:attribute name="hreflang">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="lang">
<xsl:value-of select="@id"/>
</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="/buildinfo/@fileurl"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
<xsl:for-each select="/buildinfo/document/author">
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:element name="meta">
<xsl:attribute name="name">author</xsl:attribute>
<xsl:attribute name="content">
<xsl:choose>
<xsl:when test="@id and document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]">
<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
</xsl:for-each>
<!-- Meta description -->
<xsl:element name="meta">
<xsl:attribute name="name">description</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$extract"/>
</xsl:attribute>
</xsl:element>
<!-- / meta description -->
<!-- Twitter and Facebook sharing cards -->
<xsl:variable name="metaimage">
<xsl:if test="image/@url">
<xsl:choose>
<xsl:when test="starts-with(image/@url, 'http')">
<xsl:value-of select="image/@url"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>https://fsfe.org</xsl:text>
<xsl:value-of select="image/@url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<!-- Mastodon link to profile -->
<xsl:element name="meta">
<xsl:attribute name="name">fediverse:creator</xsl:attribute>
<xsl:attribute name="content">@fsfe@mastodon.social</xsl:attribute>
</xsl:element>
<!-- Twitter cards -->
<xsl:element name="meta">
<xsl:attribute name="name">twitter:card</xsl:attribute>
<xsl:attribute name="content">
<xsl:choose>
<!-- if there is a meta "image", use a large summary card -->
<xsl:when test="$metaimage != ''">summary_large_image</xsl:when>
<xsl:otherwise>summary</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<meta name="twitter:site" content="@fsfe"/>
<xsl:element name="meta">
<xsl:attribute name="name">twitter:image</xsl:attribute>
<xsl:attribute name="content">
<xsl:choose>
<!-- if there is a meta "image", take that -->
<xsl:when test="$metaimage != ''">
<xsl:value-of select="$metaimage"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>https://fsfe.org/graphics/logo-text_square.png</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:if test="image/@alt">
<!-- add alt text if existent -->
<xsl:element name="meta">
<xsl:attribute name="name">twitter:image:alt</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:element name="meta">
<xsl:attribute name="name">twitter:title</xsl:attribute>
<xsl:attribute name="content">
<!-- content of <title> -->
<xsl:value-of select="$title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="name">twitter:description</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$extract"/>
</xsl:attribute>
</xsl:element>
<!-- OpenGraph sharing cards -->
<meta property="og:type" content="article"/>
<meta property="og:site_name" content="FSFE - Free Software Foundation Europe"/>
<xsl:element name="meta">
<xsl:attribute name="property">og:image</xsl:attribute>
<xsl:attribute name="content">
<xsl:choose>
<!-- if there is a meta "image", take that -->
<xsl:when test="$metaimage != ''">
<xsl:value-of select="$metaimage"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>https://fsfe.org/graphics/logo-text_square.png</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:element>
<xsl:if test="image/@alt">
<!-- add alt text if existent -->
<xsl:element name="meta">
<xsl:attribute name="property">og:image:alt</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:element name="meta">
<xsl:attribute name="property">og:locale</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="/buildinfo/@language"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="property">og:url</xsl:attribute>
<xsl:attribute name="content">https://fsfe.org<xsl:value-of select="/buildinfo/@fileurl"/>.html</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="property">og:title</xsl:attribute>
<xsl:attribute name="content">
<!-- content of <title> -->
<xsl:value-of select="$title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="meta">
<xsl:attribute name="property">og:description</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="$extract"/>
</xsl:attribute>
</xsl:element>
<!-- / Sharing cards -->
<script src="{$urlprefix}/scripts/thirdparty/jquery-3.5.1.min.js"/>
<script src="{$urlprefix}/scripts/thirdparty/modernizr.custom.65251.js"/>
<!-- Copy head element from the xhtml source file (and possibly from external xsl rules) -->
<xsl:apply-templates select="head/node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-224
View File
@@ -1,224 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Modify H1 -->
<xsl:template match="h1">
<!-- Apply news page PRE-rules -->
<xsl:if test="string(/buildinfo/document/@newsdate) and (not(string(/buildinfo/document/@type)) or /buildinfo/document/@type != 'newsletter' and /buildinfo/document/@type != 'podcast')">
<!-- add link to press/press.xx.html -->
<xsl:element name="p">
<xsl:attribute name="id">category</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">/news/news.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'breadcrumb-news'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- Apply newsletter page PRE-rules -->
<xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'newsletter'">
<xsl:element name="p">
<xsl:attribute name="id">category</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">/news/newsletter.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'newsletter'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- Apply podcast page PRE-rules -->
<xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'podcast'">
<xsl:element name="p">
<xsl:attribute name="id">category</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">/news/podcast.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'podcast'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
<!-- Apply news page rules -->
<xsl:if test="string(/buildinfo/document/@newsdate) and (not(string(/buildinfo/document/@type)) or /buildinfo/document/@type != 'newsletter')">
<!-- add publishing information (author, date) -->
<xsl:element name="div">
<xsl:attribute name="id">article-metadata</xsl:attribute>
<span class="published-on"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'published'"/></xsl:call-template>: </span>
<xsl:element name="time">
<xsl:attribute name="class">dt-published</xsl:attribute>
<xsl:value-of select="/buildinfo/document/@newsdate"/>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- End apply news page rules -->
<!--Article authors, date -->
<xsl:if test="/buildinfo/document/author or /buildinfo/document/date or /buildinfo/document/download">
<xsl:element name="div">
<xsl:attribute name="id">article-metadata</xsl:attribute>
<xsl:if test="/buildinfo/document/author">
<span class="written-by"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'writtenby'"/></xsl:call-template> </span>
<xsl:for-each select="/buildinfo/document/author">
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="@id and document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]">
<!-- if the author is in fsfe's people.xml then we take information from there -->
<xsl:choose>
<!-- person has a link -->
<xsl:when test="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/link">
<xsl:element name="a">
<xsl:attribute name="class">author p-author h-card</xsl:attribute>
<xsl:attribute name="rel">author</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/link"/>
</xsl:attribute>
<xsl:if test="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/avatar">
<xsl:element name="img">
<xsl:attribute name="alt"/>
<xsl:attribute name="src">/about/people/avatars/<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/avatar"/></xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/name"/>
</xsl:element>
</xsl:when>
<!-- person has no link -->
<xsl:otherwise>
<xsl:if test="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/avatar">
<xsl:element name="img">
<xsl:attribute name="alt"/>
<xsl:attribute name="src">/about/people/avatars/<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/avatar"/></xsl:attribute>
</xsl:element>
</xsl:if>
<span class="author p-author">
<xsl:value-of select="document('../../fsfe.org/about/people/people.en.xml')/personset/person[@id=$id]/name"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- person is not in people.en.xml -->
<xsl:otherwise>
<xsl:choose>
<!-- person has a link -->
<xsl:when test="link">
<xsl:element name="a">
<xsl:attribute name="class">author p-author h-card</xsl:attribute>
<xsl:attribute name="rel">author</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:if test="avatar">
<xsl:element name="img">
<xsl:attribute name="alt"/>
<xsl:attribute name="src">
<xsl:value-of select="avatar"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<xsl:value-of select="name"/>
</xsl:element>
</xsl:when>
<!-- person has no link -->
<xsl:otherwise>
<xsl:if test="avatar">
<xsl:element name="img">
<xsl:attribute name="alt"/>
<xsl:attribute name="src">
<xsl:value-of select="avatar"/>
</xsl:attribute>
</xsl:element>
</xsl:if>
<span class="author p-author">
<xsl:value-of select="name"/>
</span>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
<!-- choose whether to put a comma or an "and" between authors -->
<xsl:choose>
<!-- second-last author and not first author -->
<xsl:when test="position() = last()-1 and not(position() = 1)">
<xsl:text>, </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'and'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:when>
<!-- second-last author and first author -->
<xsl:when test="position() = last()-1 and position() = 1">
<xsl:text> </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'and'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:when>
<!-- not last author -->
<xsl:when test="not(position() = last())">
<xsl:text>, </xsl:text>
</xsl:when>
<!-- last or only author -->
<xsl:otherwise>
<xsl:text> </xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:if>
<!-- only show date if <date> exists (not news entries for example) -->
<xsl:if test="/buildinfo/document/date"><span class="published-on"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'published'"/></xsl:call-template> </span><xsl:element name="time"><xsl:attribute name="class">dt-published</xsl:attribute><xsl:value-of select="/buildinfo/document/date/original/@content"/></xsl:element> 
<xsl:if test="/buildinfo/document/date/revision">
(<span class="revision-on"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'revision'"/></xsl:call-template></span>
<xsl:for-each select="/buildinfo/document/date/revision">
 <xsl:element name="time"><xsl:attribute name="class">dt-updated</xsl:attribute><xsl:value-of select="@content"/></xsl:element>
</xsl:for-each>) 
</xsl:if>
</xsl:if>
<xsl:if test="/buildinfo/document/download">
<xsl:element name="br"/>
<span class="download"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'download'"/></xsl:call-template>: </span>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="/buildinfo/document/download/@content"/>
</xsl:attribute>
<xsl:value-of select="/buildinfo/document/download/@type"/>
</xsl:element>
</xsl:if>
</xsl:element>
</xsl:if>
<!--End Article authors, date-->
</xsl:template>
<!-- End modifications to H1 -->
<!-- Modify H2 -->
<xsl:template match="h2">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
<!-- Modify H3 -->
<xsl:template match="h3">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
<!-- Modify H4 -->
<xsl:template match="h4">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
<!-- Modify H4 -->
<xsl:template match="h4">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
<!-- Modify H5 -->
<xsl:template match="h5">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
<!-- Modify H6 -->
<xsl:template match="h6">
<!-- auto generate ID for headings if it doesn't already exist -->
<xsl:call-template name="generate-id"/>
</xsl:template>
</xsl:stylesheet>
-43
View File
@@ -1,43 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Insert local menu -->
<xsl:template match="localmenu">
<!-- Remember own set (default to 'default') -->
<xsl:variable name="set">
<xsl:choose>
<xsl:when test="@set">
<xsl:value-of select="@set"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>default</xsl:text>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Remember own id -->
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<!-- Add list of menu items -->
<xsl:element name="ul">
<xsl:attribute name="class">nav nav-tabs</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/localmenuitem[@set=$set]">
<xsl:sort select="@id"/>
<xsl:element name="li">
<xsl:attribute name="role">presentation</xsl:attribute>
<xsl:if test="@id=$id">
<xsl:attribute name="class">active</xsl:attribute>
</xsl:if>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="@link"/>
</xsl:attribute>
<xsl:value-of select="node()"/>
</xsl:element>
<!-- a -->
</xsl:element>
<!-- li -->
</xsl:for-each>
</xsl:element>
<!-- ul -->
</xsl:template>
</xsl:stylesheet>
-89
View File
@@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="tags.xsl"/>
<xsl:include href="fsfe_sidebar.xsl"/>
<xsl:template name="fsfe_mainsection">
<xsl:element name="main">
<xsl:element name="div">
<xsl:attribute name="id">content</xsl:attribute>
<xsl:if test="/buildinfo/@translation_state='very-outdated' or /buildinfo/@translation_state='untranslated'">
<xsl:attribute name="lang">
<xsl:value-of select="/buildinfo/@original"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/buildinfo/document/body/@microformats">
<xsl:attribute name="class">
<xsl:value-of select="/buildinfo/document/body/@microformats"/>
</xsl:attribute>
</xsl:if>
<!-- Here goes the actual content of the <body> node of the input file -->
<xsl:apply-templates select="/buildinfo/document/event/body | /buildinfo/document/news/body | /buildinfo/document/body/* | /buildinfo/document/body/node()"/>
<!-- Link to discussion topic on community.fsfe.org -->
<xsl:if test="/buildinfo/document/discussion/@href">
<xsl:element name="p">
<xsl:attribute name="id">discussion-link</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="class">learn-more</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="discussion/@href"/>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'discuss-article'"/>
</xsl:call-template>
<xsl:text> </xsl:text>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- Show tags if this is a news press release or an event -->
<xsl:if test="(/buildinfo/document/@newsdate or /buildinfo/document/event) and /buildinfo/document/tags/tag[not(@key='front-page')]">
<xsl:element name="footer">
<xsl:attribute name="id">tags</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'tags'"/>
</xsl:call-template>
</xsl:element>
<xsl:apply-templates select="/buildinfo/document/tags"/>
</xsl:element>
</xsl:if>
<!-- /tags -->
</xsl:element>
<!--/article#content-->
<xsl:if test="/buildinfo/document/sidebar or /buildinfo/document/@newsdate">
<xsl:call-template name="sidebar"/>
</xsl:if>
<xsl:if test="/buildinfo/document/legal">
<footer class="copyright notice creativecommons">
<xsl:choose>
<xsl:when test="/buildinfo/document/legal/license">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="/buildinfo/document/legal/license"/>
</xsl:attribute>
<xsl:attribute name="rel">license</xsl:attribute>
<xsl:value-of select="/buildinfo/document/legal/notice"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<span>
<xsl:value-of select="/buildinfo/document/legal/notice"/>
</span>
</xsl:otherwise>
</xsl:choose>
</footer>
<!--/footer-->
</xsl:if>
<!--Depreciated: it's here only for "backward compatibility" cc license way-->
<xsl:if test="string(/buildinfo/document/head/meta[@name='cc-license']/@content)">
<footer id="cc-licenses">
<xsl:element name="p">
<img src="/graphics/cc-logo.png" alt="Creative Commons logo"/>
<xsl:for-each select="/buildinfo/document/head/meta[@name='cc-license']"><xsl:value-of select="@content"/>
</xsl:for-each>
</xsl:element>
</footer>
</xsl:if>
</xsl:element>
<!--/section#main-->
</xsl:template>
</xsl:stylesheet>
-11
View File
@@ -1,11 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- Do not copy non-HTML elements to output -->
<xsl:template match=" buildinfo/document/translator| buildinfo/set| buildinfo/topbanner| buildinfo/textset| buildinfo/textsetbackup| buildinfo/trlist| buildinfo/localmenuset| buildinfo/document/legal| buildinfo/document/author| buildinfo/document/date| buildinfo/document/download| buildinfo/document/followup"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
-19
View File
@@ -1,19 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="fsfe_pageclass">
<!--Apply appopriate styles for the whole page -->
<xsl:if test="/buildinfo/document/body/@id">
<xsl:attribute name="id">
<xsl:value-of select="/buildinfo/document/body/@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/buildinfo/document/body/@class">
<xsl:attribute name="class">
<xsl:value-of select="/buildinfo/document/body/@class"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="/buildinfo/document/@newsdate">
<xsl:attribute name="class">news</xsl:attribute>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
-230
View File
@@ -1,230 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="fsfe_pagefooter">
<!-- Go to top -->
<xsl:element name="nav">
<xsl:attribute name="id">direct-to-top</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">#top</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'go-top'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="footer">
<xsl:element name="div">
<xsl:attribute name="id">page-info</xsl:attribute>
<xsl:element name="div">
<!-- Social Media links -->
<xsl:element name="p">
<xsl:attribute name="class">share-buttons footer</xsl:attribute>
<xsl:element name="a">
<!-- Mastodon -->
<xsl:attribute name="href">
<xsl:text>https://mastodon.social/@fsfe</xsl:text>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/graphics/services/mastodon.png</xsl:text>
</xsl:attribute>
<xsl:attribute name="alt">Mastodon</xsl:attribute>
<xsl:attribute name="title">Mastodon</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="a">
<!-- Peertube -->
<xsl:attribute name="href">
<xsl:text>https://media.fsfe.org/a/fsfe/videos</xsl:text>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/graphics/services/peertube.png</xsl:text>
</xsl:attribute>
<xsl:attribute name="alt">Peertube</xsl:attribute>
<xsl:attribute name="title">Peertube</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
<!-- Copyright notice -->
<xsl:element name="p">
<xsl:text>Copyright © 2001-2025 </xsl:text>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfeurope'"/>
</xsl:call-template>
</xsl:element>
<xsl:text>.</xsl:text>
</xsl:element>
<!-- Usage permission -->
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'permission'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="div">
<!-- Contact -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/contact.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'contact-us'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Jobs -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/jobs/index.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'jobs'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Imprint and other legal stuff -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/legal/imprint.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'imprint'"/>
</xsl:call-template>
</xsl:element>
<xsl:text> / </xsl:text>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/legal/imprint.html#id-privacy-policy</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'privacy-policy'"/>
</xsl:call-template>
</xsl:element>
<xsl:text> / </xsl:text>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/transparency-commitment.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'transparency-commitment'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Sister organisations -->
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfnetwork'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="div">
<!-- Link to the XHTML source -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="rel">nofollow</xsl:attribute>
<xsl:attribute name="href">
<xsl:text>https://git.fsfe.org/FSFE/fsfe-website/src/branch/master</xsl:text>
<xsl:value-of select="/buildinfo/@filename"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="/buildinfo/document/@language"/>
<xsl:text>.xhtml</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'source'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Contribute to website -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/contribute/web/web.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'contribute-web'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Contribute to translations -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/contribute/translators/translators.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translate'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Appropriate translation notice -->
<xsl:element name="p">
<xsl:if test="/buildinfo/document/@language!=/buildinfo/@original">
<xsl:choose>
<xsl:when test="/buildinfo/document/translator">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator1a'"/>
</xsl:call-template>
<xsl:value-of select="/buildinfo/document/translator"/>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator1b'"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator2'"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator3a'"/>
</xsl:call-template>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.en.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator3b'"/>
</xsl:call-template>
</xsl:element>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translator3c'"/>
</xsl:call-template>
</xsl:if>
</xsl:element>
<!-- Javascript licenses -->
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="$urlprefix"/>
<xsl:text>/about/js-licences.html</xsl:text>
</xsl:attribute>
<xsl:attribute name="data-jslicense">1</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'js-licences'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-224
View File
@@ -1,224 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="fsfe_pageheader">
<xsl:element name="header">
<xsl:attribute name="id">top</xsl:attribute>
<xsl:element name="div">
<xsl:attribute name="id">masthead</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="id">logo</xsl:attribute>
<xsl:attribute name="aria-label">FSFE Logo</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/</xsl:attribute>
<xsl:element name="span">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfeurope'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!--/a#logo-->
</xsl:element>
<!--/div#masthead-->
<xsl:element name="nav">
<xsl:attribute name="id">menu</xsl:attribute>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'go-to'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="ul">
<xsl:attribute name="id">direct-links</xsl:attribute>
<xsl:element name="li">
<xsl:attribute name="id">direct-to-menu-list</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">#menu-list</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'menu'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="id">direct-to-content</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">#content</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'content'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="id">direct-to-page-info</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">#page-info</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'page-info'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
<!--/ul#direct-links-->
<xsl:if test="not(/buildinfo/document/@external)">
<xsl:element name="input">
<xsl:attribute name="type">checkbox</xsl:attribute>
<xsl:attribute name="id">burger</xsl:attribute>
</xsl:element>
<xsl:element name="label">
<xsl:attribute name="for">burger</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-bars fa-lg</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="id">menu-list</xsl:attribute>
<xsl:element name="ul">
<xsl:element name="li">
<xsl:attribute name="id">menu-donate</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>https://my.fsfe.org/donate?referrer=https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@fileurl"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-heart-o fa-lg</xsl:attribute>
</xsl:element>
<xsl:text> </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'donate'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
<!--/ul#menu-list-->
<xsl:element name="ul">
<xsl:attribute name="id">menu-sections</xsl:attribute>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/about/about.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe/about'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/activities/activities.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe/activities'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/contribute/contribute.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe/help'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="class">visible-xs</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/news/news.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/news'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="class">visible-xs</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/events/events.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/events'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="class">visible-xs</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/news/podcast.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'podcast'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/press/press.html</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe/press'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
<!--/ul#menu-sections-->
<xsl:element name="ul">
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">https://my.fsfe.org/</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-sign-in fa-lg</xsl:attribute>
</xsl:element>
<xsl:text> </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fellowship/login'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<xsl:element name="li">
<xsl:attribute name="id">menu-translations</xsl:attribute>
<xsl:element name="a">
<xsl:attribute name="href">#translations</xsl:attribute>
<xsl:attribute name="data-toggle">collapse</xsl:attribute>
<xsl:attribute name="data-target">#translations</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-globe fa-lg</xsl:attribute>
</xsl:element>
<xsl:text> </xsl:text>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'change-lang'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Search box -->
<xsl:element name="li">
<xsl:attribute name="id">menu-search-box</xsl:attribute>
<xsl:element name="form">
<xsl:attribute name="method">GET</xsl:attribute>
<xsl:attribute name="action"><xsl:value-of select="$urlprefix"/>/search/search.<xsl:value-of select="/buildinfo/@language"/>.html</xsl:attribute>
<xsl:element name="div">
<xsl:attribute name="class">input-group</xsl:attribute>
<xsl:element name="div">
<xsl:attribute name="class">input-group-btn</xsl:attribute>
<xsl:element name="button">
<xsl:attribute name="class">btn btn-primary</xsl:attribute>
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="aria-label">Search</xsl:attribute>
<xsl:element name="i">
<xsl:attribute name="class">fa fa-search</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="placeholder">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'search/placeholder'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">q</xsl:attribute>
<xsl:attribute name="size">10</xsl:attribute>
<xsl:attribute name="class">form-control</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:element>
<!--/nav#menu-->
</xsl:element>
<!--/header#top-->
</xsl:template>
</xsl:stylesheet>
-160
View File
@@ -1,160 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="sidebar">
<aside id="sidebar">
<xsl:if test="string(/buildinfo/document/@newsdate) and /buildinfo/document/@type = 'newsletter'">
<h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'receive-newsletter'"/>
</xsl:call-template>
</h3>
<xsl:call-template name="subscribe-nl"/>
<ul>
<li>
<a href="/news/newsletter.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/nl'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="/news/news.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/news'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="/events/events.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/events'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="https://planet.fsfe.org">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/planet'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="/about/contact.html#community">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'community/discuss'"/>
</xsl:call-template>
</a>
</li>
</ul>
</xsl:if>
<xsl:if test="string(/buildinfo/document/@newsdate) and count(/buildinfo/document/@type) = 0">
<h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fsfe/press'"/>
</xsl:call-template>
</h3>
<ul>
<li>
<a href="/press/press.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/press'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="/news/news.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'news/news'"/>
</xsl:call-template>
</a>
</li>
<li>
<a href="/freesoftware/freesoftware.html">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'fs/basics'"/>
</xsl:call-template>
</a>
</li>
</ul>
</xsl:if>
<xsl:apply-templates select="/buildinfo/document/sidebar/node()"/>
<xsl:if test="string(/buildinfo/document/@newsdate)">
<a href="https://my.fsfe.org/support" class="small-donate">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support/become'"/>
</xsl:call-template>
</a>
</xsl:if>
<!-- Add promotion block depending on the "promo" parameter -->
<xsl:choose>
<!-- Promotion block "our-work" -->
<xsl:when test="/buildinfo/document/sidebar/@promo = 'our-work'">
<h3 class="promo">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'our-work'"/>
</xsl:call-template>
</h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'our-work-intro'"/>
</xsl:call-template>
<a href="/about/ourwork.html" class="learn-more">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'learn-more'"/>
</xsl:call-template>
</a>
</xsl:when>
<!-- Promotion block "support" -->
<xsl:when test="/buildinfo/document/sidebar/@promo = 'support'">
<h3 class="promo">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support'"/>
</xsl:call-template>
</h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'our-work-intro'"/>
</xsl:call-template>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support-paragraph'"/>
</xsl:call-template>
<a href="https://my.fsfe.org/support" class="big-donate">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support/become'"/>
</xsl:call-template>
</a>
</xsl:when>
<!-- Promotion block "donate" -->
<xsl:when test="/buildinfo/document/sidebar/@promo = 'donate'">
<h3 class="promo">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'donate'"/>
</xsl:call-template>
</h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'donate-paragraph'"/>
</xsl:call-template>
<a href="https://my.fsfe.org/donate" class="learn-more big-donate">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'donate'"/>
</xsl:call-template>
</a>
</xsl:when>
<!-- Promotion block "about-fsfe", which is the default -->
<xsl:when test="not(/buildinfo/document/sidebar/@promo = 'none')">
<h3 class="promo">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'about-fsfe'"/>
</xsl:call-template>
</h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'about-fsfe-intro'"/>
</xsl:call-template>
<a href="/about/about.html" class="learn-more">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'learn-more'"/>
</xsl:call-template>
</a>
</xsl:when>
</xsl:choose>
</aside>
</xsl:template>
</xsl:stylesheet>
-15
View File
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="fsfe_topbanner">
<xsl:element name="div">
<xsl:attribute name="class">topbanner</xsl:attribute>
<xsl:element name="div">
<xsl:attribute name="id">topbanner-border</xsl:attribute>
<xsl:element name="div">
<xsl:attribute name="id">topbanner-inner</xsl:attribute>
<xsl:apply-templates select="/buildinfo/topbanner/node()"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-15
View File
@@ -1,15 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Extract the content of <version> element from an XML file -->
<!-- ====================================================================== -->
<!-- This XSL script processes the <version> elements of an XML file and -->
<!-- outputs its content. It is used to check for outdated translations. -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output doctype-system="about:legacy-compat" encoding="utf-8" indent="no" method="text" omit-xml-declaration="yes"/>
<xsl:template match="version">
<xsl:value-of select="."/>
</xsl:template>
<!-- Suppress output of text nodes, which would be the default -->
<xsl:template match="text()"/>
</xsl:stylesheet>
-20
View File
@@ -1,20 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!-- this template is to be called to get texts contained in "tools/texts-xx.xml" files -->
<xsl:template name="fsfe-gettext">
<xsl:param name="id"/>
<xsl:choose>
<xsl:when test="/buildinfo/textset/text[@id=$id]">
<xsl:apply-templates select="/buildinfo/textset/text[@id=$id]/node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="/buildinfo/textsetbackup/text[@id=$id]/node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- this template is to be called to get texts contained in "tools/texts-content-xx.xml" files -->
<xsl:template name="gettext">
<xsl:param name="id"/>
<xsl:value-of select="/buildinfo/textset/text[@id=$id] | /buildinfo/textsetbackup/text[ @id=$id and not(@id=/buildinfo/textset/text/@id) ]"/>
</xsl:template>
</xsl:stylesheet>
-12
View File
@@ -1,12 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Display a prefabricated module from global/data/modules -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="module">
<xsl:variable name="id">
<xsl:value-of select="@id"/>
</xsl:variable>
<xsl:apply-templates select="/buildinfo/document/set/module[@filename=$id]/node()"/>
</xsl:template>
</xsl:stylesheet>
-201
View File
@@ -1,201 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="http://xsltsl.org/date-time" xmlns:str="http://xsltsl.org/string" version="1.0" exclude-result-prefixes="dt">
<xsl:import href="../../tools/xsltsl/date-time.xsl"/>
<xsl:import href="../../tools/xsltsl/string.xsl"/>
<!-- ==================================================================== -->
<!-- News image with or without link -->
<!-- ==================================================================== -->
<!-- Define the URL of the image -->
<xsl:template name="news-image">
<xsl:param name="shrink"/>
<xsl:if test="image/@url != ''">
<!-- the URL of the image -->
<xsl:variable name="img-src">
<xsl:choose>
<!-- use a "small" version of the image, e.g.:
https://pics.fsfe.org/uploads/medium/abc123.png
=> https://pics.fsfe.org/uploads/small/abc123.png -->
<xsl:when test="$shrink = 'yes'">
<xsl:call-template name="str:subst">
<xsl:with-param name="text">
<xsl:call-template name="str:subst">
<xsl:with-param name="text" select="image/@url"/>
<xsl:with-param name="replace" select="'/big/'"/>
<xsl:with-param name="with" select="'/small/'"/>
</xsl:call-template>
</xsl:with-param>
<xsl:with-param name="replace" select="'/medium/'"/>
<xsl:with-param name="with" select="'/small/'"/>
</xsl:call-template>
</xsl:when>
<!-- else, take the given URL -->
<xsl:otherwise>
<xsl:value-of select="image/@url"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- create an <img> element, optionally wrapped in an a element -->
<xsl:choose>
<!-- XML file provides a link (default for news items) -->
<xsl:when test="link != ''">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="$img-src"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element>
<!-- img -->
</xsl:element>
<!-- a -->
</xsl:when>
<!-- No link given for the item -->
<xsl:otherwise>
<xsl:element name="img">
<xsl:attribute name="src">
<xsl:value-of select="$img-src"/>
</xsl:attribute>
<xsl:attribute name="alt">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element>
<!-- img -->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<!-- News title with or without link -->
<!-- ==================================================================== -->
<xsl:template name="news-title">
<xsl:choose>
<xsl:when test="link">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="title"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- ==================================================================== -->
<!-- News date, written out -->
<!-- ==================================================================== -->
<xsl:template name="news-date">
<xsl:value-of select="substring(@date,9,2)"/>
<xsl:text> </xsl:text>
<xsl:call-template name="dt:get-month-name">
<xsl:with-param name="month" select="substring(@date,6,2)"/>
</xsl:call-template>
<xsl:text> </xsl:text>
<xsl:value-of select="substring(@date,1,4)"/>
</xsl:template>
<!-- ==================================================================== -->
<!-- Newsteaser text, with or without "read more" link -->
<!-- ==================================================================== -->
<xsl:template name="news-teaser">
<xsl:variable name="link" select="link"/>
<xsl:for-each select="body/*">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="position()=last() and $link">
<xsl:text> </xsl:text>
<xsl:element name="a">
<xsl:attribute name="class">learn-more</xsl:attribute>
<xsl:attribute name="href">
<xsl:value-of select="$link"/>
</xsl:attribute>
</xsl:element>
<!-- a/learn-more -->
</xsl:if>
</xsl:copy>
</xsl:for-each>
</xsl:template>
<!-- ==================================================================== -->
<!-- List of news items (as elements of an unsorted list) -->
<!-- ==================================================================== -->
<xsl:template name="news-list">
<!-- Number of news items to display -->
<xsl:variable name="count">
<xsl:choose>
<xsl:when test="@count">
<xsl:value-of select="@count"/>
</xsl:when>
<xsl:otherwise>5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Build list -->
<xsl:element name="ul">
<xsl:attribute name="class">news-list</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/news[ translate(@date,'-','') &lt;= translate(/buildinfo/@date,'-','') ]">
<xsl:sort select="@date" order="descending"/>
<xsl:if test="position() &lt;= $count">
<xsl:element name="li">
<xsl:call-template name="news-title"/>
<xsl:text> </xsl:text>
<xsl:element name="span">
<xsl:attribute name="class">date</xsl:attribute>
<xsl:call-template name="news-date"/>
</xsl:element>
<!-- span -->
</xsl:element>
<!-- li -->
</xsl:if>
</xsl:for-each>
</xsl:element>
<!-- ul -->
</xsl:template>
<!-- ==================================================================== -->
<!-- Verbose news feed -->
<!-- ==================================================================== -->
<xsl:template name="news-feed">
<!-- Number of news items to display -->
<xsl:variable name="count">
<xsl:choose>
<xsl:when test="@count">
<xsl:value-of select="@count"/>
</xsl:when>
<xsl:otherwise>5</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Build list -->
<xsl:for-each select="/buildinfo/document/set/news[ translate(@date,'-','') &lt;= translate(/buildinfo/@date,'-','') ]">
<xsl:sort select="@date" order="descending"/>
<xsl:if test="position() &lt;= $count">
<xsl:element name="article">
<xsl:attribute name="class">news</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="@filename"/>
</xsl:attribute>
<!-- Title -->
<xsl:element name="h3">
<xsl:call-template name="news-title"/>
</xsl:element>
<!-- Date -->
<xsl:element name="p">
<xsl:attribute name="class">meta</xsl:attribute>
<xsl:call-template name="news-date"/>
</xsl:element>
<!-- Text -->
<xsl:call-template name="news-teaser"/>
</xsl:element>
<!-- article -->
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
-100
View File
@@ -1,100 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="notifications">
<xsl:element name="div">
<xsl:attribute name="id">notifications</xsl:attribute>
<!-- Service notice (for downtime, upgrades, etc. enable this)
<div id="service-notice">
<div class="close">
<a title="dismiss this notification">×</a>
</div>
<div class="text">
<h1>Site currently under development</h1>
<p>
If you want to help out, <a
href="/contribute/web/web.html">consider joining the
web team</a>.
</p>
</div>
</div> -->
<!-- Outdated note -->
<xsl:if test="/buildinfo/@translation_state='outdated'">
<xsl:element name="div">
<xsl:attribute name="class">alert warning yellow</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-dismiss">alert</xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="aria-hidden">true</xsl:attribute>
×
</xsl:element>
<xsl:element name="p"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'outdated-1'"/></xsl:call-template><xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="$urlprefix"/><xsl:value-of select="/buildinfo/@fileurl"/><xsl:text>.en.html</xsl:text></xsl:attribute><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'translator3b'"/></xsl:call-template></xsl:element>.
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'outdated-2'"/></xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- End Outdated note -->
<!-- So outdated we fellback to english note -->
<xsl:if test="/buildinfo/@translation_state='very-outdated'">
<xsl:element name="div">
<xsl:attribute name="class">alert warning yellow</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-dismiss">alert</xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="aria-hidden">true</xsl:attribute>
×
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'very-outdated'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- End very outdated note -->
<!-- Missing translation note -->
<xsl:if test="/buildinfo/@translation_state='untranslated'">
<xsl:element name="div">
<xsl:attribute name="class">alert warning yellow</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-dismiss">alert</xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="aria-hidden">true</xsl:attribute>
×
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'notranslation'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- End Missing translation note -->
<!-- Info box -->
<xsl:element name="div">
<xsl:attribute name="id">infobox</xsl:attribute>
<xsl:if test="/buildinfo/document/head/meta[@name='under-construction' and @content='true']">
<!-- Add under construction message -->
<xsl:element name="div">
<xsl:attribute name="class">alert warning yellow</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-dismiss">alert</xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="aria-hidden">true</xsl:attribute>
×
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'under-construction'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
<!-- Add project completed message -->
<xsl:if test="/buildinfo/document/head/meta[@name='project-complete' and @content='true']">
<xsl:element name="div">
<xsl:attribute name="class">alert warning green</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-dismiss">alert</xsl:attribute><xsl:attribute name="href">#</xsl:attribute><xsl:attribute name="aria-hidden">true</xsl:attribute>
×
</xsl:element>
<xsl:element name="p">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'project-complete'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:element>
<!-- End Info Box -->
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-75
View File
@@ -1,75 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- XSLT for embedding peertube videos nicely -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="peertube" match="peertube">
<xsl:param name="url" select="@url"/>
<xsl:variable name="uuid_url">
<xsl:text>https://download.fsfe.org/videos/peertube/</xsl:text>
<xsl:value-of select="substring-after($url,'https://media.fsfe.org/w/')"/>
</xsl:variable>
<xsl:element name="video">
<xsl:attribute name="crossorigin">crossorigin</xsl:attribute>
<xsl:attribute name="poster">
<xsl:value-of select="$uuid_url"/>
<xsl:text>.jpg</xsl:text>
</xsl:attribute>
<xsl:attribute name="controls">controls</xsl:attribute>
<!-- MP4 1080p -->
<xsl:element name="source">
<xsl:attribute name="type">video/mp4; codecs="avc1.42E01E, mp4a.40.2"</xsl:attribute>
<xsl:attribute name="media">screen and (min-width:1200px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_1080p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- MP4 720p -->
<xsl:element name="source">
<xsl:attribute name="type">video/mp4; codecs="avc1.42E01E, mp4a.40.2"</xsl:attribute>
<xsl:attribute name="media">screen and (max-width:1199px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_720p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- MP4 360p -->
<xsl:element name="source">
<xsl:attribute name="type">video/mp4; codecs="avc1.42E01E, mp4a.40.2"</xsl:attribute>
<xsl:attribute name="media">screen and (max-width:420px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_360p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- WEBM 1080p -->
<xsl:element name="source">
<xsl:attribute name="type">video/webm; codecs="vp9, opus"</xsl:attribute>
<xsl:attribute name="media">screen and (min-width:1200px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_1080p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- WEBM 720p -->
<xsl:element name="source">
<xsl:attribute name="type">video/webm; codecs="vp9, opus"</xsl:attribute>
<xsl:attribute name="media">screen and (max-width:1199px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_720p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
<!-- WEBM 360p -->
<xsl:element name="source">
<xsl:attribute name="type">video/webm; codecs="vp9, opus"</xsl:attribute>
<xsl:attribute name="media">screen and (max-width:420px)</xsl:attribute>
<xsl:attribute name="src">
<xsl:value-of select="$uuid_url"/>
<xsl:text>_360p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-233
View File
@@ -1,233 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:include href="email-obfuscate.xsl"/>
<!-- displays list of people for a given country (or a given team, i.e. "main") -->
<xsl:template name="country-people-list">
<!-- parameter 'team' can be
- a team (e.g. "core" or "athens")
- multiple teams (e.g. "core,ga,council")
-->
<xsl:param name="team" select="''"/>
<!-- parameter 'display' can limit the shown people to coordinators -->
<xsl:param name="display" select="''"/>
<!-- parameter 'extraclass' can set an additional class to div.people -->
<xsl:param name="extraclass" select="''"/>
<!-- test if multiple teams are displayed, or only one -->
<xsl:variable name="multiteam">
<xsl:if test="contains($team, ',')">
<xsl:text>yes</xsl:text>
</xsl:if>
</xsl:variable>
<xsl:element name="div">
<xsl:attribute name="class">
<xsl:text>row people</xsl:text>
<xsl:if test="$extraclass != ''">
<xsl:text> </xsl:text>
<xsl:value-of select="$extraclass"/>
</xsl:if>
</xsl:attribute>
<xsl:for-each select="/buildinfo/document/set/person">
<xsl:sort select="@id"/>
<xsl:variable name="id" select="@id"/>
<!-- check whether person is in requested team -->
<!-- TODO: This produces false-positives when among multiple teams the team "zurich" is requested, but person is only in "ch" -->
<xsl:variable name="inthisteam">
<xsl:for-each select="team">
<xsl:if test="($multiteam != 'yes' and $team = .) or ($multiteam = 'yes' and contains($team, .))">
<xsl:text>yes</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<!-- check whether person is a (deputy) coordinator of the requested team. Only works if $team is only one team -->
<xsl:variable name="isCoordinator">
<xsl:for-each select="function">
<xsl:variable name="function">
<xsl:value-of select="."/>
</xsl:variable>
<!-- prepare translation pattern to lower-case country/team/whatever attribute value -->
<xsl:variable name="smallcase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<!-- check whether is coord/deputy of the given country/group/team...
Notes:
- we have to lower-case here because country attributes are written in uppercase
- @* is the value of every attribute with the current function tag
-->
<xsl:if test="translate(@*, $uppercase, $smallcase) = translate($team, $uppercase, $smallcase) and (contains($function, 'coordinator') or contains($function, 'deputy'))">
<xsl:text>yes</xsl:text>
</xsl:if>
</xsl:for-each>
</xsl:variable>
<!-- only list if:
* person is in the requested team AND
* no display limitation is set OR
* coordinators limitation is set AND is a coordinator/deputy
-->
<xsl:if test="$inthisteam != '' and ($display = '' or ($display = 'coordinators' and $isCoordinator = 'yes'))">
<xsl:element name="div">
<xsl:attribute name="class">person col-xs-12 col-sm-6</xsl:attribute>
<xsl:attribute name="id">
<xsl:value-of select="$id"/>
</xsl:attribute>
<xsl:attribute name="teams">
<xsl:for-each select="team">
<xsl:value-of select="."/>
<xsl:if test="position() != last()">
<xsl:text>, </xsl:text>
</xsl:if>
</xsl:for-each>
<xsl:if test="employee != ''">, employee</xsl:if>
</xsl:attribute>
<xsl:element name="p">
<!-- Picture -->
<xsl:choose>
<xsl:when test="avatar != ''">
<xsl:choose>
<xsl:when test="link != ''">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:element name="img">
<xsl:attribute name="alt">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="src">/about/people/avatars/<xsl:value-of select="avatar"/></xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="img">
<xsl:attribute name="alt">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="src">/about/people/avatars/<xsl:value-of select="avatar"/></xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:element name="img">
<xsl:attribute name="alt">
<xsl:value-of select="name"/>
</xsl:attribute>
<xsl:attribute name="src">/about/people/avatars/default.png</xsl:attribute>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
<!-- Name; if link is given show as link -->
<xsl:element name="span">
<xsl:attribute name="class">name</xsl:attribute>
<xsl:choose>
<xsl:when test="link != ''">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="link"/>
</xsl:attribute>
<xsl:value-of select="name"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<!-- E-mail -->
<xsl:element name="span">
<xsl:attribute name="class">email</xsl:attribute>
<xsl:if test="email != ''">
<xsl:call-template name="email">
<xsl:with-param name="email" select="email"/>
<xsl:with-param name="mailto" select="'no'"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="fingerprint != ''">
<xsl:element name="a"><xsl:attribute name="href">openpgp4fpr:<xsl:value-of select="fingerprint"/></xsl:attribute>
🐾
</xsl:element>
</xsl:if>
<xsl:if test="keyhref != ''">
<xsl:element name="a"><xsl:attribute name="href"><xsl:value-of select="keyhref"/></xsl:attribute>
🔑
</xsl:element>
</xsl:if>
</xsl:element>
<!-- Functions -->
<xsl:for-each select="function">
<xsl:if test="position()!=1">
<xsl:text>, </xsl:text>
</xsl:if>
<xsl:variable name="function">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:apply-templates select="/buildinfo/document/set/function[@id=$function]/node()"/>
<xsl:if test="@country != ''">
<xsl:text> </xsl:text>
<xsl:variable name="country">
<xsl:value-of select="@country"/>
</xsl:variable>
<xsl:value-of select="/buildinfo/document/set/country[@id=$country]"/>
</xsl:if>
<xsl:if test="@group != ''">
<xsl:text> </xsl:text>
<xsl:variable name="group">
<xsl:value-of select="@group"/>
</xsl:variable>
<xsl:value-of select="/buildinfo/document/set/group[@id=$group]"/>
</xsl:if>
<xsl:if test="@activity != ''">
<xsl:text> </xsl:text>
<xsl:variable name="activity">
<xsl:value-of select="@activity"/>
</xsl:variable>
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="/buildinfo/document/set/activity[@id=$activity]/link/@href"/>
</xsl:attribute>
<xsl:value-of select="/buildinfo/document/set/activity[@id=$activity]/title"/>
</xsl:element>
</xsl:if>
<xsl:if test="@volunteers != ''">
<xsl:text> </xsl:text>
<xsl:variable name="volunteers">
<xsl:value-of select="@volunteers"/>
</xsl:variable>
<xsl:apply-templates select="/buildinfo/document/set/volunteers[@id=$volunteers]/node()"/>
</xsl:if>
</xsl:for-each>
<!-- Employee status for transparency reasons-->
<!-- TODO: I (hugo) did this, so there s probably room for improvement -->
<xsl:for-each select="employee">
<xsl:element name="span">
<xsl:choose>
<xsl:when test="substring-before( . , '/') = 'full'">
<xsl:attribute name="class">employee full</xsl:attribute>
</xsl:when>
<xsl:when test="substring-before( . , '/') = 'part'">
<xsl:attribute name="class">employee part</xsl:attribute>
</xsl:when>
<xsl:when test="substring-before( . , '/') = 'freelancer'">
<xsl:attribute name="class">employee freelancer</xsl:attribute>
</xsl:when>
<xsl:when test="substring-before( . , '/') = 'contractor'">
<xsl:attribute name="class">employee contractor</xsl:attribute>
</xsl:when>
<xsl:when test="substring-before( . , '/') = 'intern'">
<xsl:attribute name="class">employee intern</xsl:attribute>
</xsl:when>
<xsl:otherwise/>
</xsl:choose>
<xsl:variable name="employee">
<xsl:value-of select="."/>
</xsl:variable>
<xsl:apply-templates select="/buildinfo/document/set/employee[@id=$employee]/node()"/>
</xsl:element>
</xsl:for-each>
<!-- / employee status -->
</xsl:element>
</xsl:element>
<!-- /li -->
</xsl:if>
</xsl:for-each>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
-97
View File
@@ -1,97 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:import href="gettext.xsl"/>
<xsl:import href="news.xsl"/>
<xsl:import href="events.xsl"/>
<!-- ==================================================================== -->
<!-- Short list of related news and events -->
<!-- ==================================================================== -->
<xsl:template match="related-list">
<!-- Related news -->
<xsl:if test="/buildinfo/document/set/news[ translate(@date,'-','') &lt;= translate(/buildinfo/@date,'-','') ]">
<xsl:element name="h3">
<xsl:attribute name="id">related-list</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-news'"/>
</xsl:call-template>
</xsl:element>
<xsl:call-template name="news-list"/>
</xsl:if>
<!-- Related events -->
<xsl:if test="/buildinfo/document/set/event[ translate(@end,'-','') &gt;= translate(/buildinfo/@date,'-','') ]">
<xsl:element name="h3">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-events'"/>
</xsl:call-template>
</xsl:element>
<xsl:call-template name="event-list"/>
</xsl:if>
<!-- Link to tag page -->
<xsl:if test="@tag">
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>/tags/tagged-</xsl:text>
<xsl:value-of select="@tag"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-all'"/>
</xsl:call-template>
</xsl:element>
<!-- a -->
</xsl:element>
<!-- p -->
</xsl:if>
</xsl:template>
<!-- ==================================================================== -->
<!-- Verbose feed of related news and events -->
<!-- ==================================================================== -->
<xsl:template match="related-feed">
<!-- Related news -->
<xsl:if test="/buildinfo/document/set/news[ translate(@date,'-','') &lt;= translate(/buildinfo/@date,'-','') ]">
<xsl:element name="section">
<xsl:attribute name="id">related-news</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-news'"/>
</xsl:call-template>
</xsl:element>
<!-- h2 -->
<xsl:call-template name="news-feed"/>
</xsl:element>
<!-- section -->
</xsl:if>
<!-- Related events -->
<xsl:if test="/buildinfo/document/set/event[ translate(@end,'-','') &gt;= translate(/buildinfo/@date,'-','') ]">
<xsl:element name="section">
<xsl:attribute name="id">related-events</xsl:attribute>
<xsl:element name="h2">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-events'"/>
</xsl:call-template>
</xsl:element>
<!-- h2 -->
<xsl:call-template name="event-feed"/>
</xsl:element>
<!-- section -->
</xsl:if>
<!-- Link to tag page -->
<xsl:if test="@tag">
<xsl:element name="p">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>/tags/tagged-</xsl:text>
<xsl:value-of select="@tag"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-all'"/>
</xsl:call-template>
</xsl:element>
<!-- a -->
</xsl:element>
<!-- p -->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
-173
View File
@@ -1,173 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:str="http://exslt.org/strings" version="1.0">
<xsl:template name="sharebuttons">
<!-- normalized article title -->
<xsl:variable name="share-title">
<xsl:value-of select="normalize-space(head/title)"/>
</xsl:variable>
<!-- article URL -->
<xsl:variable name="share-url">
<xsl:text>https://fsfe.org</xsl:text>
<xsl:value-of select="/buildinfo/@url"/>
<xsl:text>.html</xsl:text>
</xsl:variable>
<xsl:element name="form">
<!-- div containing all buttons -->
<xsl:attribute name="action">/share</xsl:attribute>
<xsl:attribute name="method">GET</xsl:attribute>
<xsl:attribute name="class">share-buttons</xsl:attribute>
<xsl:attribute name="target">_blank</xsl:attribute>
<xsl:attribute name="onkeypress">return event.keyCode != 13;</xsl:attribute>
<h3>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-head'"/>
</xsl:call-template>
</h3>
<xsl:element name="input">
<xsl:attribute name="type">radio</xsl:attribute>
<xsl:attribute name="name">popup</xsl:attribute>
<xsl:attribute name="id">no-share-popup</xsl:attribute>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">ref</xsl:attribute>
<xsl:attribute name="value">bottom</xsl:attribute>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">url</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="$share-url"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">hidden</xsl:attribute>
<xsl:attribute name="name">title</xsl:attribute>
<xsl:attribute name="value">
<xsl:value-of select="$share-title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="class">n</xsl:attribute>
<xsl:attribute name="name">website</xsl:attribute>
<xsl:attribute name="placeholder">Please do not put anything here</xsl:attribute>
</xsl:element>
<!-- Fediverse -->
<xsl:element name="label">
<xsl:attribute name="class">button share-fediverse</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Fediverse</xsl:text>
</xsl:attribute>
<xsl:attribute name="for">fediverse-share</xsl:attribute>
<xsl:text>Fediverse</xsl:text>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">radio</xsl:attribute>
<xsl:attribute name="name">popup</xsl:attribute>
<xsl:attribute name="id">fediverse-share</xsl:attribute>
</xsl:element>
<xsl:element name="span">
<xsl:attribute name="class">popup fediverse</xsl:attribute>
<xsl:element name="label">
<xsl:attribute name="for">no-share-popup</xsl:attribute>
</xsl:element>
<xsl:element name="input">
<xsl:attribute name="type">text</xsl:attribute>
<xsl:attribute name="name">fediversepod</xsl:attribute>
<xsl:attribute name="value"/>
<xsl:attribute name="placeholder">Fediverse URL (fediverse.tld)</xsl:attribute>
</xsl:element>
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">fediverse</xsl:attribute>
<xsl:text>OK</xsl:text>
</xsl:element>
</xsl:element>
<!-- Reddit -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">reddit</xsl:attribute>
<xsl:attribute name="class">button share-reddit</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Reddit</xsl:text>
</xsl:attribute>
<xsl:text>Reddit</xsl:text>
</xsl:element>
<!-- Hacker News -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">hnews</xsl:attribute>
<xsl:attribute name="class">button share-hnews</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Hacker News</xsl:text>
</xsl:attribute>
<xsl:text>Hacker News</xsl:text>
</xsl:element>
<!-- e-mail -->
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:value-of select="concat('mailto:?subject=', str:encode-uri($share-title, 'true', 'UTF-8'), '&amp;body=', str:encode-uri($extract, 'true', 'UTF-8'), '%0A%0A', str:encode-uri($share-url, 'true', 'UTF-8'))"/>
</xsl:attribute>
<xsl:attribute name="class">button share-mail</xsl:attribute>
<xsl:text>E-Mail</xsl:text>
</xsl:element>
<!-- Twitter -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">twitter</xsl:attribute>
<xsl:attribute name="class">button share-twitter</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Twitter</xsl:text>
</xsl:attribute>
<xsl:text>Twitter</xsl:text>
</xsl:element>
<!-- Facebook -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">facebook</xsl:attribute>
<xsl:attribute name="class">button share-facebook</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Facebook</xsl:text>
</xsl:attribute>
<xsl:text>Facebook</xsl:text>
</xsl:element>
<!-- Support -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="name">service</xsl:attribute>
<xsl:attribute name="value">support</xsl:attribute>
<xsl:attribute name="class">button share-support</xsl:attribute>
<xsl:attribute name="title">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'support'"/>
</xsl:call-template>
</xsl:attribute>
<xsl:text>Support!</xsl:text>
</xsl:element>
<p>
<em><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'share-warning'"/></xsl:call-template><xsl:text> </xsl:text><a href="https://wiki.fsfe.org/Advocacy/ProprietaryWebServices"><xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'learn-more'"/></xsl:call-template></a>.</em>
</p>
</xsl:element>
<!-- /form Social network share buttons -->
</xsl:template>
</xsl:stylesheet>
-82
View File
@@ -1,82 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dt="http://xsltsl.org/date-time" xmlns:weekdays="." xmlns:months="." xmlns:nl="." xmlns:str="http://xsltsl.org/string" version="1.0" exclude-result-prefixes="dt weekdays months nl str">
<xsl:import href="../../tools/xsltsl/string.xsl"/>
<xsl:template name="subscribe-nl">
<xsl:variable name="lang">
<xsl:value-of select="/buildinfo/document/@language"/>
</xsl:variable>
<xsl:variable name="yourname">
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'yourname'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="email">
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'email'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="submit">
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'subscribe'"/>
</xsl:call-template>
</xsl:variable>
<form class="form-inline" id="formnl" name="formnl" method="POST" action="https://my.fsfe.org/subscribe">
<input type="hidden" name="language" value="{$lang}"/>
<input type="input" style="display: none !important" name="password" tabindex="-1" autocomplete="off"/>
<input id="yourname" name="name" type="text" required="required" placeholder="{$yourname}"/>
<input id="email" name="email1" type="email" required="required" placeholder="{$email}"/>
<fsfe-cd-referrer-input/>
<input type="hidden" name="wants_info" value="yes"/>
<input type="hidden" name="wants_newsletter_info" value="yes"/>
<input type="hidden" name="category" value="i"/>
<input id="submit" type="submit" value="{$submit}"/>
</form>
</xsl:template>
<!-- auto generate ID for headings if doesn't already exist -->
<xsl:template name="generate-id">
<xsl:copy>
<xsl:call-template name="generate-id-attribute"/>
<xsl:if test="@class">
<xsl:attribute name="class">
<xsl:value-of select="@class"/>
</xsl:attribute>
</xsl:if>
<xsl:apply-templates select="node()"/>
</xsl:copy>
</xsl:template>
<xsl:template name="generate-id-attribute">
<xsl:param name="title" select="''"/>
<xsl:variable name="title2">
<xsl:choose>
<xsl:when test="normalize-space($title)=''">
<xsl:apply-templates select="node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="not(@id) or normalize-space($title)!=''">
<!-- replace spaces with dashes -->
<xsl:variable name="punctuation">.,:;!? "'()[]&lt;&gt;&gt;{}</xsl:variable>
<xsl:variable name="formattedTitle1" select="translate(normalize-space(translate($title2,$punctuation,' ')),' ','-')"/>
<xsl:variable name="accents">áàâäãéèêëíìîïóòôöõúùûüçğ</xsl:variable>
<xsl:variable name="noaccents">aaaaaeeeeiiiiooooouuuucg</xsl:variable>
<xsl:variable name="formattedTitle2">
<xsl:call-template name="str:to-lower">
<xsl:with-param name="text" select="$formattedTitle1"/>
</xsl:call-template>
</xsl:variable>
<xsl:attribute name="id">
<xsl:value-of select="concat('id-',translate($formattedTitle2,$accents,$noaccents))"/>
</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="id">
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
-36
View File
@@ -1,36 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Display a list of tags (below a news item or event entry) -->
<!-- ====================================================================== -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="tags">
<xsl:element name="ul">
<xsl:attribute name="class">tags</xsl:attribute>
<xsl:for-each select="tag[not(@key='front-page') and not(@key='press') and not(@key='highlights')]">
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href">
<xsl:text>/tags/tagged-</xsl:text>
<xsl:value-of select="@key"/>
<xsl:text>.</xsl:text>
<xsl:value-of select="/buildinfo/@language"/>
<xsl:text>.html</xsl:text>
</xsl:attribute>
<!-- If the <tag> element has no text content, fall back to key -->
<xsl:choose>
<xsl:when test="text()">
<xsl:value-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@key"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
<!-- a -->
</xsl:element>
<!-- li -->
</xsl:for-each>
</xsl:element>
<!-- ul -->
</xsl:template>
</xsl:stylesheet>
-41
View File
@@ -1,41 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="translation_list">
<xsl:if test="not(/buildinfo/document/@external)">
<xsl:element name="nav">
<xsl:attribute name="id">translations</xsl:attribute>
<xsl:attribute name="class">alert</xsl:attribute>
<xsl:element name="a"><xsl:attribute name="class">close</xsl:attribute><xsl:attribute name="data-toggle">collapse</xsl:attribute><xsl:attribute name="data-target">#translations</xsl:attribute><xsl:attribute name="href">#</xsl:attribute>
×
</xsl:element>
<xsl:element name="a">
<xsl:attribute name="class">contribute-translation</xsl:attribute>
<xsl:attribute name="href"><xsl:value-of select="$urlprefix"/>/contribute/translators/</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'translate'"/>
</xsl:call-template>
</xsl:element>
<xsl:element name="ul">
<xsl:for-each select="/buildinfo/trlist/tr">
<xsl:sort select="@id"/>
<xsl:choose>
<xsl:when test="@id=/buildinfo/@language">
<xsl:element name="li">
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:element>
</xsl:when>
<xsl:otherwise>
<xsl:element name="li">
<xsl:element name="a">
<xsl:attribute name="href"><xsl:value-of select="/buildinfo/@fileurl"/>.<xsl:value-of select="@id"/>.html</xsl:attribute>
<xsl:value-of select="." disable-output-escaping="yes"/>
</xsl:element>
</xsl:element>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:template>
</xsl:stylesheet>