added page header atom feed link
[mspang/www.git] / xsl / common.xsl
1 <?xml version='1.0'?>
2
3 <xsl:stylesheet version="2.0"
4     xmlns="http://www.w3.org/1999/xhtml"
5     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
6     xmlns:xs="http://www.w3.org/2001/XMLSchema"
7     xmlns:fn="http://www.w3.org/2005/xpath-functions"
8     xmlns:csc="http://csclub.uwaterloo.ca/xslt">
9
10 <xsl:template match="cscpage">
11   <html>
12     <head>
13       <link rel="shortcut icon" href="/favicon.ico" />
14       <link rel="alternate" title="CSC Events Feed" href="http://csclub.uwaterloo.ca/events.xml" type="application/rss+xml" />
15       <link rel="alternate" title="CSC News Feed" href="http://csclub.uwaterloo.ca/news.atom" type="application/rss+xml" />
16       <title><xsl:value-of select="@title" /></title>
17       <link rel="stylesheet" href="{$pre}default.css" type="text/css" />
18     </head>
19     <body><div>
20       <a id="pagetop" />
21       <xsl:apply-templates select="biglogo" />
22       <xsl:apply-templates select="header" />
23       <xsl:apply-templates select="section|menu" />
24       <xsl:apply-templates select="footer" />
25     </div></body>
26   </html>
27 </xsl:template>
28
29 <xsl:template match="section">
30   <xsl:if test="@anchor">
31     <a name="{@anchor}" />
32   </xsl:if>
33   <h2><xsl:value-of select="@title" /></h2>
34   <xsl:apply-templates />
35 </xsl:template>
36
37 <xsl:template match="biglogo">
38   <div class="biglogo">
39     <div class="uwlogo">
40       <a href="http://www.uwaterloo.ca/"><img src="{$pre}logos/uw_logo.gif"
41           alt="University of Waterloo" width="105" height="70" /></a>
42     </div>
43     <div class="acmlogo">
44       <a href="http://www.acm.org"><img src="{$pre}logos/acm_logo.gif"
45            alt="A Student Chapter of the ACM" width="82" height="88" /></a>
46     </div>
47     <div class="csclogo">
48       <a href="{$pre}index.html"><img src="{$pre}logos/csc_logo.gif"
49           alt="University of Waterloo" width="420" height="79" /></a>
50     </div>
51   </div>
52   <div class="template-header">
53     <xsl:apply-templates
54         select="document(concat($g_pwd, '/directory.xml'))/directory"/>
55   </div>
56 </xsl:template>
57
58 <xsl:template match="header">
59   <xsl:call-template name="header" />
60 </xsl:template>
61
62 <xsl:template name="header">
63   <xsl:param name="title" />
64   <xsl:param name="href" />
65   <div id="vfeed" />
66   <div class="webtitle">
67     <div class="csclogo">
68       <a href="{$pre}"><img src="{$pre}logos/csc_80_35_white.png" 
69           alt="CSC Logo" /></a>
70     </div>
71     <div>
72       <a href="{$pre}"><img src="{$pre}logos/csc_title.png" 
73           alt="Computer Science Club" /></a>
74     </div>
75   </div>
76   <div class="template-header">
77     <xsl:apply-templates
78         select="document(concat($g_pwd, '/directory.xml'))/directory"/>
79     <xsl:if test="$title">
80       <xsl:call-template name="diritem">
81         <xsl:with-param name="title" select="$title" />
82         <xsl:with-param name="href" select="$href" />
83       </xsl:call-template>
84     </xsl:if>
85   </div>
86 </xsl:template>
87
88 <xsl:template match="footer" name="footer">
89   <div class="footer">
90     <xsl:call-template name="menu" />
91     <a href="#pagetop" class="pagetop">Go to top</a>
92     <div class="infobox">
93       <p>
94         This site supports TLS/SSL using a certificate signed by the 
95         "CSC Certificate Authority". Click <a href="{$pre}csclub.pem">here</a>
96         (PEM format) or <a href="{$pre}csclub.der">here</a> (DER format) to
97         install the certificate authority into your browser.
98       </p><p>
99         This page was generated on <xsl:value-of select="$g_date" /> at 
100         <xsl:value-of select="$g_time" />.
101       </p><p>
102         Copyright
103         <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
104         2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
105         Computer Science Club of the University of Waterloo.
106       </p>
107     </div>
108     <p>
109       <a href="http://validator.w3.org/check?uri=referer">
110       <img src="http://www.w3.org/Icons/valid-xhtml10"
111           alt="Valid XHTML 1.0 Strict" height="31" width="88" />
112       </a>
113       <a href="http://jigsaw.w3.org/css-validator/check/referer">
114       <img style="border:0;width:88px;height:31px"
115           src="http://jigsaw.w3.org/css-validator/images/vcss" 
116           alt="Valid CSS!" />
117       </a>
118     </p>
119   </div>
120 </xsl:template>
121
122 <xsl:template match="news-and-events">
123   <table cellspacing="1" cellpadding="2" class="newsandevents">
124     <xsl:call-template name="events" />
125     <xsl:call-template name="news" />
126  </table>
127 </xsl:template>
128
129 </xsl:stylesheet>