build: use lefthook for pre-commit (#5248)
continuous-integration/drone/push Build is passing

update docs
update nix-shell to auto install
rework custom pre-commit hooks to integrate better
add dockerfile for lefthook and integrate into drone
add some more hooks for formatting and linting some files

Co-authored-by: Darragh Elliott <me@delliott.net>
Reviewed-on: #5248
Co-authored-by: delliott <delliott@fsfe.org>
Co-committed-by: delliott <delliott@fsfe.org>
This commit was merged in pull request #5248.
This commit is contained in:
2025-08-27 15:22:06 +00:00
committed by tobiasd
parent 7290c37397
commit 1a05dee2f6
186 changed files with 9247 additions and 9590 deletions
+1 -2
View File
@@ -1,6 +1,5 @@
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)
tools/xsltsl/ (deprecated)
build/xsltlib/
+2 -6
View File
@@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template name="body_scripts">
<script src="{$urlprefix}/scripts/bootstrap-3.0.3.custom.js"></script>
<script src="{$urlprefix}/scripts/bootstrap-3.0.3.custom.js"/>
</xsl:template>
</xsl:stylesheet>
+20 -26
View File
@@ -1,21 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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:attribute name="class">
<xsl:value-of select="$class"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<!-- when called with the required="yes" param, add the attribute
@@ -23,7 +22,7 @@
<xsl:choose>
<xsl:when test="$required = 'yes'">
<xsl:attribute name="required">required</xsl:attribute>
<option></option>
<option/>
<!-- this will force people to pick a choice actively -->
</xsl:when>
</xsl:choose>
@@ -31,11 +30,9 @@
<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 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 -->
@@ -43,14 +40,14 @@
<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: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:sort select="." lang="en"/>
<xsl:call-template name="country-list-options"/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
@@ -59,25 +56,22 @@
</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 name="value"><xsl:value-of select="@id"/>|<xsl:value-of select="."/>
</xsl:attribute>
<xsl:value-of select="." />
<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:value-of select="@id"/>
</xsl:attribute>
<xsl:value-of select="." />
<xsl:value-of select="."/>
</xsl:element>
<!-- /option -->
</xsl:template>
+11 -21
View File
@@ -1,28 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- XML tag for obfuscating an email address against scaper bots -->
<!-- ====================================================================== -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exsl="http://exslt.org/common">
<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="email" select="."/>
<xsl:param name="mailto" select="@mailto"/>
<!-- 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: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">
@@ -77,12 +69,12 @@
<xsl:text>;</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="text()" />
<xsl:value-of select="text()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:variable> <!-- /$email-encoded -->
</xsl:variable>
<!-- /$email-encoded -->
<!-- Output email address in desired form -->
<xsl:choose>
<!-- Should be a clickable mailto: link -->
@@ -92,17 +84,15 @@
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:value-of select="$email-encoded" disable-output-escaping="yes"/>
<xsl:text disable-output-escaping="yes">"&gt;</xsl:text>
<xsl:value-of select="$email-encoded" disable-output-escaping="yes" />
<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:value-of select="$email-encoded" disable-output-escaping="yes"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
+41 -83
View File
@@ -1,17 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="http://xsltsl.org/date-time"
exclude-result-prefixes="dt">
<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">
@@ -35,19 +27,14 @@
</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">
@@ -55,24 +42,19 @@
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</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: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">
@@ -80,62 +62,53 @@
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</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: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 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: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: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: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>
@@ -151,25 +124,22 @@
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="position()=last() and $link != ''">
<xsl:text>&#160;</xsl:text>
<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: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>
@@ -179,35 +149,31 @@
<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: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>&#160;</xsl:text>
<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:element>
<!-- span -->
</xsl:element>
<!-- li -->
</xsl:if>
</xsl:for-each>
</xsl:element><!-- ul -->
</xsl:element>
<!-- ul -->
</xsl:template>
<!-- ==================================================================== -->
<!-- Verbose event feed -->
<!-- ==================================================================== -->
<xsl:template name="event-feed">
<!-- Number of events to display -->
<xsl:variable name="count">
<xsl:choose>
@@ -217,11 +183,8 @@
<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: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">
@@ -229,25 +192,20 @@
<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:element>
<!-- article -->
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
+1 -6
View File
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Helper stylesheets to include referrer for fsfe-cd -->
<!-- ====================================================================== -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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">
@@ -18,7 +15,6 @@
</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">
@@ -30,5 +26,4 @@
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
+20 -26
View File
@@ -1,36 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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" />
<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" />
<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: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>
+4 -10
View File
@@ -1,27 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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 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:call-template name="page-head"/>
<xsl:call-template name="page-body"/>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
+52 -42
View File
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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.
@@ -26,79 +24,94 @@
<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: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: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: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: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:with-param name="id" select="'show-support-paragraph'"/>
</xsl:call-template>
<br />
<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: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: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>&#x2000;</xsl:text>
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'donate'" /></xsl:call-template>
<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: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: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: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: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:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'followup/press-paragraph'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:when>
@@ -108,22 +121,19 @@
<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: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: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:call-template name="subscribe-nl"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element>
+231 -230
View File
@@ -1,267 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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:value-of select="/buildinfo/document/head/title/text()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="/buildinfo/document/head/title/text()" />
<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: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/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/fsfe.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: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">author</xsl:attribute>
<xsl:attribute name="name">robots</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 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/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/fsfe.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:value-of select="name" />
<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: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 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: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="name">twitter:title</xsl:attribute>
<xsl:attribute name="content">
<xsl:value-of select="image/@alt" />
<!-- content of <title> -->
<xsl:value-of select="$title"/>
</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 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/jquery-3.5.1.min.js"/>
<script src="{$urlprefix}/scripts/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: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/jquery-3.5.1.min.js"></script>
<script src="{$urlprefix}/scripts/modernizr.custom.65251.js"></script>
<!-- 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:template>
</xsl:stylesheet>
+139 -156
View File
@@ -1,241 +1,224 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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')">
<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: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: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: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" />
<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')">
<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>
<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: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>&#160;</span>
<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>
<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>
<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: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 is not in people.en.xml -->
<!-- person has no link -->
<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>
<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>
<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: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>
<!-- 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>&#160;</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>&#160;</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: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>&#160;</span>
<xsl:element name="time">
<xsl:attribute name="class">dt-published</xsl:attribute>
<xsl:value-of select="/buildinfo/document/date/original/@content" />
</xsl:element>&#160;
</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>
(<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">
&#160;<xsl:element name="time">
<xsl:attribute name="class">dt-updated</xsl:attribute>
<xsl:value-of select="@content" />
</xsl:element>
</xsl:for-each>)&#160;
 <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>:&#160;</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: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: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: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: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: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: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:call-template name="generate-id"/>
