Merge branch 'master' of caffeine:/users/www/www/
[mspang/www.git] / xsl / common.xsl
1 <?xml version='1.0'?>
2
3 <xsl:stylesheet version="1.1"
4     xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5     xmlns:csc="http://csclub.uwaterloo.ca/xsltproc"
6     xmlns="http://www.w3.org/1999/xhtml"
7     exclude-result-prefixes="csc">
8 <xsl:output method="xml" />
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 class="content">
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.png"
43           alt="University of Waterloo" width="105" height="70" /></a>
44     </div>
45     <div class="csclogo">
46       <a href="{$g_pre}"><img src="{$g_pre}logos/csc_logo.png"
47           alt="Computer Science Club" width="420" height="79" /></a>
48     </div>
49   </div>
50   <div class="dirheader">
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 class="webtitle">
64     <a href="{$g_pre}"><img src="{$g_pre}logos/csc_title.png"
65         alt="CSC Logo" /></a>
66   </div>
67   <div class="dirheader">
68     <xsl:apply-templates
69         select="document(concat($g_pwd, '/directory.xml'))/directory"/>
70     <xsl:if test="$title">
71       <xsl:call-template name="diritem">
72         <xsl:with-param name="title" select="$title" />
73         <xsl:with-param name="href" select="$href" />
74       </xsl:call-template>
75     </xsl:if>
76   </div>
77 </xsl:template>
78
79 <xsl:template match="footer" name="footer">
80   <div class="footer">
81     <xsl:call-template name="menu" />
82     <a href="#pagetop" class="pagetop">Go to top</a>
83     <div class="infobox">
84       <p>
85         This site supports TLS/SSL using a certificate signed by GlobalSign.
86       </p><p>
87         This page was generated on <xsl:value-of select="$g_date" /> at
88         <xsl:value-of select="$g_time" />.
89       </p><p>
90         Copyright
91         <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
92         2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2012
93         Computer Science Club of the University of Waterloo.
94       </p>
95     </div>
96   </div>
97 </xsl:template>
98
99 <xsl:template match="news-and-events">
100   <table cellspacing="1" cellpadding="2" class="newsandevents">
101     <xsl:call-template name="events" />
102     <xsl:call-template name="news" />
103   </table>
104 </xsl:template>
105
106 </xsl:stylesheet>