Changeset View
Changeset View
Standalone View
Standalone View
head/en_US.ISO8859-1/htdocs/news/status/report.xsl
Show All 10 Lines | <xsl:stylesheet version="1.0" | ||||
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | xmlns:xsl="http://www.w3.org/1999/XSL/Transform" | ||||
xmlns="http://www.w3.org/1999/xhtml"> | xmlns="http://www.w3.org/1999/xhtml"> | ||||
<xsl:import href="http://www.FreeBSD.org/XML/lang/share/xml/libcommon.xsl"/> | <xsl:import href="http://www.FreeBSD.org/XML/lang/share/xml/libcommon.xsl"/> | ||||
<xsl:import href="http://www.FreeBSD.org/XML/share/xml/xhtml.xsl"/> | <xsl:import href="http://www.FreeBSD.org/XML/share/xml/xhtml.xsl"/> | ||||
<xsl:variable name="title">&title;</xsl:variable> | <xsl:variable name="title">&title;</xsl:variable> | ||||
<!-- Sort only reports strictly older than 2019q4 --> | |||||
<xsl:variable name="manual-sorting-condition" select="/report/date/year > 2020 or (/report/date/year = 2019 and /report/date/month = '10-12')"/> | |||||
<xsl:template name="process.sidewrap"> | <xsl:template name="process.sidewrap"> | ||||
&nav.about; | &nav.about; | ||||
</xsl:template> | </xsl:template> | ||||
<xsl:template name="process.contentwrap"> | <xsl:template name="process.contentwrap"> | ||||
<!-- Process all the <sections>, in order --> | <!-- Process all the <sections>, in order --> | ||||
<xsl:apply-templates select="report/section"/> | <xsl:apply-templates select="report/section"/> | ||||
<hr/> | <hr/> | ||||
<!-- Generate a table of contents, sorted --> | <!-- Generate a table of contents, sorted if needed --> | ||||
<xsl:for-each select="report/category"> | <xsl:for-each select="report/category"> | ||||
<!-- category title and link --> | <!-- category title and link --> | ||||
<h3><a><xsl:attribute name="href">#<xsl:value-of | <h3><a><xsl:attribute name="href">#<xsl:value-of | ||||
select="translate(normalize-space(description),' ', '-')"/></xsl:attribute> | select="translate(normalize-space(description),' ', '-')"/></xsl:attribute> | ||||
<xsl:value-of select="description"/></a></h3> | <xsl:value-of select="description"/></a></h3> | ||||
<xsl:variable name="cat-short" select="name"/> | <xsl:variable name="cat-short" select="name"/> | ||||
<ul> | <ul> | ||||
<xsl:choose> | |||||
<xsl:when test="$manual-sorting-condition"> | |||||
<xsl:for-each select="//project[@cat=$cat-short and @summary]"> | <xsl:for-each select="//project[@cat=$cat-short and @summary]"> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | |||||
select="translate(normalize-space(title), ' ', | |||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | |||||
</li> | |||||
</xsl:for-each> | |||||
</xsl:when> | |||||
<xsl:otherwise> | |||||
<xsl:for-each select="//project[@cat=$cat-short and @summary]"> | |||||
<xsl:sort select="translate(title, $lowercase, $uppercase)"/> | <xsl:sort select="translate(title, $lowercase, $uppercase)"/> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | <li><a><xsl:attribute name="href">#<xsl:value-of | ||||
select="translate(normalize-space(title), ' ', | select="translate(normalize-space(title), ' ', | ||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | '-')"/></xsl:attribute><xsl:value-of select="title"/></a> | ||||
</li> | </li> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</xsl:otherwise> | |||||
</xsl:choose> | |||||
<xsl:choose> | |||||
<xsl:when test="$manual-sorting-condition"> | |||||
<xsl:for-each select="//project[@cat=$cat-short and not(@summary)]"> | <xsl:for-each select="//project[@cat=$cat-short and not(@summary)]"> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | |||||
select="translate(normalize-space(title), ' ', | |||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | |||||
</li> | |||||
</xsl:for-each> | |||||
</xsl:when> | |||||
<xsl:otherwise> | |||||
<xsl:for-each select="//project[@cat=$cat-short and not(@summary)]"> | |||||
<xsl:sort select="translate(title, $lowercase, $uppercase)"/> | <xsl:sort select="translate(title, $lowercase, $uppercase)"/> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | <li><a><xsl:attribute name="href">#<xsl:value-of | ||||
select="translate(normalize-space(title), ' ', | select="translate(normalize-space(title), ' ', | ||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | '-')"/></xsl:attribute><xsl:value-of select="title"/></a> | ||||
</li> | </li> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</xsl:otherwise> | |||||
</xsl:choose> | |||||
</ul> | </ul> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
<ul> | <ul> | ||||
<xsl:choose> | |||||
<xsl:when test="$manual-sorting-condition"> | |||||
<xsl:for-each select="//project[not(@cat)]"> | <xsl:for-each select="//project[not(@cat)]"> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | |||||
select="translate(normalize-space(title), ' ', | |||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | |||||
</li> | |||||
</xsl:for-each> | |||||
</xsl:when> | |||||
<xsl:otherwise> | |||||
<xsl:for-each select="//project[not(@cat)]"> | |||||
<xsl:sort select="translate(title, $lowercase, $uppercase)"/> | <xsl:sort select="translate(title, $lowercase, $uppercase)"/> | ||||
<li><a><xsl:attribute name="href">#<xsl:value-of | <li><a><xsl:attribute name="href">#<xsl:value-of | ||||
select="translate(normalize-space(title), ' ', | select="translate(normalize-space(title), ' ', | ||||
'-')"/></xsl:attribute><xsl:value-of select="title"/></a> | '-')"/></xsl:attribute><xsl:value-of select="title"/></a> | ||||
</li> | </li> | ||||
</xsl:for-each> | </xsl:for-each> | ||||
</xsl:otherwise> | |||||
</xsl:choose> | |||||
</ul> | </ul> | ||||
<hr/> | <hr/> | ||||
<!-- For each category, process the corresponding projects and sort | <!-- For each category, process the corresponding projects and sort | ||||
them by title, so they will be listed in the same order as | them by title if needed, so they will be listed in the same | ||||
they are in the table of contents --> | order as they are in the table of contents --> | ||||
<xsl:choose> | <xsl:choose> | ||||
<xsl:when test="report/category"> | <xsl:when test="report/category"> | ||||
<xsl:for-each select="report/category"> | <xsl:for-each select="report/category"> | ||||
<!-- category title --> | <!-- category title --> | ||||
<br/><h1><a> | <br/><h1><a> | ||||
<xsl:attribute name="name"><xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute> | <xsl:attribute name="name"><xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute> | ||||
<xsl:attribute name="href">#<xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute> | <xsl:attribute name="href">#<xsl:value-of select="translate(normalize-space(description), ' ', '-')"/></xsl:attribute> | ||||
<xsl:value-of select="description"/></a></h1> | <xsl:value-of select="description"/></a></h1> | ||||
<!-- per-category intro text, if present --> | <!-- per-category intro text, if present --> | ||||
<xsl:apply-templates select="p" mode="copy.html"/><br/> | <xsl:apply-templates select="p" mode="copy.html"/><br/> | ||||
<xsl:variable name="cat-short" select="name"/> | <xsl:variable name="cat-short" select="name"/> | ||||
<xsl:choose> | |||||
<xsl:when test="$manual-sorting-condition"> | |||||
<xsl:apply-templates select="//project[@cat=$cat-short]"/> | |||||
</xsl:when> | |||||
<xsl:otherwise> | |||||
<xsl:apply-templates select="//project[@cat=$cat-short]"> | <xsl:apply-templates select="//project[@cat=$cat-short]"> | ||||
<xsl:sort select="translate(title, $lowercase, $uppercase)"/> | <xsl:sort select="translate(title, $lowercase, $uppercase)"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</xsl:otherwise> | |||||
</xsl:choose> | |||||
</xsl:for-each> | </xsl:for-each> | ||||
</xsl:when> | </xsl:when> | ||||
<xsl:otherwise> | <xsl:otherwise> | ||||
<xsl:choose> | |||||
<xsl:when test="$manual-sorting-condition"> | |||||
<xsl:apply-templates select="report/project"/> | |||||
</xsl:when> | |||||
<xsl:otherwise> | |||||
<xsl:apply-templates select="report/project"> | <xsl:apply-templates select="report/project"> | ||||
<xsl:sort select="translate(title, $lowercase, $uppercase)"/> | <xsl:sort select="translate(title, $lowercase, $uppercase)"/> | ||||
</xsl:apply-templates> | </xsl:apply-templates> | ||||
</xsl:otherwise> | |||||
</xsl:choose> | |||||
</xsl:otherwise> | </xsl:otherwise> | ||||
</xsl:choose> | </xsl:choose> | ||||
<!-- Standard footer --> | <!-- Standard footer --> | ||||
<a href="../news.html">News Home</a> | <a href="status.html">Status Home</a> | <a href="../news.html">News Home</a> | <a href="status.html">Status Home</a> | ||||
</xsl:template> | </xsl:template> | ||||
<!-- Everything that follows are templates for the rest of the content --> | <!-- Everything that follows are templates for the rest of the content --> | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |