Reflowed and split cscweb.xsl into smaller xsl files.
[mspang/www.git] / xsl / common.xsl
1 <?xml version='1.0'?>
2
3 <xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4     xmlns:csc="http://www.csclub.uwaterloo.ca/cow" 
5     extension-element-prefixes="csc">
6
7 <xsl:template match="cscpage">
8   <html>
9     <head>
10       <title><xsl:value-of select="@title" /></title>
11       <link rel="stylesheet" href="{$pre}default.css" type="text/css" />
12     </head>
13     <body><div>
14       <a name="pagetop" id="pagetop" />
15       <xsl:apply-templates select="biglogo" />
16       <xsl:apply-templates select="header">
17         <xsl:with-param name="title" select="@title" />
18       </xsl:apply-templates>
19       <xsl:apply-templates select="section|menu" />
20       <xsl:apply-templates select="footer" />
21     </div></body>
22   </html>
23 </xsl:template>
24
25 <xsl:template match="section">
26   <xsl:if test="@id != ''">
27     <a id="{@id}" />
28   </xsl:if>
29   <h2><xsl:value-of select="@title" /></h2>
30   <xsl:apply-templates />
31 </xsl:template>
32
33 <xsl:template match="biglogo" name="biglogo">
34   <div class="biglogo">
35     <table cellspacing="0" cellpadding="0" border="0">
36       <tr><td>
37         <a href="http://www.uwaterloo.ca/"><img 
38            src="{$pre}logos/uw_logo_100_68.gif" alt="University of Waterloo"
39            width="100" height="68" /></a>
40       </td><td>
41         <a href="http://www.acm.org"><img width="82" height="103" 
42            src="{$pre}logos/acm_logo.gif"
43            alt="A Student Chapter of the ACM" /></a>
44       </td></tr>
45     </table>
46   </div>
47 </xsl:template>
48
49 <xsl:template match="header" name="header">
50   <div id="vfeed" />
51   <div class="webtitle"><div class="webtitle-inner">
52     <table cellpadding="0" cellspacing="0" border="0"><tr>
53       <td>
54         <a href="{$pre}"><img src="{$pre}logos/csc_80_35_white.png" 
55             alt="CSC Logo" /></a>
56       </td><td>
57         <a href="{$pre}"><img src="{$pre}logos/csc_title.png" 
58             alt="CSC Title" /></a>
59       </td><td valign="top" align="right" />
60     </tr></table>
61   </div></div>
62   <table cellspacing="0" cellpadding="2" border="0" width="100%" 
63       class="template-header">
64     <tr>
65       <td colspan="2" class="pagetitle"><xsl:value-of select="@title" /></td>
66     </tr>
67     <tr>
68       <td colspan="2">
69         <xsl:apply-templates
70            select="document('../directory.xml')/directory" />
71       </td>
72     </tr>
73   </table>
74 </xsl:template>
75
76 <xsl:template match="footer" name="footer">
77   <a href="#pagetop" class="pagetop">Go to top</a>
78   <div class="footer">
79   <xsl:call-template name="menu" />
80   <p>This page was generated on <xsl:value-of select="$date" /> at 
81     <xsl:value-of select="$time" />.</p>
82   <p class="infobox">
83     The overall layout is designed specially for Mozilla-based browsers.
84     It is also printer-friendly. Please report any difficulty you may find, 
85     including the version of your browser and your operating system.
86     to the <a href="mailto:www@csclub.uwaterloo.ca">Webmaster</a>.
87   </p>
88   <p>
89     <a href="http://validator.w3.org/check?uri=referer">
90     <img src="http://www.w3.org/Icons/valid-xhtml10"
91         alt="Valid XHTML 1.0 Strict" height="31" width="88" />
92     </a>
93     <a href="http://jigsaw.w3.org/css-validator/check/referer">
94       <img style="border:0;width:88px;height:31px"
95           src="http://jigsaw.w3.org/css-validator/images/vcss" 
96           alt="Valid CSS!" />
97     </a>
98   </p>
99   <div class="footerlogo"><a href="{$pre}"><img src=
100       "{$pre}logos/csc_80_35.png" alt="CSC" /></a></div>
101     <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.<br />
106       KDE Crystal theme icons are copyright
107       <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
108       2002 and following years KDE Artists. Sunflower image is copyright Manan 
109       Tuli. Horde image is copyright horde contributors. Both are available 
110       under the <a href="http://creativecommons.org/licenses/by-sa/2.5/">
111       Creative Commons::Attribution-ShareAlike license</a>. Gopher image is 
112       copyright Elron6900 (Flickr) and is available under the <a
113       href="http://creativecommons.org/licenses/by-nc/2.0/">
114       Attribution-NonCommercial 2.0</a> license.
115     </p>
116   </div>
117 </xsl:template>
118
119 <xsl:template match="news-and-events">
120   <table cellspacing="1" cellpadding="2" class="newsandevents">
121     <xsl:call-template name="events" />
122     <xsl:call-template name="news" />
123  </table>
124 </xsl:template>
125
126 </xsl:stylesheet>