Lots of stuff.
[www/www.git] / cscweb.xsl
index 9810323..0751ae5 100755 (executable)
@@ -19,9 +19,6 @@
   </style>
 </head>
 <body>
-<p>
-  <xsl:value-of select="csc:term($date)"/>
-</p>
 <xsl:apply-templates select="biglogo"/>
 <xsl:apply-templates select="header">
  <xsl:with-param name="title" select="@title"/>
  </table>
 </xsl:template>
 
-<xsl:template match="events-this-term">
+<xsl:template match="events-this-term" name="events-by-term">
   <p>The events for <xsl:value-of select="csc:term($date)"/> are listed here.</p>
    <xsl:for-each select="document('events.xml')/eventdefs/eventitem">
     <xsl:sort select="translate(@date, '-', '')"
               order="ascending"
               data-type="number"/>
-    <xsl:if test="@term = csc:term($date)">
-     <h3><xsl:value-of select="@title"/></h3>
+    <xsl:if test="csc:term(@date) = csc:term($date)">
+     <h3><a href="{translate(concat('/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"><xsl:value-of select="@title"/></a></h3>
      <p>
       <b><xsl:value-of select="@room"/>,
       <xsl:value-of select="@date"/>, <xsl:value-of
    </xsl:for-each>
 </xsl:template>
 
+<xsl:template match="members-this-term">
+  <p>The members for <xsl:value-of select="csc:term($date)"/> are
+  listed here.</p>
+  <table>
+    <tr>
+      <th>Member ID</th>
+      <th>Name</th>
+      <th>Program</th>
+    </tr>
+    <xsl:for-each select="document('members.xml')/memberlist/member">
+      <tr>
+       <td><xsl:value-of select="@id"/></td>
+       <td><xsl:value-of select="@name"/></td>
+       <td><xsl:value-of select="@program"/></td>
+      </tr>
+    </xsl:for-each>
+  </table>
+</xsl:template>
+
 <xsl:template match="generate-event-files">
  <xsl:apply-templates select="document('events.xml')/eventdefs"/>
 </xsl:template>
 
-<xsl:template match="old-events">
- <xsl:for-each select="document('events.xml')/eventdefs/eventitem">
-  <xsl:sort select="term"
-            order="descending"
-            data-type="number"/>
+<xsl:key name="eventterm"
+    match="/eventdefs/eventitem"
+    use="csc:term(@date)" />
 
- </xsl:for-each>
-</xsl:template>
+  <xsl:template match="old-events">
+    <xsl:for-each
+      select="document('events.xml')/eventdefs/eventitem">
+
+     <xsl:sort select="translate(@date, '-', '')"
+              order="descending"
+              data-type="number"/>
 
+      <xsl:if
+              test="not(preceding-sibling::*[csc:term(@date)=csc:term(current()/@date)]) and not(csc:term(@date) = csc:term($date))">
+       <p><a href="{translate(concat('old-',
+       csc:term(@date), '.html'), ' ', '_')}">
+           <xsl:value-of
+             select="csc:term(@date)"/></a></p>
+ <xsl:document method="html" href="{translate(concat($root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}">
+<xsl:text disable-output-escaping="yes"><![CDATA[<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">]]>
+</xsl:text>
+<html>
+<head>
+ <title>Events for <xsl:value-of select="csc:term(@date)"/></title>
+  <style type="text/css">
+   <![CDATA[<!-- @import url('/default.css'); -->]]>
+  </style>
+</head>
+<body>
+ <xsl:call-template name="header">
+  <xsl:with-param name="title" select="concat('Events for ', csc:term(@date))"/>
+ </xsl:call-template>
+ <xsl:call-template name="events-by-term">
+   <xsl:with-param name="date" select="@date"/>
+ </xsl:call-template>
+ <xsl:call-template name="footer"/>
+</body>
+</html>
+ </xsl:document>
+      </xsl:if>
+    </xsl:for-each>
+  </xsl:template>
+  
 <xsl:template match="execlist">
  <h3>Elected positions</h3>
  <ul>