svn commit: r53785 - head/en_US.ISO8859-1/htdocs/news/status

Benedict Reuschling <[email protected]>
Newsgroups gmane.os.freebsd.devel.cvs.doc
Message-ID <[email protected]>
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 &gt; 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>
 
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-doc-all
To unsubscribe, send any mail to "[email protected]"
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.