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
Date: Thu, 04 Oct 2007 19:48:05
Message-Id: E1IdWWz-0007b6-6a@stork.gentoo.org
1 neysx 07/10/04 19:38:45
2
3 Modified: guide.xsl
4 Log:
5 Added shortcut for gentoo devs in <mail>: <mail>nick</mail> is enough
6 Commented out link to p.g.o until further notice
7
8 Revision Changes Path
9 1.220 xml/htdocs/xsl/guide.xsl
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?rev=1.220&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?rev=1.220&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/xml/htdocs/xsl/guide.xsl?r1=1.219&r2=1.220
14
15 Index: guide.xsl
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/xml/htdocs/xsl/guide.xsl,v
18 retrieving revision 1.219
19 retrieving revision 1.220
20 diff -u -r1.219 -r1.220
21 --- guide.xsl 14 Sep 2007 08:39:08 -0000 1.219
22 +++ guide.xsl 4 Oct 2007 19:38:44 -0000 1.220
23 @@ -39,16 +39,19 @@
24 <!-- Where is this xsl being run? -->
25 <xsl:param name="httphost">www</xsl:param>
26
27 -<!-- Get the list of retired devs from the roll-call -->
28 -<xsl:variable name="RETIRED-DEVS" xmlns="">
29 - <retired>
30 - <xsl:for-each select="document('/proj/en/devrel/roll-call/userinfo.xml')/userlist/user[translate(status,'TIRED','tired')='retired']">
31 +<!-- Get the list of devs from the roll-call -->
32 +<xsl:variable name="ALL-DEVS" xmlns="">
33 + <devs>
34 + <xsl:for-each select="document('/proj/en/devrel/roll-call/userinfo.xml')/userlist/user">
35 <user username="{@username}">
36 + <xsl:if test="translate(status,'TIRED','tired')='retired'">
37 + <xsl:attribute name="retired"/>
38 + </xsl:if>
39 <xsl:copy-of select="realname"/>
40 - <xsl:copy-of select="email[substring-after(text(),'@')!='gentoo.org']"/>
41 + <xsl:copy-of select="email"/>
42 </user>
43 </xsl:for-each>
44 - </retired>
45 + </devs>
46 </xsl:variable>
47
48 <!-- img tag -->
49 @@ -157,7 +160,7 @@
50 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/>
51 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/>
52 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
53 - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
54 +<!-- <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> -->
55 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
56
57 <xsl:if test="//glsaindex or //glsa-latest">
58 @@ -289,7 +292,7 @@
59 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/www-gentoo-org.xml" title="Gentoo Website"/>
60 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/forums-gentoo-org.xml" title="Gentoo Forums"/>
61 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/bugs-gentoo-org.xml" title="Gentoo Bugzilla"/>
62 - <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/>
63 +<!-- <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/packages-gentoo-org.xml" title="Gentoo Packages"/> -->
64 <link rel="search" type="application/opensearchdescription+xml" href="http://www.gentoo.org/search/archives-gentoo-org.xml" title="Gentoo List Archives"/>
65
66 <xsl:if test="/mainpage/newsitems">
67 @@ -544,8 +547,10 @@
68 </xsl:if>
69 <xsl:text>Name and Logo Guidelines</xsl:text></a>
70 <br/>
71 +<!--
72 <a class="altlink" href="http://packages.gentoo.org/">Online Package Database</a>
73 <br/>
74 +-->
75 <a class="altlink" href="{concat($www,'/security/en/index.xml')}">Security Announcements</a>
76 <br/>
77 <a class="altlink" href="{concat($www,'/proj/en/devrel/staffing-needs/')}">Staffing&#xA0;Needs</a>
78 @@ -672,63 +677,121 @@
79 <xsl:otherwise>/main/en/contact.xml</xsl:otherwise>
80 </xsl:choose>
81 </xsl:variable>
82 -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>.
83 +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>.
84 </xsl:template>
85
86 <!-- Mail template -->
87 <xsl:template match="mail">
88 -<a>
89 - <xsl:attribute name="href">
90 +<xsl:if test="string-length(@link)>0 or string-length(.)>0">
91 + <xsl:variable name="gnick">
92 + <xsl:choose>
93 + <xsl:when test="string-length(@link)=0 and not(contains(text(),'@'))">
94 + <!-- <mail>nick</mail> -->
95 + <xsl:value-of select="."/>
96 + </xsl:when>
97 + <xsl:when test="string-length(@link)=0 and contains(text(),'@gentoo.org')">
98 + <!-- <mail>nick@g.o</mail> -->
99 + <xsl:value-of select="substring-before(., '@')"/>
100 + </xsl:when>
101 + <xsl:when test="string-length(@link)>0 and not(contains(@link,'@'))">
102 + <!-- <mail link="nick">blah blah</mail> -->
103 + <xsl:value-of select="@link"/>
104 + </xsl:when>
105 + <xsl:when test="contains(@link,'@gentoo.org')">
106 + <!-- <mail link="nick@g.o">blah blah</mail> -->
107 + <xsl:value-of select="substring-before(@link, '@gentoo.org')"/>
108 + </xsl:when>
109 + </xsl:choose>
110 + </xsl:variable>
111 +
112 + <xsl:variable name="gmail">
113 + <xsl:if test="string-length($gnick)>0">
114 <xsl:choose>
115 - <xsl:when test="@link">
116 - <xsl:value-of select="concat('mailto:', @link)"/>
117 + <xsl:when test="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick and @retired]">
118 + <xsl:value-of select="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/email[substring-after(text(),'@')!='gentoo.org'][1]"/>
119 </xsl:when>
120 <xsl:otherwise>
121 - <xsl:value-of select="concat('mailto:', .)"/>
122 + <xsl:value-of select="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/email[substring-after(text(),'@')='gentoo.org'][1]"/>
123 </xsl:otherwise>
124 </xsl:choose>
125 - </xsl:attribute>
126 - <xsl:value-of select="."/>
127 -</a>
128 + </xsl:if>
129 + </xsl:variable>
130
131 -</xsl:template>
132 + <xsl:variable name="gname">
133 + <xsl:if test="string-length($gnick)>0">
134 + <xsl:choose>
135 + <xsl:when test="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/realname/@fullname">
136 + <xsl:value-of select="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/realname/@fullname"/>
137 + </xsl:when>
138 + <xsl:when test="exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/realname[firstname or familyname]">
139 + <xsl:value-of select="concat(exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/realname/firstname,' ',exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick]/realname/familyname)"/>
140 + </xsl:when>
141 + </xsl:choose>
142 + </xsl:if>
143 + </xsl:variable>
144
145 -<!-- Mail inside <author>...</author> -->
146 -<xsl:template match="/*[1]/author/mail">
147 - <xsl:variable name="nick" select="substring-before(@link,'@gentoo.org')"/>
148 + <xsl:variable name="href">
149 <xsl:choose>
150 - <xsl:when test="substring-after(@link,'@')='gentoo.org' and exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]">
151 - <!-- @gentoo.org address of a retired dev, use another email from roll-call, or no email at all -->
152 - <xsl:choose>
153 - <xsl:when test="exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]/email">
154 - <b><a class="altlink" href="mailto:{exslt:node-set($RETIRED-DEVS)/retired/user[@username=$nick]/email[1]}"><xsl:value-of select="."/></a></b>
155 - </xsl:when>
156 - <xsl:otherwise>
157 - <xsl:value-of select="."/>
158 - </xsl:otherwise>
159 - </xsl:choose>
160 + <xsl:when test="string-length($gname)>0 and string-length($gmail)=0 and exslt:node-set($ALL-DEVS)/devs/user[@username=$gnick and @retired]"/>
161 + <xsl:when test="string-length($gmail)>0">
162 + <xsl:value-of select="concat('mailto:', $gmail)"/>
163 + </xsl:when>
164 + <xsl:when test="string-length(@link)>0">
165 + <xsl:value-of select="concat('mailto:', @link)"/>
166 + </xsl:when>
167 + <xsl:when test="string-length(.)>0">
168 + <xsl:value-of select="concat('mailto:', .)"/>
169 + </xsl:when>
170 + </xsl:choose>
171 + </xsl:variable>
172 +
173 + <xsl:variable name="content">
174 + <xsl:choose>
175 + <xsl:when test="string-length(@link)>0 and string-length(.)>0">
176 + <xsl:value-of select="."/>
177 + </xsl:when>
178 + <xsl:when test="string-length($gname)>0">
179 + <xsl:value-of select="$gname"/>
180 + </xsl:when>
181 + <xsl:when test="string-length($gnick)>0">
182 + <xsl:value-of select="$gnick"/>
183 </xsl:when>
184 <xsl:otherwise>
185 - <b><a class="altlink" href="mailto:{@link}"><xsl:value-of select="."/></a></b>
186 + <xsl:value-of select="."/>
187 </xsl:otherwise>
188 - </xsl:choose>
189 + </xsl:choose>
190 + </xsl:variable>
191
192 + <xsl:choose>
193 + <xsl:when test="string-length($href)>0">
194 + <a href="{$href}">
195 + <xsl:choose>
196 + <xsl:when test="name(..)='author'">
197 + <xsl:attribute name="class">altlink</xsl:attribute>
198 + <b><xsl:value-of select="$content"/></b>
199 + </xsl:when>
200 + <xsl:otherwise>
201 + <xsl:value-of select="$content"/>
202 + </xsl:otherwise>
203 + </xsl:choose>
204 + </a>
205 + </xsl:when>
206 + <xsl:otherwise><xsl:value-of select="$content"/></xsl:otherwise>
207 + </xsl:choose>
208 +
209 +</xsl:if>
210 </xsl:template>
211
212 <!-- Author -->
213 <xsl:template match="author">
214 -<xsl:apply-templates/>
215 + <xsl:apply-templates/>
216 <xsl:if test="@title">
217 - <xsl:if test="$style != 'printable'">
218 - <br/>
219 - </xsl:if>
220 - <xsl:if test="$style = 'printable'">&#160;</xsl:if>
221 + <xsl:if test="$style != 'printable'"><br/></xsl:if>
222 + <xsl:if test="$style = 'printable'">&#160;</xsl:if>
223 <i><xsl:value-of select="@title"/></i>
224 </xsl:if>
225 <br/>
226 - <xsl:if test="$style != 'printable' and position()!=last()">
227 - <br/>
228 - </xsl:if>
229 + <xsl:if test="$style != 'printable' and position() != last()"><br/></xsl:if>
230 </xsl:template>
231
232 <!-- FAQ Index & Chapter -->
233 @@ -1614,6 +1677,18 @@
234
235 <xsl:template name="rhcol">
236 <!-- Right-hand column with date/authors/ads -->
237 +
238 + <xsl:variable name="images">
239 + <!-- Source images from www.gentoo.org when on another server to
240 + prevent missing images after an update -->
241 + <xsl:choose>
242 + <xsl:when test="$httphost != 'www'">http://www.gentoo.org/</xsl:when>
243 + <xsl:otherwise>
244 + <xsl:value-of select="$ROOT"/>
245 + </xsl:otherwise>
246 + </xsl:choose>
247 + </xsl:variable>
248 +
249 <table border="0" cellspacing="4px" cellpadding="4px">
250 <!-- Add a "printer-friendly" button when link attribute exists -->
251 <xsl:if test="/book or /guide">
252 @@ -1746,7 +1821,7 @@
253 <tr lang="en">
254 <td align="center" class="topsep">
255 <a href="http://www.vr.org">
256 - <img src="{concat($ROOT,'images/vr-ad.png')}" width="125" height="144" alt="Gentoo Centric Hosting: vr.org" border="0"/>
257 + <img src="{concat($images,'images/vr-ad.png')}" width="125" height="144" alt="Gentoo Centric Hosting: vr.org" border="0"/>
258 </a>
259 <p class="alttext">
260 <a href="http://www.vr.org/">VR Hosted</a>
261 @@ -1756,7 +1831,7 @@
262 <tr lang="en">
263 <td align="center" class="topsep">
264 <a href="http://www.tek.net" target="_top">
265 - <img src="{concat($ROOT,'images/tek-gentoo.gif')}" width="125" height="125" alt="Tek Alchemy" border="0"/>
266 + <img src="{concat($images,'images/tek-gentoo.gif')}" width="125" height="125" alt="Tek Alchemy" border="0"/>
267 </a>
268 <p class="alttext">
269 <a href="http://www.tek.net/">Tek Alchemy</a>
270 @@ -1766,7 +1841,7 @@
271 <tr lang="en">
272 <td align="center" class="topsep">
273 <a href="http://www.sevenl.net" target="_top">
274 - <img src="{concat($ROOT,'images/sponsors/sevenl.gif')}" width="125" height="144" alt="SevenL.net" border="0"/>
275 + <img src="{concat($images,'images/sponsors/sevenl.gif')}" width="125" height="144" alt="SevenL.net" border="0"/>
276 </a>
277 <p class="alttext">
278 <a href="http://www.sevenl.net/">SevenL.net</a>
279 @@ -1776,7 +1851,7 @@
280 <tr lang="en">
281 <td align="center" class="topsep">
282 <a href="http://www.gni.com" target="_top">
283 - <img src="{concat($ROOT,'images/gni_logo.png')}" width="125" alt="Global Netoptex Inc." border="0"/>
284 + <img src="{concat($images,'images/gni_logo.png')}" width="125" alt="Global Netoptex Inc." border="0"/>
285 </a>
286 <p class="alttext">
287 <a href="http://www.gni.com">Global Netoptex Inc.</a>
288
289
290
291 --
292 gentoo-commits@g.o mailing list