diff options
author | Alec Warner <antarus@scriptkitty.com> | 2011-03-03 14:23:58 -0800 |
---|---|---|
committer | Alec Warner <antarus@scriptkitty.com> | 2011-03-03 14:23:58 -0800 |
commit | ee4217d87c00157c4010b1eb05d6ce552efc6ac2 (patch) | |
tree | a6f0752660ae7b48aead0fe9164e8d10a826a91c | |
parent | Add indexes, robots.txt favicon, and devmap stuff. (diff) | |
parent | Split the function that determines what image we are using into its own template (diff) | |
download | www-redesign-ee4217d87c00157c4010b1eb05d6ce552efc6ac2.tar.gz www-redesign-ee4217d87c00157c4010b1eb05d6ce552efc6ac2.tar.bz2 www-redesign-ee4217d87c00157c4010b1eb05d6ce552efc6ac2.zip |
Merge branch 'master' of /home/antarus/code/conversion
-rw-r--r-- | xml/htdocs/xsl/disclaimer.xsl | 38 | ||||
-rw-r--r-- | xml/htdocs/xsl/guide.xsl | 123 | ||||
-rw-r--r-- | xml/htdocs/xsl/newscontent.xsl | 99 |
3 files changed, 143 insertions, 117 deletions
diff --git a/xml/htdocs/xsl/disclaimer.xsl b/xml/htdocs/xsl/disclaimer.xsl new file mode 100644 index 00000000..e77dd949 --- /dev/null +++ b/xml/htdocs/xsl/disclaimer.xsl @@ -0,0 +1,38 @@ +<?xml version="1.0" encoding="UTF-8"?> +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> + + <!-- + call-template show-disclaimer + This prints an obsolete disclaimer on documents that have this field + Typically this is used to note obsolete documents (see @disclaimed='obsolete') + Optionally offer a redirect link to a new page fir @redirect + --> + <xsl:template name="show-disclaimer"> + <!-- Disclaimer stuff --> + <xsl:if test="/*[1][@disclaimer] or /*[1][@redirect]"> + <table class="ncontent" align="center" width="90%" border="2px" cellspacing="0" cellpadding="4px"> + <xsl:if test="/*[1]/@disclaimer='obsolete'"> + <xsl:attribute name="style">margin-top:40px;margin-bottom:30px</xsl:attribute> + </xsl:if> + <tr> + <td bgcolor="#ddddff"> + <p class="note"> + <xsl:if test="/*[1][@disclaimer]"> + <xsl:if test="/*[1]/@disclaimer='obsolete'"> + <xsl:attribute name="style">font-size:1.3em</xsl:attribute> + </xsl:if> + <b><xsl:value-of select="func:gettext('disclaimer')"/>: </b> + <xsl:apply-templates select="func:gettext(/*[1]/@disclaimer)"/> + </xsl:if> + <xsl:if test="/*[1][@redirect]"> + <xsl:apply-templates select="func:gettext('redirect')"> + <xsl:with-param name="paramlink" select="/*[1]/@redirect"/> + </xsl:apply-templates> + </xsl:if> + </p> + </td> + </tr> + </table> + </xsl:if> + </xsl:template> +</xsl:stylesheet> diff --git a/xml/htdocs/xsl/guide.xsl b/xml/htdocs/xsl/guide.xsl index 44d8da52..1e6f3f45 100644 --- a/xml/htdocs/xsl/guide.xsl +++ b/xml/htdocs/xsl/guide.xsl @@ -19,15 +19,17 @@ doctype-system="http://www.w3.org/TR/html4/loose.dtd"/> <!-- Include external stylesheets --> +<xsl:include href="/xsl/ads.xsl" /> <xsl:include href="/xsl/content.xsl" /> +<xsl:include href="/xsl/devmap.xsl" /> +<xsl:include href="/xsl/disclaimer.xsl" /> +<xsl:include href="/xsl/doc-struct.xsl" /> <xsl:include href="/xsl/handbook.xsl" /> -<xsl:include href="/xsl/util.xsl"/> <xsl:include href="/xsl/inserts.xsl" /> <xsl:include href="/xsl/mail.xsl" /> <xsl:include href="/xsl/menu.xsl" /> -<xsl:include href="/xsl/devmap.xsl" /> -<xsl:include href="/xsl/doc-struct.xsl" /> -<xsl:include href="/xsl/ads.xsl" /> +<xsl:include href="/xsl/newscontent.xsl" /> +<xsl:include href="/xsl/util.xsl"/> <!-- When using <pre>, whitespaces should be preserved --> <xsl:preserve-space elements="pre script"/> @@ -64,36 +66,6 @@ <img src="{@src}" alt=""/> </xsl:template> -<xsl:template name="show-disclaimer"> - <!-- Disclaimer stuff --> - <xsl:if test="/*[1][@disclaimer] or /*[1][@redirect]"> - <table class="ncontent" align="center" width="90%" border="2px" cellspacing="0" cellpadding="4px"> - <xsl:if test="/*[1]/@disclaimer='obsolete'"> - <xsl:attribute name="style">margin-top:40px;margin-bottom:30px</xsl:attribute> - </xsl:if> - <tr> - <td bgcolor="#ddddff"> - <p class="note"> - <xsl:if test="/*[1][@disclaimer]"> - <xsl:if test="/*[1]/@disclaimer='obsolete'"> - <xsl:attribute name="style">font-size:1.3em</xsl:attribute> - </xsl:if> - <b><xsl:value-of select="func:gettext('disclaimer')"/>: </b> - <xsl:apply-templates select="func:gettext(/*[1]/@disclaimer)"/> - </xsl:if> - <xsl:if test="/*[1][@redirect]"> - <xsl:apply-templates select="func:gettext('redirect')"> - <xsl:with-param name="paramlink" select="/*[1]/@redirect"/> - </xsl:apply-templates> - </xsl:if> - </p> - </td> - </tr> - </table> - </xsl:if> -</xsl:template> - - <!-- Content of /guide --> <xsl:template name="guidecontent"> <xsl:if test="$style != 'printable'"> @@ -1852,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..b9fd65d8 --- /dev/null +++ b/xml/htdocs/xsl/newscontent.xsl @@ -0,0 +1,99 @@ +<?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? + + 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:call-template name="news-icon-selector"> + <xsl:with-param name="category" select="$thenews/@category"/> + </xsl:call-template> + + <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> |