Added old news
authorWebmaster <www@csclub.uwaterloo.ca>
Tue, 17 Sep 2002 04:08:11 +0000 (04:08 +0000)
committerWebmaster <www@csclub.uwaterloo.ca>
Tue, 17 Sep 2002 04:08:11 +0000 (04:08 +0000)
Makefile
cscweb.xsl
news/Makefile [new file with mode: 0755]
news/directory.xml [new file with mode: 0755]
news/index.xml [new file with mode: 0755]

index da9e51e..dbc070c 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
 INPUTS = index.xml 
-SUBDIRS = about events docs office
+SUBDIRS = about events docs office news
 
 # the following two rules are there so cow gets built first.
 cow-first: recurse-cow books.xml members.xml all
index 028f263..0357cdf 100755 (executable)
 
 <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: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
     </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>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('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>
diff --git a/news/Makefile b/news/Makefile
new file mode 100755 (executable)
index 0000000..2ae895f
--- /dev/null
@@ -0,0 +1,3 @@
+INPUTS = index.xml
+
+include ../default.mk
diff --git a/news/directory.xml b/news/directory.xml
new file mode 100755 (executable)
index 0000000..b91c059
--- /dev/null
@@ -0,0 +1,6 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE directory SYSTEM "../csc.dtd">
+
+<directory title="Old news">
+</directory>
diff --git a/news/index.xml b/news/index.xml
new file mode 100755 (executable)
index 0000000..0801e45
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version='1.0'?>
+
+<!DOCTYPE cscpage SYSTEM "../csc.dtd">
+
+<cscpage title="CSC News">
+ <header />
+
+ <section title="Old news">
+  <old-news />
+ </section>
+
+ <footer />
+</cscpage>