]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/events.xsl
* Notion of future and past events/deadlines introduced.
[helm.git] / helm / mowgli / home / xsl / events.xsl
1 <?xml version="1.0"?>
2
3 <xsl:stylesheet version="1.0"
4                 xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
5
6 <xsl:import href="common.xsl"/>
7
8 <xsl:output method="html"/>
9
10 <xsl:param name="events-class" select="''"/>
11 <xsl:param name="today"/>
12
13 <xsl:template match="/">
14  <html>
15   <head>
16    <title>
17     <xsl:value-of select="$events-class"/>
18     <xsl:text> Events</xsl:text>
19    </title>
20    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
21    <link rel="stylesheet" href="../style/mowgli.css" type="text/css"/>
22   </head>
23   <body>
24     <xsl:call-template name="head">
25      <xsl:with-param name="path_to_top" select="'.'"/>
26     </xsl:call-template>
27     <h1>
28      <xsl:value-of select="$events-class"/>
29      <xsl:text> Events</xsl:text>
30     </h1>
31     <xsl:if test="$events-class = 'Other'">
32      [Sorted by event date] [<a href="deadlines.html">Sorted by deadline</a>]
33      <br /><br />
34      <hr />
35     </xsl:if>
36     <dl>
37      <xsl:apply-templates select="events/event[when/begin &gt;= $today]">
38       <xsl:sort select="when/begin" data-type="number"/>
39      </xsl:apply-templates>
40     </dl>
41     <hr />
42     <h1>Past Events</h1>
43     <dl>
44      <xsl:apply-templates select="events/event[when/begin &lt; $today]">
45       <xsl:sort select="when/begin" data-type="number"/>
46      </xsl:apply-templates>
47     </dl>
48     <xsl:call-template name="foot">
49      <xsl:with-param name="path_to_top" select="'.'"/>
50     </xsl:call-template>
51   </body>
52  </html>
53 </xsl:template>
54
55 <xsl:template match="event">
56  <dt>
57   <a href="{url}"><xsl:value-of select="name"/></a>
58  </dt>
59  <dd>
60   <xsl:if test="where">
61    <b><xsl:value-of select="where"/></b>
62    <xsl:text> </xsl:text>
63   </xsl:if>
64   <xsl:if test="when">
65    <b>
66     <xsl:call-template name="print_interval">
67      <xsl:with-param name="begin" select="when/begin/text()"/>
68      <xsl:with-param name="end" select="when/end/text()"/>
69     </xsl:call-template>
70    </b>
71    <br />
72   </xsl:if>
73   <xsl:if test="description">
74    <p><xsl:value-of select="description"/></p>
75   </xsl:if>
76   <xsl:if test="deadline">
77    <p>Deadlines:</p>
78    <ul>
79     <xsl:apply-templates select="deadline"/>
80    </ul>
81   </xsl:if>
82   <br />
83  </dd>
84 </xsl:template>
85
86 <xsl:template match="deadline">
87  <li>
88   <xsl:variable name="kind">
89    <xsl:call-template name="color_of_deadline_kind">
90     <xsl:with-param name="kind" select="@kind"/>
91    </xsl:call-template>
92   </xsl:variable>
93   <b>
94    <span style="color: {$kind}">
95     <xsl:call-template name="print_date">
96      <xsl:with-param name="date" select="date/text()"/>
97     </xsl:call-template>
98    </span>
99   </b>
100   <xsl:text> </xsl:text>
101   <xsl:value-of select="description"/>
102  </li>
103 </xsl:template>
104
105 </xsl:stylesheet>