diff options
Diffstat (limited to 'xml')
-rw-r--r-- | xml/htdocs/xsl/newscontent.xsl | 94 |
1 files changed, 51 insertions, 43 deletions
diff --git a/xml/htdocs/xsl/newscontent.xsl b/xml/htdocs/xsl/newscontent.xsl index e560c986..b9fd65d8 100644 --- a/xml/htdocs/xsl/newscontent.xsl +++ b/xml/htdocs/xsl/newscontent.xsl @@ -1,6 +1,50 @@ <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> - + + + <xsl:template name="news-icon-selector"> + <xsl:param name="category"/> + <xsl:choose> + <xsl:when test="$category='birthday'"> + <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/> + </xsl:when> + <xsl:when test="$category='gentoo'"> + <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/> + </xsl:when> + <xsl:when test="$category='main'"> + <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/> + </xsl:when> + <xsl:when test="$category='linux'"> + <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/> + </xsl:when> + <xsl:when test="$category='moo'"> + <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/> + </xsl:when> + <xsl:when test="$category='plans'"> + <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/> + </xsl:when> + <xsl:when test="$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="$category='alpha'"> + <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/> + </xsl:when> + <xsl:when test="$category='kde'"> + <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/> + </xsl:when> + <xsl:when test="$category='ibm'"> + <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/> + </xsl:when> + <xsl:when test="$category='nvidia'"> + <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/> + </xsl:when> + <xsl:when test="$category='freescale'"> + <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/> + </xsl:when> + </xsl:choose> + </xsl:template> + <!-- TODO(antarus): What does this actually do? Does anything still use it? @@ -8,9 +52,9 @@ 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"/> + <xsl:param name="thenews"/> + <xsl:param name="summary"/> + <xsl:param name="link"/> <div class="news"> <p class="newshead" lang="en"> @@ -34,45 +78,9 @@ </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> + <xsl:call-template name="news-icon-selector"> + <xsl:with-param name="category" select="$thenews/@category"/> + </xsl:call-template> <div class="newsitem"> <xsl:choose> |