Gentoo Archives: gentoo-commits

From: "Xavier Neys (neysx)" <neysx@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in xml/htdocs/xsl: guide.xsl guide2.xsl
Date: Sat, 31 Jan 2009 08:42:53
Message-Id: E1LTBRC-0001Ye-CG@stork.gentoo.org
1 neysx 09/01/31 08:42:50
2
3 Modified: guide.xsl
4 Removed: guide2.xsl
5 Log:
6 #204402 & #252157 Reorg menu & display GLSA/new packages/blog entries on front page
7
8 Revision Changes Path
9 1.239 xml/htdocs/xsl/guide.xsl
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?rev=1.239&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?rev=1.239&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?r1=1.238&r2=1.239
14
15 Index: guide.xsl
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/guide.xsl,v
18 retrieving revision 1.238
19 retrieving revision 1.239
20 diff -u -r1.238 -r1.239
21 --- guide.xsl 28 Sep 2008 14:02:15 -0000 1.238
22 +++ guide.xsl 31 Jan 2009 08:42:50 -0000 1.239
23 @@ -5,8 +5,10 @@
24 xmlns:dyn="http://exslt.org/dynamic"
25 xmlns:str="http://exslt.org/strings"
26
27 + xmlns:feed="http://www.w3.org/2005/Atom"
28 +
29 xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/"
30 - exclude-result-prefixes="opensearch"
31 + exclude-result-prefixes="opensearch feed"
32
33 extension-element-prefixes="exslt func dyn str" >
34
35 @@ -23,6 +25,8 @@
36
37 <xsl:include href="/xsl/mail.xsl" />
38
39 +<xsl:include href="/xsl/menu.xsl" />
40 +
41 <xsl:include href="/xsl/devmap.xsl" />
42
43 <xsl:include href="/xsl/doc-struct.xsl" />
44 @@ -32,7 +36,7 @@
45
46 <!-- Global definition of style parameter -->
47 <xsl:param name="style">0</xsl:param>
48 -<xsl:param name="newsitemcount">6</xsl:param>
49 +<xsl:param name="newsitemcount">9</xsl:param>
50
51 <!-- Category from metadoc -->
52 <xsl:param name="catid">0</xsl:param>
53 @@ -151,7 +155,7 @@
54 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
55 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
56 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
57 -
58 +
59 <xsl:if test="//glsaindex or //glsa-latest">
60 <link rel="alternate" type="application/rss+xml">
61 <xsl:attribute name="href">
62 @@ -172,24 +176,20 @@
63 <!-- Redirect using http header when supported -->
64 <xsl:value-of select="concat('%%GORG%%Redirect=',/*[1]/@redirect)"/>
65 </xsl:message>
66 - </xsl:if>
67 + </xsl:if>
68
69 <title>
70 <xsl:choose>
71 - <xsl:when test="/guide/@type='project'">Gentoo Linux Projects — </xsl:when>
72 - <xsl:when test="/guide/@type='newsletter'">Gentoo Linux Newsletter — </xsl:when>
73 - <xsl:when test="/sections">Gentoo Linux Handbook Page — </xsl:when>
74 + <xsl:when test="/guide/@type='project'">Gentoo Linux Projects</xsl:when>
75 + <xsl:when test="/guide/@type='newsletter'">Gentoo Linux Newsletter</xsl:when>
76 + <xsl:when test="/sections">Gentoo Linux Handbook Page</xsl:when>
77 + <xsl:otherwise><xsl:value-of select="func:gettext('GLinuxDoc')"/></xsl:otherwise>
78 </xsl:choose>
79 +--
80 <xsl:choose>
81 <xsl:when test="subtitle"><xsl:if test="/guide/@type!='newsletter'"><xsl:value-of select="title"/>:</xsl:if> <xsl:value-of select="subtitle"/></xsl:when>
82 <xsl:otherwise><xsl:value-of select="title"/></xsl:otherwise>
83 </xsl:choose>
84 - <xsl:choose>
85 - <xsl:when test="/guide/@type='project'"/>
86 - <xsl:when test="/guide/@type='newsletter'"/>
87 - <xsl:when test="/sections"/>
88 - <xsl:otherwise> — <xsl:value-of select="func:gettext('GLinuxDoc')"/></xsl:otherwise>
89 - </xsl:choose>
90 </title>
91
92 </head>
93 @@ -287,7 +287,7 @@
94 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
95 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
96 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
97 -
98 +
99 <xsl:if test="/*[1][@redirect]">
100 <!-- Immediate HTML refresh in case redirect is not supported -->
101 <meta http-equiv="Refresh">
102 @@ -297,7 +297,7 @@
103 <!-- Redirect using http header when supported -->
104 <xsl:value-of select="concat('%%GORG%%Redirect=',/*[1]/@redirect)"/>
105 </xsl:message>
106 - </xsl:if>
107 + </xsl:if>
108
109 <xsl:if test="/mainpage/newsitems">
110 <link rel="alternate" type="application/rss+xml" title="Gentoo Linux News RDF" href="http://www.gentoo.org/rdf/en/gentoo-news.rdf" />
111 @@ -326,7 +326,7 @@
112 <xsl:variable name="newscript" select="str:replace($devmap-js, 'X-PLACEHOLDER', string($selectdev))"/>
113 <script type="text/javascript">//<xsl:comment><xsl:value-of select="$newscript"/>//</xsl:comment></script>
114 </xsl:if>
115 -
116 +
117 </head>
118 <body style="margin:0px;" bgcolor="#000000">
119
120 @@ -336,8 +336,6 @@
121 </xsl:if>
122
123 <table border="0" width="100%" cellspacing="0" cellpadding="0">
124 - <xsl:variable name="tpath" select="str:replace($link, str:replace(concat('/',$glang,'/'),'//','/en/'), '/**/')"/>
125 - <xsl:variable name="isEnglish"><xsl:if test="string-length($glang)=0 or $glang='en'">Y</xsl:if></xsl:variable>
126 <xsl:variable name="www"><xsl:if test="$httphost!='www'">http://www.gentoo.org</xsl:if></xsl:variable>
127 <tr>
128 <td valign="top" height="125" width="1%" bgcolor="#45347b">
129 @@ -346,111 +344,7 @@
130 <!-- Top bar menu -->
131 <td valign="bottom" align="left" bgcolor="#000000" colspan="2" lang="en">
132 <p class="menu">
133 - <a class="menulink" href="{concat($www,'/main/en/about.xml')}">
134 - <xsl:choose>
135 - <xsl:when test="$tpath='/main/**/about.xml'">
136 - <xsl:attribute name="class">highlight</xsl:attribute>
137 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
138 - </xsl:when>
139 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/about.xml'))/missing)">
140 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/about.xml')"/></xsl:attribute>
141 - </xsl:when>
142 - </xsl:choose>
143 - About</a>
144 - |
145 - <a class="menulink" href="{concat($www,'/proj/en/index.xml')}">
146 - <xsl:if test="starts-with($tpath, '/proj/**/')">
147 - <xsl:attribute name="class">highlight</xsl:attribute>
148 - </xsl:if>
149 - Projects</a>
150 - |
151 - <a class="menulink" href="{concat($www,'/doc/en/index.xml')}">
152 - <xsl:choose>
153 - <xsl:when test="starts-with($tpath, '/doc/**/')">
154 - <xsl:attribute name="class">highlight</xsl:attribute>
155 - <xsl:attribute name="href"><xsl:value-of select="str:replace(concat('/doc/',$glang,'/'), '//','/en/')"/></xsl:attribute>
156 - </xsl:when>
157 - <xsl:when test="not($isEnglish='Y' or document(concat('/doc/', $glang, '/index.xml'))/missing)">
158 - <xsl:attribute name="href"><xsl:value-of select="concat('/doc/',$glang,'/index.xml')"/></xsl:attribute>
159 - </xsl:when>
160 - </xsl:choose>
161 - Docs</a>
162 - | <a class="menulink" href="http://forums.gentoo.org">Forums</a>
163 - |
164 - <a class="menulink" href="{concat($www,'/main/en/lists.xml')}">
165 - <xsl:choose>
166 - <xsl:when test="$tpath='/main/**/lists.xml'">
167 - <xsl:attribute name="class">highlight</xsl:attribute>
168 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
169 - </xsl:when>
170 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/lists.xml'))/missing)">
171 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/lists.xml')"/></xsl:attribute>
172 - </xsl:when>
173 - </xsl:choose>
174 - Lists</a>
175 - | <a class="menulink" href="http://bugs.gentoo.org">Bugs</a>
176 - | <a class="menulink" href="http://www.cafepress.com/officialgentoo/">Store</a>
177 - |
178 - <a class="menulink" href="{concat($www,'/news/en/gmn/')}">
179 - <xsl:choose>
180 - <xsl:when test="starts-with($tpath, '/news/**/gmn/')">
181 - <xsl:attribute name="class">highlight</xsl:attribute>
182 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
183 - </xsl:when>
184 - <xsl:when test="not($isEnglish='Y' or document(concat('/news/', $glang, '/gmn/index.xml'))/missing)">
185 - <xsl:attribute name="href"><xsl:value-of select="concat('/news/',$glang,'/gmn/index.xml')"/></xsl:attribute>
186 - </xsl:when>
187 - </xsl:choose>
188 - GMN</a>
189 - |
190 - <a class="menulink" href="{concat($www,'/main/en/where.xml')}">
191 - <xsl:choose>
192 - <xsl:when test="$tpath='/main/**/where.xml'">
193 - <xsl:attribute name="class">highlight</xsl:attribute>
194 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
195 - </xsl:when>
196 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/where.xml'))/missing)">
197 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/where.xml')"/></xsl:attribute>
198 - </xsl:when>
199 - </xsl:choose>
200 - Get Gentoo!</a>
201 - |
202 - <a class="menulink" href="{concat($www,'/main/en/support.xml')}">
203 - <xsl:choose>
204 - <xsl:when test="$tpath='/main/**/support.xml'">
205 - <xsl:attribute name="class">highlight</xsl:attribute>
206 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
207 - </xsl:when>
208 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/support.xml'))/missing)">
209 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/support.xml')"/></xsl:attribute>
210 - </xsl:when>
211 - </xsl:choose>
212 - Support</a>
213 - |
214 - <a class="menulink" href="{concat($www,'/main/en/sponsors.xml')}">
215 - <xsl:choose>
216 - <xsl:when test="$tpath='/main/**/sponsors.xml'">
217 - <xsl:attribute name="class">highlight</xsl:attribute>
218 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
219 - </xsl:when>
220 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/sponsors.xml'))/missing)">
221 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/sponsors.xml')"/></xsl:attribute>
222 - </xsl:when>
223 - </xsl:choose>
224 - Sponsors</a>
225 - | <a class="menulink" href="http://planet.gentoo.org">Planet</a>
226 - |
227 - <a class="menulink" href="{concat($www,'/main/en/contact.xml')}">
228 - <xsl:choose>
229 - <xsl:when test="$tpath='/main/**/contact.xml'">
230 - <xsl:attribute name="class">highlight</xsl:attribute>
231 - <xsl:attribute name="href"><xsl:value-of select="$link"/></xsl:attribute>
232 - </xsl:when>
233 - <xsl:when test="not($isEnglish='Y' or document(concat('/main/', $glang, '/contact.xml'))/missing)">
234 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/contact.xml')"/></xsl:attribute>
235 - </xsl:when>
236 - </xsl:choose>
237 - Contact</a>
238 + <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='Y']"/>
239 </p>
240 </td>
241 </tr>
242 @@ -469,119 +363,9 @@
243 <tr>
244 <td valign="top" class="leftmenu" lang="en">
245 <p class="altmenu">
246 - Installation:
247 - <br/>
248 - <a class="altlink" href="{concat($www,'/doc/en/handbook/index.xml')}">
249 - <xsl:if test="not($isEnglish='Y' or document(concat('/doc/', $glang, '/handbook/index.xml'))/missing)">
250 - <xsl:attribute name="href"><xsl:value-of select="concat('/doc/',$glang,'/handbook/index.xml')"/></xsl:attribute>
251 - </xsl:if>
252 - <xsl:text>Gentoo&#xA0;Handbook</xsl:text></a>
253 - <br/>
254 - <a class="altlink" href="{concat($www,'/doc/en/index.xml?catid=install#doc_chap2')}">
255 - <xsl:if test="not($isEnglish='Y' or document(concat('/doc/', $glang, '/index.xml'))/missing)">
256 - <xsl:attribute name="href"><xsl:value-of select="concat('/doc/',$glang,'/index.xml?catid=install#doc_chap2')"/></xsl:attribute>
257 - </xsl:if>
258 - <xsl:text>Installation&#xA0;Docs</xsl:text></a>
259 - <br/><br/>
260 - Documentation:
261 - <br/>
262 - <a class="altlink" href="{concat($www,'/doc/en/index.xml')}">
263 - <xsl:if test="not($isEnglish='Y' or document(concat('/doc/', $glang, '/index.xml'))/missing)">
264 - <xsl:attribute name="href"><xsl:value-of select="concat('/doc/',$glang,'/index.xml')"/></xsl:attribute>
265 - </xsl:if>
266 - <xsl:text>Home</xsl:text></a>
267 - <br/>
268 - <a class="altlink" href="{concat($www,'/doc/en/list.xml')}">
269 - <xsl:if test="not($isEnglish='Y' or document(concat('/doc/', $glang, '/list.xml'))/missing)">
270 - <xsl:attribute name="href"><xsl:value-of select="concat('/doc/',$glang,'/list.xml')"/></xsl:attribute>
271 - </xsl:if>
272 - <xsl:text>Listing</xsl:text></a>
273 - <br/>
274 - <a class="altlink" href="{concat($www,'/main/en/about.xml')}">
275 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/about.xml'))/missing)">
276 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/about.xml')"/></xsl:attribute>
277 - </xsl:if>
278 - <xsl:text>About&#xA0;Gentoo</xsl:text></a>
279 - <br/>
280 - <a class="altlink" href="{concat($www,'/main/en/philosophy.xml')}">
281 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/philosophy.xml'))/missing)">
282 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/philosophy.xml')"/></xsl:attribute>
283 - </xsl:if>
284 - <xsl:text>Philosophy</xsl:text></a>
285 - <br/>
286 - <a class="altlink" href="{concat($www,'/main/en/contract.xml')}">
287 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/contract.xml'))/missing)">
288 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/contract.xml')"/></xsl:attribute>
289 - </xsl:if>
290 - <xsl:text>Social&#xA0;Contract</xsl:text></a>
291 - <br/><br/>
292 - Resources:
293 - <br/>
294 - <a class="altlink" href="http://bugs.gentoo.org">Bug&#xA0;Tracker</a>
295 - <br/>
296 - <a class="altlink" href="{concat($www,'/proj/en/devrel/roll-call/userinfo.xml')}">Developer&#xA0;List</a>
297 - <br/>
298 - <a class="altlink" href="http://forums.gentoo.org">Discussion&#xA0;Forums</a>
299 - <br/>
300 - <a class="altlink" href="http://torrents.gentoo.org/">Gentoo&#xA0;BitTorrents</a>
301 - <br/>
302 - <a class="altlink" href="{concat($www,'/proj/en/glep/')}">Gentoo&#xA0;Linux Enhancement Proposals</a>
303 - <br/>
304 - <a class="altlink" href="{concat($www,'/main/en/irc.xml')}">
305 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/irc.xml'))/missing)">
306 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/irc.xml')"/></xsl:attribute>
307 - </xsl:if>
308 - <xsl:text>IRC&#xA0;Channels</xsl:text></a>
309 - <br/>
310 - <a class="altlink" href="{concat($www,'/main/en/lists.xml')}">
311 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/lists.xml'))/missing)">
312 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/lists.xml')"/></xsl:attribute>
313 - </xsl:if>
314 - <xsl:text>Mailing&#xA0;Lists</xsl:text></a>
315 - <br/>
316 - <a class="altlink" href="{concat($www,'/main/en/mirrors.xml')}">
317 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/mirrors.xml'))/missing)">
318 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/mirrors.xml')"/></xsl:attribute>
319 - </xsl:if>
320 - <xsl:text>Mirrors</xsl:text></a>
321 - <br/>
322 - <a class="altlink" href="{concat($www,'/main/en/name-logo.xml')}">
323 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/name-logo.xml'))/missing)">
324 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/name-logo.xml')"/></xsl:attribute>
325 - </xsl:if>
326 - <xsl:text>Name and Logo Guidelines</xsl:text></a>
327 - <br/>
328 - <a class="altlink" href="http://packages.gentoo.org/">Online Package Database</a>
329 - <br/>
330 - <a class="altlink" href="{concat($www,'/security/en/index.xml')}">Security Announcements</a>
331 - <br/>
332 - <a class="altlink" href="{concat($www,'/proj/en/devrel/staffing-needs/')}">Staffing&#xA0;Needs</a>
333 - <br/>
334 - <a class="altlink" href="http://vendors.gentoo.org/">Supporting&#xA0;Vendors</a>
335 - <br/>
336 - <a class="altlink" href="http://sources.gentoo.org/">View&#xA0;our&#xA0;Sources</a>
337 - <br/><br/>
338 - Graphics:
339 - <br/>
340 - <a class="altlink" href="{concat($www,'/main/en/graphics.xml')}">
341 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/graphics.xml'))/missing)">
342 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/graphics.xml')"/></xsl:attribute>
343 - </xsl:if>
344 - <xsl:text>Logos and themes</xsl:text></a>
345 - <br/>
346 - <a class="altlink" href="{concat($www,'/main/en/shots.xml')}">
347 - <xsl:if test="not($isEnglish='Y' or document(concat('/main/', $glang, '/shots.xml'))/missing)">
348 - <xsl:attribute name="href"><xsl:value-of select="concat('/main/',$glang,'/shots.xml')"/></xsl:attribute>
349 - </xsl:if>
350 - <xsl:text>ScreenShots</xsl:text></a>
351 - <br/><br/>
352 - Miscellaneous Resources:
353 - <br/>
354 - <a class="altlink" href="http://www.cafepress.com/officialgentoo/">Gentoo Linux Store</a>
355 - <br/>
356 - <a class="altlink" href="{concat($www,'/doc/en/articles/')}">IBM dW/Intel article archive</a>
357 + <xsl:apply-templates select="document('/xsl/menu.xml')//group[@top='N']"/>
358 </p>
359 - <br/><br />
360 + <br/><br/>
361 </td>
362 </tr>
363 </table>
364 @@ -607,13 +391,249 @@
365 To learn more, read our <b><a href="/main/en/about.xml">about
366 page</a></b>.</span>
367 </p>
368 - <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&lt;=$newsitemcount]/text()">
369 - <xsl:call-template name="newscontent">
370 - <xsl:with-param name="thenews" select="document(.)/news"/>
371 - <xsl:with-param name="summary" select="'yes'"/>
372 - <xsl:with-param name="link" select="."/>
373 - </xsl:call-template>
374 - </xsl:for-each>
375 +
376 + <xsl:variable name="GLSAs" select="document('/dyn/glsa-index2.xml')"/>
377 + <xsl:variable name="new-packages" select="document('/dyn/new-packages.xml')"/>
378 + <xsl:variable name="planet" select="document('/dyn/planet.xml')"/>
379 +
380 + <xsl:variable name="all-news" xmlns="">
381 + <news>
382 + <!-- News from news-index.xml, i.e. list of files under /news/ -->
383 + <xsl:for-each select="document('/dyn/news-index.xml')/uris/uri[position()&lt;=$newsitemcount]/text()">
384 + <xsl:variable name="tlink" select="."/>
385 + <newsitem date="{document($tlink)/news/date}" link="{$tlink}"/>
386 + </xsl:for-each>
387 +
388 + <!-- GLSAs from my own glsa-index.xml, i.e. not Gentoo's -->
389 + <xsl:for-each select="$GLSAs//glsa">
390 + <!-- <xsl:sort select="date" order="descending"/> Can't sort on English dates, they should be sorted in the source file -->
391 + <xsl:if test="position() &lt;=$newsitemcount">
392 + <!-- convert bloody dates like 'July 29, 2006: 02' to YYYY-MM-DD -->
393 + <xsl:variable name="yydate">
394 + <xsl:choose>
395 + <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),'|'))">
396 + <xsl:value-of select="substring(date,1,10)"/>
397 + </xsl:when>
398 + <xsl:otherwise>
399 + <xsl:value-of select="substring(substring-after(substring-after(date,' '),' '),1,4)"/>
400 + <xsl:text>-</xsl:text>
401 + <xsl:choose>
402 + <xsl:when test="substring-before(date,' ')='January'">01</xsl:when>
403 + <xsl:when test="substring-before(date,' ')='February'">02</xsl:when>
404 + <xsl:when test="substring-before(date,' ')='March'">03</xsl:when>
405 + <xsl:when test="substring-before(date,' ')='April'">04</xsl:when>
406 + <xsl:when test="substring-before(date,' ')='May'">05</xsl:when>
407 + <xsl:when test="substring-before(date,' ')='June'">06</xsl:when>
408 + <xsl:when test="substring-before(date,' ')='July'">07</xsl:when>
409 + <xsl:when test="substring-before(date,' ')='August'">08</xsl:when>
410 + <xsl:when test="substring-before(date,' ')='September'">09</xsl:when>
411 + <xsl:when test="substring-before(date,' ')='October'">10</xsl:when>
412 + <xsl:when test="substring-before(date,' ')='November'">11</xsl:when>
413 + <xsl:when test="substring-before(date,' ')='December'">12</xsl:when>
414 + <xsl:otherwise>00</xsl:otherwise>
415 + </xsl:choose>
416 + <xsl:text>-</xsl:text>
417 + <xsl:value-of select="substring-before(substring-after(date,' '),',')"/>
418 + </xsl:otherwise>
419 + </xsl:choose>
420 + </xsl:variable>
421 + <xsl:if test="func:is-date($yydate)='YES'">
422 + <newsitem date="{$yydate}" glsaid="{@id}"/>
423 + </xsl:if>
424 + </xsl:if>
425 + </xsl:for-each>
426 +
427 + <!-- New packages from packages.gentoo.org/feed/newpackage-->
428 + <xsl:if test="$new-packages//feed:entry/feed:updated">
429 + <newsitem date="{substring($new-packages//feed:entry[1]/feed:updated,1,10)}" package="{generate-id($new-packages//feed:entry[1])}"/>
430 + </xsl:if>
431 +
432 + <!-- Latest posts on planet.g.o from planet.gentoo.org/rss20.xml -->
433 + <xsl:for-each select="$planet/rss/channel/item">
434 + <xsl:variable name="pubDate" select="substring(pubDate,1,16)"/>
435 + <xsl:if test="count(preceding-sibling::item[substring(pubDate,1,16)=$pubDate])=0">
436 + <xsl:variable name="postdate">
437 + <xsl:value-of select="substring(substring-after(substring-after(substring-after(pubDate,' '),' '), ' '),1,4)"/>
438 + <xsl:choose>
439 + <xsl:when test="'Jan' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-01-</xsl:when>
440 + <xsl:when test="'Feb' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-02-</xsl:when>
441 + <xsl:when test="'Mar' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-03-</xsl:when>
442 + <xsl:when test="'Apr' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-04-</xsl:when>
443 + <xsl:when test="'May' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-05-</xsl:when>
444 + <xsl:when test="'Jun' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-06-</xsl:when>
445 + <xsl:when test="'Jul' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-07-</xsl:when>
446 + <xsl:when test="'Aug' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-08-</xsl:when>
447 + <xsl:when test="'Sep' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-09-</xsl:when>
448 + <xsl:when test="'Oct' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-10-</xsl:when>
449 + <xsl:when test="'Nov' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-11-</xsl:when>
450 + <xsl:when test="'Dec' = substring(substring-after(substring-after(pubDate,' '),' '),1,3)">-12-</xsl:when>
451 + <xsl:otherwise>-00-</xsl:otherwise>
452 + </xsl:choose>
453 + <xsl:value-of select="format-number(number(substring-before(substring-after(pubDate,' '),' ')),'00')"/>
454 + </xsl:variable>
455 + <xsl:if test="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]">
456 + <newsitem date="{$postdate}" planet="{$pubDate}"/>
457 + </xsl:if>
458 + </xsl:if>
459 + </xsl:for-each>
460 + </news>
461 + </xsl:variable>
462 +
463 + <xsl:variable name="all-news1" xmlns="">
464 + <news>
465 + <xsl:for-each select="exslt:node-set($all-news)/news/newsitem">
466 + <xsl:sort select="@date" order="descending"/>
467 + <xsl:copy-of select="."/>
468 + </xsl:for-each>
469 + </news>
470 + </xsl:variable>
471 +
472 + <xsl:variable name="all-news0" xmlns="">
473 + <news>
474 + <xsl:for-each select="exslt:node-set($all-news1)/news/newsitem">
475 + <xsl:choose>
476 + <xsl:when test="@link or @package or @glsaid">
477 + <xsl:copy-of select="."/>
478 + </xsl:when>
479 +
480 + <xsl:when test="@planet">
481 + <xsl:if test="not(preceding-sibling::newsitem[1]/@planet)">
482 + <!-- group consecutive blog days into a single item -->
483 + <newsitem date="{@date}" blog='1'>
484 + <xsl:copy-of select="."/>
485 + <xsl:apply-templates select="following-sibling::*[position()=1 and @planet]" mode="moreblogs"/>
486 + </newsitem>
487 + </xsl:if>
488 + </xsl:when>
489 + </xsl:choose>
490 + </xsl:for-each>
491 + </news>
492 + </xsl:variable>
493 +
494 + <!-- Display news items -->
495 +
496 + <xsl:for-each select="exslt:node-set($all-news0)/news/newsitem">
497 + <xsl:sort select="@date" order="descending"/>
498 +
499 + <!-- Build a newsitem that can be passed to the template that displays a newsitem -->
500 + <xsl:variable name="thenews" xmlns="">
501 + <news>
502 + <xsl:choose>
503 + <xsl:when test="@link">
504 + <xsl:variable name="newsitem" select="document(@link)/news"/>
505 + <xsl:attribute name="category"><xsl:value-of select="$newsitem/@category"/></xsl:attribute>
506 + <title><xsl:copy-of select="$newsitem/title"/></title>
507 + <date><xsl:value-of select="@date"/></date>
508 + <!--
509 + <xsl:variable name="poster">
510 + <xsl:call-template name="smart-mail">
511 + <xsl:with-param name="mail" select="$newsitem/poster"/>
512 + </xsl:call-template>
513 + </xsl:variable>
514 + <poster><xsl:copy-of select="$poster"/></poster>
515 + -->
516 + <poster><xsl:value-of select="$newsitem/poster"/></poster>
517 + <xsl:choose>
518 + <xsl:when test="$newsitem/summary"><summary><xsl:copy-of select="$newsitem/summary"/></summary></xsl:when>
519 + <xsl:otherwise><body><xsl:copy-of select="$newsitem/body"/></body></xsl:otherwise>
520 + </xsl:choose>
521 + </xsl:when>
522 +
523 + <xsl:when test="@blog">
524 + <xsl:attribute name="category">planet</xsl:attribute>
525 + <title>Blog posts</title>
526 + <date><xsl:value-of select="@date"/></date>
527 + <xsl:if test="@date != ./newsitem[position()=last()]/@date">
528 + <until><xsl:value-of select="./newsitem[position()=last()]/@date"/></until>
529 + </xsl:if>
530 + <poster>planet.gentoo.org</poster>
531 + <body><table>
532 + <xsl:variable name="blogentries" xmlns="">
533 + <xsl:for-each select="./newsitem">
534 + <xsl:variable name="pubDate" select="@planet"/>
535 + <xsl:for-each select="$planet//item[substring(pubDate,1,16)=$pubDate and not(contains(link, 'http://www.gentoo.org/news'))]">
536 + <tr>
537 + <xsl:choose>
538 + <xsl:when test="contains(title,': ')">
539 + <ti><xsl:value-of select="substring-before(title,': ')"/></ti>
540 + <ti><uri link="{link}"><xsl:value-of select="substring-after(title,': ')"/></uri></ti>
541 + </xsl:when>
542 + <xsl:otherwise>
543 + <ti><xsl:value-of select="title"/></ti>
544 + <ti><uri link="{link}">. . .</uri></ti>
545 + </xsl:otherwise>
546 + </xsl:choose>
547 + </tr>
548 + </xsl:for-each>
549 + </xsl:for-each>
550 + </xsl:variable>
551 +
552 + <xsl:variable name="sortedblogentries" xmlns="">
553 + <xsl:for-each select="exslt:node-set($blogentries)/tr">
554 + <xsl:sort select="ti[1]"/>
555 + <tr>
556 + <xsl:copy-of select="ti"/>
557 + </tr>
558 + </xsl:for-each>
559 + </xsl:variable>
560 +
561 + <xsl:for-each select="exslt:node-set($sortedblogentries)/tr">
562 + <xsl:variable name="blogposter" select="ti[1]"/>
563 + <tr>
564 + <xsl:choose>
565 + <xsl:when test="preceding-sibling::tr[1]/ti[1]/text()=$blogposter">
566 + </xsl:when>
567 + <xsl:when test="following-sibling::tr[1]/ti[1]/text()=$blogposter">
568 + <ti rowspan="{1+count(following-sibling::tr[ti[1]/text()=$blogposter])}"><xsl:value-of select="ti[1]"/></ti>
569 + </xsl:when>
570 + <xsl:otherwise>
571 + <xsl:copy-of select="ti[1]"/>
572 + </xsl:otherwise>
573 + </xsl:choose>
574 + <xsl:copy-of select="ti[2]"/>
575 + </tr>
576 + </xsl:for-each>
577 + </table></body>
578 + </xsl:when>
579 +
580 + <xsl:when test="@glsaid">
581 + <xsl:attribute name="category">plans</xsl:attribute>
582 + <xsl:variable name="glsaid" select="@glsaid"/>
583 + <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>
584 + <date><xsl:value-of select="@date"/></date>
585 + <poster>Gentoo Security Team</poster>
586 + <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>
587 + </xsl:when>
588 +
589 + <xsl:when test="@package">
590 + <xsl:attribute name="category">moo</xsl:attribute>
591 + <xsl:variable name="pid" select="@package"/>
592 + <title>New Packages</title>
593 + <date><xsl:value-of select="@date"/></date>
594 + <poster>packages.gentoo.org</poster>
595 + <body><table>
596 + <xsl:for-each select="$new-packages//feed:entry">
597 + <tr>
598 + <ti><uri link="{feed:id}"><xsl:value-of select="feed:title/feed:div/feed:span[1]"/></uri></ti>
599 + <ti><xsl:value-of select="feed:title/feed:div/feed:span[2]"/></ti>
600 + </tr>
601 + </xsl:for-each>
602 + </table></body>
603 + </xsl:when>
604 + </xsl:choose>
605 + </news>
606 + </xsl:variable>
607 +
608 + <xsl:call-template name="newscontent">
609 + <xsl:with-param name="thenews" select="exslt:node-set($thenews)/news"/>
610 + <xsl:with-param name="summary" select="'yes'"/>
611 + <xsl:with-param name="link" select="@link"/>
612 + </xsl:call-template>
613 + </xsl:for-each>
614 +
615 +
616 +
617 +
618 <!-- Links to older news below news items -->
619 <div class="news">
620 <p class="newshead" lang="en">
621 @@ -627,6 +647,7 @@
622 </ul>
623 </div>
624 </xsl:when>
625 +
626 <xsl:when test="/news">
627 <xsl:call-template name="newscontent">
628 <xsl:with-param name="thenews" select="/news"/>
629 @@ -664,6 +685,13 @@
630 </html>
631 </xsl:template>
632
633 +<xsl:template match="newsitem" mode="moreblogs">
634 + <xsl:copy-of select="."/>
635 + <xsl:if test="following-sibling::*[1]/@planet">
636 + <xsl:apply-templates select="following-sibling::newsitem[position()=1 and @planet]" mode="moreblogs"/>
637 + </xsl:if>
638 +</xsl:template>
639 +
640 <xsl:template name="copyright-footer">
641 <xsl:variable name="isEnglish">
642 <xsl:if test="string-length($glang)=0 or $glang='en'">Y</xsl:if>
643 @@ -1124,7 +1152,7 @@
644 </xsl:otherwise>
645 </xsl:choose>
646 </xsl:variable>
647 -
648 +
649 <a name="{$preid}"/>
650 <table class="ntable" width="100%" cellspacing="0" cellpadding="0" border="0">
651 <tr>
652 @@ -1406,14 +1434,16 @@
653 </xsl:template>
654
655 <!-- Table Heading, no idea why <th> hasn't been used -->
656 -<!-- 2008-03-09: th uses th, default is align:left for historical reasons -->
657 <xsl:template match="th">
658 -<th class="infohead">
659 - <xsl:if test="@align='left' or @align='right'">
660 - <xsl:attribute name="style"><xsl:value-of select="concat('text-align:',@align)"/></xsl:attribute>
661 - </xsl:if>
662 +<td class="infohead">
663 <xsl:if test="@colspan">
664 <xsl:attribute name="colspan"><xsl:value-of select="@colspan"/></xsl:attribute>
665 + <!-- Center only when item spans several columns as
666 + centering all <th> might disrupt some pages.
667 + We might want to use a plain html <th> tag later.
668 + Tip: to center a single-cell title, use <th colspan="1">
669 + -->
670 + <xsl:attribute name="style">text-align:center</xsl:attribute>
671 </xsl:if>
672 <xsl:if test="@rowspan">
673 <xsl:attribute name="rowspan"><xsl:value-of select="@rowspan"/></xsl:attribute>
674 @@ -1421,7 +1451,7 @@
675 <b>
676 <xsl:apply-templates/>
677 </b>
678 -</th>
679 +</td>
680 </xsl:template>
681
682 <!-- Unnumbered List -->
683 @@ -1574,10 +1604,10 @@
684
685 <xsl:template name="maxdate">
686 <xsl:param name="thedoc"/>
687 - <xsl:for-each select="$thedoc//date">
688 + <xsl:for-each select="$thedoc//date">
689 <xsl:sort select="." order="descending" />
690 <xsl:if test="position()=1"><xsl:value-of select="."/></xsl:if>
691 - </xsl:for-each>
692 + </xsl:for-each>
693 </xsl:template>
694
695 <xsl:template name="contentdate">
696 @@ -1586,7 +1616,7 @@
697 <xsl:with-param name="thedoc" select="exslt:node-set($doc-struct)"/>
698 </xsl:call-template>
699 </xsl:variable>
700 -
701 +
702 <xsl:choose>
703 <xsl:when test="func:gettext('Updated')/docdate">
704 <xsl:apply-templates select="func:gettext('Updated')">
705 @@ -1830,18 +1860,6 @@
706 </form>
707 </td>
708 </tr>
709 - <!-- OSL -->
710 - <tr lang="en">
711 - <td align="center" class="topsep">
712 - <a href="http://osuosl.org/contribute">
713 - <img src="{concat($images,'images/osuosl.png')}" width="125" height="50" alt="Support OSL" border="0"/>
714 - </a>
715 - <p class="alttext">
716 - <a href="http://osuosl.org/contribute">Support OSL</a>
717 - </p>
718 - </td>
719 - </tr>
720 - <!-- /OSL -->
721 <!-- VR -->
722 <tr lang="en">
723 <td align="center" class="topsep">
724 @@ -1878,30 +1896,30 @@
725 </td>
726 </tr>
727 <!-- /SevenL -->
728 - <!-- GNi -->
729 + <!-- bytemark -->
730 <tr lang="en">
731 <td align="center" class="topsep">
732 - <a href="http://www.gni.com" target="_top">
733 - <img src="{concat($images,'images/gni_logo.png')}" width="125" alt="Global Netoptex Inc." border="0"/>
734 + <a href="http://www.bytemark.co.uk/r/gentoo-home" target="_top">
735 + <img src="{concat($images,'images/sponsors/bytemark_ad.png')}" width="125" alt="Bytemark" border="0"/>
736 </a>
737 <p class="alttext">
738 - <a href="http://www.gni.com">Global Netoptex Inc.</a>
739 + <a href="http://www.bytemark.co.uk/r/gentoo-home">Bytemark</a>
740 </p>
741 </td>
742 </tr>
743 - <!-- /GNi -->
744 - <!-- bytemark -->
745 + <!-- /bytemark -->
746 + <!-- GNi -->
747 <tr lang="en">
748 <td align="center" class="topsep">
749 - <a href="http://www.bytemark.co.uk/r/gentoo-home" target="_top">
750 - <img src="{concat($images,'images/sponsors/bytemark_ad.png')}" width="125" alt="Bytemark" border="0"/>
751 + <a href="http://www.gni.com" target="_top">
752 + <img src="{concat($images,'images/gni_logo.png')}" width="125" alt="Global Netoptex Inc." border="0"/>
753 </a>
754 <p class="alttext">
755 - <a href="http://www.bytemark.co.uk/r/gentoo-home">Bytemark</a>
756 + <a href="http://www.gni.com">Global Netoptex Inc.</a>
757 </p>
758 </td>
759 </tr>
760 - <!-- /bytemark -->
761 + <!-- /GNi -->
762 <tr>
763 <td align="center" class="topsep"/>
764 </tr>
765 @@ -1918,7 +1936,14 @@
766 <b><xsl:value-of select="$thenews/title"/></b>
767 <br/>
768 <font size="0.90em">
769 - Posted on <xsl:copy-of select="func:format-date($thenews/date)"/>
770 + <xsl:choose>
771 + <xsl:when test="$thenews/until">
772 + Posted between <xsl:copy-of select="func:format-date($thenews/date)"/> and <xsl:copy-of select="func:format-date($thenews/until)"/>
773 + </xsl:when>
774 + <xsl:otherwise>
775 + Posted on <xsl:copy-of select="func:format-date($thenews/date)"/>
776 + </xsl:otherwise>
777 + </xsl:choose>
778 <xsl:variable name="poster">
779 <xsl:call-template name="smart-mail">
780 <xsl:with-param name="mail" select="$thenews/poster"/>
781 @@ -1927,23 +1952,14 @@
782 by <xsl:value-of select="$poster"/>
783 </font>
784 </p>
785 -
786 +
787 <xsl:choose>
788 - <xsl:when test="$thenews/@category='alpha'">
789 - <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
790 - </xsl:when>
791 - <xsl:when test="$thenews/@category='kde'">
792 - <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
793 - </xsl:when>
794 <xsl:when test="$thenews/@category='gentoo'">
795 <img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
796 </xsl:when>
797 <xsl:when test="$thenews/@category='main'">
798 <img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
799 </xsl:when>
800 - <xsl:when test="$thenews/@category='ibm'">
801 - <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
802 - </xsl:when>
803 <xsl:when test="$thenews/@category='linux'">
804 <img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
805 </xsl:when>
806 @@ -1953,6 +1969,19 @@
807 <xsl:when test="$thenews/@category='plans'">
808 <img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
809 </xsl:when>
810 + <xsl:when test="$thenews/@category='planet'">
811 + <img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/>
812 + </xsl:when>
813 + <!-- old ones, kept to display very very old news items -->
814 + <xsl:when test="$thenews/@category='alpha'">
815 + <img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
816 + </xsl:when>
817 + <xsl:when test="$thenews/@category='kde'">
818 + <img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
819 + </xsl:when>
820 + <xsl:when test="$thenews/@category='ibm'">
821 + <img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
822 + </xsl:when>
823 <xsl:when test="$thenews/@category='nvidia'">
824 <img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
825 </xsl:when>
826 @@ -1960,7 +1989,7 @@
827 <img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
828 </xsl:when>
829 </xsl:choose>
830 -
831 +
832 <div class="newsitem">
833 <xsl:choose>
834 <xsl:when test="$thenews/summary and $summary='yes'">