Merge branch 'master' of caffeine.uwaterloo.ca:/users/www/www
[mspang/www.git] / xsl / common.xsl
index 272aed8..218f65d 100644 (file)
@@ -1,21 +1,27 @@
 <?xml version='1.0'?>
 
-<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
-    xmlns:csc="http://www.csclub.uwaterloo.ca/cow" 
-    extension-element-prefixes="csc">
+<xsl:stylesheet version="1.1"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:csc="http://csclub.uwaterloo.ca/xsltproc"
+    xmlns="http://www.w3.org/1999/xhtml"
+    exclude-result-prefixes="csc">
+<xsl:output method="xml" />
 
 <xsl:template match="cscpage">
   <html>
     <head>
+      <link rel="shortcut icon" href="/favicon.ico" />
+      <link rel="alternate" title="CSC Events Feed" href="{$g_pre}events.atom"
+          type="application/rss+xml" />
+      <link rel="alternate" title="CSC News Feed" href="{$g_pre}news.atom"
+          type="application/rss+xml" />
       <title><xsl:value-of select="@title" /></title>
-      <link rel="stylesheet" href="{$pre}default.css" type="text/css" />
+      <link rel="stylesheet" href="{$g_pre}default.css" type="text/css" />
     </head>
-    <body><div>
-      <a name="pagetop" id="pagetop" />
+    <body><div class="content">
+      <a id="pagetop" />
       <xsl:apply-templates select="biglogo" />
-      <xsl:apply-templates select="header">
-        <xsl:with-param name="title" select="@title" />
-      </xsl:apply-templates>
+      <xsl:apply-templates select="header" />
       <xsl:apply-templates select="section|menu" />
       <xsl:apply-templates select="footer" />
     </div></body>
 </xsl:template>
 
 <xsl:template match="section">
-  <xsl:if test="@id != ''">
-    <a id="{@id}" />
+  <xsl:if test="@anchor">
+    <a id="{@anchor}" />
   </xsl:if>
   <h2><xsl:value-of select="@title" /></h2>
   <xsl:apply-templates />
 </xsl:template>
 
-<xsl:template match="biglogo" name="biglogo">
+<xsl:template match="biglogo">
   <div class="biglogo">
-    <table cellspacing="0" cellpadding="0" border="0">
-      <tr><td>
-        <a href="http://www.uwaterloo.ca/"><img 
-           src="{$pre}logos/uw_logo_100_68.gif" alt="University of Waterloo"
-           width="100" height="68" /></a>
-      </td><td>
-        <a href="http://www.acm.org"><img width="82" height="103" 
-           src="{$pre}logos/acm_logo.gif"
-           alt="A Student Chapter of the ACM" /></a>
-      </td></tr>
-    </table>
+    <div class="uwlogo">
+      <a href="http://www.uwaterloo.ca/"><img src="{$g_pre}logos/uw_logo.png"
+          alt="University of Waterloo" width="105" height="70" /></a>
+    </div>
+    <div class="csclogo">
+      <a href="{$g_pre}"><img src="{$g_pre}logos/csc_logo.png"
+          alt="Computer Science Club" width="420" height="79" /></a>
+    </div>
+  </div>
+  <div class="dirheader">
+    <xsl:apply-templates
+        select="document(concat($g_pwd, '/directory.xml'))/directory"/>
   </div>
 </xsl:template>
 
