From 395845e6b699bcf8a0eb2947c613620d57ecd98d Mon Sep 17 00:00:00 2001 From: Gabor Kovesdan <gabor@FreeBSD.org> Date: Sun, 19 Jan 2014 12:40:13 +0000 Subject: [PATCH] - Add a sponsor element to the status report DTD so that sponsores can be mentioned in a unified manner - Generate sponsor entries into the output - Update the template Requested by: theraven --- .../htdocs/news/status/report-sample.xml | 3 +++ en_US.ISO8859-1/htdocs/news/status/report.xsl | 16 ++++++++++++++++ share/xml/statusreport.dtd | 4 +++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/en_US.ISO8859-1/htdocs/news/status/report-sample.xml b/en_US.ISO8859-1/htdocs/news/status/report-sample.xml index a4b0229af6..c0e1d146f9 100644 --- a/en_US.ISO8859-1/htdocs/news/status/report-sample.xml +++ b/en_US.ISO8859-1/htdocs/news/status/report-sample.xml @@ -51,6 +51,9 @@ in this area.</p> </body> + <sponsor>Optional sponsor</sponsor> + <sponsor>Another one</sponsor> + <!-- Optional section for listing tasks. --> <help> <task>If help is needed, make this explicit!</task> diff --git a/en_US.ISO8859-1/htdocs/news/status/report.xsl b/en_US.ISO8859-1/htdocs/news/status/report.xsl index f098a0ee1a..379c1b33cf 100644 --- a/en_US.ISO8859-1/htdocs/news/status/report.xsl +++ b/en_US.ISO8859-1/htdocs/news/status/report.xsl @@ -93,6 +93,22 @@ <xsl:apply-templates select="body"/> + <xsl:if test="sponsor"> + <xsl:variable name="sponsors"> + <xsl:for-each select="sponsor"> + <xsl:value-of select="."/> + <xsl:choose> + <xsl:when test="position() = last()">.</xsl:when> + <xsl:when test="position() = (last() - 1)"> and </xsl:when> + <xsl:when test="position() < (last() - 1)">, </xsl:when> + <xsl:otherwise>.</xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:variable> + + <p>This project was sponsored by <xsl:value-of select="$sponsors"/></p> + </xsl:if> + <xsl:apply-templates select="help"/> <hr/> diff --git a/share/xml/statusreport.dtd b/share/xml/statusreport.dtd index 21abc27e91..605cfd955a 100644 --- a/share/xml/statusreport.dtd +++ b/share/xml/statusreport.dtd @@ -44,7 +44,7 @@ id ID #IMPLIED > -<!ELEMENT project (title, contact, links, body, help?)> +<!ELEMENT project (title, contact, links, body, sponsor*, help?)> <!ATTLIST project id ID #IMPLIED cat CDATA #REQUIRED @@ -86,6 +86,8 @@ href CDATA #REQUIRED > +<!ELEMENT sponsor (#PCDATA)> + <!ELEMENT help (task)+> <!ATTLIST help id ID #IMPLIED