]> matita.cs.unibo.it Git - helm.git/blob - helm/mowgli/home/xsl/deadlines.xsl
A big commit:
[helm.git] / helm / mowgli / home / xsl / deadlines.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
12 <xsl:template match="/">
13  <html>
14   <head>
15    <title>
16     <xsl:value-of select="$events-class"/>
17     <xsl:text> Events Sorted by Deadlines</xsl:text>
18    </title>
19    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
20    <link rel="stylesheet" href="../style/mowgli.css" type="text/css"/>
21   </head>
22   <body>
23     <xsl:call-template name="head">
24      <xsl:with-param name="path_to_top" select="'.'"/>
25     </xsl:call-template>
26     <h1>
27      <xsl:value-of select="$events-class"/>
28      <xsl:text> Events</xsl:text>
29     </h1>
30     <xsl:variable name="url">
31      <xsl:choose>
32       <xsl:when test="$events-class='Other'">other-events.html</xsl:when>
33       <xsl:otherwise>mowgli-events.html</xsl:otherwise>
34      </xsl:choose>
35     </xsl:variable>
36     [<a href="{$url}">Sorted by event date</a>] [Sorted by deadline]
37     <br /><br />
38     <hr />
39     <ul>
40      <xsl:apply-templates select="events/event/deadline">
41       <xsl:sort select="date" data-type="number"/>
42      </xsl:apply-templates>
43     </ul>
44     <xsl:call-template name="foot">
45      <xsl:with-param name="path_to_top" select="'.'"/>
46     </xsl:call-template>
47   </body>
48  </html>
49 </xsl:template>
50
51 <xsl:template match="deadline">
52  <li>
53   <b>
54    <xsl:variable name="kind">
55     <xsl:call-template name="color_of_deadline_kind">
56      <xsl:with-param name="kind" select="@kind"/>
57     </xsl:call-template>
58    </xsl:variable>
59    <span style="color: {$kind}">
60     <xsl:call-template name="print_date">
61      <xsl:with-param name="date" select="date/text()"/>
62     </xsl:call-template>
63    </span>
64   </b>
65   <xsl:text> </xsl:text>
66   <xsl:value-of select="description"/>
67   <xsl:text> </xsl:text>
68   <a href="{../url}" target="_top"><xsl:value-of select="../name"/></a>
69  </li>
70 </xsl:template>
71
72 </xsl:stylesheet>
73