Added books... yay.

foo
Stefanus Du Toit 21 years ago
parent 96df86cd8e
commit 51c473f23e
  1. 14
      Makefile
  2. 12
      csc.dtd
  3. 67
      cscweb.xsl
  4. 1
      default.css
  5. 2
      docs/Makefile
  6. 6
      docs/website.xml
  7. 7
      office/Makefile
  8. 11
      office/books.xml
  9. 1
      office/books/.cvsignore
  10. 3
      office/books/Makefile
  11. 1
      office/directory.xml

@ -1,8 +1,8 @@
INPUTS = index.xml
INPUTS = index.xml
SUBDIRS = about events docs office
# the following two rules are there so cow gets built first.
cow-first: recurse-cow members.xml all
cow-first: recurse-cow books.xml members.xml all
recurse-cow:
cd cow && $(MAKE) && cd ..
@ -10,13 +10,19 @@ recurse-cow:
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 "\" />"; }' >> $@
ceoquery memberlist | awk -F \| '{ id = $$1; name = $$2; program = $$3; gsub(/&/, "\\&amp;", name); gsub(/&/, "\\&amp;", program); gsub(/"/, "\\&quot;", name); gsub(/"/, "\\&quot;", program); print "<member id=\"" id "\" name=\"" name "\" program=\"" program "\" />"; }' >> $@
echo '</memberlist>' >> $@
books.xml:
echo '<?xml version='\''1.0'\'' encoding="ISO-8859-1"?>' > $@
echo '<booklist>' >> $@
ceoquery booklist | awk -F \| '{ isbn = $$1; title = $$2; author = $$3; edition = $$4; published = $$5; gsub(/&/, "\\&amp;", title); gsub(/&/, "\\&amp;", author); gsub(/&/, "\\&amp;", published); gsub(/&/, "\\&amp;", edition); gsub(/"/, "\\&quot;", title); gsub(/"/, "\\&quot;", author); gsub(/"/, "\\&quot;", published); gsub(/"/, "\\&quot;", edition); print "<book isbn=\"" isbn "\" title=\"" title "\" author=\"" author "\" edition=\"" edition "\" published=\"" published "\"/>"; }' >> $@
echo '</booklist>' >> $@
include default.mk
default.mk: default.mk.in
echo 'ROOT = '`pwd` > $@
cat $< >> $@
.PHONY: members.xml
.PHONY: members.xml books.xml

@ -39,6 +39,17 @@
<!ELEMENT members-this-term EMPTY>
<!ELEMENT booklist (member*)>
<!ELEMENT book EMPTY>
<!ATTLIST book
isbn CDATA #REQUIRED
title CDATA #REQUIRED
author CDATA #REQUIRED
published CDATA ""
edition CDATA "">
<!ELEMENT all-books EMPTY>
<!ELEMENT menudefs (menuitem*)>
<!ELEMENT menuitem EMPTY>
<!ATTLIST menuitem
@ -61,3 +72,4 @@
type CDATA "elected"
name CDATA #REQUIRED
userid CDATA #REQUIRED>

@ -34,14 +34,18 @@
<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>
@ -239,6 +243,9 @@
</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>
@ -247,6 +254,52 @@
</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/{@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: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>

@ -15,3 +15,4 @@ td.eventitem { background: white; text-align: left}
td.eventroom { background: #eeffee; font-family: sans-serif; font-size: x-small; text-align: center}
th.news { background: #222255; color: white; font-family: sans-serif; font-size: x-small; text-align: left; }
td.pagetitle { font-size: large; font-weight: bold; }
th { background: #002288; color: white; }

@ -1,4 +1,4 @@
INPUTS = index.xml constitution.xml official.xml machine_usage.xml \
machine_usage_summary.xml website.xml
machine_usage_summary.xml website.xml editing-howto.xml
include ../default.mk

@ -21,9 +21,9 @@
generating the <a href="/events/">events pages</a>).
</p>
</section>
<section title="Documentation">
<p>Soon I'll hopefully have some documentation here on how to add
content to the website and make other changes.</p>
<section title="Adding to the website">
<p>See the <a href="editing-howto.html">Editing Howto</a> for
information on editing the website</p>
</section>
<section title="Links">
<p>

@ -1,3 +1,6 @@
INPUTS = index.xml staff.xml
SUBDIRS = books
INPUTS = index.xml staff.xml books.xml
include ../default.mk
include ../default.mk
books.html: ../books.xml

@ -0,0 +1,11 @@
<?xml version='1.0'?>
<!DOCTYPE cscpage SYSTEM "../csc.dtd">
<cscpage title="CSC Books">
<header />
<section title="CSC Book list">
<all-books />
</section>
<footer />
</cscpage>

@ -0,0 +1,3 @@
INPUTS =
include ../../default.mk

@ -4,4 +4,5 @@
<directory title="Office">
<diritem title="Staff" href="staff.html" />
<diritem title="Books" href="books.html" />
</directory>

Loading…
Cancel
Save