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