Yay, memberlist.
authorStefanus Du Toit <sjdutoit@csclub.uwaterloo.ca>
Mon, 15 Apr 2002 22:31:30 +0000 (22:31 +0000)
committerStefanus Du Toit <sjdutoit@csclub.uwaterloo.ca>
Mon, 15 Apr 2002 22:31:30 +0000 (22:31 +0000)
Makefile
about/Makefile
about/members.xml
csc.dtd
cscweb.xsl

index 1542caf..64634e3 100755 (executable)
--- a/Makefile
+++ b/Makefile
@@ -2,14 +2,21 @@ INPUTS = index.xml
 SUBDIRS = about events docs office
 
 # the following two rules are there so cow gets built first.
-cow-first: recurse-cow all
+cow-first: recurse-cow members.xml all
 
 recurse-cow:
        cd cow && $(MAKE) && cd ..
 
+members.xml:
+       echo '<?xml version='\''1.0'\''?>' > $@
+       echo '<memberlist>' >> $@
+       ceoquery memberlist | awk -F \| '{ id = $$1; name = $$2; program = $$3; gsub(/"/, "\\&quot;", name); gsub(/"/, "\\&quot;", program); gsub(/&/, "\\&amp;", name); gsub(/&/, "\\&amp;", program); print "<member id=\"" id "\" name=\"" name "\" program=\"" program "\" />"; }' >> $@
+       echo '</memberlist>' >> $@
+
 include default.mk
 
 default.mk: default.mk.in
        echo 'ROOT = '`pwd` > $@
        cat $< >> $@
 
+.PHONY: members.xml
index bb26eca..4d9021e 100755 (executable)
@@ -2,3 +2,5 @@ INPUTS = index.xml exec.xml members.xml
 
 include ../default.mk
 
+members.html: ../members.xml
+
index 7d64838..8ac702b 100755 (executable)
@@ -4,8 +4,8 @@
 
 <cscpage title="Membership list">
   <header />
-  <section title="Not yet available.">
-    The membership list is not yet available. Please check back later.
+  <section title="Members this term">
+    <members-this-term />
   </section>
   <footer />
 </cscpage>
diff --git a/csc.dtd b/csc.dtd
index a99da44..fdd4576 100755 (executable)
--- a/csc.dtd
+++ b/csc.dtd
   title CDATA #REQUIRED>
 <!ELEMENT short (#PCDATA)>
 
+<!ELEMENT memberlist (member*)>
+<!ELEMENT member EMPTY>
+<!ATTLIST member
+  id CDATA #REQUIRED
+  name CDATA #REQUIRED
+  program CDATA #REQUIRED>
+
+<!ELEMENT members-this-term EMPTY>
+
 <!ELEMENT menudefs (menuitem*)>
 <!ELEMENT menuitem EMPTY>
 <!ATTLIST menuitem
index 3ab8ff5..aa1299e 100755 (executable)
    </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>