Fixup
[mspang/www.git] / cscweb.xsl
index 229bbb9..a891283 100755 (executable)
  <xsl:apply-templates />
 </xsl:template>
 
-<xsl:template match="biglogo" name="menu">
-  <table cellspacing="0" cellpadding="2" border="0" align="center">
+<xsl:template match="biglogo" name="biglogo">
+  <table cellspacing="0" cellpadding="0" border="0" align="center">
    <tr>
-    <td width="174" rowspan="2"><img src="/logos/csc_160_70.png" alt="CSC" width="165" height="75" /></td>
-    <td>University of Waterloo</td>
-   </tr>
-   <tr>
-    <td>Computer Science Club</td>
+    <td width="109"><a href="http://www.uwaterloo.ca/"><img
+    src="/logos/uw_logo_100_68.gif" alt="University of Waterloo"
+    width="100" height="68" align="center" border="0" /></a></td>
+    <td width="174"><a href="/"><img src="/logos/csc_160_70.png"
+    alt="Computer Science Club" width="165" height="75" align="center"
+    border="0" /></a></td>
+    <td width="91"><a href="http://www.acm.org"><img width="82"
+    height="103" src="/logos/acm_logo.gif" alt="A Student Chapter of
+    the ACM" align="center" border="0" /></a></td>
    </tr>
   </table>
 </xsl:template>
@@ -84,7 +88,9 @@
 </xsl:template>
 
 <xsl:template match="directory">
- [<a href="index.html"><xsl:value-of select="@title"/></a>]
+ [<xsl:if test="@href = ''"><a href="index.html"><xsl:value-of
+ select="@title"/></a></xsl:if><xsl:if test="@href != ''">
+      <a href="{@href}"><xsl:value-of select="@title"/></a></xsl:if>]
  <xsl:apply-templates match="diritem"/>
 </xsl:template>
 
   <xsl:value-of select="$time"/>.
  </p>
  <p>
+   We recently switched to our new website. The <a href="/old/">old
+   website (as of 2002-08-10)</a> is still available.
+ </p>
+ <p>
    Copyright 2002 the Computer Science Club of the University of
    Waterloo. Please direct website comments to the <a
    href="mailto:www@csclub.uwaterloo.ca">Webmaster</a>. 
 
 <xsl:template match="news-and-events">
  <table cellspacing="1" cellpadding="2" bgcolor="black">
-  <xsl:call-template name="news"/>
   <xsl:call-template name="events"/>
+  <xsl:call-template name="news"/>
  </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="csc:term(@date) = csc:term($date)">
-     <h3><xsl:value-of select="@title"/></h3>
+     <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="news-this-term" name="news-by-term">
+  <p>The news for <xsl:value-of select="csc:term($date)"/> is listed here.</p>
+   <xsl:for-each select="document('news.xml')/newsdefs/newsitem">
+    <xsl:sort select="translate(@date, '-', '')"
+              order="descending"
+              data-type="number"/>
+    <xsl:if test="csc:term(@date) = csc:term($date)">
+     <p>
+      <b><xsl:value-of select="@date"/>,
+         <xsl:value-of select="@author"/>: </b> <xsl:apply-templates/>
+     </p>
+    </xsl:if>
+   </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. We currently have <xsl:value-of
+  select="count(document('members.xml')/memberlist/member)"/> members.</p>
+  <table>
+    <tr>
+      <th>Member ID</th>
+      <th>Name</th>
+      <th>Program</th>
+    </tr>
+    <xsl:for-each select="document('members.xml')/memberlist/member">
+      <tr>
+       <xsl:if test="position() mod 2 = 0">
+         <xsl:attribute name="bgcolor">#cee6ff</xsl:attribute>
+       </xsl:if>
+       <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="all-books">
+  <p>The books we currently own include:</p>
+  <table>
+    <tr>
+      <th>Title</th>
+      <th>Author</th>
+    </tr>
+    <xsl:for-each select="document('books.xml')/booklist/book">
+      <tr>
+       <xsl:if test="position() mod 2 = 0">
+         <xsl:attribute name="bgcolor">#cee6ff</xsl:attribute>
+       </xsl:if>
+       <td><a href="/office/books/{translate(@isbn, ' ', '_')}.html"><xsl:value-of
+       select="@title"/><xsl:if test="@edition != ''"> (<xsl:value-of
+       select="@edition"/>)</xsl:if></a></td>
+       <td><xsl:value-of select="@author"/></td>
+      </tr>
+<xsl:document method="html" href="{translate(concat($root, '/office/books/', @isbn, '.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>Book: <xsl:value-of select="@title"/></title>
+  <style type="text/css">
+   <![CDATA[<!-- @import url('/default.css'); -->]]>
+  </style>
+</head>
+<body>
+ <xsl:call-template name="header">
+    <xsl:with-param name="title" select="@title"/>
+    <xsl:with-param name="pwd" select="concat($pwd, '/books')"/>
+ </xsl:call-template>
+<p>
+ <b>Title: </b> <xsl:value-of select="@title"/><br />
+ <b>Edition: </b> <xsl:value-of select="@edition"/><br />
+ <b>ISBN: </b> <xsl:value-of select="@isbn"/><br />
+ <b>Author: </b> <xsl:value-of select="@author"/><br />
+ <b>Published: </b> <xsl:value-of select="@published"/><br />
+</p>
+  <xsl:call-template name="footer"/>
+</body>
+</html>
+ </xsl:document>
+    </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:key name="newsterm"
+    match="/newsdefs/newsitem"
+    use="csc:term(@date)" />
+
+  <xsl:template match="old-news">
+    <xsl:for-each
+      select="document('news.xml')/newsdefs/newsitem">
 
+     <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, '/news/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>News 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('News for ', csc:term(@date))"/>
+ </xsl:call-template>
+ <xsl:call-template name="news-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>