0a2c4068022edc39300d98c737c2097b07ad4a50
[www/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="{$g_pre}events.atom"
15           type="application/rss+xml" />
16       <link rel="alternate" title="CSC News Feed" href="{$g_pre}news.atom"
17           type="application/rss+xml" />
18       <title><xsl:value-of select="@title" /></title>
19       <link rel="stylesheet" href="{$g_pre}default.css" type="text/css" />
20     </head>
21     <body><div>
22       <a id="pagetop" />
23       <xsl:apply-templates select="biglogo" />
24       <xsl:apply-templates select="header" />
25       <xsl:apply-templates select="section|menu" />
26       <xsl:apply-templates select="footer" />
27     </div></body>
28   </html>
29 </xsl:template>
30
31 <xsl:template match="section">
32   <xsl:if test="@anchor">
33     <a id="{@anchor}" />
34   </xsl:if>
35   <h2><xsl:value-of select="@title" /></h2>
36   <xsl:apply-templates />
37 </xsl:template>
38
39 <xsl:template match="biglogo">
40   <div class="biglogo">
41     <div class="uwlogo">
42       <a href="http://www.uwaterloo.ca/"><img src="{$g_pre}logos/uw_logo.gif"
43           alt="University of Waterloo" width="105" height="70" /></a>
44     </div>
45     <div class="acmlogo">
46       <a href="http://www.acm.org"><img src="{$g_pre}logos/acm_logo.gif"
47            alt="A Student Chapter of the ACM" width="82" height="88" /></a>
48     </div>
49     <div class="csclogo">
50       <a href="{$g_pre}index.html"><img src="{$g_pre}logos/csc_logo.gif"
51           alt="Computer Science Club" width="420" height="79" /></a>
52     </div>
53   </div>
54   <div class="template-header">
55     <xsl:apply-templates
56         select="document(concat($g_pwd, '/directory.xml'))/directory"/>
57   </div>
58 </xsl:template>
59
60 <xsl:template match="header">
61   <xsl:call-template name="header" />
62 </xsl:template>
63
64 <xsl:template name="header">
65   <xsl:param name="title" />
66   <xsl:param name="href" />
67   <div class="webtitle">
68     <a href="{$g_pre}"><img src="{$g_pre}logos/csc_title.gif"
69         alt="CSC Logo" /></a>
70   </div>
71   <div class="template-header">
72     <xsl:apply-templates
73         select="document(concat($g_pwd, '/directory.xml'))/directory"/>
74     <xsl:if test="$title">
75       <xsl:call-template name="diritem">
76         <xsl:with-param name="title" select="$title" />
77         <xsl:with-param name="href" select="$href" />
78       </xsl:call-template>
79     </xsl:if>
80   </div>
81 </xsl:template>
82
83 <xsl:template match="footer" name="footer">
84   <div class="footer">
85     <xsl:call-template name="menu" />
86     <a href="#pagetop" class="pagetop">Go to top</a>
87     <div class="infobox">
88       <p>
89         This site supports TLS/SSL using a certificate signed by the
90         "CSC Certificate Authority". Click <a href="{$g_pre}csclub.pem">
91         here</a> (PEM format) or <a href="{$g_pre}csclub.der">here</a> (DER
92         format) to install the certificate authority into your browser.
93       </p><p>
94         This page was generated on <xsl:value-of select="$g_date" /> at
95         <xsl:value-of select="$g_time" />.
96       </p><p>
97         Copyright
98         <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
99         2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
100         Computer Science Club of the University of Waterloo.
101       </p>
102     </div>
103   </div>
104 </xsl:template>
105
106 <xsl:template match="news-and-events">
107   <table cellspacing="1" cellpadding="2" class="newsandevents">
108     <xsl:call-template name="events" />
109     <xsl:call-template name="news" />
110  </table>
111 </xsl:template>
112
113 </xsl:stylesheet>