blob: e560c986e80bb230d3ba3cf31561c03e639c5eed (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<!--
TODO(antarus): What does this actually do? Does anything still use it?
It takes 3 paramters, thenews, summary, link.
TODO(antarus): The icon selector should be its own template.
-->
<xsl:template name="newscontent">
<xsl:param name="thenews"/>
<xsl:param name="summary"/>
<xsl:param name="link"/>
<div class="news">
<p class="newshead" lang="en">
<b><xsl:value-of select="$thenews/title"/></b>
<br/>
<font size="0.90em">
<xsl:choose>
<xsl:when test="$thenews/until">
Posted between <xsl:copy-of select="func:format-date($thenews/date)"/> and <xsl:copy-of select="func:format-date($thenews/until)"/>
</xsl:when>
<xsl:otherwise>
Posted on <xsl:copy-of select="func:format-date($thenews/date)"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="poster">
<xsl:call-template name="smart-mail">
<xsl:with-param name="mail" select="$thenews/poster"/>
</xsl:call-template>
</xsl:variable>
by <xsl:value-of select="$poster"/>
</font>
</p>
<xsl:choose>
<xsl:when test="$thenews/@category='birthday'">
<img class="newsicon" src="/images/birthday_cake.png" alt="Happy Birthday"/>
</xsl:when>
<xsl:when test="$thenews/@category='gentoo'">
<img class="newsicon" src="/images/icon-gentoo.png" alt="gentoo"/>
</xsl:when>
<xsl:when test="$thenews/@category='main'">
<img class="newsicon" src="/images/icon-stick.png" alt="stick man"/>
</xsl:when>
<xsl:when test="$thenews/@category='linux'">
<img class="newsicon" src="/images/icon-penguin.png" alt="tux"/>
</xsl:when>
<xsl:when test="$thenews/@category='moo'">
<img class="newsicon" src="/images/icon-cow.png" alt="Larry the Cow"/>
</xsl:when>
<xsl:when test="$thenews/@category='plans'">
<img class="newsicon" src="/images/icon-clock.png" alt="Clock"/>
</xsl:when>
<xsl:when test="$thenews/@category='planet'">
<img class="newsicon" src="/images/G-Earth.png" alt="Planet Earth"/>
</xsl:when>
<!-- old ones, kept to display very very old news items -->
<xsl:when test="$thenews/@category='alpha'">
<img class="newsicon" src="/images/icon-alpha.gif" alt="AlphaServer GS160"/>
</xsl:when>
<xsl:when test="$thenews/@category='kde'">
<img class="newsicon" src="/images/icon-kde.png" alt="KDE"/>
</xsl:when>
<xsl:when test="$thenews/@category='ibm'">
<img class="newsicon" src="/images/icon-ibm.gif" alt="ibm"/>
</xsl:when>
<xsl:when test="$thenews/@category='nvidia'">
<img class="newsicon" src="/images/icon-nvidia.png" alt="Nvidia"/>
</xsl:when>
<xsl:when test="$thenews/@category='freescale'">
<img class="newsicon" src="/images/icon-freescale.gif" alt="Freescale Semiconductor"/>
</xsl:when>
</xsl:choose>
<div class="newsitem">
<xsl:choose>
<xsl:when test="$thenews/summary and $summary='yes'">
<xsl:apply-templates select="$thenews/summary"/>
<br/>
<a href="{$link}"><b>(full story)</b></a>
</xsl:when>
<xsl:when test="$thenews/body">
<xsl:apply-templates select="$thenews/body"/>
</xsl:when>
</xsl:choose>
</div>
</div>
</xsl:template>
</xsl:stylesheet>
|