Date: Thu, 16 Jan 2020 07:42:24 +0000 (UTC) From: Benedict Reuschling <bcr@FreeBSD.org> To: doc-committers@freebsd.org, svn-doc-all@freebsd.org, svn-doc-head@freebsd.org Subject: svn commit: r53785 - head/en_US.ISO8859-1/htdocs/news/status Message-ID: <202001160742.00G7gOM4042686@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: bcr Date: Thu Jan 16 07:42:24 2020 New Revision: 53785 URL: https://svnweb.freebsd.org/changeset/doc/53785 Log: Disable automatic sorting for new quarterly status reports. While preparing the last quarterly status report (2019Q4), Makefiles were added in the git repository that make it very easy to sort the project reports. However, our report.xsl file enforces automatic alphabetical sorting in each category, which destroys our manual sorting. This patch disables automatic sorting starting with this quarter (2019Q4). Automatic sorting is kept for older reports: we avoid to change them since they have no designed and reviewed manual sort. Submitted by: salvadore@ Approved by: bcr@ Differential Revision: https://reviews.freebsd.org/D23175 Modified: head/en_US.ISO8859-1/htdocs/news/status/report.xsl Modified: head/en_US.ISO8859-1/htdocs/news/status/report.xsl ============================================================================== --- head/en_US.ISO8859-1/htdocs/news/status/report.xsl Thu Jan 16 06:06:35 2020 (r53784) +++ head/en_US.ISO8859-1/htdocs/news/status/report.xsl Thu Jan 16 07:42:24 2020 (r53785) @@ -16,6 +16,9 @@ <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"> &nav.about; </xsl:template> @@ -26,7 +29,7 @@ <hr/> - <!-- Generate a table of contents, sorted --> + <!-- Generate a table of contents, sorted if needed --> <xsl:for-each select="report/category"> <!-- category title and link --> <h3><a><xsl:attribute name="href">#<xsl:value-of @@ -34,38 +37,74 @@ <xsl:value-of select="description"/></a></h3> <xsl:variable name="cat-short" select="name"/> <ul> - <xsl:for-each select="//project[@cat=$cat-short and @summary]"> - <xsl:sort select="translate(title, $lowercase, $uppercase)"/> - <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:choose> + <xsl:when test="$manual-sorting-condition"> + <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)"/> + <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:otherwise> + </xsl:choose> - <xsl:for-each select="//project[@cat=$cat-short and not(@summary)]"> - <xsl:sort select="translate(title, $lowercase, $uppercase)"/> - <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:choose> + <xsl:when test="$manual-sorting-condition"> + <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)"/> + <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:otherwise> + </xsl:choose> </ul> </xsl:for-each> <ul> - <xsl:for-each select="//project[not(@cat)]"> - <xsl:sort select="translate(title, $lowercase, $uppercase)"/> - <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:choose> + <xsl:when test="$manual-sorting-condition"> + <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)"/> + <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:otherwise> + </xsl:choose> </ul> <hr/> <!-- For each category, process the corresponding projects and sort - them by title, so they will be listed in the same order as - they are in the table of contents --> + them by title if needed, so they will be listed in the same + order as they are in the table of contents --> <xsl:choose> <xsl:when test="report/category"> <xsl:for-each select="report/category"> @@ -79,15 +118,32 @@ <xsl:apply-templates select="p" mode="copy.html"/><br/> <xsl:variable name="cat-short" select="name"/> - <xsl:apply-templates select="//project[@cat=$cat-short]"> + <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:sort select="translate(title, $lowercase, $uppercase)"/> - </xsl:apply-templates> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> </xsl:for-each> + </xsl:when> <xsl:otherwise> - <xsl:apply-templates select="report/project"> - <xsl:sort select="translate(title, $lowercase, $uppercase)"/> - </xsl:apply-templates> + + <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:sort select="translate(title, $lowercase, $uppercase)"/> + </xsl:apply-templates> + </xsl:otherwise> + </xsl:choose> + </xsl:otherwise> </xsl:choose>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001160742.00G7gOM4042686>