/[gentoo]/xml/htdocs/xsl/guide.xsl
Gentoo

Contents of /xml/htdocs/xsl/guide.xsl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.246 - (hide annotations) (download) (as text)
Sun Jul 12 15:40:16 2009 UTC (5 years, 5 months ago) by neysx
Branch: MAIN
Changes since 1.245: +38 -3 lines
File MIME type: application/xml
Show content with a file name header and grey left border when a debug.xml
exists in the document root. Should not be used on www.g.o

debug.xml should contain
<debug on="1"/>

Used an external file instead of a parameter so that it is not viewable on www.gentoo.org

1 rajiv 1.6 <?xml version="1.0" encoding="UTF-8"?>
2 neysx 1.123 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
3 neysx 1.129 xmlns:exslt="http://exslt.org/common"
4 neysx 1.131 xmlns:func="http://exslt.org/functions"
5 neysx 1.182 xmlns:dyn="http://exslt.org/dynamic"
6 neysx 1.202 xmlns:str="http://exslt.org/strings"
7 neysx 1.189
8 neysx 1.239 xmlns:feed="http://www.w3.org/2005/Atom"
9    
10 neysx 1.189 xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
11 neysx 1.239 exclude-result-prefixes="opensearch feed"
12 neysx 1.189
13 neysx 1.202 extension-element-prefixes="exslt func dyn str" >
14 swift 1.73
15 neysx 1.189 <xsl:output encoding="UTF-8"
16     method="html"
17     indent="yes"
18     doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
19     doctype-system="http://www.w3.org/TR/html4/loose.dtd"/>
20 neysx 1.146
21 swift 1.73 <!-- Include external stylesheets -->
22 neysx 1.215 <xsl:include href="/xsl/content.xsl" />
23     <xsl:include href="/xsl/handbook.xsl" />
24 neysx 1.240 <xsl:include href="/xsl/util.xsl"/>
25 neysx 1.215 <xsl:include href="/xsl/inserts.xsl" />
26 swift 1.73
27 neysx 1.221 <xsl:include href="/xsl/mail.xsl" />
28    
29 neysx 1.239 <xsl:include href="/xsl/menu.xsl" />
30    
31 neysx 1.215 <xsl:include href="/xsl/devmap.xsl" />
32 neysx 1.205
33 neysx 1.224 <xsl:include href="/xsl/doc-struct.xsl" />
34    
35 neysx 1.241 <xsl:include href="/xsl/ads.xsl" />
36    
37 swift 1.73 <!-- When using <pre>, whitespaces should be preserved -->
38 neysx 1.205 <xsl:preserve-space elements="pre script"/>
39 swift 1.73
40     <!-- Global definition of style parameter -->
41     <xsl:param name="style">0</xsl:param>
42 neysx 1.239 <xsl:param name="newsitemcount">9</xsl:param>
43 swift 1.73
44 neysx 1.163 <!-- Category from metadoc -->
45     <xsl:param name="catid">0</xsl:param>
46    
47 neysx 1.205 <!-- Nick to select on dev map -->
48     <xsl:param name="dev"/>
49    
50 neysx 1.209 <!-- Where is this xsl being run? -->
51     <xsl:param name="httphost">www</xsl:param>
52    
53 neysx 1.240 <xsl:variable name="basename">
54     <xsl:call-template name="filename">
55     <xsl:with-param name="path" select="$link"/>
56     </xsl:call-template>
57     </xsl:variable>
58    
59 neysx 1.246 <!-- Debug mode, when /debug.xml exists, should never be available on www.g.o -->
60     <xsl:variable name="debug">
61     <xsl:if test="document('/debug.xml')/debug/@on='1'">1</xsl:if>
62     </xsl:variable>
63    
64 swift 1.73 <!-- img tag -->
65     <xsl:template match="img">
66 neysx 1.157 <img src="{@src}" alt=""/>
67 swift 1.73 </xsl:template>
68    
69 neysx 1.165 <xsl:template name="show-disclaimer">
70     <!-- Disclaimer stuff -->
71     <xsl:if test="/*[1][@disclaimer] or /*[1][@redirect]">
72 neysx 1.177 <table class="ncontent" align="center" width="90%" border="2px" cellspacing="0" cellpadding="4px">
73     <xsl:if test="/*[1]/@disclaimer='obsolete'">
74     <xsl:attribute name="style">margin-top:40px;margin-bottom:30px</xsl:attribute>
75     </xsl:if>
76 neysx 1.165 <tr>
77     <td bgcolor="#ddddff">
78     <p class="note">
79     <xsl:if test="/*[1][@disclaimer]">
80 neysx 1.177 <xsl:if test="/*[1]/@disclaimer='obsolete'">
81     <xsl:attribute name="style">font-size:1.3em</xsl:attribute>
82     </xsl:if>
83 neysx 1.165 <b><xsl:value-of select="func:gettext('disclaimer')"/>: </b>
84     <xsl:apply-templates select="func:gettext(/*[1]/@disclaimer)"/>
85     </xsl:if>
86     <xsl:if test="/*[1][@redirect]">
87     <xsl:apply-templates select="func:gettext('redirect')">
88     <xsl:with-param name="paramlink" select="/*[1]/@redirect"/>
89     </xsl:apply-templates>
90     </xsl:if>
91     </p>
92     </td>
93     </tr>
94     </table>
95     </xsl:if>
96     </xsl:template>
97    
98    
99 swift 1.73 <!-- Content of /guide -->
100     <xsl:template name="guidecontent">
101 neysx 1.141 <xsl:if test="$style != 'printable'">
102     <br />
103     </xsl:if>
104 neysx 1.165
105 swift 1.118 <h1>
106 swift 1.73 <xsl:choose>
107     <xsl:when test="/guide/subtitle"><xsl:value-of select="/guide/title"/>: <xsl:value-of select="/guide/subtitle"/></xsl:when>
108     <xsl:otherwise><xsl:value-of select="/guide/title"/></xsl:otherwise>
109     </xsl:choose>
110 swift 1.118 </h1>
111 swift 1.73
112 swift 1.96 <xsl:choose>
113     <xsl:when test="$style = 'printable'">
114     <xsl:apply-templates select="author" />
115 neysx 1.141 <br/>
116     <i><xsl:call-template name="contentdate"/></i>
117 neysx 1.165 <xsl:variable name="outdated">
118     <xsl:call-template name="outdated-translation"/>
119     </xsl:variable>
120     <xsl:if test="string-length($outdated) &gt; 1">
121 neysx 1.212 <br/><b><i><xsl:copy-of select="$outdated"/></i></b>
122 neysx 1.165 </xsl:if>
123 swift 1.96 </xsl:when>
124     <xsl:otherwise>
125 neysx 1.224 <xsl:if test="count(exslt:node-set($doc-struct)//chapter)&gt;1">
126 swift 1.96 <form name="contents" action="http://www.gentoo.org">
127 neysx 1.123 <b><xsl:value-of select="func:gettext('Content')"/></b>:
128 neysx 1.146 <select name="url" size="1" OnChange="location.href=form.url.options[form.url.selectedIndex].value" style="font-family:sans-serif,Arial,Helvetica">
129 neysx 1.224 <xsl:for-each select="exslt:node-set($doc-struct)//chapter">
130     <option value="#doc_chap{position()}"><xsl:number/>. <xsl:value-of select="@title"/></option>
131 swift 1.96 </xsl:for-each>
132     </select>
133     </form>
134 neysx 1.149 </xsl:if>
135 swift 1.96 </xsl:otherwise>
136     </xsl:choose>
137 swift 1.73
138 neysx 1.147 <xsl:choose>
139     <xsl:when test="/guide">
140 neysx 1.215 <xsl:apply-templates select="faqindex|chapter"/>
141 neysx 1.147 </xsl:when>
142     <xsl:when test="/sections">
143     <xsl:apply-templates select="/sections/section"/>
144     </xsl:when>
145     </xsl:choose>
146 swift 1.73 <br/>
147     <xsl:if test="/guide/license">
148     <xsl:apply-templates select="license" />
149     </xsl:if>
150     <br/>
151     </xsl:template>
152    
153     <!-- Layout for documentation -->
154     <xsl:template name="doclayout">
155 neysx 1.192 <xsl:param name="chapnum"/>
156     <xsl:param name="partnum"/>
157 neysx 1.165 <html>
158     <xsl:if test="string-length($glang)>1">
159     <xsl:attribute name="lang"><xsl:value-of select="translate($glang,'_','-')"/></xsl:attribute>
160     </xsl:if>
161     <head>
162     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
163 neysx 1.214 <link title="new" rel="stylesheet" href="{concat($ROOT,'css/main.css')}" type="text/css"/>
164 neysx 1.201 <link REL="shortcut icon" HREF="{concat($ROOT,'favicon.ico')}" TYPE="image/x-icon"/>
165 neysx 1.189
166 neysx 1.190 <!-- Support for opensearch -->
167 neysx 1.189 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/>
168     <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/>
169     <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
170 neysx 1.226 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
171 neysx 1.218 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
172 neysx 1.239
173 neysx 1.193 <xsl:if test="//glsaindex or //glsa-latest">
174     <link rel="alternate" type="application/rss+xml">
175     <xsl:attribute name="href">
176     <xsl:text>/rdf/en/glsa-index.rdf</xsl:text>
177     <xsl:if test="//glsa-latest">
178     <xsl:text>?num=9</xsl:text>
179     </xsl:if>
180     </xsl:attribute>
181     </link>
182     </xsl:if>
183    
184 neysx 1.189 <xsl:if test="/*[1][@redirect]">
185     <!-- HTML refresh in case redirect is not supported -->
186     <meta http-equiv="Refresh">
187     <xsl:attribute name="content"><xsl:value-of select="concat('15; URL=', /*[1]/@redirect)"/></xsl:attribute>
188     </meta>
189     <xsl:message>
190     <!-- Redirect using http header when supported -->
191     <xsl:value-of select="concat('%%GORG%%Redirect=',/*[1]/@redirect)"/>
192     </xsl:message>
193 neysx 1.239 </xsl:if>
194 neysx 1.165
195 swift 1.96 <title>
196 swift 1.73 <xsl:choose>
197 neysx 1.239 <xsl:when test="/guide/@type='project'">Gentoo Linux Projects</xsl:when>
198     <xsl:when test="/guide/@type='newsletter'">Gentoo Linux Newsletter</xsl:when>
199     <xsl:when test="/sections">Gentoo Linux Handbook Page</xsl:when>
200     <xsl:otherwise><xsl:value-of select="func:gettext('GLinuxDoc')"/></xsl:otherwise>
201 swift 1.73 </xsl:choose>
202 neysx 1.239 --
203 swift 1.73 <xsl:choose>
204     <xsl:when test="subtitle"><xsl:if test="/guide/@type!='newsletter'"><xsl:value-of select="title"/>:</xsl:if> <xsl:value-of select="subtitle"/></xsl:when>
205     <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
206     </xsl:choose>
207     </title>
208 swift 1.118
209 neysx 1.165 </head>
210 swift 1.118 <xsl:choose>
211     <xsl:when test="$style = 'printable'">
212     <!-- Insert the node-specific content -->
213     <body bgcolor="#ffffff">
214 neysx 1.194 <!-- Test for RTL languages -->
215 neysx 1.208 <xsl:if test="$RTL='Y'">
216 neysx 1.194 <xsl:attribute name="dir">RTL</xsl:attribute>
217     </xsl:if>
218    
219 neysx 1.165 <xsl:call-template name="show-disclaimer"/>
220 neysx 1.192 <xsl:call-template name="content">
221     <xsl:with-param name="chapnum" select="$chapnum"/>
222     <xsl:with-param name="partnum" select="$partnum"/>
223     </xsl:call-template>
224 swift 1.118 </body>
225     </xsl:when>
226     <xsl:otherwise>
227 swift 1.100 <body style="margin:0px;" bgcolor="#ffffff">
228 swift 1.73 <table width="100%" border="0" cellspacing="0" cellpadding="0">
229     <tr>
230     <td valign="top" height="125" bgcolor="#45347b">
231 neysx 1.201 <a href="/"><img border="0" src="{concat($ROOT,'images/gtop-www.jpg')}" alt="Gentoo Logo"/></a>
232 swift 1.73 </td>
233     </tr>
234     <tr>
235     <td valign="top" align="right" colspan="1" bgcolor="#ffffff">
236     <table border="0" cellspacing="0" cellpadding="0" width="100%">
237     <tr>
238 neysx 1.195 <td width="99%" class="content" valign="top">
239 neysx 1.194 <!-- Test for RTL languages -->
240 neysx 1.196 <xsl:choose>
241 neysx 1.208 <xsl:when test="$RTL='Y'">
242 neysx 1.196 <xsl:attribute name="dir">RTL</xsl:attribute>
243     </xsl:when>
244     <xsl:otherwise>
245     <xsl:attribute name="align">left</xsl:attribute>
246     </xsl:otherwise>
247     </xsl:choose>
248 swift 1.73 <!-- Insert the node-specific content -->
249 neysx 1.165 <xsl:call-template name="show-disclaimer"/>
250 neysx 1.192 <xsl:call-template name="content">
251     <xsl:with-param name="chapnum" select="$chapnum"/>
252     <xsl:with-param name="partnum" select="$partnum"/>
253     </xsl:call-template>
254 swift 1.73 </td>
255     <td width="1%" bgcolor="#dddaec" valign="top">
256 neysx 1.146 <xsl:call-template name="rhcol"/>
257 swift 1.73 </td>
258     </tr>
259     </table>
260     </td>
261     </tr>
262     <tr>
263 neysx 1.146 <td colspan="2" align="right" class="infohead">
264 neysx 1.211 <xsl:call-template name="copyright-footer"/>
265 swift 1.73 </td>
266     </tr>
267     </table>
268    
269     </body>
270 swift 1.118 </xsl:otherwise>
271     </xsl:choose>
272 neysx 1.165 </html>
273 swift 1.73 </xsl:template>
274    
275 neysx 1.189
276 neysx 1.224 <xsl:template match="/included|/gleps|/devaway|/uris|/inserts|/glsa-index|opensearch:OpenSearchDescription">
277 neysx 1.189 <xsl:message>
278     <xsl:value-of select="concat('%%GORG%%Redirect=',$link,'?passthru=1')"/>
279     </xsl:message>
280     </xsl:template>
281    
282 swift 1.73 <!-- Guide template -->
283     <xsl:template match="/guide">
284     <xsl:call-template name="doclayout" />
285     </xsl:template>
286    
287     <!-- {Mainpage, News, Email} template -->
288 neysx 1.201 <xsl:template match="/mainpage | /news">
289 neysx 1.165 <html>
290     <xsl:if test="string-length($glang)>1">
291     <xsl:attribute name="lang"><xsl:value-of select="translate($glang,'_','-')"/></xsl:attribute>
292     </xsl:if>
293     <head>
294     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
295 neysx 1.214 <link title="new" rel="stylesheet" href="{concat($ROOT,'css/main.css')}" type="text/css"/>
296 neysx 1.201 <link REL="shortcut icon" HREF="{concat($ROOT,'favicon.ico')}" TYPE="image/x-icon"/>
297 neysx 1.189
298 neysx 1.190 <!-- Support for opensearch -->
299 neysx 1.189 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/>
300     <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/>
301     <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
302 neysx 1.224 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
303 neysx 1.218 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
304 neysx 1.239
305 neysx 1.226 <xsl:if test="/*[1][@redirect]">
306     <!-- Immediate HTML refresh in case redirect is not supported -->
307     <meta http-equiv="Refresh">
308     <xsl:attribute name="content"><xsl:value-of select="concat('0; URL=', /*[1]/@redirect)"/></xsl:attribute>
309     </meta>
310     <xsl:message>
311     <!-- Redirect using http header when supported -->
312     <xsl:value-of select="concat('%%GORG%%Redirect=',/*[1]/@redirect)"/>
313     </xsl:message>
314 neysx 1.239 </xsl:if>
315 neysx 1.226
316 neysx 1.202 <xsl:if test="/mainpage/newsitems">
317 swift 1.73 <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" />
318     </xsl:if>
319     <xsl:choose>
320     <xsl:when test="/mainpage | /news">
321 neysx 1.201 <title>
322     Gentoo Linux -- <xsl:value-of select="title"/>
323     </title>
324 swift 1.73 </xsl:when>
325     </xsl:choose>
326 neysx 1.204
327     <xsl:if test="/mainpage/devmap">
328     <xsl:variable name="gkey" select="document('/gmaps-key.xml')/gkey"/>
329     <script src="{concat('http://maps.google.com/maps?file=api&amp;v=2&amp;key=', $gkey)}" type="text/javascript"></script>
330 neysx 1.205
331     <xsl:variable name="selectdev">
332     <xsl:choose>
333     <xsl:when test="string-length(translate($dev,'qwertyuioplkjhgfdsazxcvbnm-_0987654321QWERTYUIOPLKJHGFDSAZXCVBNM',''))=0 and string-length($dev)&lt;24">
334     <xsl:value-of select="translate($dev,'QWERTYUIOPLKJHGFDSAZXCVBNM','qwertyuioplkjhgfdsazxcvbnm')"/>
335     </xsl:when>
336     <xsl:otherwise>NotADev</xsl:otherwise>
337     </xsl:choose>
338     </xsl:variable>
339    
340     <xsl:variable name="newscript" select="str:replace($devmap-js, 'X-PLACEHOLDER', string($selectdev))"/>
341     <script type="text/javascript">//<xsl:comment><xsl:value-of select="$newscript"/>//</xsl:comment></script>
342 neysx 1.204 </xsl:if>
343 neysx 1.239
344 neysx 1.165 </head>
345 swift 1.100 <body style="margin:0px;" bgcolor="#000000">
346 drobbins 1.1
347 neysx 1.204 <xsl:if test="/mainpage/devmap">
348     <xsl:attribute name="onload">load()</xsl:attribute>
349     <xsl:attribute name="onunload">GUnload()</xsl:attribute>
350     </xsl:if>
351    
352 swift 1.73 <table border="0" width="100%" cellspacing="0" cellpadding="0">
353 neysx 1.209 <xsl:variable name="www"><xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if></xsl:variable>
354 swift 1.73 <tr>
355     <td valign="top" height="125" width="1%" bgcolor="#45347b">
356 neysx 1.209 <a href="{concat($www,'/')}"><img border="0" src="{concat($ROOT,'images/gtop-www.jpg')}" alt="Gentoo Logo"/></a>
357 swift 1.73 </td>
358 neysx 1.202 <!-- Top bar menu -->
359 neysx 1.149 <td valign="bottom" align="left" bgcolor="#000000" colspan="2" lang="en">
360 swift 1.73 <p class="menu">
361 neysx 1.239 <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='Y']"/>
362 swift 1.73 </p>
363     </td>
364     </tr>
365     <tr>
366     <td valign="top" align="right" width="1%" bgcolor="#dddaec">
367     <table width="100%" cellspacing="0" cellpadding="0" border="0">
368     <tr>
369     <td height="1%" valign="top" align="right">
370 neysx 1.201 <img src="{concat($ROOT,'images/gridtest.gif')}" alt="Gentoo Spaceship"/>
371 swift 1.73 </td>
372     </tr>
373     <tr>
374 neysx 1.149 <td height="99%" valign="top" align="left">
375 swift 1.73 <!--info goes here-->
376     <table cellspacing="0" cellpadding="5" border="0">
377     <tr>
378 neysx 1.149 <td valign="top" class="leftmenu" lang="en">
379 swift 1.73 <p class="altmenu">
380 neysx 1.239 <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='N']"/>
381 swift 1.73 </p>
382 neysx 1.239 <br/><br/>
383 swift 1.73 </td>
384     </tr>
385     </table>
386     </td>
387     </tr>
388     </table>
389     </td>
390 neysx 1.146 <!-- Content below top menu and between left menu and ads -->
391     <td valign="top" bgcolor="#ffffff">
392 neysx 1.194 <!-- Test for RTL languages -->
393 neysx 1.208 <xsl:if test="$RTL='Y'">
394 neysx 1.194 <xsl:attribute name="dir">RTL</xsl:attribute>
395     </xsl:if>
396 swift 1.73 <xsl:choose>
397 neysx 1.202 <xsl:when test="/mainpage/newsitems">
398 neysx 1.146 <p class="news">
399 neysx 1.201 <img class="newsicon" src="{concat($ROOT,'images/gentoo-new.gif')}" alt="Gentoo logo"/>
400 neysx 1.149 <span class="newsitem" lang="en">We produce Gentoo Linux, a special flavor of Linux that
401 neysx 1.146 can be automatically optimized and customized for just
402     about any application or need. Extreme performance,
403     configurability and a top-notch user and developer
404     community are all hallmarks of the Gentoo experience.
405     To learn more, read our <b><a href="/main/en/about.xml">about
406     page</a></b>.</span>
407     </p>
408 neysx 1.239
409     <xsl:variable name="GLSAs" select="document('/dyn/glsa-index2.xml')"/>
410     <xsl:variable name="new-packages" select="document('/dyn/new-packages.xml')"/>
411     <xsl:variable name="planet" select="document('/dyn/planet.xml')"/>
412    
413     <xsl:variable name="all-news" xmlns="">
414     <news>
415     <!-- News from news-index.xml, i.e. list of files under /news/ -->
416     <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&lt;=$newsitemcount]/text()">
417     <xsl:variable name="tlink" select="."/>
418     <newsitem date="{document($tlink)/news/date}" link="{$tlink}"/>
419     </xsl:for-each>
420    
421     <!-- GLSAs from my own glsa-index.xml, i.e. not Gentoo's -->
422     <xsl:for-each select="$GLSAs//glsa">
423     <!-- <xsl:sort select="date" order="descending"/> Can't sort on English dates, they should be sorted in the source file -->
424     <xsl:if test="position() &lt;=$newsitemcount">
425     <!-- convert bloody dates like 'July 29, 2006: 02' to YYYY-MM-DD -->
426     <xsl:variable name="yydate">
427     <xsl:choose>
428     <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),'|'))">
429     <xsl:value-of select="substring(date,1,10)"/>
430     </xsl:when>
431     <xsl:otherwise>
432     <xsl:value-of select="substring(substring-after(substring-after(date,' '),' '),1,4)"/>
433     <xsl:text>-</xsl:text>
434     <xsl:choose>
435     <xsl:when test="substring-before(date,' ')='January'">01</xsl:when>
436     <xsl:when test="substring-before(date,' ')='February'">02</xsl:when>
437     <xsl:when test="substring-before(date,' ')='March'">03</xsl:when>
438     <xsl:when test="substring-before(date,' ')='April'">04</xsl:when>
439     <xsl:when test="substring-before(date,' ')='May'">05</xsl:when>
440     <xsl:when test="substring-before(date,' ')='June'">06</xsl:when>
441     <xsl:when test="substring-before(date,' ')='July'">07</xsl:when>
442     <xsl:when test="substring-before(date,' ')='August'">08</xsl:when>
443     <xsl:when test="substring-before(date,' ')='September'">09</xsl:when>
444     <xsl:when test="substring-before(date,' ')='October'">10</xsl:when>
445     <xsl:when test="substring-before(date,' ')='November'">11</xsl:when>
446     <xsl:when test="substring-before(date,' ')='December'">12</xsl:when>
447     <xsl:otherwise>00</xsl:otherwise>
448     </xsl:choose>
449     <xsl:text>-</xsl:text>
450     <xsl:value-of select="substring-before(substring-after(date,' '),',')"/>
451     </xsl:otherwise>
452     </xsl:choose>
453     </xsl:variable>
454     <xsl:if test="func:is-date($yydate)='YES'">
455     <newsitem date="{$yydate}" glsaid="{@id}"/>
456     </xsl:if>
457     </xsl:if>
458     </xsl:for-each>
459    
460     <!-- New packages from packages.gentoo.org/feed/newpackage-->
461     <xsl:if test="$new-packages//feed:entry/feed:updated">
462     <newsitem date="{substring($new-packages//feed:entry[1]/feed:updated,1,10)}" package="{generate-id($new-packages//feed:entry[1])}"/>
463     </xsl:if>
464    
465     <!-- Latest posts on planet.g.o from planet.gentoo.org/rss20.xml -->
466     <xsl:for-each select="$planet/rss/channel/item">
467     <xsl:variable name="pubDate" select="substring(pubDate,1,16)"/>
468     <xsl:if test="count(preceding-sibling::item[substring(pubDate,1,16)=$pubDate])=0">
469     <xsl:variable name="postdate">
470     <xsl:value-of select="substring(substring-after(substring-after(substring-after(pubDate,' '),' '), ' '),1,4)"/>
471     <xsl:choose>
472     <xsl:when test="'Jan' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-01-</xsl:when>
473     <xsl:when test="'Feb' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-02-</xsl:when>
474     <xsl:when test="'Mar' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-03-</xsl:when>
475     <xsl:when test="'Apr' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-04-</xsl:when>
476     <xsl:when test="'May' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-05-</xsl:when>
477     <xsl:when test="'Jun' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-06-</xsl:when>
478     <xsl:when test="'Jul' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-07-</xsl:when>
479     <xsl:when test="'Aug' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-08-</xsl:when>
480     <xsl:when test="'Sep' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-09-</xsl:when>
481     <xsl:when test="'Oct' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-10-</xsl:when>
482     <xsl:when test="'Nov' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-11-</xsl:when>
483     <xsl:when test="'Dec' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-12-</xsl:when>
484     <xsl:otherwise>-00-</xsl:otherwise>
485     </xsl:choose>
486     <xsl:value-of select="format-number(number(substring-before(substring-after(pubDate,' '),' ')),'00')"/>
487     </xsl:variable>
488     <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]">
489     <newsitem date="{$postdate}" planet="{$pubDate}"/>
490     </xsl:if>
491     </xsl:if>
492     </xsl:for-each>
493     </news>
494     </xsl:variable>
495    
496     <xsl:variable name="all-news1" xmlns="">
497     <news>
498     <xsl:for-each select="exslt:node-set($all-news)/news/newsitem">
499     <xsl:sort select="@date" order="descending"/>
500     <xsl:copy-of select="."/>
501     </xsl:for-each>
502     </news>
503     </xsl:variable>
504    
505     <xsl:variable name="all-news0" xmlns="">
506     <news>
507     <xsl:for-each select="exslt:node-set($all-news1)/news/newsitem">
508     <xsl:choose>
509     <xsl:when test="@link or @package or @glsaid">
510     <xsl:copy-of select="."/>
511     </xsl:when>
512    
513     <xsl:when test="@planet">
514     <xsl:if test="not(preceding-sibling::newsitem[1]/@planet)">
515     <!-- group consecutive blog days into a single item -->
516     <newsitem date="{@date}" blog='1'>
517     <xsl:copy-of select="."/>
518     <xsl:apply-templates select="following-sibling::*[position()=1 and @planet]" mode="moreblogs"/>
519     </newsitem>
520     </xsl:if>
521     </xsl:when>
522     </xsl:choose>
523     </xsl:for-each>
524     </news>
525     </xsl:variable>
526    
527     <!-- Display news items -->
528    
529     <xsl:for-each select="exslt:node-set($all-news0)/news/newsitem">
530     <xsl:sort select="@date" order="descending"/>
531    
532     <!-- Build a newsitem that can be passed to the template that displays a newsitem -->
533     <xsl:variable name="thenews" xmlns="">
534     <news>
535     <xsl:choose>
536     <xsl:when test="@link">
537     <xsl:variable name="newsitem" select="document(@link)/news"/>
538     <xsl:attribute name="category"><xsl:value-of select="$newsitem/@category"/></xsl:attribute>
539     <title><xsl:copy-of select="$newsitem/title"/></title>
540     <date><xsl:value-of select="@date"/></date>
541     <!--
542     <xsl:variable name="poster">
543     <xsl:call-template name="smart-mail">
544     <xsl:with-param name="mail" select="$newsitem/poster"/>
545     </xsl:call-template>
546     </xsl:variable>
547     <poster><xsl:copy-of select="$poster"/></poster>
548     -->
549     <poster><xsl:value-of select="$newsitem/poster"/></poster>
550     <xsl:choose>
551     <xsl:when test="$newsitem/summary"><summary><xsl:copy-of select="$newsitem/summary"/></summary></xsl:when>
552     <xsl:otherwise><body><xsl:copy-of select="$newsitem/body"/></body></xsl:otherwise>
553     </xsl:choose>
554     </xsl:when>
555    
556     <xsl:when test="@blog">
557     <xsl:attribute name="category">planet</xsl:attribute>
558     <title>Blog posts</title>
559     <date><xsl:value-of select="@date"/></date>
560     <xsl:if test="@date != ./newsitem[position()=last()]/@date">
561     <until><xsl:value-of select="./newsitem[position()=last()]/@date"/></until>
562     </xsl:if>
563     <poster>planet.gentoo.org</poster>
564     <body><table>
565     <xsl:variable name="blogentries" xmlns="">
566     <xsl:for-each select="./newsitem">
567     <xsl:variable name="pubDate" select="@planet"/>
568     <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]">
569     <tr>
570     <xsl:choose>
571     <xsl:when test="contains(title,': ')">
572     <ti><xsl:value-of select="substring-before(title,': ')"/></ti>
573     <ti><uri link="{link}"><xsl:value-of select="substring-after(title,': ')"/></uri></ti>
574     </xsl:when>
575     <xsl:otherwise>
576     <ti><xsl:value-of select="title"/></ti>
577     <ti><uri link="{link}">. . .</uri></ti>
578     </xsl:otherwise>
579     </xsl:choose>
580     </tr>
581     </xsl:for-each>
582     </xsl:for-each>
583     </xsl:variable>
584    
585     <xsl:variable name="sortedblogentries" xmlns="">
586     <xsl:for-each select="exslt:node-set($blogentries)/tr">
587     <xsl:sort select="ti[1]"/>
588     <tr>
589     <xsl:copy-of select="ti"/>
590     </tr>
591     </xsl:for-each>
592     </xsl:variable>
593    
594     <xsl:for-each select="exslt:node-set($sortedblogentries)/tr">
595     <xsl:variable name="blogposter" select="ti[1]"/>
596     <tr>
597     <xsl:choose>
598     <xsl:when test="preceding-sibling::tr[1]/ti[1]/text()=$blogposter">
599     </xsl:when>
600     <xsl:when test="following-sibling::tr[1]/ti[1]/text()=$blogposter">
601     <ti rowspan="{1+count(following-sibling::tr[ti[1]/text()=$blogposter])}"><xsl:value-of select="ti[1]"/></ti>
602     </xsl:when>
603     <xsl:otherwise>
604     <xsl:copy-of select="ti[1]"/>
605     </xsl:otherwise>
606     </xsl:choose>
607     <xsl:copy-of select="ti[2]"/>
608     </tr>
609     </xsl:for-each>
610     </table></body>
611     </xsl:when>
612    
613     <xsl:when test="@glsaid">
614     <xsl:attribute name="category">plans</xsl:attribute>
615     <xsl:variable name="glsaid" select="@glsaid"/>
616     <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>
617     <date><xsl:value-of select="@date"/></date>
618     <poster>Gentoo Security Team</poster>
619     <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>
620     </xsl:when>
621    
622     <xsl:when test="@package">
623     <xsl:attribute name="category">moo</xsl:attribute>
624     <xsl:variable name="pid" select="@package"/>
625     <title>New Packages</title>
626     <date><xsl:value-of select="@date"/></date>
627     <poster>packages.gentoo.org</poster>
628     <body><table>
629     <xsl:for-each select="$new-packages//feed:entry">
630     <tr>
631     <ti><uri link="{feed:id}"><xsl:value-of select="feed:title/feed:div/feed:span[1]"/></uri></ti>
632     <ti><xsl:value-of select="feed:title/feed:div/feed:span[2]"/></ti>
633     </tr>
634     </xsl:for-each>
635     </table></body>
636     </xsl:when>
637     </xsl:choose>
638     </news>
639     </xsl:variable>
640    
641     <xsl:call-template name="newscontent">
642     <xsl:with-param name="thenews" select="exslt:node-set($thenews)/news"/>
643     <xsl:with-param name="summary" select="'yes'"/>
644     <xsl:with-param name="link" select="@link"/>
645     </xsl:call-template>
646     </xsl:for-each>
647    
648    
649    
650    
651 neysx 1.181 <!-- Links to older news below news items -->
652     <div class="news">
653     <p class="newshead" lang="en">
654     <b>Older News</b>
655     </p>
656     <ul>
657     <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&gt;$newsitemcount][position()&lt;20]/text()">
658     <xsl:variable name="newsuri" select="."/>
659     <li><b><a class="altlink" href="{$newsuri}"><xsl:value-of select="document(.)/news/title"/></a></b></li>
660     </xsl:for-each>
661     </ul>
662     </div>
663 swift 1.73 </xsl:when>
664 neysx 1.239
665 swift 1.73 <xsl:when test="/news">
666 neysx 1.154 <xsl:call-template name="newscontent">
667     <xsl:with-param name="thenews" select="/news"/>
668     <xsl:with-param name="summary" select="no"/>
669     </xsl:call-template>
670 swift 1.73 </xsl:when>
671     </xsl:choose>
672 neysx 1.146 <br/>
673     <table border="0" class="content">
674 klieber 1.107 <tr>
675     <td>
676 neysx 1.204 <xsl:apply-templates select="chapter|devmap"/>
677 klieber 1.107 </td>
678     </tr>
679 neysx 1.146 </table>
680     <br/>
681     <xsl:if test="/mainpage/license">
682     <xsl:apply-templates select="license" />
683     </xsl:if>
684     <br/>
685     <!--content end-->
686 swift 1.73 </td>
687 neysx 1.146 <td width="1%" bgcolor="#dddaec" valign="top">
688     <xsl:call-template name="rhcol"/>
689 swift 1.73 </td>
690     </tr>
691 neysx 1.149 <tr lang="en">
692 neysx 1.146 <td align="right" class="infohead" colspan="3">
693 neysx 1.211 <xsl:call-template name="copyright-footer"/>
694 swift 1.73 </td>
695     </tr>
696 drobbins 1.1 </table>
697 swift 1.73
698     </body>
699 neysx 1.165 </html>
700 swift 1.73 </xsl:template>
701    
702 neysx 1.239 <xsl:template match="newsitem" mode="moreblogs">
703     <xsl:copy-of select="."/>
704     <xsl:if test="following-sibling::*[1]/@planet">
705     <xsl:apply-templates select="following-sibling::newsitem[position()=1 and @planet]" mode="moreblogs"/>
706     </xsl:if>
707     </xsl:template>
708    
709 neysx 1.211 <xsl:template name="copyright-footer">
710     <xsl:variable name="isEnglish">
711     <xsl:if test="string-length($glang)=0 or $glang='en'">Y</xsl:if>
712     </xsl:variable>
713     <xsl:variable name="www">
714     <xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if>
715     </xsl:variable>
716     <xsl:variable name="contact">
717     <xsl:choose>
718     <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/contact.xml'))/missing)">
719     <xsl:value-of select="concat('/main/', $glang, '/contact.xml')"/>
720     </xsl:when>
721     <xsl:otherwise>/main/en/contact.xml</xsl:otherwise>
722     </xsl:choose>
723     </xsl:variable>
724 neysx 1.220 Copyright 2001-<xsl:value-of select="substring(func:today(),1,4)"/> Gentoo Foundation, Inc. Questions, Comments? <a class="highlight" href="{concat($www, $contact)}">Contact us</a>.
725 neysx 1.211 </xsl:template>
726    
727 swift 1.73 <!-- Mail template -->
728     <xsl:template match="mail">
729 neysx 1.221 <xsl:variable name="mail">
730     <xsl:call-template name="smart-mail">
731     <xsl:with-param name="mail" select="."/>
732     </xsl:call-template>
733 neysx 1.220 </xsl:variable>
734    
735     <xsl:choose>
736 neysx 1.221 <xsl:when test="string-length(exslt:node-set($mail)/mail/@link)>0">
737     <a href="{concat('mailto:',exslt:node-set($mail)/mail/@link)}">
738 neysx 1.220 <xsl:choose>
739     <xsl:when test="name(..)='author'">
740     <xsl:attribute name="class">altlink</xsl:attribute>
741 neysx 1.221 <b><xsl:value-of select="exslt:node-set($mail)/mail/text()"/></b>
742 neysx 1.220 </xsl:when>
743     <xsl:otherwise>
744 neysx 1.221 <xsl:value-of select="exslt:node-set($mail)/mail/text()"/>
745 neysx 1.220 </xsl:otherwise>
746     </xsl:choose>
747     </a>
748     </xsl:when>
749 neysx 1.221 <xsl:otherwise><xsl:value-of select="exslt:node-set($mail)/mail/text()"/></xsl:otherwise>
750 neysx 1.220 </xsl:choose>
751 swift 1.73 </xsl:template>
752    
753     <!-- Author -->
754     <xsl:template match="author">
755 neysx 1.220 <xsl:apply-templates/>
756 neysx 1.146 <xsl:if test="@title">
757 neysx 1.220 <xsl:if test="$style != 'printable'"><br/></xsl:if>
758     <xsl:if test="$style = 'printable'">&#160;</xsl:if>
759 neysx 1.146 <i><xsl:value-of select="@title"/></i>
760     </xsl:if>
761 swift 1.73 <br/>
762 neysx 1.220 <xsl:if test="$style != 'printable' and position() != last()"><br/></xsl:if>
763 swift 1.73 </xsl:template>
764    
765 neysx 1.215 <!-- FAQ Index & Chapter -->
766 neysx 1.224 <xsl:template match="faqindex|chapter|/sections/section">
767     <xsl:if test="not(@test) or dyn:evaluate(@test)">
768     <xsl:variable name="uid" select="generate-id(.)" />
769     <xsl:variable name="chid">
770     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[@uid=$uid]/preceding-sibling::chapter)"/>
771     </xsl:variable>
772    
773     <xsl:variable name="partnum">
774     <xsl:value-of select="exslt:node-set($doc-struct)//bookpart[descendant::*[@uid=$uid]]/@pos"/>
775     </xsl:variable>
776     <xsl:variable name="chapnum">
777     <xsl:value-of select="exslt:node-set($doc-struct)//bookchap[descendant::*[@uid=$uid]]/@pos"/>
778     </xsl:variable>
779    
780 neysx 1.176 <xsl:choose>
781 neysx 1.224 <xsl:when test="include">
782 neysx 1.246 <xsl:choose>
783     <xsl:when test="$debug='1'">
784     <div style="border-left:4px solid #AAA;padding-left:4px;">
785     <div style="color:white;background:#AAA;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div>
786     <xsl:apply-templates select="document(include/@href)//chapter"/>
787     </div>
788     </xsl:when>
789     <xsl:otherwise>
790     <xsl:apply-templates select="document(include/@href)//chapter"/>
791     </xsl:otherwise>
792     </xsl:choose>
793 neysx 1.224 </xsl:when>
794    
795 neysx 1.176 <xsl:when test="title">
796 swift 1.73 <p class="chaphead">
797 neysx 1.224 <xsl:if test="@id">
798     <a name="{@id}"/>
799 neysx 1.176 </xsl:if>
800 neysx 1.224
801     <xsl:choose>
802     <xsl:when test="$TTOP='book' and $full != 0">
803     <a name="book_part{$partnum}_chap{$chapnum}__chap{$chid}"/>
804     </xsl:when>
805     <xsl:otherwise>
806     <a name="doc_chap{$chid}"/>
807     </xsl:otherwise>
808     </xsl:choose>
809    
810     <span class="chapnum">
811     <xsl:choose>
812     <xsl:when test="$TTOP='book'">
813     <xsl:value-of select="$chapnum" />.<xsl:number level="multiple" format="a. " value="$chid"/>
814     </xsl:when>
815     <xsl:otherwise>
816     <xsl:value-of select="$chid"/>.&#160;
817     </xsl:otherwise>
818     </xsl:choose>
819     </span>
820 neysx 1.176 <xsl:value-of select="title"/>
821 drobbins 1.1 </p>
822 neysx 1.176 </xsl:when>
823     <xsl:otherwise>
824     <xsl:if test="/guide">
825     <p class="chaphead">
826     <span class="chapnum">
827     <a name="doc_chap{$chid}"><xsl:number/>.</a>
828     </span>
829     </p>
830     </xsl:if>
831     </xsl:otherwise>
832     </xsl:choose>
833 neysx 1.224
834     <xsl:apply-templates select="section|subsection|body"/>
835 neysx 1.215
836     <xsl:if test="name()='faqindex'">
837     <!-- Generate FAQ index -->
838    
839 neysx 1.224 <xsl:for-each select="exslt:node-set($doc-struct)//chapter[position()>1]">
840     <xsl:if test="section[@title]">
841 neysx 1.215 <p class="secthead">
842 neysx 1.224 <xsl:value-of select="@title"/>
843 neysx 1.215 </p>
844     <xsl:variable name="nchap"><xsl:value-of select="1+position()"/></xsl:variable>
845     <ul>
846     <xsl:for-each select="section">
847 neysx 1.224 <xsl:if test="@title">
848 neysx 1.215 <li>
849     <a>
850     <xsl:attribute name="href">
851     <xsl:choose>
852     <xsl:when test="@id">
853     #<xsl:value-of select="@id"/>
854     </xsl:when>
855     <xsl:otherwise>
856     <xsl:value-of select="concat('#doc_chap', $nchap, '_sect')"/><xsl:number/>
857     </xsl:otherwise>
858     </xsl:choose>
859     </xsl:attribute>
860 neysx 1.224 <xsl:value-of select="@title"/>
861 neysx 1.215 </a>
862     </li>
863     </xsl:if>
864     </xsl:for-each>
865     </ul>
866     </xsl:if>
867     </xsl:for-each>
868     </xsl:if>
869 neysx 1.224 </xsl:if>
870 swift 1.73 </xsl:template>
871    
872    
873     <!-- Section template -->
874 neysx 1.224 <xsl:template match="section|/sections/section/subsection">
875     <xsl:if test="not(@test) or dyn:evaluate(@test)">
876    
877     <xsl:variable name="uid" select="generate-id(.)" />
878     <xsl:variable name="chid">
879     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::section[@uid=$uid]]/preceding-sibling::chapter)"/>
880     </xsl:variable>
881     <xsl:variable name="seid">
882     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//section[@uid=$uid]/preceding-sibling::section)"/>
883     </xsl:variable>
884    
885     <xsl:variable name="partnum">
886     <xsl:value-of select="exslt:node-set($doc-struct)//bookpart[descendant::*[@uid=$uid]]/@pos"/>
887     </xsl:variable>
888     <xsl:variable name="chapnum">
889     <xsl:value-of select="exslt:node-set($doc-struct)//bookchap[descendant::*[@uid=$uid]]/@pos"/>
890     </xsl:variable>
891    
892     <xsl:choose>
893     <xsl:when test="include">
894 neysx 1.246 <xsl:choose>
895     <xsl:when test="$debug='1'">
896     <div style="border-left:4px solid #888;padding-left:4px;">
897     <div style="color:white;background:#888;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div>
898     <xsl:apply-templates select="document(include/@href)//section"/>
899     </div>
900     </xsl:when>
901     <xsl:otherwise>
902     <xsl:apply-templates select="document(include/@href)//section"/>
903     </xsl:otherwise>
904     </xsl:choose>
905 neysx 1.224 </xsl:when>
906    
907     <xsl:when test="title">
908     <xsl:variable name="sectid">
909     <xsl:choose>
910     <xsl:when test="$TTOP='book' and $full != 0">
911     <xsl:value-of select="concat('book_part', $partnum, '_chap', $chapnum, '__chap', $chid, '_sect', $seid)"/>
912     </xsl:when>
913     <xsl:otherwise>
914     <xsl:value-of select="concat('doc_chap', $chid, '_sect', $seid)"/>
915     </xsl:otherwise>
916     </xsl:choose>
917     </xsl:variable>
918    
919     <p class="secthead">
920     <xsl:if test="@id">
921     <a name="{@id}"/></xsl:if>
922     <a name="{$sectid}"><xsl:value-of select="title"/></a>
923     </p>
924     </xsl:when>
925     </xsl:choose>
926    
927     <xsl:apply-templates select="body"/>
928     </xsl:if>
929 swift 1.73 </xsl:template>
930    
931     <!-- Figure template -->
932     <xsl:template match="figure">
933 neysx 1.224 <xsl:variable name="uid" select="generate-id(.)" />
934     <xsl:variable name="chid">
935     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::figure[@uid=$uid]]/preceding-sibling::chapter)"/>
936     </xsl:variable>
937     <xsl:variable name="fignum">
938     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::figure[@uid=$uid]]//figure[following::figure[@uid=$uid]])"/>
939     </xsl:variable>
940     <xsl:variable name="figid">
941     <xsl:choose>
942     <xsl:when test="($TTOP = 'book') and ($full != 0)">
943     <xsl:value-of select="concat('book_part', exslt:node-set($doc-struct)//bookpart[descendant::figure[@uid=$uid]]/@pos, '_chap', exslt:node-set($doc-struct)//bookchap[descendant::figure[@uid=$uid]]/@pos, '__chap', $chid, '_fig', $fignum)"/>
944 neysx 1.146 </xsl:when>
945     <xsl:otherwise>
946 neysx 1.224 <xsl:value-of select="concat('doc_chap', $chid, '_fig', $fignum)"/>
947 neysx 1.146 </xsl:otherwise>
948 neysx 1.224 </xsl:choose>
949     </xsl:variable>
950    
951     <xsl:variable name="llink">
952     <xsl:choose>
953     <xsl:when test="starts-with(@link,'http://www.gentoo.org/')">
954     <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/>
955     </xsl:when>
956     <xsl:when test="starts-with(@link,'/')">
957     <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/>
958     </xsl:when>
959     <xsl:otherwise>
960     <xsl:value-of select="@link"/>
961     </xsl:otherwise>
962     </xsl:choose>
963     </xsl:variable>
964     <br/>
965     <a name="{$figid}"/>
966     <table cellspacing="0" cellpadding="0" border="0">
967     <tr>
968     <td bgcolor="#7a5ada">
969     <p class="codetitle">
970     <xsl:choose>
971     <xsl:when test="@caption">
972     <xsl:value-of select="func:gettext('Figure')"/>&#160;<xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/><xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/>
973     </xsl:when>
974     <xsl:otherwise>
975     <xsl:value-of select="func:gettext('Figure')"/>&#160;<xsl:value-of select="$chid"/>.<xsl:value-of select="$fignum"/>
976     </xsl:otherwise>
977     </xsl:choose>
978     </p>
979     </td>
980     </tr>
981     <tr>
982     <td align="center" bgcolor="#ddddff">
983 swift 1.73 <xsl:choose>
984 neysx 1.224 <xsl:when test="@short">
985     <img src="{$llink}" alt="Fig. {$fignum}: {@short}"/>
986 swift 1.73 </xsl:when>
987     <xsl:otherwise>
988 neysx 1.224 <img src="{$llink}" alt="Fig. {$fignum}"/>
989 swift 1.73 </xsl:otherwise>
990     </xsl:choose>
991 neysx 1.224 </td>
992     </tr>
993     </table>
994     <br/>
995 swift 1.73 </xsl:template>
996    
997     <!--figure without a caption; just a graphical element-->
998     <xsl:template match="fig">
999 neysx 1.201 <xsl:variable name="llink">
1000     <xsl:choose>
1001     <xsl:when test="starts-with(@link,'http://www.gentoo.org/')">
1002     <xsl:value-of select="concat($ROOT, substring-after(@link, 'http://www.gentoo.org/'))"/>
1003     </xsl:when>
1004     <xsl:when test="starts-with(@link,'/')">
1005     <xsl:value-of select="concat($ROOT, substring-after(@link, '/'))"/>
1006     </xsl:when>
1007     <xsl:otherwise>
1008     <xsl:value-of select="@link"/>
1009     </xsl:otherwise>
1010     </xsl:choose>
1011     </xsl:variable>
1012     <center>
1013     <xsl:choose>
1014     <xsl:when test="@linkto">
1015     <a href="{@linkto}"><img border="0" src="{$llink}" alt="{@short}"/></a>
1016     </xsl:when>
1017     <xsl:otherwise>
1018     <img src="{$llink}" alt="{@short}"/>
1019     </xsl:otherwise>
1020     </xsl:choose>
1021     </center>
1022 swift 1.73 </xsl:template>
1023    
1024 neysx 1.204 <xsl:template match="devmap">
1025     <h1>Gentoo Developers Map</h1>
1026     <p id="map" style="height:460px"/>
1027     <br/>
1028     <table id="devlinks" style="width:100%"/>
1029     </xsl:template>
1030    
1031 swift 1.73 <!-- Line break -->
1032     <xsl:template match="br">
1033     <br/>
1034     </xsl:template>
1035    
1036     <!-- Note -->
1037     <xsl:template match="note">
1038 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1039     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
1040     <tr>
1041     <td bgcolor="#bbffbb">
1042     <p class="note">
1043     <b><xsl:value-of select="func:gettext('Note')"/>: </b>
1044     <xsl:apply-templates/>
1045     </p>
1046     </td>
1047     </tr>
1048     </table>
1049     </xsl:if>
1050 swift 1.73 </xsl:template>
1051    
1052     <!-- Important item -->
1053     <xsl:template match="impo">
1054 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1055     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
1056     <tr>
1057     <td bgcolor="#ffffbb">
1058     <p class="note">
1059     <b><xsl:value-of select="func:gettext('Important')"/>: </b>
1060     <xsl:apply-templates/>
1061     </p>
1062     </td>
1063     </tr>
1064     </table>
1065     </xsl:if>
1066 swift 1.73 </xsl:template>
1067    
1068     <!-- Warning -->
1069     <xsl:template match="warn">
1070 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1071     <table class="ncontent" width="100%" border="0" cellspacing="0" cellpadding="0">
1072     <tr>
1073     <td bgcolor="#ffbbbb">
1074     <p class="note">
1075     <b><xsl:value-of select="func:gettext('Warning')"/>: </b>
1076     <xsl:apply-templates/>
1077     </p>
1078     </td>
1079     </tr>
1080     </table>
1081     </xsl:if>
1082 swift 1.73 </xsl:template>
1083    
1084     <!-- Code note -->
1085     <xsl:template match="codenote">
1086 neysx 1.146 <span class="comment">
1087     <xsl:if test='not(starts-with(., "("))'>(</xsl:if>
1088     <xsl:apply-templates/>
1089     <xsl:if test='not(starts-with(., "("))'>)</xsl:if>
1090     </span>
1091 swift 1.73 </xsl:template>
1092    
1093     <!-- Regular comment -->
1094     <xsl:template match="comment">
1095 neysx 1.172 <span class="code-comment"><xsl:apply-templates/></span>
1096 swift 1.73 </xsl:template>
1097    
1098 neysx 1.172 <!-- Colour coding inside <pre> -->
1099 swift 1.73 <xsl:template match="i">
1100 neysx 1.172 <span class="code-input"><xsl:apply-templates/></span>
1101     </xsl:template>
1102    
1103     <xsl:template match="var">
1104     <span class="code-variable"><xsl:apply-templates/></span>
1105     </xsl:template>
1106    
1107     <xsl:template match="ident">
1108     <span class="code-identifier"><xsl:apply-templates/></span>
1109 swift 1.73 </xsl:template>
1110    
1111 neysx 1.172 <xsl:template match="keyword">
1112     <span class="code-keyword"><xsl:apply-templates/></span>
1113     </xsl:template>
1114    
1115     <xsl:template match="stmt">
1116     <span class="code-statement"><xsl:apply-templates/></span>
1117     </xsl:template>
1118    
1119     <xsl:template match="const">
1120     <span class="code-constant"><xsl:apply-templates/></span>
1121     </xsl:template>
1122    
1123    
1124 swift 1.73 <!-- Bold -->
1125     <xsl:template match="b">
1126     <b><xsl:apply-templates/></b>
1127     </xsl:template>
1128    
1129 neysx 1.166 <!-- Superscript -->
1130     <xsl:template match="sup">
1131     <sup><xsl:apply-templates/></sup>
1132     </xsl:template>
1133    
1134     <!-- Subscript -->
1135     <xsl:template match="sub">
1136     <sub><xsl:apply-templates/></sub>
1137     </xsl:template>
1138    
1139 swift 1.73 <!-- Brite -->
1140     <xsl:template match="brite">
1141     <font color="#ff0000">
1142     <b><xsl:apply-templates/></b>
1143     </font>
1144     </xsl:template>
1145    
1146     <!-- Body -->
1147     <xsl:template match="body">
1148 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1149 neysx 1.224 <xsl:choose>
1150     <xsl:when test="include">
1151 neysx 1.246 <xsl:choose>
1152     <xsl:when test="$debug='1'">
1153     <div style="border-left:4px solid #666;padding-left:4px;">
1154     <div style="color:white;background:#666;font-weight:bold;padding:4px;margin-left:-4px;"><xsl:value-of select="include/@href"/></div>
1155     <xsl:apply-templates select="document(include/@href)//body"/>
1156     </div>
1157     </xsl:when>
1158     <xsl:otherwise>
1159     <xsl:apply-templates select="document(include/@href)//body"/>
1160     </xsl:otherwise>
1161     </xsl:choose>
1162 neysx 1.224 </xsl:when>
1163     <xsl:otherwise>
1164     <xsl:apply-templates select="./*[not(@test) or dyn:evaluate(@test)]"/>
1165     </xsl:otherwise>
1166     </xsl:choose>
1167 neysx 1.182 </xsl:if>
1168 swift 1.73 </xsl:template>
1169    
1170     <!-- Command or input, not to use inside <pre> -->
1171     <xsl:template match="c">
1172 neysx 1.200 <span class="code" dir="ltr"><xsl:apply-templates/></span>
1173 swift 1.73 </xsl:template>
1174    
1175     <!-- Preserve whitespace, aka Code Listing -->
1176     <xsl:template match="pre">
1177 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1178 neysx 1.224 <xsl:variable name="uid" select="generate-id(.)" />
1179     <xsl:variable name="chid">
1180     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::pre[@uid=$uid]]/preceding-sibling::chapter)"/>
1181     </xsl:variable>
1182     <xsl:variable name="prenum">
1183     <xsl:value-of select="1+count(exslt:node-set($doc-struct)//chapter[descendant::pre[@uid=$uid]]//pre[following::pre[@uid=$uid]])"/>
1184     </xsl:variable>
1185     <xsl:variable name="preid">
1186     <xsl:choose>
1187     <xsl:when test="($TTOP = 'book') and ($full != 0)">
1188     <xsl:value-of select="concat('book_part', exslt:node-set($doc-struct)//bookpart[descendant::pre[@uid=$uid]]/@pos, '_chap', exslt:node-set($doc-struct)//bookchap[descendant::pre[@uid=$uid]]/@pos, '__chap', $chid, '_pre', $prenum)"/>
1189     </xsl:when>
1190     <xsl:otherwise>
1191     <xsl:value-of select="concat('doc_chap', $chid, '_pre', $prenum)"/>
1192     </xsl:otherwise>
1193     </xsl:choose>
1194     </xsl:variable>
1195 neysx 1.239
1196 neysx 1.182 <a name="{$preid}"/>
1197     <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
1198 neysx 1.244 <xsl:if test="not($httphost='archives')">
1199 robbat2 1.242 <tr>
1200     <td bgcolor="#7a5ada">
1201     <p class="codetitle">
1202     <xsl:value-of select="func:gettext('CodeListing')"/>&#160;<xsl:if test="$chid"><xsl:value-of select="$chid"/>.</xsl:if><xsl:value-of select="$prenum"/>
1203     <xsl:if test="@caption">
1204     <xsl:value-of select="func:gettext('SpaceBeforeColon')"/>: <xsl:value-of select="@caption"/>
1205     </xsl:if>
1206     </p>
1207     </td>
1208     </tr>
1209 neysx 1.244 </xsl:if>
1210 neysx 1.182 <tr>
1211 neysx 1.199 <td bgcolor="#eeeeff" align="left" dir="ltr">
1212 neysx 1.182 <pre>
1213     <xsl:apply-templates/>
1214     </pre>
1215     </td>
1216     </tr>
1217     </table>
1218     </xsl:if>
1219 swift 1.73 </xsl:template>
1220    
1221     <!-- Path -->
1222     <xsl:template match="path">
1223 neysx 1.199 <span class="path" dir="ltr"><xsl:apply-templates/></span>
1224 swift 1.73 </xsl:template>
1225    
1226     <!-- Url -->
1227     <xsl:template match="uri">
1228 neysx 1.165 <xsl:param name="paramlink"/>
1229 swift 1.73 <!-- expand templates to handle things like <uri link="http://bar"><c>foo</c></uri> -->
1230 neysx 1.240 <xsl:variable name="theurl">
1231     <xsl:choose>
1232     <xsl:when test="@link and contains(@link, '__FILE_')">
1233     <xsl:value-of select="concat(substring-before(@link,'__FILE__'),$basename,substring-after(@link,'__FILE__'))" />
1234     </xsl:when>
1235     <xsl:when test="@link"><xsl:value-of select="@link" /></xsl:when>
1236     <xsl:when test="contains(text(), '__FILE_')">
1237     <xsl:value-of select="concat(substring-before(text(),'__FILE__'),$basename,substring-after(text(),'__FILE__'))" />
1238     </xsl:when>
1239     <xsl:otherwise><xsl:value-of select="text()" /></xsl:otherwise>
1240     </xsl:choose>
1241     </xsl:variable>
1242    
1243 swift 1.73 <xsl:choose>
1244     <xsl:when test="@link">
1245 swift 1.87 <xsl:choose>
1246 neysx 1.147 <xsl:when test="($TTOP = 'sections') and (starts-with(@link, '?'))">
1247     <!-- Handbook link pointing to another part/chapter when viewing a single page,
1248     cannot be a link because we have no idea where to link to
1249     Besides, we have no way of knowing the language unless told via a param -->
1250     <xsl:variable name="nolink"><xsl:value-of select="func:gettext('hb_file', $glang)"/></xsl:variable>
1251     <span title="{$nolink}"><font color="#404080">(<xsl:apply-templates/>)</font></span>
1252     </xsl:when>
1253 swift 1.96 <xsl:when test="($TTOP = 'book') and ($full = 0) and (starts-with(@link, '?'))">
1254 neysx 1.112 <!-- Handbook link pointing to another part/chapter, normal case -->
1255 neysx 1.146 <xsl:choose>
1256     <xsl:when test="$style != 'printable'">
1257 neysx 1.240 <a href="{$link}{$theurl}"><xsl:apply-templates/></a>
1258 neysx 1.146 </xsl:when>
1259     <xsl:otherwise>
1260 neysx 1.240 <a href="{$link}{$theurl}&amp;style=printable"><xsl:apply-templates/></a>
1261 neysx 1.146 </xsl:otherwise>
1262     </xsl:choose>
1263 swift 1.96 </xsl:when>
1264     <xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '?'))">
1265 blackace 1.98 <!-- Handbook link pointing to another part/chapter
1266 swift 1.96 Handbook is being rendered in a single page (full=1)
1267 neysx 1.112 Hence link needs to be rewritten as a local one
1268 neysx 1.147 i.e. ?part=1&chap=3#doc_chap1 must become #book_part1_chap3__chap1 Case 1a
1269     i.e. ?part=1&chap=3#anID must become #anID Case 1b
1270 neysx 1.112 or ?part=1&chap=3 must become #book_part1_chap3 Case 2
1271     or ?part=2 must become #book_part2 Case 3-->
1272 swift 1.96 <xsl:choose>
1273 neysx 1.112 <xsl:when test="contains(@link, 'chap=') and contains(@link, '#doc_')">
1274 neysx 1.147 <!-- Link points inside a chapter (Case 1a)-->
1275 neysx 1.240 <xsl:variable name="linkpart" select="substring-after(substring-before($theurl, '&amp;'), '=')" />
1276     <xsl:variable name="linkchap" select="substring-before(substring-after(substring-after($theurl, '&amp;'), '='), '#doc_')" />
1277     <xsl:variable name="linkanch" select="substring-after($theurl, '#doc_')" />
1278 neysx 1.112 <a href="#book_part{$linkpart}_chap{$linkchap}__{$linkanch}"><xsl:apply-templates /></a>
1279     </xsl:when>
1280 neysx 1.147 <xsl:when test="contains(@link, 'chap=') and contains(@link, '#')">
1281     <!-- Link points inside a chapter via an ID (Case 1b)
1282     (IDs are expected to be unique throughout a handbook) -->
1283 neysx 1.192 <xsl:variable name="linkanch" select="substring-after(@link, '#')" />
1284 neysx 1.147 <a href="#{$linkanch}"><xsl:apply-templates /></a>
1285     </xsl:when>
1286 neysx 1.112 <xsl:when test="contains(@link, 'chap=')">
1287     <!-- Link points to a chapter (Case 2)-->
1288 neysx 1.240 <xsl:variable name="linkpart" select="substring-after(substring-before($theurl, '&amp;'), '=')" />
1289     <xsl:variable name="linkchap" select="substring-after(substring-after($theurl, '&amp;'), '=')" />
1290 swift 1.96 <a href="#book_part{$linkpart}_chap{$linkchap}"><xsl:apply-templates /></a>
1291     </xsl:when>
1292     <xsl:otherwise>
1293 neysx 1.112 <!-- Link points to a part (Case 3)-->
1294 neysx 1.240 <xsl:variable name="linkpart" select="substring-after($theurl, '=')" />
1295 swift 1.96 <a href="#book_part{$linkpart}"><xsl:apply-templates/></a>
1296     </xsl:otherwise>
1297     </xsl:choose>
1298     </xsl:when>
1299     <xsl:when test="($TTOP = 'book') and ($full = 1) and (starts-with(@link, '#'))">
1300 neysx 1.147 <!-- Handbook link pointing to another place in same part/chapter
1301 swift 1.96 Handbook is being rendered in a single page (full=1)
1302 blackace 1.98 Hence link needs to be rewritten as an internal one that is unique
1303 swift 1.96 for the whole handbook, i.e.
1304     #doc_part1_chap3 becomes #book_{UNIQUEID}_part1_chap3, but
1305 neysx 1.147 #anything_else_like_an_ID is left unchanged (IDs are expected to be unique throughout a handbook)-->
1306 swift 1.96 <xsl:choose>
1307     <xsl:when test="starts-with(@link, '#doc_')">
1308 neysx 1.192 <xsl:variable name="locallink" select="substring-after(@link, 'doc_')" />
1309 neysx 1.224 <xsl:variable name="bodyid" select="generate-id(ancestor::body)"/>
1310     <a href="{concat('#book_part',exslt:node-set($doc-struct)//bookpart[descendant::body[@uid=$bodyid]]/@pos,'_chap',exslt:node-set($doc-struct)//bookchap[descendant::body[@uid=$bodyid]]/@pos,'__',$locallink)}"><xsl:apply-templates /></a>
1311 swift 1.96 </xsl:when>
1312     <xsl:otherwise>
1313 neysx 1.240 <a href="{$theurl}"><xsl:apply-templates/></a>
1314 swift 1.96 </xsl:otherwise>
1315     </xsl:choose>
1316 swift 1.87 </xsl:when>
1317     <xsl:otherwise>
1318 neysx 1.165
1319     <xsl:variable name="thelink">
1320     <xsl:choose>
1321     <xsl:when test="name(..)='insert' and $theurl='$redirect' and $paramlink"><xsl:value-of select="$paramlink" /></xsl:when>
1322     <xsl:when test="name(..)='insert' and $theurl='$originalversion' and $paramlink">
1323     <xsl:variable name="temp">
1324     <xsl:value-of select="$paramlink"/>
1325     <xsl:if test="$style = 'printable'">&amp;style=printable</xsl:if>
1326     <xsl:if test="$full != '0'">&amp;full=1</xsl:if>
1327     <xsl:if test="$part != '0'">&amp;part=<xsl:value-of select="$part"/></xsl:if>
1328     <xsl:if test="$chap != '0'">&amp;chap=<xsl:value-of select="$chap"/></xsl:if>
1329     </xsl:variable>
1330     <xsl:choose>
1331     <xsl:when test="contains($temp, '&amp;')">
1332     <xsl:value-of select="concat(substring-before($temp,'&amp;'), '?', substring-after($temp,'&amp;'))"/>
1333     </xsl:when>
1334     <xsl:otherwise>
1335     <xsl:value-of select="$temp"/>
1336     </xsl:otherwise>
1337     </xsl:choose>
1338     </xsl:when>
1339     <xsl:otherwise><xsl:value-of select="$theurl" /></xsl:otherwise>
1340     </xsl:choose>
1341     </xsl:variable>
1342    
1343 neysx 1.209 <!-- Strip http://www.gentoo.org from links if running on www.g.o
1344     Has no effect on actual www.g.o but helps when surfing on a local copy as long as httphost is set to www as well
1345 neysx 1.180 Rewrite http://www.gentoo.org/cgi-bin/viewcvs/ to use sources.gentoo.org/
1346 neysx 1.159 -->
1347 neysx 1.146 <xsl:variable name="llink">
1348     <xsl:choose>
1349 neysx 1.180 <xsl:when test="starts-with($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://sources.gentoo.org/viewcvs.py', substring-after($thelink, 'http://www.gentoo.org/cgi-bin/viewcvs.cgi'))" /></xsl:when>
1350     <xsl:when test="starts-with($thelink, '/cgi-bin/viewcvs.cgi')"><xsl:value-of select="concat('http://sources.gentoo.org/viewcvs.py', substring-after($thelink, '/cgi-bin/viewcvs.cgi'))" /></xsl:when>
1351 neysx 1.209 <xsl:when test="$httphost='www' and starts-with($thelink, 'http://www.gentoo.org/')"><xsl:value-of select="substring-after($thelink, 'http://www.gentoo.org')" /></xsl:when>
1352     <xsl:when test="not($httphost='www') and starts-with($thelink, '/') and not(starts-with($thelink, '/~'))"><xsl:value-of select="concat('http://www.gentoo.org', $thelink)" /></xsl:when>
1353 neysx 1.163 <!-- Add catid to links to /doc/LL/index.xml -->
1354 neysx 1.165 <xsl:when test="$catid != '0' and starts-with($thelink, '/doc/') and (substring-after(substring-after($thelink, '/doc/'), '/')='' or substring-after(substring-after($thelink, '/doc/'), '/')='index.xml')">
1355     <xsl:value-of select="concat($thelink, '?catid=', $catid)"/>
1356 neysx 1.163 </xsl:when>
1357 neysx 1.165 <xsl:otherwise><xsl:value-of select="$thelink" /></xsl:otherwise>
1358 neysx 1.146 </xsl:choose>
1359     </xsl:variable>
1360    
1361     <!-- Now, insert style=printable in the URL if necessary -->
1362     <xsl:variable name="alink">
1363     <xsl:choose>
1364     <xsl:when test="$style != 'printable' or contains($llink, 'style=printable')">
1365     <!-- Not printable style or style=printable already in URL, copy link -->
1366     <xsl:value-of select="$llink" />
1367     </xsl:when>
1368     <xsl:when test="contains($llink, '://')">
1369     <!-- External link, copy link -->
1370     <xsl:value-of select="$llink" />
1371     </xsl:when>
1372     <xsl:when test="starts-with($llink, '#')">
1373     <!-- Anchor, copy link -->
1374     <xsl:value-of select="$llink" />
1375     </xsl:when>
1376     <xsl:otherwise>
1377     <!-- We should have eliminated all other cases,
1378     style printable, local link, then insert ?style=printable -->
1379     <xsl:choose>
1380     <xsl:when test="starts-with($llink, '?')">
1381     <xsl:value-of select="concat( '?style=printable&amp;', substring-after($llink, '?'))" />
1382     </xsl:when>
1383     <xsl:when test="contains($llink, '.xml?')">
1384     <xsl:value-of select="concat(substring-before($llink, '.xml?'), '.xml?style=printable&amp;', substring-after($llink, '.xml?'))" />
1385     </xsl:when>
1386     <xsl:when test="contains($llink, '.xml#')">
1387     <xsl:value-of select="concat(substring-before($llink, '.xml#'), '.xml?style=printable#', substring-after($llink, '.xml#'))" />
1388     </xsl:when>
1389     <xsl:when test="substring-after($llink, '.xml') = ''">
1390     <xsl:value-of select="concat($llink, '?style=printable')" />
1391     </xsl:when>
1392     <xsl:otherwise>
1393     <!-- Have I forgotten anything?
1394     Copy link -->
1395     <xsl:value-of select="$llink" />
1396     </xsl:otherwise>
1397     </xsl:choose>
1398     </xsl:otherwise>
1399     </xsl:choose>
1400     </xsl:variable>
1401     <a href="{$alink}"><xsl:apply-templates/></a>
1402 swift 1.87 </xsl:otherwise>
1403     </xsl:choose>
1404 swift 1.73 </xsl:when>
1405     <xsl:otherwise>
1406     <xsl:variable name="loc" select="."/>
1407     <a href="{$loc}"><xsl:apply-templates/></a>
1408     </xsl:otherwise>
1409     </xsl:choose>
1410     </xsl:template>
1411    
1412     <!-- Paragraph -->
1413     <xsl:template match="p">
1414     <xsl:param name="chid"/>
1415 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1416 neysx 1.166 <p>
1417     <!-- Keep this for old files with <p class="secthead"> -->
1418     <xsl:if test="@class">
1419     <xsl:attribute name="class"><xsl:value-of select="@class"/></xsl:attribute>
1420     </xsl:if>
1421    
1422     <xsl:if test="@by">
1423     <xsl:attribute name="class">epigraph</xsl:attribute>
1424     </xsl:if>
1425    
1426     <xsl:apply-templates>
1427     <xsl:with-param name="chid" select="$chid"/>
1428     </xsl:apply-templates>
1429    
1430     <xsl:if test="@by">
1431     <br/><br/><span class="episig">—<xsl:value-of select="@by"/></span><br/><br/>
1432     </xsl:if>
1433     </p>
1434 neysx 1.182 </xsl:if>
1435 swift 1.73 </xsl:template>
1436    
1437     <!-- Emphasize -->
1438     <xsl:template match="e">
1439     <span class="emphasis"><xsl:apply-templates/></span>
1440     </xsl:template>
1441    
1442     <!-- Table -->
1443     <xsl:template match="table">
1444 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1445     <table class="ntable">
1446     <xsl:apply-templates/>
1447     </table>
1448     </xsl:if>
1449 swift 1.73 </xsl:template>
1450    
1451     <!-- Table Row -->
1452     <xsl:template match="tr">
1453 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1454     <tr>
1455     <xsl:if test="@id">
1456     <xsl:attribute name="id">
1457     <xsl:value-of select="@id"/>
1458     </xsl:attribute>
1459     </xsl:if>
1460     <xsl:apply-templates/>
1461     </tr>
1462 neysx 1.158 </xsl:if>
1463 swift 1.73 </xsl:template>
1464    
1465 neysx 1.169 <xsl:template match="tcolumn">
1466     <col width="{@width}"/>
1467     </xsl:template>
1468    
1469 swift 1.73 <!-- Table Item -->
1470     <xsl:template match="ti">
1471 neysx 1.146 <td class="tableinfo">
1472 neysx 1.175 <xsl:if test="@align='center' or @align='right'">
1473     <xsl:attribute name="style"><xsl:value-of select="concat('text-align:',@align)"/></xsl:attribute>
1474     </xsl:if>
1475 neysx 1.169 <xsl:if test="@colspan">
1476     <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute>
1477     </xsl:if>
1478     <xsl:if test="@rowspan">
1479     <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute>
1480     </xsl:if>
1481 swift 1.73 <xsl:apply-templates/>
1482     </td>
1483     </xsl:template>
1484    
1485 neysx 1.166 <!-- Table Heading, no idea why <th> hasn't been used -->
1486 swift 1.73 <xsl:template match="th">
1487 neysx 1.239 <td class="infohead">
1488 neysx 1.166 <xsl:if test="@colspan">
1489     <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute>
1490 neysx 1.239 <!-- Center only when item spans several columns as
1491     centering all <th> might disrupt some pages.
1492     We might want to use a plain html <th> tag later.
1493     Tip: to center a single-cell title, use <th colspan="1">
1494     -->
1495     <xsl:attribute name="style">text-align:center</xsl:attribute>
1496 neysx 1.166 </xsl:if>
1497     <xsl:if test="@rowspan">
1498     <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute>
1499     </xsl:if>
1500 swift 1.73 <b>
1501     <xsl:apply-templates/>
1502     </b>
1503 neysx 1.239 </td>
1504 swift 1.73 </xsl:template>
1505    
1506     <!-- Unnumbered List -->
1507     <xsl:template match="ul">
1508 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1509     <ul>
1510     <xsl:apply-templates/>
1511     </ul>
1512     </xsl:if>
1513 swift 1.73 </xsl:template>
1514    
1515     <!-- Ordered List -->
1516     <xsl:template match="ol">
1517 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1518     <ol>
1519     <xsl:apply-templates/>
1520     </ol>
1521     </xsl:if>
1522 swift 1.73 </xsl:template>
1523    
1524     <!-- List Item -->
1525     <xsl:template match="li">
1526 neysx 1.182 <xsl:if test="not(@test) or dyn:evaluate(@test)">
1527     <li>
1528     <xsl:apply-templates/>
1529     </li>
1530     </xsl:if>
1531 swift 1.73 </xsl:template>
1532    
1533 neysx 1.166 <!-- Definition Lists -->
1534     <xsl:template match="dl">
1535     <dl><xsl:apply-templates/></dl>
1536     </xsl:template>
1537    
1538     <xsl:template match="dt">
1539     <dt><xsl:apply-templates/></dt>
1540     </xsl:template>
1541    
1542     <xsl:template match="dd">
1543     <dd><xsl:apply-templates/></dd>
1544     </xsl:template>
1545    
1546 swift 1.73 <!-- NOP -->
1547     <xsl:template match="ignoreinemail">
1548     <xsl:apply-templates/>
1549     </xsl:template>
1550    
1551     <!-- NOP -->
1552     <xsl:template match="ignoreinguide">
1553     </xsl:template>
1554    
1555     <!-- License Tag -->
1556 swift 1.61 <xsl:template match="license">
1557 neysx 1.146 <p class="copyright">
1558 neysx 1.194 <!-- Test for RTL languages -->
1559 neysx 1.208 <xsl:if test="$RTL='Y'">
1560 neysx 1.194 <xsl:attribute name="dir">RTL</xsl:attribute>
1561     </xsl:if>
1562 neysx 1.130 <xsl:apply-templates select="func:gettext('License')"/>
1563 neysx 1.146 </p>
1564 neysx 1.151 <xsl:comment>
1565     &lt;rdf:RDF xmlns="http://web.resource.org/cc/"
1566     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"&gt;
1567 neysx 1.152 &lt;License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"&gt;
1568 neysx 1.151 &lt;permits rdf:resource="http://web.resource.org/cc/Reproduction" /&gt;
1569     &lt;permits rdf:resource="http://web.resource.org/cc/Distribution" /&gt;
1570     &lt;requires rdf:resource="http://web.resource.org/cc/Notice" /&gt;
1571     &lt;requires rdf:resource="http://web.resource.org/cc/Attribution" /&gt;
1572     &lt;permits rdf:resource="http://web.resource.org/cc/DerivativeWorks" /&gt;
1573     &lt;requires rdf:resource="http://web.resource.org/cc/ShareAlike" /&gt;
1574     &lt;/License&gt;
1575     &lt;/rdf:RDF&gt;
1576     </xsl:comment>
1577 swift 1.61 </xsl:template>
1578 klieber 1.25
1579 neysx 1.207 <!-- GLEP index -->
1580     <xsl:template match="glepindex">
1581     <table class="ntable">
1582     <tr>
1583     <td class="infohead">Number</td><td class="infohead">Type</td><td class="infohead">Status</td><td class="infohead">Title</td>
1584     </tr>
1585     <xsl:apply-templates select="document(@index)/gleps/glep">
1586     <xsl:with-param name="status" select="string(@status)"/>
1587     </xsl:apply-templates>
1588     </table>
1589     </xsl:template>
1590    
1591     <!-- One GLEP table row -->
1592     <xsl:template match="glep">
1593     <xsl:param name="status" select="''"/>
1594     <xsl:if test="string-length($status)=0 or contains($status, @status)">
1595     <tr>
1596     <td class="tableinfo"><a href="{@file}"><xsl:value-of select="@id"/></a></td>
1597     <td class="tableinfo"><xsl:value-of select="@type"/></td>
1598     <td class="tableinfo"><xsl:value-of select="@status"/></td>
1599     <td class="tableinfo"><xsl:apply-templates select="node()"/></td>
1600     </tr>
1601     </xsl:if>
1602     </xsl:template>
1603    
1604    
1605 blackace 1.98 <!-- GLSA Index -->
1606     <xsl:template match="glsaindex">
1607     <xsl:apply-templates select="document('/dyn/glsa-index.xml')/guide/chapter[1]/section[1]/body"/>
1608     </xsl:template>
1609    
1610 swift 1.119 <!-- GLSA Latest (max 10) -->
1611     <xsl:template match="glsa-latest">
1612     <xsl:variable name="src" select="'/dyn/glsa-index.xml'"/>
1613     <table>
1614     <xsl:for-each select="document($src)/guide/chapter[1]/section[1]/body/table[1]/tr[position()&lt;11]">
1615     <tr><xsl:apply-templates/></tr>
1616     </xsl:for-each>
1617     </table>
1618     </xsl:template>
1619    
1620 neysx 1.141
1621 neysx 1.165 <!-- Compare versions between two documents, scan handbooks if need be -->
1622     <xsl:template name="compare-versions">
1623     <xsl:param name="original"/>
1624     <xsl:param name="translation"/>
1625 neysx 1.224
1626     <xsl:choose>
1627     <xsl:when test="$original/doc-struct/@type != $translation/doc-struct/@type">
1628     <xsl:text>NoOriginal</xsl:text>
1629     </xsl:when>
1630    
1631     <xsl:when test="/book and $full='0' and $chap != '0' and $part != '0' and not($original/doc-struct/bookpart[@pos=$part]/bookchap[@pos=$chap])">
1632     <xsl:text>NoOriginal</xsl:text>
1633     </xsl:when>
1634    
1635     <xsl:otherwise>
1636     <xsl:variable name="orig-versions">
1637     <xsl:for-each select="$original//version">
1638     <xsl:value-of select="concat(.,' ')"/>
1639     </xsl:for-each>
1640     </xsl:variable>
1641    
1642     <xsl:variable name="trans-versions">
1643     <xsl:for-each select="$translation//version">
1644     <xsl:value-of select="concat(.,' ')"/>
1645     </xsl:for-each>
1646     </xsl:variable>
1647    
1648     <xsl:if test="$orig-versions != $trans-versions">Different</xsl:if>
1649     </xsl:otherwise>
1650     </xsl:choose>
1651    
1652 neysx 1.165 </xsl:template>
1653    
1654     <xsl:template name="maxdate">
1655 neysx 1.224 <xsl:param name="thedoc"/>
1656 neysx 1.239 <xsl:for-each select="$thedoc//date">
1657 neysx 1.224 <xsl:sort select="." order="descending" />
1658     <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
1659 neysx 1.239 </xsl:for-each>
1660 neysx 1.165 </xsl:template>
1661    
1662     <xsl:template name="contentdate">
1663     <xsl:variable name="docdate">
1664     <xsl:call-template name="maxdate">
1665 neysx 1.224 <xsl:with-param name="thedoc" select="exslt:node-set($doc-struct)"/>
1666 neysx 1.165 </xsl:call-template>
1667     </xsl:variable>
1668 neysx 1.239
1669 neysx 1.165 <xsl:choose>
1670     <xsl:when test="func:gettext('Updated')/docdate">
1671     <xsl:apply-templates select="func:gettext('Updated')">
1672     <xsl:with-param name="docdate" select="$docdate"/>
1673     </xsl:apply-templates>
1674 neysx 1.147 </xsl:when>
1675 neysx 1.165 <xsl:otherwise>
1676     <xsl:value-of select="concat(func:gettext('Updated'),' ')"/> <xsl:copy-of select="func:format-date($docdate)"/>
1677     </xsl:otherwise>
1678 neysx 1.141 </xsl:choose>
1679     </xsl:template>
1680    
1681 neysx 1.165 <xsl:template name="outdated-translation">
1682 neysx 1.202 <!-- Add mention that translation is outdated whenever possible in /main and /doc-->
1683 neysx 1.213 <xsl:if test="$glang != '' and not (//*[1]/@metadoc = 'yes') and (starts-with($link, '/doc/') or starts-with($link, '/main/') or (starts-with($link, '/proj/') and contains($link, '/gdp/'))) and not(starts-with($link, '/doc/en/') or starts-with($link, '/main/en/') or starts-with($link, '/proj/en/'))">
1684 neysx 1.165 <!-- We have a translation, is it up-to-date? -->
1685     <xsl:variable name="metadoc" select="document(concat('/doc/', $glang, '/metadoc.xml'))"/>
1686     <xsl:variable name="fileid" select="$metadoc/metadoc/files/file[text()=$link]/@id"/>
1687     <xsl:choose>
1688     <xsl:when test="not($fileid)">
1689     <!-- File is not even listed in local metadoc.xml -->
1690     <xsl:value-of select="func:gettext('NoIndex')"/>
1691     </xsl:when>
1692     <xsl:otherwise>
1693     <xsl:variable name="pmetadoc" select="document($metadoc/metadoc/@parent)"/>
1694     <xsl:choose>
1695     <xsl:when test="not($pmetadoc/metadoc/files/file[@id=$fileid])">
1696     <!-- File is not listed in original metadoc.xml -->
1697     <xsl:value-of select="func:gettext('NoOriginal')"/>
1698     </xsl:when>
1699     <xsl:otherwise>
1700     <!-- Document is listed in both local metadoc.xml and English one, compare version numbers -->
1701     <xsl:variable name="pfile" select="$pmetadoc/metadoc/files/file[@id=$fileid]"/>
1702 neysx 1.224
1703     <xsl:variable name="orig-struct" xmlns="">
1704     <xsl:call-template name="build-doc-struct">
1705     <xsl:with-param name="doc" select="document($pfile)"/>
1706     </xsl:call-template>
1707     </xsl:variable>
1708    
1709 neysx 1.165 <xsl:variable name="versions">
1710     <xsl:call-template name="compare-versions">
1711 neysx 1.224 <xsl:with-param name="translation" select ="exslt:node-set($doc-struct)"/>
1712     <xsl:with-param name="original" select ="exslt:node-set($orig-struct)"/>
1713 neysx 1.165 </xsl:call-template>
1714     </xsl:variable>
1715 neysx 1.224
1716 neysx 1.222 <xsl:choose>
1717 neysx 1.224 <xsl:when test="$versions = 'Different'">
1718 neysx 1.222 <xsl:variable name="pdocdate">
1719     <xsl:call-template name="maxdate">
1720 neysx 1.224 <xsl:with-param name="thedoc" select="exslt:node-set($orig-struct)"/>
1721 neysx 1.222 </xsl:call-template>
1722     </xsl:variable>
1723     <xsl:variable name="res">
1724     <xsl:apply-templates select="func:gettext('Outdated')">
1725     <xsl:with-param name="docdate" select="$pdocdate"/>
1726     <xsl:with-param name="paramlink" select="$pfile"/>
1727     </xsl:apply-templates>
1728     </xsl:variable>
1729     <xsl:copy-of select="$res"/>
1730     </xsl:when>
1731 neysx 1.224 <xsl:when test="contains($versions,'NoOriginal')">
1732     <xsl:value-of select="func:gettext('NoOriginal')"/>
1733     </xsl:when>
1734 neysx 1.222 </xsl:choose>
1735 neysx 1.165 </xsl:otherwise>
1736     </xsl:choose>
1737     </xsl:otherwise>
1738     </xsl:choose>
1739     </xsl:if>
1740     </xsl:template>
1741    
1742     <xsl:template match="docdate">
1743     <xsl:param name="docdate"/>
1744     <xsl:copy-of select="func:format-date($docdate)"/>
1745     </xsl:template>
1746    
1747    
1748 neysx 1.146 <xsl:template name="rhcol">
1749     <!-- Right-hand column with date/authors/ads -->
1750 neysx 1.220
1751     <xsl:variable name="images">
1752     <!-- Source images from www.gentoo.org when on another server to
1753     prevent missing images after an update -->
1754     <xsl:choose>
1755     <xsl:when test="$httphost != 'www'">http://www.gentoo.org/</xsl:when>
1756     <xsl:otherwise>
1757     <xsl:value-of select="$ROOT"/>
1758     </xsl:otherwise>
1759     </xsl:choose>
1760     </xsl:variable>
1761    
1762 neysx 1.146 <table border="0" cellspacing="4px" cellpadding="4px">
1763 neysx 1.238 <!-- Add a "printer-friendly" -->
1764 neysx 1.186 <xsl:if test="/book or /guide">
1765 neysx 1.146 <tr>
1766     <td class="topsep" align="center">
1767     <p class="altmenu">
1768 neysx 1.161 <xsl:variable name="PrintTip"><xsl:value-of select="func:gettext('PrintTip')"/></xsl:variable>
1769     <xsl:variable name="href">
1770     <xsl:choose>
1771     <xsl:when test="/book and $full != 0">
1772 neysx 1.186 <xsl:value-of select="concat($link, '?full=1&amp;style=printable')"/>
1773 neysx 1.161 </xsl:when>
1774     <xsl:when test="/book">
1775 neysx 1.186 <xsl:value-of select="concat($link, '?style=printable')"/>
1776 neysx 1.161 <xsl:if test="$part != '0'">&amp;part=<xsl:value-of select="$part"/></xsl:if>
1777     <xsl:if test="$chap != '0'">&amp;chap=<xsl:value-of select="$chap"/></xsl:if>
1778     </xsl:when>
1779     <xsl:when test="/guide">
1780 neysx 1.186 <xsl:value-of select="concat($link, '?style=printable')"/>
1781 neysx 1.161 </xsl:when>
1782     </xsl:choose>
1783     </xsl:variable>
1784     <a title="{$PrintTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('Print')"/></a>
1785 neysx 1.146 </p>
1786     </td>
1787     </tr>
1788     </xsl:if>
1789 neysx 1.238 <!-- Add link to full handbook -->
1790     <xsl:if test="$TTOP='book' and $full=0">
1791     <tr>
1792     <td class="topsep" align="center">
1793     <p class="altmenu">
1794     <xsl:variable name="ShowFullHBTip"><xsl:value-of select="func:gettext('ShowFullHBTip')"/></xsl:variable>
1795     <xsl:variable name="href">
1796     <xsl:choose>
1797     <xsl:when test="$part != 0 and $chap != 0">
1798     <xsl:value-of select="concat($link, '?full=1#book_part',$part,'_chap',$chap)"/>
1799     </xsl:when>
1800     <xsl:otherwise>
1801     <xsl:value-of select="concat($link, '?full=1')"/>
1802     </xsl:otherwise>
1803     </xsl:choose>
1804     </xsl:variable>
1805     <a title="{$ShowFullHBTip}" class="altlink" href="{$href}"><xsl:value-of select="func:gettext('ShowFullHB')"/></a>
1806     </p>
1807     </td>
1808     </tr>
1809     </xsl:if>
1810 neysx 1.197 <xsl:if test="/book/date or /guide/date or /sections/date or /mainpage/date or /news/date">
1811     <tr>
1812     <td class="topsep">
1813     <!-- Test for RTL languages -->
1814     <xsl:choose>
1815 neysx 1.208 <xsl:when test="$RTL='Y'">
1816 neysx 1.197 <xsl:attribute name="dir">RTL</xsl:attribute>
1817     </xsl:when>
1818     <xsl:otherwise>
1819     <xsl:attribute name="align">center</xsl:attribute>
1820     </xsl:otherwise>
1821     </xsl:choose>
1822    
1823     <p class="alttext">
1824     <xsl:call-template name="contentdate"/>
1825     </p>
1826     </td>
1827     </tr>
1828 neysx 1.202 <xsl:if test="/book/date or /guide/date or /sections/date or /mainpage/date">
1829 neysx 1.165 <xsl:variable name="outdated">
1830     <xsl:call-template name="outdated-translation"/>
1831     </xsl:variable>
1832     <xsl:if test="string-length($outdated) &gt; 1">
1833     <tr>
1834 neysx 1.197 <td class="topsep">
1835     <!-- Test for RTL languages -->
1836     <xsl:choose>
1837 neysx 1.208 <xsl:when test="$RTL='Y'">
1838 neysx 1.197 <xsl:attribute name="dir">RTL</xsl:attribute>
1839     </xsl:when>
1840     <xsl:otherwise>
1841     <xsl:attribute name="align">left</xsl:attribute>
1842     </xsl:otherwise>
1843     </xsl:choose>
1844    
1845 neysx 1.165 <p class="alttext">
1846 neysx 1.212 <b><xsl:copy-of select="$outdated"/></b>
1847 neysx 1.165 </p>
1848     </td>
1849     </tr>
1850     </xsl:if>
1851 neysx 1.197 </xsl:if>
1852     </xsl:if>
1853 neysx 1.187 <xsl:if test="abstract or document(include/@href)/*[1]/abstract">
1854 neysx 1.146 <tr>
1855 neysx 1.197 <td class="topsep">
1856     <!-- Test for RTL languages -->
1857     <xsl:choose>
1858 neysx 1.208 <xsl:when test="$RTL='Y'">
1859 neysx 1.197 <xsl:attribute name="dir">RTL</xsl:attribute>
1860     </xsl:when>
1861     <xsl:otherwise>
1862     <xsl:attribute name="align">left</xsl:attribute>
1863     </xsl:otherwise>
1864     </xsl:choose>
1865    
1866 neysx 1.146 <p class="alttext">
1867     <!-- Abstract (summary) of the document -->
1868     <b><xsl:value-of select="func:gettext('Summary')"/>: </b>
1869 neysx 1.187 <xsl:choose>
1870     <xsl:when test="abstract">
1871     <xsl:value-of select="abstract" />
1872     </xsl:when>
1873     <xsl:otherwise>
1874     <xsl:value-of select="document(include/@href)/*[1]/abstract" />
1875     </xsl:otherwise>
1876     </xsl:choose>
1877 neysx 1.146 </p>
1878     </td>
1879     </tr>
1880     </xsl:if>
1881     <xsl:if test="/book/author or /guide/author">
1882     <tr>
1883 neysx 1.166 <td align="left" class="topsep">
1884 neysx 1.146 <p class="alttext">
1885     <!-- Authors -->
1886     <xsl:apply-templates select="/guide/author|/book/author"/>
1887     </p>
1888     </td>
1889     </tr>
1890     </xsl:if>
1891    
1892 neysx 1.149 <tr lang="en">
1893 neysx 1.146 <td align="center" class="topsep">
1894     <p class="alttext">
1895     <b>Donate</b> to support our development efforts.
1896     </p>
1897    
1898     <form action="https://www.paypal.com/cgi-bin/webscr" method="post">
1899     <input type="hidden" name="cmd" value="_xclick"/>
1900     <input type="hidden" name="business" value="paypal@gentoo.org"/>
1901     <input type="hidden" name="item_name" value="Gentoo Linux Support"/>
1902     <input type="hidden" name="item_number" value="1000"/>
1903     <input type="hidden" name="image_url" value="/images/paypal.png"/>
1904     <input type="hidden" name="no_shipping" value="1"/>
1905     <input type="hidden" name="return" value="http://www.gentoo.org"/>
1906     <input type="hidden" name="cancel_return" value="http://www.gentoo.org"/>
1907    
1908 neysx 1.174 <input type="image" src="http://images.paypal.com/images/x-click-but21.gif" name="submit" alt="Donate to Gentoo"/>
1909 neysx 1.146 </form>
1910     </td>
1911     </tr>
1912 neysx 1.241 <xsl:call-template name="ads">
1913     <xsl:with-param name="images" select="$images"/>
1914     </xsl:call-template>
1915 neysx 1.146 <tr>
1916     <td align="center" class="topsep"/>
1917     </tr>
1918     </table>
1919     </xsl:template>
1920    
1921 neysx 1.154 <xsl:template name="newscontent">
1922     <xsl:param name="thenews"/>
1923     <xsl:param name="summary"/>
1924     <xsl:param name="link"/>
1925    
1926     <div class="news">
1927     <p class="newshead" lang="en">
1928     <b><xsl:value-of select="$thenews/title"/></b>
1929     <br/>
1930     <font size="0.90em">
1931 neysx 1.239 <xsl:choose>
1932     <xsl:when test="$thenews/until">
1933     Posted between <xsl:copy-of select="func:format-date($thenews/date)"/> and <xsl:copy-of select="func:format-date($thenews/until)"/>
1934     </xsl:when>
1935     <xsl:otherwise>
1936     Posted on <xsl:copy-of select="func:format-date($thenews/date)"/>
1937     </xsl:otherwise>
1938     </xsl:choose>
1939 neysx 1.225 <xsl:variable name="poster">
1940     <xsl:call-template name="smart-mail">
1941     <xsl:with-param name="mail" select="$thenews/poster"/>
1942     </xsl:call-template>
1943     </xsl:variable>
1944     by <xsl:value-of select="$poster"/>
1945 neysx 1.154 </font>
1946     </p>
1947 neysx 1.239
1948 neysx 1.154 <xsl:choose>
1949 neysx 1.245 <xsl:when test="$thenews/@category='birthday'">
1950     <img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/>
1951     </xsl:when>
1952 neysx 1.154 <xsl:when test="$thenews/@category='gentoo'">
1953     <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
1954     </xsl:when>
1955     <xsl:when test="$thenews/@category='main'">
1956     <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
1957     </xsl:when>
1958     <xsl:when test="$thenews/@category='linux'">
1959     <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
1960     </xsl:when>
1961     <xsl:when test="$thenews/@category='moo'">
1962     <img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/>
1963     </xsl:when>
1964     <xsl:when test="$thenews/@category='plans'">
1965     <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
1966     </xsl:when>
1967 neysx 1.239 <xsl:when test="$thenews/@category='planet'">
1968     <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/>
1969     </xsl:when>
1970     <!-- old ones, kept to display very very old news items -->
1971     <xsl:when test="$thenews/@category='alpha'">
1972     <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
1973     </xsl:when>
1974     <xsl:when test="$thenews/@category='kde'">
1975     <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
1976     </xsl:when>
1977     <xsl:when test="$thenews/@category='ibm'">
1978     <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
1979     </xsl:when>
1980 neysx 1.154 <xsl:when test="$thenews/@category='nvidia'">
1981     <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
1982     </xsl:when>
1983     <xsl:when test="$thenews/@category='freescale'">
1984     <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
1985     </xsl:when>
1986     </xsl:choose>
1987 neysx 1.239
1988 neysx 1.154 <div class="newsitem">
1989     <xsl:choose>
1990     <xsl:when test="$thenews/summary and $summary='yes'">
1991     <xsl:apply-templates select="$thenews/summary"/>
1992     <br/>
1993     <a href="{$link}"><b>(full story)</b></a>
1994     </xsl:when>
1995     <xsl:when test="$thenews/body">
1996     <xsl:apply-templates select="$thenews/body"/>
1997     </xsl:when>
1998     </xsl:choose>
1999     </div>
2000     </div>
2001     </xsl:template>
2002    
2003 drobbins 1.1 </xsl:stylesheet>

  ViewVC Help
Powered by ViewVC 1.1.20