diff options
Diffstat (limited to 'xml/htdocs')
-rw-r--r-- | xml/htdocs/xsl/guide.xsl | 817 |
1 files changed, 370 insertions, 447 deletions
diff --git a/xml/htdocs/xsl/guide.xsl b/xml/htdocs/xsl/guide.xsl index b23e64f6..44d8da52 100644 --- a/xml/htdocs/xsl/guide.xsl +++ b/xml/htdocs/xsl/guide.xsl @@ -23,15 +23,10 @@ <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" /> <!-- When using <pre>, whitespaces should be preserved --> @@ -345,359 +340,320 @@ </xsl:if> </head> -<body style="margin:0px;" bgcolor="#000000"> +<body> <xsl:if test="/mainpage/devmap"> <xsl:attribute name="onload">load()</xsl:attribute> <xsl:attribute name="onunload">GUnload()</xsl:attribute> </xsl:if> -<table border="0" width="100%" cellspacing="0" cellpadding="0"> - <xsl:variable name="www"><xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if></xsl:variable> - <tr> - <td valign="top" height="125" width="1%" bgcolor="#45347b"> - <a href="{concat($www,'/')}"><img border="0" src="{concat($ROOT,'images/gtop-www.jpg')}" alt="Gentoo Logo"/></a> - </td> - <!-- Top bar menu --> - <td valign="bottom" align="left" bgcolor="#000000" colspan="2" lang="en"> - <p class="menu"> - <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='Y']"/> +<div class="page"> + <!-- NOTE(antarus): The way CSS 'block' layout appears to work as follows: + + "In a block formatting context, boxes are laid out one after the other, + vertically, beginning at the top of a containing block. The vertical + distance between two sibling boxes is determined by the 'margin' properties. + Vertical margins between adjacent block boxes in a block formatting context + collapse." + + This means that 'header-logo' is the container block for the entire header + (including menu). To get the menu to render to the right we set its display + to inline-block. Thus our main page really has 3 'horizontal' blocks... + + HEADER-BLOCK -> gentoo-logo and topmenu + CONTENT-BLOCK -> sidebar-menu, content, adbar + FOOTER-BLOCK -> copywrite notice + --> + <div class="header-block"> + <xsl:variable name="www"><xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if></xsl:variable> + <a id="gentoo-logo" href="{concat($www,'/')}"><img src="{concat($ROOT,'images/gtop-www.jpg')}" alt="Gentoo Logo"/></a> + <div class="header-menu"> + <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='Y']"/> + </div> + </div> + <div class="content-block"> + <div class="sidebar-menu"> + <img id="gentoo-saucer" src="{concat($ROOT,'images/gridtest.gif')}" alt="Gentoo Spaceship"/> + <p class="altmenu"> + <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='N']"/> </p> - </td> - </tr> - <tr> - <td valign="top" align="right" width="1%" bgcolor="#dddaec"> - <table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td height="1%" valign="top" align="right"> - <img src="{concat($ROOT,'images/gridtest.gif')}" alt="Gentoo Spaceship"/> - </td> - </tr> - <tr> - <td height="99%" valign="top" align="left"> - <!--info goes here--> - <table cellspacing="0" cellpadding="5" border="0"> - <tr> - <td valign="top" class="leftmenu" lang="en"> - <p class="altmenu"> - <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='N']"/> - </p> - <br/><br/> - </td> - </tr> - </table> - </td> - </tr> - </table> - </td> - <!-- Content below top menu and between left menu and ads --> - <td valign="top" bgcolor="#ffffff"> - <!-- Test for RTL languages --> - <xsl:if test="$RTL='Y'"> - <xsl:attribute name="dir">RTL</xsl:attribute> - </xsl:if> - <xsl:choose> - <xsl:when test="/mainpage/newsitems"> - <p class="news"> - <img class="newsicon" src="{concat($ROOT,'images/gentoo-new.gif')}" alt="Gentoo logo"/> - <span class="newsitem" lang="en">We produce Gentoo Linux, a special flavor of Linux that - can be automatically optimized and customized for just - about any application or need. Extreme performance, - configurability and a top-notch user and developer - community are all hallmarks of the Gentoo experience. - To learn more, read our <b><a href="/main/en/about.xml">about - page</a></b>.</span> - </p> - - <xsl:variable name="GLSAs" select="document('/dyn/glsa-index2.xml')"/> - <xsl:variable name="new-packages" select="document('/dyn/new-packages.xml')"/> - <xsl:variable name="planet" select="document('/dyn/planet.xml')"/> - - <xsl:variable name="all-news" xmlns=""> - <news> - <!-- News from news-index.xml, i.e. list of files under /news/ --> - <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<=$newsitemcount]/text()"> - <xsl:variable name="tlink" select="."/> - <newsitem date="{document($tlink)/news/date}" link="{$tlink}"/> - </xsl:for-each> + </div> + <!-- Test for RTL languages --> + <xsl:if test="$RTL='Y'"> + <xsl:attribute name="dir">RTL</xsl:attribute> + </xsl:if> + <xsl:choose> + <xsl:when test="/mainpage/newsitems"> + <div id="news-block"> + <p class="news"> + <img class="newsicon" src="{concat($ROOT,'images/gentoo-new.gif')}" alt="Gentoo logo"/> + <span class="newsitem" lang="en">We produce Gentoo Linux, a special flavor of Linux that + can be automatically optimized and customized for just + about any application or need. Extreme performance, + configurability and a top-notch user and developer + community are all hallmarks of the Gentoo experience. + to learn more, read our <b><a href="/main/en/about.xml">about page</a></b>. + </span> + </p> + <xsl:variable name="GLSAs" select="document('/dyn/glsa-index2.xml')"/> + <xsl:variable name="new-packages" select="document('/dyn/new-packages.xml')"/> + <xsl:variable name="planet" select="document('/dyn/planet.xml')"/> + + <xsl:variable name="all-news" xmlns=""> + <news> + <!-- News from news-index.xml, i.e. list of files under /news/ --> + <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()<=$newsitemcount]/text()"> + <xsl:variable name="tlink" select="."/> + <newsitem date="{document($tlink)/news/date}" link="{$tlink}"/> + </xsl:for-each> + + <!-- GLSAs from my own glsa-index.xml, i.e. not Gentoo's --> + <xsl:for-each select="$GLSAs//glsa"> + <!-- <xsl:sort select="date" order="descending"/> Can't sort on English dates, they should be sorted in the source file --> + <xsl:if test="position() <=$newsitemcount"> + <!-- convert bloody dates like 'July 29, 2006: 02' to YYYY-MM-DD --> + <xsl:variable name="yydate"> + <xsl:choose> + <xsl:when test="string-length(substring(date,1,10))=10 and substring(date,5,1)='-' and substring(date,8,1)='-' and contains('|01|02|03|04|05|06|07|08|09|10|11|12|',concat('|',substring(date,6,2),'|'))"> + <xsl:value-of select="substring(date,1,10)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="substring(substring-after(substring-after(date,' '),' '),1,4)"/> + <xsl:text>-</xsl:text> + <xsl:choose> + <xsl:when test="substring-before(date,' ')='January'">01</xsl:when> + <xsl:when test="substring-before(date,' ')='February'">02</xsl:when> + <xsl:when test="substring-before(date,' ')='March'">03</xsl:when> + <xsl:when test="substring-before(date,' ')='April'">04</xsl:when> + <xsl:when test="substring-before(date,' ')='May'">05</xsl:when> + <xsl:when test="substring-before(date,' ')='June'">06</xsl:when> + <xsl:when test="substring-before(date,' ')='July'">07</xsl:when> + <xsl:when test="substring-before(date,' ')='August'">08</xsl:when> + <xsl:when test="substring-before(date,' ')='September'">09</xsl:when> + <xsl:when test="substring-before(date,' ')='October'">10</xsl:when> + <xsl:when test="substring-before(date,' ')='November'">11</xsl:when> + <xsl:when test="substring-before(date,' ')='December'">12</xsl:when> + <xsl:otherwise>00</xsl:otherwise> + </xsl:choose> + <xsl:text>-</xsl:text> + <xsl:value-of select="substring-before(substring-after(date,' '),',')"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + <xsl:if test="func:is-date($yydate)='YES'"> + <newsitem date="{$yydate}" glsaid="{@id}"/> + </xsl:if> + </xsl:if> + </xsl:for-each> - <!-- GLSAs from my own glsa-index.xml, i.e. not Gentoo's --> - <xsl:for-each select="$GLSAs//glsa"> - <!-- <xsl:sort select="date" order="descending"/> Can't sort on English dates, they should be sorted in the source file --> - <xsl:if test="position() <=$newsitemcount"> - <!-- convert bloody dates like 'July 29, 2006: 02' to YYYY-MM-DD --> - <xsl:variable name="yydate"> + <!-- New packages from packages.gentoo.org/feed/newpackage--> + <xsl:if test="$new-packages//feed:entry/feed:updated"> + <newsitem date="{substring($new-packages//feed:entry[1]/feed:updated,1,10)}" package="{generate-id($new-packages//feed:entry[1])}"/> + </xsl:if> + + <!-- Latest posts on planet.g.o from planet.gentoo.org/rss20.xml --> + <xsl:for-each select="$planet/rss/channel/item"> + <xsl:variable name="pubDate" select="substring(pubDate,1,16)"/> + <xsl:if test="count(preceding-sibling::item[substring(pubDate,1,16)=$pubDate])=0"> + <xsl:variable name="postdate"> + <xsl:value-of select="substring(substring-after(substring-after(substring-after(pubDate,' '),' '), ' '),1,4)"/> <xsl:choose> - <xsl:when test="string-length(substring(date,1,10))=10 and substring(date,5,1)='-' and substring(date,8,1)='-' and contains('|01|02|03|04|05|06|07|08|09|10|11|12|',concat('|',substring(date,6,2),'|'))"> - <xsl:value-of select="substring(date,1,10)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="substring(substring-after(substring-after(date,' '),' '),1,4)"/> - <xsl:text>-</xsl:text> - <xsl:choose> - <xsl:when test="substring-before(date,' ')='January'">01</xsl:when> - <xsl:when test="substring-before(date,' ')='February'">02</xsl:when> - <xsl:when test="substring-before(date,' ')='March'">03</xsl:when> - <xsl:when test="substring-before(date,' ')='April'">04</xsl:when> - <xsl:when test="substring-before(date,' ')='May'">05</xsl:when> - <xsl:when test="substring-before(date,' ')='June'">06</xsl:when> - <xsl:when test="substring-before(date,' ')='July'">07</xsl:when> - <xsl:when test="substring-before(date,' ')='August'">08</xsl:when> - <xsl:when test="substring-before(date,' ')='September'">09</xsl:when> - <xsl:when test="substring-before(date,' ')='October'">10</xsl:when> - <xsl:when test="substring-before(date,' ')='November'">11</xsl:when> - <xsl:when test="substring-before(date,' ')='December'">12</xsl:when> - <xsl:otherwise>00</xsl:otherwise> - </xsl:choose> - <xsl:text>-</xsl:text> - <xsl:value-of select="substring-before(substring-after(date,' '),',')"/> - </xsl:otherwise> + <xsl:when test="'Jan' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-01-</xsl:when> + <xsl:when test="'Feb' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-02-</xsl:when> + <xsl:when test="'Mar' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-03-</xsl:when> + <xsl:when test="'Apr' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-04-</xsl:when> + <xsl:when test="'May' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-05-</xsl:when> + <xsl:when test="'Jun' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-06-</xsl:when> + <xsl:when test="'Jul' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-07-</xsl:when> + <xsl:when test="'Aug' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-08-</xsl:when> + <xsl:when test="'Sep' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-09-</xsl:when> + <xsl:when test="'Oct' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-10-</xsl:when> + <xsl:when test="'Nov' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-11-</xsl:when> + <xsl:when test="'Dec' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-12-</xsl:when> + <xsl:otherwise>-00-</xsl:otherwise> </xsl:choose> + <xsl:value-of select="format-number(number(substring-before(substring-after(pubDate,' '),' ')),'00')"/> </xsl:variable> - <xsl:if test="func:is-date($yydate)='YES'"> - <newsitem date="{$yydate}" glsaid="{@id}"/> + <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> + <newsitem date="{$postdate}" planet="{$pubDate}"/> </xsl:if> </xsl:if> - </xsl:for-each> + </xsl:for-each> + </news> + </xsl:variable> - <!-- New packages from packages.gentoo.org/feed/newpackage--> - <xsl:if test="$new-packages//feed:entry/feed:updated"> - <newsitem date="{substring($new-packages//feed:entry[1]/feed:updated,1,10)}" package="{generate-id($new-packages//feed:entry[1])}"/> - </xsl:if> + <xsl:variable name="all-news1" xmlns=""> + <news> + <xsl:for-each select="exslt:node-set($all-news)/news/newsitem"> + <xsl:sort select="@date" order="descending"/> + <xsl:copy-of select="."/> + </xsl:for-each> + </news> + </xsl:variable> - <!-- Latest posts on planet.g.o from planet.gentoo.org/rss20.xml --> - <xsl:for-each select="$planet/rss/channel/item"> - <xsl:variable name="pubDate" select="substring(pubDate,1,16)"/> - <xsl:if test="count(preceding-sibling::item[substring(pubDate,1,16)=$pubDate])=0"> - <xsl:variable name="postdate"> - <xsl:value-of select="substring(substring-after(substring-after(substring-after(pubDate,' '),' '), ' '),1,4)"/> + <xsl:variable name="all-news0" xmlns=""> + <news> + <xsl:for-each select="exslt:node-set($all-news1)/news/newsitem"> <xsl:choose> - <xsl:when test="'Jan' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-01-</xsl:when> - <xsl:when test="'Feb' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-02-</xsl:when> - <xsl:when test="'Mar' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-03-</xsl:when> - <xsl:when test="'Apr' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-04-</xsl:when> - <xsl:when test="'May' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-05-</xsl:when> - <xsl:when test="'Jun' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-06-</xsl:when> - <xsl:when test="'Jul' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-07-</xsl:when> - <xsl:when test="'Aug' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-08-</xsl:when> - <xsl:when test="'Sep' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-09-</xsl:when> - <xsl:when test="'Oct' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-10-</xsl:when> - <xsl:when test="'Nov' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-11-</xsl:when> - <xsl:when test="'Dec' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-12-</xsl:when> - <xsl:otherwise>-00-</xsl:otherwise> + <xsl:when test="@link or @package or @glsaid"> + <xsl:copy-of select="."/> + </xsl:when> + + <xsl:when test="@planet"> + <xsl:if test="not(preceding-sibling::newsitem[1]/@planet)"> + <!-- group consecutive blog days into a single item --> + <newsitem date="{@date}" blog='1'> + <xsl:copy-of select="."/> + <xsl:apply-templates select="following-sibling::*[position()=1 and @planet]" mode="moreblogs"/> + </newsitem> + </xsl:if> + </xsl:when> </xsl:choose> - <xsl:value-of select="format-number(number(substring-before(substring-after(pubDate,' '),' ')),'00')"/> - </xsl:variable> - <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> - <newsitem date="{$postdate}" planet="{$pubDate}"/> - </xsl:if> - </xsl:if> - </xsl:for-each> - </news> - </xsl:variable> + </xsl:for-each> + </news> + </xsl:variable> + + <!-- Display news items --> - <xsl:variable name="all-news1" xmlns=""> - <news> - <xsl:for-each select="exslt:node-set($all-news)/news/newsitem"> + <xsl:for-each select="exslt:node-set($all-news0)/news/newsitem"> <xsl:sort select="@date" order="descending"/> - <xsl:copy-of select="."/> - </xsl:for-each> - </news> - </xsl:variable> - <xsl:variable name="all-news0" xmlns=""> - <news> - <xsl:for-each select="exslt:node-set($all-news1)/news/newsitem"> - <xsl:choose> - <xsl:when test="@link or @package or @glsaid"> - <xsl:copy-of select="."/> - </xsl:when> + <!-- Build a newsitem that can be passed to the template that displays a newsitem --> + <xsl:variable name="thenews" xmlns=""> + <news> + <xsl:choose> + <xsl:when test="@link"> + <xsl:variable name="newsitem" select="document(@link)/news"/> + <xsl:attribute name="category"><xsl:value-of select="$newsitem/@category"/></xsl:attribute> + <title><xsl:copy-of select="$newsitem/title"/></title> + <date><xsl:value-of select="@date"/></date> + <!-- + <xsl:variable name="poster"> + <xsl:call-template name="smart-mail"> + <xsl:with-param name="mail" select="$newsitem/poster"/> + </xsl:call-template> + </xsl:variable> + <poster><xsl:copy-of select="$poster"/></poster> + --> + <poster><xsl:value-of select="$newsitem/poster"/></poster> + <xsl:choose> + <xsl:when test="$newsitem/summary"><summary><xsl:copy-of select="$newsitem/summary"/></summary></xsl:when> + <xsl:otherwise><xsl:copy-of select="$newsitem/body"/></xsl:otherwise> + </xsl:choose> + </xsl:when> - <xsl:when test="@planet"> - <xsl:if test="not(preceding-sibling::newsitem[1]/@planet)"> - <!-- group consecutive blog days into a single item --> - <newsitem date="{@date}" blog='1'> - <xsl:copy-of select="."/> - <xsl:apply-templates select="following-sibling::*[position()=1 and @planet]" mode="moreblogs"/> - </newsitem> - </xsl:if> - </xsl:when> - </xsl:choose> - </xsl:for-each> - </news> - </xsl:variable> + <xsl:when test="@blog"> + <xsl:attribute name="category">planet</xsl:attribute> + <title>Blog posts</title> + <date><xsl:value-of select="@date"/></date> + <xsl:if test="@date != ./newsitem[position()=last()]/@date"> + <until><xsl:value-of select="./newsitem[position()=last()]/@date"/></until> + </xsl:if> + <poster>planet.gentoo.org</poster> + <xsl:variable name="blogentries" xmlns=""> + <xsl:for-each select="./newsitem"> + <xsl:variable name="pubDate" select="@planet"/> + <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> + <xsl:choose> + <xsl:when test="contains(title,': ')"> + <xsl:value-of select="substring-before(title,': ')"/> + <uri link="{link}"><xsl:value-of select="substring-after(title,': ')"/></uri> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="title"/> + <uri link="{link}">. . .</uri> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> + </xsl:for-each> + </xsl:variable> - <!-- Display news items --> - - <xsl:for-each select="exslt:node-set($all-news0)/news/newsitem"> - <xsl:sort select="@date" order="descending"/> - - <!-- Build a newsitem that can be passed to the template that displays a newsitem --> - <xsl:variable name="thenews" xmlns=""> - <news> - <xsl:choose> - <xsl:when test="@link"> - <xsl:variable name="newsitem" select="document(@link)/news"/> - <xsl:attribute name="category"><xsl:value-of select="$newsitem/@category"/></xsl:attribute> - <title><xsl:copy-of select="$newsitem/title"/></title> - <date><xsl:value-of select="@date"/></date> - <!-- - <xsl:variable name="poster"> - <xsl:call-template name="smart-mail"> - <xsl:with-param name="mail" select="$newsitem/poster"/> - </xsl:call-template> - </xsl:variable> - <poster><xsl:copy-of select="$poster"/></poster> - --> - <poster><xsl:value-of select="$newsitem/poster"/></poster> - <xsl:choose> - <xsl:when test="$newsitem/summary"><summary><xsl:copy-of select="$newsitem/summary"/></summary></xsl:when> - <xsl:otherwise><body><xsl:copy-of select="$newsitem/body"/></body></xsl:otherwise> - </xsl:choose> - </xsl:when> + <xsl:variable name="sortedblogentries" xmlns=""> + <xsl:for-each select="exslt:node-set($blogentries)/tr"> + <xsl:sort select="ti[1]"/> + <xsl:copy-of select="ti"/> + </xsl:for-each> + </xsl:variable> - <xsl:when test="@blog"> - <xsl:attribute name="category">planet</xsl:attribute> - <title>Blog posts</title> - <date><xsl:value-of select="@date"/></date> - <xsl:if test="@date != ./newsitem[position()=last()]/@date"> - <until><xsl:value-of select="./newsitem[position()=last()]/@date"/></until> - </xsl:if> - <poster>planet.gentoo.org</poster> - <body><table> - <xsl:variable name="blogentries" xmlns=""> - <xsl:for-each select="./newsitem"> - <xsl:variable name="pubDate" select="@planet"/> - <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]"> - <tr> + <xsl:for-each select="exslt:node-set($sortedblogentries)/tr"> + <xsl:variable name="blogposter" select="ti[1]"/> <xsl:choose> - <xsl:when test="contains(title,': ')"> - <ti><xsl:value-of select="substring-before(title,': ')"/></ti> - <ti><uri link="{link}"><xsl:value-of select="substring-after(title,': ')"/></uri></ti> - </xsl:when> - <xsl:otherwise> - <ti><xsl:value-of select="title"/></ti> - <ti><uri link="{link}">. . .</uri></ti> - </xsl:otherwise> + <xsl:when test="preceding-sibling::tr[1]/ti[1]/text()=$blogposter"> + </xsl:when> + <xsl:when test="following-sibling::tr[1]/ti[1]/text()=$blogposter"> + <!--<ti rowspan="{1+count(following-sibling::tr[ti[1]/text()=$blogposter])}"><xsl:value-of select="ti[1]"/> --> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="ti[1]"/> + </xsl:otherwise> </xsl:choose> - </tr> - </xsl:for-each> + <xsl:copy-of select="ti[2]"/> </xsl:for-each> - </xsl:variable> + </xsl:when> - <xsl:variable name="sortedblogentries" xmlns=""> - <xsl:for-each select="exslt:node-set($blogentries)/tr"> - <xsl:sort select="ti[1]"/> - <tr> - <xsl:copy-of select="ti"/> - </tr> - </xsl:for-each> - </xsl:variable> + <xsl:when test="@glsaid"> + <xsl:attribute name="category">plans</xsl:attribute> + <xsl:variable name="glsaid" select="@glsaid"/> + <title>GLSA <xsl:value-of select="$glsaid"/>: <xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/package[1]"/><xsl:if test="count($GLSAs//glsa[@id=$glsaid]/package)>1"> (and <xsl:value-of select="count($GLSAs//glsa[@id=$glsaid]/package)-1"/> more package<xsl:if test="count($GLSAs//glsa[@id=$glsaid]/package)>2">s</xsl:if>)</xsl:if></title> + <date><xsl:value-of select="@date"/></date> + <poster>Gentoo Security Team</poster> + <p><b><xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/title"/></b><br/><xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/synopsis/text()"/><br/>See <uri link="{$GLSAs//glsa[@id=$glsaid]/link}">GLSA <xsl:value-of select="$glsaid"/></uri> for more information.</p> + </xsl:when> - <xsl:for-each select="exslt:node-set($sortedblogentries)/tr"> - <xsl:variable name="blogposter" select="ti[1]"/> - <tr> - <xsl:choose> - <xsl:when test="preceding-sibling::tr[1]/ti[1]/text()=$blogposter"> - </xsl:when> - <xsl:when test="following-sibling::tr[1]/ti[1]/text()=$blogposter"> - <ti rowspan="{1+count(following-sibling::tr[ti[1]/text()=$blogposter])}"><xsl:value-of select="ti[1]"/></ti> - </xsl:when> - <xsl:otherwise> - <xsl:copy-of select="ti[1]"/> - </xsl:otherwise> - </xsl:choose> - <xsl:copy-of select="ti[2]"/> - </tr> + <xsl:when test="@package"> + <xsl:attribute name="category">moo</xsl:attribute> + <xsl:variable name="pid" select="@package"/> + <title>New Packages</title> + <date><xsl:value-of select="@date"/></date> + <poster>packages.gentoo.org</poster> + <xsl:for-each select="$new-packages//feed:entry"> + <uri link="{feed:id}"><xsl:value-of select="feed:title/feed:div/feed:span[1]"/></uri> + <xsl:value-of select="feed:title/feed:div/feed:span[2]"/> </xsl:for-each> - </table></body> - </xsl:when> - - <xsl:when test="@glsaid"> - <xsl:attribute name="category">plans</xsl:attribute> - <xsl:variable name="glsaid" select="@glsaid"/> - <title>GLSA <xsl:value-of select="$glsaid"/>: <xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/package[1]"/><xsl:if test="count($GLSAs//glsa[@id=$glsaid]/package)>1"> (and <xsl:value-of select="count($GLSAs//glsa[@id=$glsaid]/package)-1"/> more package<xsl:if test="count($GLSAs//glsa[@id=$glsaid]/package)>2">s</xsl:if>)</xsl:if></title> - <date><xsl:value-of select="@date"/></date> - <poster>Gentoo Security Team</poster> - <body><p><b><xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/title"/></b><br/><xsl:value-of select="$GLSAs//glsa[@id=$glsaid]/synopsis/text()"/><br/>See <uri link="{$GLSAs//glsa[@id=$glsaid]/link}">GLSA <xsl:value-of select="$glsaid"/></uri> for more information.</p></body> - </xsl:when> - - <xsl:when test="@package"> - <xsl:attribute name="category">moo</xsl:attribute> - <xsl:variable name="pid" select="@package"/> - <title>New Packages</title> - <date><xsl:value-of select="@date"/></date> - <poster>packages.gentoo.org</poster> - <body><table> - <xsl:for-each select="$new-packages//feed:entry"> - <tr> - <ti><uri link="{feed:id}"><xsl:value-of select="feed:title/feed:div/feed:span[1]"/></uri></ti> - <ti><xsl:value-of select="feed:title/feed:div/feed:span[2]"/></ti> - </tr> - </xsl:for-each> - </table></body> - </xsl:when> - </xsl:choose> - </news> - </xsl:variable> + </xsl:when> + </xsl:choose> + </news> + </xsl:variable> + <xsl:call-template name="newscontent"> + <xsl:with-param name="thenews" select="exslt:node-set($thenews)/news"/> + <xsl:with-param name="summary" select="'yes'"/> + <xsl:with-param name="link" select="@link"/> + </xsl:call-template> + </xsl:for-each> + <!-- Links to older news below news items --> + <p class="newshead" lang="en"> + <b>Older News</b> + </p> + <ul> + <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()>$newsitemcount][position()<20]/text()"> + <xsl:variable name="newsuri" select="."/> + <li><b><a class="altlink" href="{$newsuri}"><xsl:value-of select="document(.)/news/title"/></a></b></li> + </xsl:for-each> + </ul> + </div> <!-- End news block --> + </xsl:when> <!-- test == /mainpage/newsitems --> + <xsl:when test="/news"> <xsl:call-template name="newscontent"> - <xsl:with-param name="thenews" select="exslt:node-set($thenews)/news"/> - <xsl:with-param name="summary" select="'yes'"/> - <xsl:with-param name="link" select="@link"/> + <xsl:with-param name="thenews" select="/news"/> + <xsl:with-param name="summary" select="no"/> </xsl:call-template> - </xsl:for-each> - - - - - <!-- Links to older news below news items --> - <div class="news"> - <p class="newshead" lang="en"> - <b>Older News</b> - </p> - <ul> - <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()>$newsitemcount][position()<20]/text()"> - <xsl:variable name="newsuri" select="."/> - <li><b><a class="altlink" href="{$newsuri}"><xsl:value-of select="document(.)/news/title"/></a></b></li> - </xsl:for-each> - </ul> - </div> - </xsl:when> - - <xsl:when test="/news"> - <xsl:call-template name="newscontent"> - <xsl:with-param name="thenews" select="/news"/> - <xsl:with-param name="summary" select="no"/> - </xsl:call-template> - </xsl:when> - </xsl:choose> - <br/> - <table border="0" class="content"> - <tr> - <td> - <xsl:apply-templates select="chapter|devmap"/> - </td> - </tr> - </table> - <br/> - <xsl:if test="/mainpage/license"> - <xsl:apply-templates select="license" /> - </xsl:if> - <br/> - <!--content end--> - </td> - <td width="1%" bgcolor="#dddaec" valign="top"> + </xsl:when> + </xsl:choose> + <xsl:apply-templates select="chapter|devmap"/> + <xsl:if test="/mainpage/license"> + <xsl:apply-templates select="license" /> + </xsl:if> + <div class="adbar"> <xsl:call-template name="rhcol"/> - </td> - </tr> - <tr lang="en"> - <td align="right" class="infohead" colspan="3"> - <xsl:call-template name="copyright-footer"/> - </td> - </tr> -</table> - + </div> + </div> <!-- End of content-block --> + <div class="footer-block"> + <div class="infohead"> + <xsl:call-template name="copyright-footer"/> + </div> + </div> <!-- end footer-block --> +</div> <!-- page --> </body> </html> </xsl:template> @@ -1762,100 +1718,65 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:choose> </xsl:variable> - <table border="0" cellspacing="4px" cellpadding="4px"> + <div> <!-- Add a "printer-friendly" --> <xsl:if test="/book or /guide"> - <tr> - <td class="topsep" align="center"> - <p class="altmenu"> - <xsl:variable name="PrintTip"><xsl:value-of select="func:gettext('PrintTip')"/></xsl:variable> - <xsl:variable name="href"> - <xsl:choose> - <xsl:when test="/book and $full != 0"> - <xsl:value-of select="concat($link, '?full=1&style=printable')"/> - </xsl:when> - <xsl:when test="/book"> - <xsl:value-of select="concat($link, '?style=printable')"/> - <xsl:if test="$part != '0'">&part=<xsl:value-of select="$part"/></xsl:if> - <xsl:if test="$chap != '0'">&chap=<xsl:value-of select="$chap"/></xsl:if> - </xsl:when> - <xsl:when test="/guide"> - <xsl:value-of select="concat($link, '?style=printable')"/> - </xsl:when> - </xsl:choose> - </xsl:variable> - <a title="{$PrintTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('Print')"/></a> - </p> - </td> - </tr> + <p class="altmenu"> + <xsl:variable name="PrintTip"><xsl:value-of select="func:gettext('PrintTip')"/></xsl:variable> + <xsl:variable name="href"> + <xsl:choose> + <xsl:when test="/book and $full != 0"> + <xsl:value-of select="concat($link, '?full=1&style=printable')"/> + </xsl:when> + <xsl:when test="/book"> + <xsl:value-of select="concat($link, '?style=printable')"/> + <xsl:if test="$part != '0'">&part=<xsl:value-of select="$part"/></xsl:if> + <xsl:if test="$chap != '0'">&chap=<xsl:value-of select="$chap"/></xsl:if> + </xsl:when> + <xsl:when test="/guide"> + <xsl:value-of select="concat($link, '?style=printable')"/> + </xsl:when> + </xsl:choose> + </xsl:variable> + <a title="{$PrintTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('Print')"/></a> + </p> </xsl:if> <!-- Add link to full handbook --> <xsl:if test="$TTOP='book' and $full=0"> - <tr> - <td class="topsep" align="center"> - <p class="altmenu"> - <xsl:variable name="ShowFullHBTip"><xsl:value-of select="func:gettext('ShowFullHBTip')"/></xsl:variable> - <xsl:variable name="href"> - <xsl:choose> - <xsl:when test="$part != 0 and $chap != 0"> - <xsl:value-of select="concat($link, '?full=1#book_part',$part,'_chap',$chap)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="concat($link, '?full=1')"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - <a title="{$ShowFullHBTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('ShowFullHB')"/></a> - </p> - </td> - </tr> - </xsl:if> - <xsl:if test="/book/date or /guide/date or /sections/date or /mainpage/date or /news/date"> - <tr> - <td class="topsep"> - <!-- Test for RTL languages --> + <p class="altmenu"> + <xsl:variable name="ShowFullHBTip"><xsl:value-of select="func:gettext('ShowFullHBTip')"/></xsl:variable> + <xsl:variable name="href"> <xsl:choose> - <xsl:when test="$RTL='Y'"> - <xsl:attribute name="dir">RTL</xsl:attribute> + <xsl:when test="$part != 0 and $chap != 0"> + <xsl:value-of select="concat($link, '?full=1#book_part',$part,'_chap',$chap)"/> </xsl:when> <xsl:otherwise> - <xsl:attribute name="align">center</xsl:attribute> + <xsl:value-of select="concat($link, '?full=1')"/> </xsl:otherwise> </xsl:choose> + </xsl:variable> + <a title="{$ShowFullHBTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('ShowFullHB')"/></a> + </p> + </xsl:if> + <xsl:if test="/book/date or /guide/date or /sections/date or /mainpage/date or /news/date"> + <!-- Test for RTL languages --> + <xsl:choose> + <xsl:when test="$RTL='Y'"> + <xsl:attribute name="dir">RTL</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="align">center</xsl:attribute> + </xsl:otherwise> + </xsl:choose> - <p class="alttext"> - <xsl:call-template name="contentdate"/> - </p> - </td> - </tr> + <p class="alttext"> + <xsl:call-template name="contentdate"/> + </p> <xsl:if test="/book/date or /guide/date or /sections/date or /mainpage/date"> <xsl:variable name="outdated"> <xsl:call-template name="outdated-translation"/> </xsl:variable> <xsl:if test="string-length($outdated) > 1"> - <tr> - <td class="topsep"> - <!-- Test for RTL languages --> - <xsl:choose> - <xsl:when test="$RTL='Y'"> - <xsl:attribute name="dir">RTL</xsl:attribute> - </xsl:when> - <xsl:otherwise> - <xsl:attribute name="align">left</xsl:attribute> - </xsl:otherwise> - </xsl:choose> - - <p class="alttext"> - <b><xsl:copy-of select="$outdated"/></b> - </p> - </td> - </tr> - </xsl:if> - </xsl:if> - </xsl:if> - <xsl:if test="abstract or document(include/@href)/*[1]/abstract"> - <tr> - <td class="topsep"> <!-- Test for RTL languages --> <xsl:choose> <xsl:when test="$RTL='Y'"> @@ -1867,51 +1788,56 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found </xsl:choose> <p class="alttext"> - <!-- Abstract (summary) of the document --> - <b><xsl:value-of select="func:gettext('Summary')"/>: </b> - <xsl:choose> - <xsl:when test="abstract"> - <xsl:value-of select="abstract" /> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="document(include/@href)/*[1]/abstract" /> - </xsl:otherwise> - </xsl:choose> + <b><xsl:copy-of select="$outdated"/></b> </p> - </td> - </tr> + </xsl:if> + </xsl:if> + </xsl:if> + <xsl:if test="abstract or document(include/@href)/*[1]/abstract"> + <!-- Test for RTL languages --> + <xsl:choose> + <xsl:when test="$RTL='Y'"> + <xsl:attribute name="dir">RTL</xsl:attribute> + </xsl:when> + <xsl:otherwise> + <xsl:attribute name="align">left</xsl:attribute> + </xsl:otherwise> + </xsl:choose> + + <p class="alttext"> + <!-- Abstract (summary) of the document --> + <b><xsl:value-of select="func:gettext('Summary')"/>: </b> + <xsl:choose> + <xsl:when test="abstract"> + <xsl:value-of select="abstract" /> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="document(include/@href)/*[1]/abstract" /> + </xsl:otherwise> + </xsl:choose> + </p> </xsl:if> <xsl:if test="/book/author or /guide/author"> - <tr> - <td align="left" class="topsep"> - <p class="alttext"> - <!-- Authors --> - <xsl:apply-templates select="/guide/author|/book/author"/> - </p> - </td> - </tr> + <p class="alttext"> + <!-- Authors --> + <xsl:apply-templates select="/guide/author|/book/author"/> + </p> </xsl:if> + <p class="alttext"> + <b>Donate</b> to support our development efforts. + </p> - <tr lang="en"> - <td align="center" class="topsep"> - <p class="alttext"> - <b>Donate</b> to support our development efforts. - </p> - - <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> - <input type="hidden" name="cmd" value="_xclick"/> - <input type="hidden" name="business" value="paypal@gentoo.org"/> - <input type="hidden" name="item_name" value="Gentoo Linux Support"/> - <input type="hidden" name="item_number" value="1000"/> - <input type="hidden" name="image_url" value="/images/paypal.png"/> - <input type="hidden" name="no_shipping" value="1"/> - <input type="hidden" name="return" value="http://www.gentoo.org"/> - <input type="hidden" name="cancel_return" value="http://www.gentoo.org"/> - - <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> - </form> - </td> - </tr> + <form action="https://www.paypal.com/cgi-bin/webscr" method="post"> + <input type="hidden" name="cmd" value="_xclick"/> + <input type="hidden" name="business" value="paypal@gentoo.org"/> + <input type="hidden" name="item_name" value="Gentoo Linux Support"/> + <input type="hidden" name="item_number" value="1000"/> + <input type="hidden" name="image_url" value="/images/paypal.png"/> + <input type="hidden" name="no_shipping" value="1"/> + <input type="hidden" name="return" value="http://www.gentoo.org"/> + <input type="hidden" name="cancel_return" value="http://www.gentoo.org"/> + <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/> + </form> <xsl:choose> <xsl:when test="$ads='ads2'"> <xsl:call-template name="ads2"> @@ -1923,11 +1849,8 @@ Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Found <xsl:with-param name="images" select="$images"/> </xsl:call-template> </xsl:otherwise> - <tr> - <td align="center" class="topsep"/> - </tr> </xsl:choose> - </table> + </div> </xsl:template> <xsl:template name="newscontent"> |