diff options
author | 2010-09-12 16:14:24 -0700 | |
---|---|---|
committer | 2010-09-12 16:14:24 -0700 | |
commit | ce64d3f3bbaa610eb874cfed992d012051dd2bea (patch) | |
tree | 8ca05977a03c27fbd7df53b3abc16ea7b87d460f | |
parent | Fix xsl for disclaimer.xsl to be proper xsl. (diff) | |
download | www-redesign-ce64d3f3bbaa610eb874cfed992d012051dd2bea.tar.gz www-redesign-ce64d3f3bbaa610eb874cfed992d012051dd2bea.tar.bz2 www-redesign-ce64d3f3bbaa610eb874cfed992d012051dd2bea.zip |
Split out newscontent template into newscontent.xsl
include newscontent.xsl in guide.xsl
-rw-r--r-- | xml/htdocs/xsl/guide.xsl | 84 | ||||
-rw-r--r-- | xml/htdocs/xsl/newscontent.xsl | 91 |
2 files changed, 92 insertions, 83 deletions
diff --git a/xml/htdocs/xsl/guide.xsl b/xml/htdocs/xsl/guide.xsl index 06707a74..1e6f3f45 100644 --- a/xml/htdocs/xsl/guide.xsl +++ b/xml/htdocs/xsl/guide.xsl @@ -28,6 +28,7 @@ <xsl:include href="/xsl/inserts.xsl" /> <xsl:include href="/xsl/mail.xsl" /> <xsl:include href="/xsl/menu.xsl" /> +<xsl:include href="/xsl/newscontent.xsl" /> <xsl:include href="/xsl/util.xsl"/> <!-- When using <pre>, whitespaces should be preserved --> @@ -1823,87 +1824,4 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:choose> </div> </xsl:template> - -<xsl:template name="newscontent"> -<xsl:param name="thenews"/> -<xsl:param name="summary"/> -<xsl:param name="link"/> - - <div class="news"> - <p class="newshead" lang="en"> - <b><xsl:value-of select="$thenews/title"/></b> - <br/> - <font size="0.90em"> - <xsl:choose> - <xsl:when test="$thenews/until"> - Posted between <xsl:copy-of select="func:format-date($thenews/date)"/> and <xsl:copy-of select="func:format-date($thenews/until)"/> - </xsl:when> - <xsl:otherwise> - Posted on <xsl:copy-of select="func:format-date($thenews/date)"/> - </xsl:otherwise> - </xsl:choose> - <xsl:variable name="poster"> - <xsl:call-template name="smart-mail"> - <xsl:with-param name="mail" select="$thenews/poster"/> - </xsl:call-template> - </xsl:variable> - by <xsl:value-of select="$poster"/> - </font> - </p> - - <xsl:choose> - <xsl:when test="$thenews/@category='birthday'"> - <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/> - </xsl:when> - <xsl:when test="$thenews/@category='gentoo'"> - <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/> - </xsl:when> - <xsl:when test="$thenews/@category='main'"> - <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/> - </xsl:when> - <xsl:when test="$thenews/@category='linux'"> - <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/> - </xsl:when> - <xsl:when test="$thenews/@category='moo'"> - <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/> - </xsl:when> - <xsl:when test="$thenews/@category='plans'"> - <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/> - </xsl:when> - <xsl:when test="$thenews/@category='planet'"> - <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/> - </xsl:when> - <!-- old ones, kept to display very very old news items --> - <xsl:when test="$thenews/@category='alpha'"> - <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/> - </xsl:when> - <xsl:when test="$thenews/@category='kde'"> - <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/> - </xsl:when> - <xsl:when test="$thenews/@category='ibm'"> - <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/> - </xsl:when> - <xsl:when test="$thenews/@category='nvidia'"> - <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/> - </xsl:when> - <xsl:when test="$thenews/@category='freescale'"> - <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/> - </xsl:when> - </xsl:choose> - - <div class="newsitem"> - <xsl:choose> - <xsl:when test="$thenews/summary and $summary='yes'"> - <xsl:apply-templates select="$thenews/summary"/> - <br/> - <a href="{$link}"><b>(full story)</b></a> - </xsl:when> - <xsl:when test="$thenews/body"> - <xsl:apply-templates select="$thenews/body"/> - </xsl:when> - </xsl:choose> - </div> - </div> -</xsl:template> - </xsl:stylesheet> diff --git a/xml/htdocs/xsl/newscontent.xsl b/xml/htdocs/xsl/newscontent.xsl new file mode 100644 index 00000000..e560c986 --- /dev/null +++ b/xml/htdocs/xsl/newscontent.xsl @@ -0,0 +1,91 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <!-- + TODO(antarus): What does this actually do? Does anything still use it? + + It takes 3 paramters, thenews, summary, link. + TODO(antarus): The icon selector should be its own template. + --> + <xsl:template name="newscontent"> + <xsl:param name="thenews"/> + <xsl:param name="summary"/> + <xsl:param name="link"/> + + <div class="news"> + <p class="newshead" lang="en"> + <b><xsl:value-of select="$thenews/title"/></b> + <br/> + <font size="0.90em"> + <xsl:choose> + <xsl:when test="$thenews/until"> + Posted between <xsl:copy-of select="func:format-date($thenews/date)"/> and <xsl:copy-of select="func:format-date($thenews/until)"/> + </xsl:when> + <xsl:otherwise> + Posted on <xsl:copy-of select="func:format-date($thenews/date)"/> + </xsl:otherwise> + </xsl:choose> + <xsl:variable name="poster"> + <xsl:call-template name="smart-mail"> + <xsl:with-param name="mail" select="$thenews/poster"/> + </xsl:call-template> + </xsl:variable> + by <xsl:value-of select="$poster"/> + </font> + </p> + + <xsl:choose> + <xsl:when test="$thenews/@category='birthday'"> + <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/> + </xsl:when> + <xsl:when test="$thenews/@category='gentoo'"> + <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/> + </xsl:when> + <xsl:when test="$thenews/@category='main'"> + <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/> + </xsl:when> + <xsl:when test="$thenews/@category='linux'"> + <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/> + </xsl:when> + <xsl:when test="$thenews/@category='moo'"> + <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/> + </xsl:when> + <xsl:when test="$thenews/@category='plans'"> + <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/> + </xsl:when> + <xsl:when test="$thenews/@category='planet'"> + <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/> + </xsl:when> + <!-- old ones, kept to display very very old news items --> + <xsl:when test="$thenews/@category='alpha'"> + <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/> + </xsl:when> + <xsl:when test="$thenews/@category='kde'"> + <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/> + </xsl:when> + <xsl:when test="$thenews/@category='ibm'"> + <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/> + </xsl:when> + <xsl:when test="$thenews/@category='nvidia'"> + <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/> + </xsl:when> + <xsl:when test="$thenews/@category='freescale'"> + <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/> + </xsl:when> + </xsl:choose> + + <div class="newsitem"> + <xsl:choose> + <xsl:when test="$thenews/summary and $summary='yes'"> + <xsl:apply-templates select="$thenews/summary"/> + <br/> + <a href="{$link}"><b>(full story)</b></a> + </xsl:when> + <xsl:when test="$thenews/body"> + <xsl:apply-templates select="$thenews/body"/> + </xsl:when> + </xsl:choose> + </div> + </div> + </xsl:template> +</xsl:stylesheet> |