]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/mowgli/home/xsl/deadlines.xsl
ocaml 3.09 transition
[helm.git] / helm / mowgli / home / xsl / deadlines.xsl
index fde85f52de0e07ade3767bbdb5f4cd734302ce6d..a71a04feb5a792e8cba5c9a3980ece6829491b28 100644 (file)
@@ -5,31 +5,45 @@
 
 <xsl:import href="common.xsl"/>
 
-<xsl:output method="html"/>
+<xsl:output method="xml"/>
+
+<xsl:param name="events-class" select="''"/>
+<xsl:param name="today" select="''"/>
 
 <xsl:template match="/">
  <html>
   <head>
-   <title>Events Sorted by Deadlines</title>
-   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-   <link rel="stylesheet" href="../style/mowgli.css" type="text/css"/>
+   <title>
+    <xsl:value-of select="$events-class"/>
+    <xsl:text> Events Sorted by Deadlines</xsl:text>
+   </title>
   </head>
   <body>
-    <xsl:call-template name="head">
-     <xsl:with-param name="path_to_top" select="'.'"/>
-    </xsl:call-template>
-    <h1>Mowgli Events Sorted by Deadlines</h1>
+    <h1>
+     <xsl:value-of select="$events-class"/>
+     <xsl:text> Events</xsl:text>
+    </h1>
+    <xsl:variable name="url">
+     <xsl:choose>
+      <xsl:when test="$events-class='Other'">other-events.html</xsl:when>
+      <xsl:otherwise>mowgli-events.html</xsl:otherwise>
+     </xsl:choose>
+    </xsl:variable>
+    [<a href="{$url}">Sorted by event date</a>] [Sorted by deadline]
+    <br /><br />
     <hr />
-    <h1>Events of Interest to MOWGLI Sorted by Deadlines ---
-        <a href="events.html">Sort by events date!</a></h1>
     <ul>
-     <xsl:apply-templates select="events/event/deadline">
+     <xsl:apply-templates select="events/event/deadline[date &gt;= $today]">
       <xsl:sort select="date" data-type="number"/>
      </xsl:apply-templates>
     </ul>
-    <xsl:call-template name="foot">
-     <xsl:with-param name="path_to_top" select="'.'"/>
-    </xsl:call-template>
+    <hr />
+    <h1>Past Events</h1>
+    <ul>
+     <xsl:apply-templates select="events/event/deadline[date &lt; $today]">
+      <xsl:sort select="date" data-type="number" order="descending"/>
+     </xsl:apply-templates>
+    </ul>
   </body>
  </html>
 </xsl:template>
@@ -56,3 +70,4 @@
 </xsl:template>
 
 </xsl:stylesheet>
+