</xsl:template>
</xsl:stylesheet>
+10 -14
View File
@@ -1,10 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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>
@@ -16,32 +13,31 @@
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- Remember own id -->
<xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
<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:element>
<!-- a -->
</xsl:element>
<!-- li -->
</xsl:for-each>
</xsl:element><!-- ul -->
</xsl:element>
<!-- ul -->
</xsl:template>
</xsl:stylesheet>
+38 -43
View File
@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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">
@@ -14,32 +12,30 @@
</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: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()" />
<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: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:value-of select="discussion/@href"/>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'discuss-article'" />
<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: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">
@@ -49,46 +45,45 @@
</xsl:element>
<xsl:apply-templates select="/buildinfo/document/tags"/>
</xsl:element>
</xsl:if> <!-- /tags -->
</xsl:if>
<!-- /tags -->
</xsl:element>
<!--/article#content-->
<xsl:if test = "/buildinfo/document/sidebar or /buildinfo/document/@newsdate">
<xsl:call-template name="sidebar"/>
<xsl:if test="/buildinfo/document/sidebar or /buildinfo/document/@newsdate">
<xsl:call-template name="sidebar"/>
</xsl:if>
<xsl:if test = "/buildinfo/document/legal">
<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>
<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: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:element>
</footer>
</xsl:if>
</xsl:element>
<!--/section#main-->
</xsl:template>
</xsl:stylesheet>
+2 -18
View File
@@ -1,27 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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"/>
<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>
+4 -5
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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">
@@ -16,5 +16,4 @@
<xsl:attribute name="class">news</xsl:attribute>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
+5 -27
View File
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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">
@@ -13,18 +11,15 @@
</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:element name="a">
<!-- Mastodon -->
<xsl:attribute name="href">
<xsl:text>https://mastodon.social/@fsfe</xsl:text>
</xsl:attribute>
@@ -37,7 +32,8 @@
<xsl:attribute name="title">Mastodon</xsl:attribute>
</xsl:element>
</xsl:element>
<xsl:element name="a"> <!-- Peertube -->
<xsl:element name="a">
<!-- Peertube -->
<xsl:attribute name="href">
<xsl:text>https://media.fsfe.org/a/fsfe/videos</xsl:text>
</xsl:attribute>
@@ -51,7 +47,6 @@
</xsl:element>
</xsl:element>
</xsl:element>
<!-- Copyright notice -->
<xsl:element name="p">
<xsl:text>Copyright © 2001-2025 </xsl:text>
@@ -66,18 +61,14 @@
</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">
@@ -90,7 +81,6 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Jobs -->
<xsl:element name="p">
<xsl:element name="a">
@@ -103,7 +93,6 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Imprint and other legal stuff -->
<xsl:element name="p">
<xsl:element name="a">
@@ -136,18 +125,14 @@
</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">
@@ -164,7 +149,6 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Contribute to website -->
<xsl:element name="p">
<xsl:element name="a">
@@ -177,7 +161,6 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Contribute to translations -->
<xsl:element name="p">
<xsl:element name="a">
@@ -190,7 +173,6 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
<!-- Appropriate translation notice -->
<xsl:element name="p">
<xsl:if test="/buildinfo/document/@language!=/buildinfo/@original">
@@ -228,7 +210,6 @@
</xsl:call-template>
</xsl:if>
</xsl:element>
<!-- Javascript licenses -->
<xsl:element name="p">
<xsl:element name="a">
@@ -242,11 +223,8 @@
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
+53 -43
View File
@@ -1,14 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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>
@@ -20,46 +16,46 @@
</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: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: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: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: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>
@@ -67,11 +63,10 @@
</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 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">
@@ -86,63 +81,77 @@
<xsl:element name="i">
<xsl:attribute name="class">fa fa-heart-o fa-lg</xsl:attribute>
</xsl:element>
<xsl:text>&#x2000;</xsl:text>
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'donate'" /></xsl:call-template>
<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: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: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: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: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: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: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: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">
@@ -150,11 +159,12 @@
<xsl:element name="i">
<xsl:attribute name="class">fa fa-sign-in fa-lg</xsl:attribute>
</xsl:element>
<xsl:text>&#x2000;</xsl:text>
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'fellowship/login'" /></xsl:call-template>
<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">
@@ -164,17 +174,18 @@
<xsl:element name="i">
<xsl:attribute name="class">fa fa-globe fa-lg</xsl:attribute>
</xsl:element>
<xsl:text>&#x2000;</xsl:text>
<xsl:call-template name="fsfe-gettext"><xsl:with-param name="id" select="'change-lang'" /></xsl:call-template>
<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: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">
@@ -190,7 +201,9 @@
</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: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>
@@ -203,12 +216,9 @@
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:element>
<!--/nav#menu-->
</xsl:element>
<!--/header#top-->
</xsl:template>
</xsl:stylesheet>
+111 -83
View File
@@ -1,132 +1,160 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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" />
<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>
<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>
<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>
<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: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: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: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: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: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: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: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: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: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: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: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: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: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: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:with-param name="id" select="'learn-more'"/>
</xsl:call-template>
</a>
</xsl:when>
</xsl:choose>
</aside>
</xsl:template>
</xsl:stylesheet>
+2 -4
View File
@@ -1,7 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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>
@@ -9,7 +7,7 @@
<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:apply-templates select="/buildinfo/topbanner/node()"/>
</xsl:element>
</xsl:element>
</xsl:element>
+2 -11
View File
@@ -1,24 +1,15 @@
<?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 version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output
doctype-system="about:legacy-compat"
encoding="utf-8"
indent="no"
method="text"
omit-xml-declaration="yes" />
<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>
+6 -12
View File
@@ -1,26 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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:param name="id"/>
<xsl:choose>
<xsl:when test="/buildinfo/textset/text[@id=$id]">
<xsl:apply-templates select="/buildinfo/textset/text[@id=$id]/node()" />
<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: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: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>
+5 -5
View File
@@ -1,12 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Display a prefabricated module from global/data/modules -->
<!-- ====================================================================== -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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>
+27 -60
View File
@@ -1,23 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="http://xsltsl.org/date-time"
xmlns:str="http://xsltsl.org/string"
exclude-result-prefixes="dt">
<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:param name="shrink"/>
<xsl:if test="image/@url != ''">
<!-- the URL of the image -->
<xsl:variable name="img-src">
@@ -29,13 +19,13 @@
<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: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:with-param name="replace" select="'/medium/'"/>
<xsl:with-param name="with" select="'/small/'"/>
</xsl:call-template>
</xsl:when>
<!-- else, take the given URL -->
@@ -44,7 +34,6 @@
</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) -->
@@ -63,8 +52,10 @@
<xsl:attribute name="title">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element><!-- img -->
</xsl:element><!-- a -->
</xsl:element>
<!-- img -->
</xsl:element>
<!-- a -->
</xsl:when>
<!-- No link given for the item -->
<xsl:otherwise>
@@ -78,17 +69,15 @@
<xsl:attribute name="title">
<xsl:value-of select="image/@alt"/>
</xsl:attribute>
</xsl:element><!-- img -->
</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">
@@ -104,12 +93,9 @@
</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>
@@ -119,37 +105,31 @@
<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>&#160;</xsl:text>
<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: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>
@@ -159,36 +139,31 @@
<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: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>&#160;</xsl:text>
<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:element>
<!-- span -->
</xsl:element>
<!-- li -->
</xsl:if>
</xsl:for-each>
</xsl:element><!-- ul -->
</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>
@@ -198,11 +173,8 @@
<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: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">
@@ -210,25 +182,20 @@
<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:element>
<!-- article -->
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
+28 -59
View File
@@ -1,11 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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">
@@ -22,110 +19,82 @@
</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 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 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 -->
</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 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 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 -->
</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 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 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 -->
</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']">
<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 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: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: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 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:with-param name="id" select="'project-complete'"/>
</xsl:call-template>
</xsl:element>
</xsl:element>
</xsl:if>
</xsl:element><!-- End Info Box -->
</xsl:element>
<!-- End Info Box -->
</xsl:element>
</xsl:template>
</xsl:stylesheet>
+10 -16
View File
@@ -1,23 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- XSLT for embedding peertube videos nicely -->
<!-- ====================================================================== -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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: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:value-of select="$uuid_url"/>
<xsl:text>.jpg</xsl:text>
</xsl:attribute>
<xsl:attribute name="controls">controls</xsl:attribute>
@@ -26,7 +21,7 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_1080p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
@@ -35,7 +30,7 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_720p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
@@ -44,7 +39,7 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_360p.mp4</xsl:text>
</xsl:attribute>
</xsl:element>
@@ -53,7 +48,7 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_1080p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
@@ -62,7 +57,7 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_720p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
@@ -71,11 +66,10 @@
<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:value-of select="$uuid_url"/>
<xsl:text>_360p.webm</xsl:text>
</xsl:attribute>
</xsl:element>
</xsl:element>
</xsl:template>
</xsl:stylesheet>
+206 -217
View File
@@ -1,244 +1,233 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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
<!-- 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: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: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: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: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...
</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:
<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: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/default.png</xsl:attribute>
<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>
<!-- 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>
</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>
<!-- 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: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: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: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: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:element> <!-- /li -->
</xsl:if>
</xsl:for-each>
</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>
+27 -44
View File
@@ -1,43 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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: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: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: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: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">
@@ -48,51 +36,46 @@
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-all'" />
<xsl:with-param name="id" select="'related-all'"/>
</xsl:call-template>
</xsl:element><!-- a -->
</xsl:element><!-- p -->
</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: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:with-param name="id" select="'related-news'"/>
</xsl:call-template>
</xsl:element><!-- h2 -->
</xsl:element>
<!-- h2 -->
<xsl:call-template name="news-feed"/>
</xsl:element><!-- section -->
</xsl:element>
<!-- section -->
</xsl:if>
<!-- Related events -->
<xsl:if test="/buildinfo/document/set/event[
translate(@end,'-','') &gt;= translate(/buildinfo/@date,'-','')
]">
<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:with-param name="id" select="'related-events'"/>
</xsl:call-template>
</xsl:element><!-- h2 -->
</xsl:element>
<!-- h2 -->
<xsl:call-template name="event-feed"/>
</xsl:element><!-- section -->
</xsl:element>
<!-- section -->
</xsl:if>
<!-- Link to tag page -->
<xsl:if test="@tag">
<xsl:element name="p">
@@ -103,12 +86,12 @@
<xsl:text>.html</xsl:text>
</xsl:attribute>
<xsl:call-template name="fsfe-gettext">
<xsl:with-param name="id" select="'related-all'" />
<xsl:with-param name="id" select="'related-all'"/>
</xsl:call-template>
</xsl:element><!-- a -->
</xsl:element><!-- p -->
</xsl:element>
<!-- a -->
</xsl:element>
<!-- p -->
</xsl:if>
</xsl:template>
</xsl:stylesheet>
+30 -45
View File
@@ -1,14 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:str="http://exslt.org/strings">
<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:value-of select="normalize-space(head/title)"/>
</xsl:variable>
<!-- article URL -->
<xsl:variable name="share-url">
@@ -16,8 +11,8 @@
<xsl:value-of select="/buildinfo/@url"/>
<xsl:text>.html</xsl:text>
</xsl:variable>
<xsl:element name="form"> <!-- div containing all buttons -->
<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>
@@ -25,42 +20,44 @@
<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: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: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: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:attribute name="value">
<xsl:value-of select="$share-url"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="input" >
<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:attribute name="value">
<xsl:value-of select="$share-title"/>
</xsl:attribute>
</xsl:element>
<xsl:element name="input" >
<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:with-param name="id" select="'share-page'"/>
</xsl:call-template>
<xsl:text> Fediverse</xsl:text>
</xsl:attribute>
@@ -74,11 +71,13 @@
</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="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>
<xsl:attribute name="value"/>
<xsl:attribute name="placeholder">Fediverse URL (fediverse.tld)</xsl:attribute>
</xsl:element>
<xsl:element name="button">
@@ -88,7 +87,6 @@
<xsl:text>OK</xsl:text>
</xsl:element>
</xsl:element>
<!-- Reddit -->
<xsl:element name="button">
<xsl:attribute name="type">submit</xsl:attribute>
@@ -97,13 +95,12 @@
<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: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>
@@ -112,13 +109,12 @@
<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: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">
@@ -127,7 +123,6 @@
<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>
@@ -136,13 +131,12 @@
<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: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>
@@ -151,13 +145,12 @@
<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: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>
@@ -166,23 +159,15 @@
<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: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 -->
<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>
+24 -40
View File
@@ -1,30 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
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'
exclude-result-prefixes="dt weekdays months nl str">
<xsl:import href="../../tools/xsltsl/string.xsl" />
<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: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: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: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"/>
@@ -37,61 +32,50 @@
<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:call-template name="generate-id-attribute"/>
<xsl:if test="@class">
<xsl:attribute name="class">
<xsl:value-of select="@class" />
</xsl:attribute>
<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:param name="title" select="''"/>
<xsl:variable name="title2">
<xsl:choose>
<xsl:when test="normalize-space($title)=''">
<xsl:apply-templates select="node()" />
<xsl:apply-templates select="node()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$title" />
<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">.,:;!?&#160;&quot;'()[]&lt;&gt;>{}</xsl:variable>
<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="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: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: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:value-of select="@id"/>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
+7 -6
View File
@@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- ====================================================================== -->
<!-- Display a list of tags (below a news item or event entry) -->
<!-- ====================================================================== -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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>
@@ -27,9 +25,12 @@
<xsl:value-of select="@key"/>
</xsl:otherwise>
</xsl:choose>
</xsl:element><!-- a -->
</xsl:element><!-- li -->
</xsl:element>
<!-- a -->
</xsl:element>
<!-- li -->
</xsl:for-each>
</xsl:element><!-- ul -->
</xsl:element>
<!-- ul -->
</xsl:template>
</xsl:stylesheet>
+7 -15
View File
@@ -1,30 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<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 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: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:sort select="@id"/>
<xsl:choose>
<xsl:when test="@id=/buildinfo/@language">
<xsl:element name="li">
@@ -34,8 +27,7 @@
<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: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>