-<xsl:template match="header" name="header">
-  <div id="vfeed" />
-  <div class="webtitle"><div class="webtitle-inner">
-    <table cellpadding="0" cellspacing="0" border="0"><tr>
-      <td>
-        <a href="{$pre}"><img src="{$pre}logos/csc_80_35_white.png" 
-            alt="CSC Logo" /></a>
-      </td><td>
-        <a href="{$pre}"><img src="{$pre}logos/csc_title.png" 
-            alt="CSC Title" /></a>
-      </td><td valign="top" align="right" />
-    </tr></table>
-  </div></div>
-  <table cellspacing="0" cellpadding="2" border="0" width="100%" 
-      class="template-header">
-    <tr>
-      <td colspan="2" class="pagetitle"><xsl:value-of select="@title" /></td>
-    </tr>
-    <tr>
-      <td colspan="2">
-        <xsl:apply-templates
-           select="document('../directory.xml')/directory" />
-      </td>
-    </tr>
-  </table>
+<xsl:template match="header">
+  <xsl:call-template name="header" />
+</xsl:template>
+
+<xsl:template name="header">
+  <xsl:param name="title" />
+  <xsl:param name="href" />
+  <div class="webtitle">
+    <a href="{$g_pre}"><img src="{$g_pre}logos/csc_title.png"
+        alt="CSC Logo" /></a>
+  </div>
+  <div class="dirheader">
+    <xsl:apply-templates
+        select="document(concat($g_pwd, '/directory.xml'))/directory"/>
+    <xsl:if test="$title">
+      <xsl:call-template name="diritem">
+        <xsl:with-param name="title" select="$title" />
+        <xsl:with-param name="href" select="$href" />
+      </xsl:call-template>
+    </xsl:if>
+  </div>
 </xsl:template>
 
 <xsl:template match="footer" name="footer">
-  <a href="#pagetop" class="pagetop">Go to top</a>
   <div class="footer">
-  <xsl:call-template name="menu" />
-  <p>This page was generated on <xsl:value-of select="$date" /> at 
-    <xsl:value-of select="$time" />.</p>
-  <p class="infobox">
-    The overall layout is designed specially for Mozilla-based browsers.
-    It is also printer-friendly. Please report any difficulty you may find, 
-    including the version of your browser and your operating system.
-    to the <a href="mailto:www@csclub.uwaterloo.ca">Webmaster</a>.
-  </p>
-  <p>
-    <a href="http://validator.w3.org/check?uri=referer">
-    <img src="http://www.w3.org/Icons/valid-xhtml10"
-        alt="Valid XHTML 1.0 Strict" height="31" width="88" />
-    </a>
-    <a href="http://jigsaw.w3.org/css-validator/check/referer">
-      <img style="border:0;width:88px;height:31px"
-          src="http://jigsaw.w3.org/css-validator/images/vcss" 
-          alt="Valid CSS!" />
-    </a>
-  </p>
-  <div class="footerlogo"><a href="{$pre}"><img src=
-      "{$pre}logos/csc_80_35.png" alt="CSC" /></a></div>
-    <p>
-      Copyright
-      <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
-      2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
-      Computer Science Club of the University of Waterloo.<br />
-      KDE Crystal theme icons are copyright
-      <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
-      2002 and following years KDE Artists. Sunflower image is copyright Manan 
-      Tuli. Horde image is copyright horde contributors. Both are available 
-      under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">
-      Creative Commons::Attribution-ShareAlike license</a>. Gopher image is 
-      copyright Elron6900 (Flickr) and is available under the <a
-      href="http://creativecommons.org/licenses/by-nc/2.0/">
-      Attribution-NonCommercial 2.0</a> license.
-    </p>
+    <xsl:call-template name="menu" />
+    <a href="#pagetop" class="pagetop">Go to top</a>
+    <div class="infobox">
+      <p>
+        This site supports TLS/SSL using a certificate signed by the
+        "CSC Certificate Authority". Click <a href="{$g_pre}csclub.pem">
+        here</a> (PEM format) or <a href="{$g_pre}csclub.der">here</a> (DER
+        format) to install the certificate authority into your browser.
+      </p><p>
+        This page was generated on <xsl:value-of select="$g_date" /> at
+        <xsl:value-of select="$g_time" />.
+      </p><p>
+        Copyright
+        <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
+        2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
+        Computer Science Club of the University of Waterloo.
+      </p>
+    </div>
   </div>
 </xsl:template>
 
   <table cellspacing="1" cellpadding="2" class="newsandevents">
     <xsl:call-template name="events" />
     <xsl:call-template name="news" />
- </table>
 </table>
 </xsl:template>
 
 </xsl:stylesheet>