Changed all absolute paths in cscweb.xsl to relative paths

This commit is contained in:
David Bartley 2007-07-13 06:54:56 -04:00
parent 721ebad826
commit 1c0f220b90
2 changed files with 42 additions and 24 deletions

View File

@ -5,6 +5,20 @@
xmlns:csc="http://www.csclub.uwaterloo.ca/cow" xmlns:csc="http://www.csclub.uwaterloo.ca/cow"
extension-element-prefixes="csc"> extension-element-prefixes="csc">
<!--
Set global "pre" variable based on /cscpage/@pre, which represents the
relative path needed to get to the root. If you do not include a "pre"
attribute on cscpage then the "pre" attribute will default to "../".
-->
<xsl:variable name="pre">
<xsl:choose>
<xsl:when test="/cscpage/@pre"><xsl:value-of select="/cscpage/@pre"/></xsl:when>
<xsl:otherwise>../</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:output method="html" /> <xsl:output method="html" />
<xsl:template match="cscpage"> <xsl:template match="cscpage">
@ -14,9 +28,9 @@
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<title><xsl:value-of select="@title"/></title> <title><xsl:value-of select="@title"/></title>
<link rel="stylesheet" href="/default.css" type="text/css" /> <link rel="stylesheet" href="{$pre}default.css" type="text/css" />
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
@ -42,13 +56,13 @@
<table cellspacing="0" cellpadding="0" border="0" align="left"> <table cellspacing="0" cellpadding="0" border="0" align="left">
<tr> <tr>
<td width="109"><a href="http://www.uwaterloo.ca/"><img <td width="109"><a href="http://www.uwaterloo.ca/"><img
src="/logos/uw_logo_100_68.gif" alt="University of Waterloo" src="{$pre}logos/uw_logo_100_68.gif" alt="University of Waterloo"
width="100" height="68" align="center" border="0" /></a></td> width="100" height="68" align="center" border="0" /></a></td>
<!--<td width="174"><a href="/"><img src="/logos/csc_160_70.png" <!--<td width="174"><a href="{$pre}"><img src="{$pre}logos/csc_160_70.png"
alt="Computer Science Club" width="165" height="75" align="center" alt="Computer Science Club" width="165" height="75" align="center"
border="0" /></a></td>--> border="0" /></a></td>-->
<td width="91"><a href="http://www.acm.org"><img width="82" <td width="91"><a href="http://www.acm.org"><img width="82"
height="103" src="/logos/acm_logo.gif" alt="A Student Chapter of height="103" src="{$pre}logos/acm_logo.gif" alt="A Student Chapter of
the ACM" align="center" border="0" /></a></td> the ACM" align="center" border="0" /></a></td>
</tr> </tr>
</table> </table>
@ -57,8 +71,7 @@
<xsl:template match="mediafile"> <xsl:template match="mediafile">
<xsl:param name="ext" /> <xsl:param name="ext" />
<xsl:param name="pre" /> <a href="/files/{@file}{$ext}"><xsl:value-of select="@type" /></a>,
<a href="{$pre}/files/{@file}{$ext}"><xsl:value-of select="@type" /></a>,
</xsl:template> </xsl:template>
<xsl:template match="flvfile"> <xsl:template match="flvfile">
@ -87,7 +100,7 @@
<head> <head>
<title><xsl:value-of select="@title"/></title> <title><xsl:value-of select="@title"/></title>
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
@ -120,7 +133,7 @@
<br/><br/> <br/><br/>
BitTorrent: BitTorrent:
<xsl:apply-templates select="mediafile" > <xsl:apply-templates select="mediafile" >
<xsl:with-param name="ext">.torrent</xsl:with-param> <xsl:with-param name="ext">.torrent</xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
</strong></p> </strong></p>
</xsl:if> </xsl:if>
@ -166,9 +179,9 @@ google_ad_channel = "1106187834";
<xsl:template match="menuitem"> <xsl:template match="menuitem">
<td align="center" class="menuitem"> <td align="center" class="menuitem">
<a href="{@href}"><img border="0" src="/buttons/{@icon}.png" <a href="{$pre}{@href}"><img border="0" src="{$pre}buttons/{@icon}.png"
width="40" height="40" alt="{@title}" /><!--</a>--><br /> width="40" height="40" alt="{@title}" /><!--</a>--><br />
<!--<a href="{@href}">--><xsl:value-of select="@title"/></a> <!--<a href="{$pre}{@href}">--><xsl:value-of select="@title"/></a>
</td> </td>
</xsl:template> </xsl:template>
@ -192,9 +205,9 @@ google_ad_channel = "1106187834";
<div class="webtitle"><div class="webtitle-inner"> <div class="webtitle"><div class="webtitle-inner">
<table cellpadding="0" cellspacing="0" border="0" align="left"><tr> <table cellpadding="0" cellspacing="0" border="0" align="left"><tr>
<td width="90"> <td width="90">
<a href="/"><img src="/logos/csc_80_35_white.png" alt="CSC Logo" /></a> <a href="{$pre}"><img src="{$pre}logos/csc_80_35_white.png" alt="CSC Logo" /></a>
</td><td> </td><td>
<a href="/"><img src="/logos/csc_title.png" alt="CSC Title" /></a> <a href="{$pre}"><img src="{$pre}logos/csc_title.png" alt="CSC Title" /></a>
</td><td valign="top" align="right"> </td><td valign="top" align="right">
</td> </td>
</tr></table> </tr></table>
@ -241,7 +254,7 @@ google_ad_channel = "1106187834";
may find, including the version of your browser and your operating system. may find, including the version of your browser and your operating system.
</p> </p>
<p> <p>
<a href="/"><img src="/logos/csc_80_35.png" alt="CSC" align="right"/></a> <a href="{$pre}"><img src="{$pre}logos/csc_80_35.png" alt="CSC" align="right"/></a>
Copyright Copyright
<xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text> <xsl:text disable-output-escaping="yes">&amp;copy;</xsl:text>
2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007 2002<xsl:text disable-output-escaping="yes">&amp;ndash;</xsl:text>2007
@ -275,6 +288,7 @@ google_ad_channel = "1106187834";
</tr> </tr>
</xsl:template> </xsl:template>
<!-- TODO: methinks this is borked -->
<xsl:template match="news" name="news"> <xsl:template match="news" name="news">
<tr> <tr>
<th colspan="2" class="news" bgcolor="#aaaaff"> <th colspan="2" class="news" bgcolor="#aaaaff">
@ -337,7 +351,7 @@ google_ad_channel = "1106187834";
<head> <head>
<title><xsl:value-of select="@title"/></title> <title><xsl:value-of select="@title"/></title>
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
@ -370,13 +384,13 @@ google_ad_channel = "1106187834";
order="ascending" order="ascending"
data-type="number"/> data-type="number"/>
<xsl:if test="csc:term(@date) = csc:term($date)"> <xsl:if test="csc:term(@date) = csc:term($date)">
<h3><a href="{translate(concat('/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"><xsl:value-of select="@title"/></a></h3> <h3><a href="{translate(concat($pre, 'events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"><xsl:value-of select="@title"/></a></h3>
<p> <p>
<b><xsl:value-of select="@room"/>, <b><xsl:value-of select="@room"/>,
<xsl:value-of select="@date"/>, <xsl:value-of <xsl:value-of select="@date"/>, <xsl:value-of
select="@time"/>: </b> select="@time"/>: </b>
<xsl:value-of select="short"/> <xsl:value-of select="short"/>
<a href="{translate(concat('/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"> <a href="{translate(concat($pre, 'events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}">
More information</a>. More information</a>.
</p> </p>
</xsl:if> </xsl:if>
@ -433,9 +447,12 @@ google_ad_channel = "1106187834";
<xsl:if test="position() mod 2 = 0"> <xsl:if test="position() mod 2 = 0">
<xsl:attribute name="bgcolor">#cee6ff</xsl:attribute> <xsl:attribute name="bgcolor">#cee6ff</xsl:attribute>
</xsl:if> </xsl:if>
<td><a href="/office/books/{translate(@isbn, ' ', '_')}.html"><xsl:value-of <td><a href="{$pre}office/books/{translate(@isbn, ' ', '_')}.html">
select="@title"/><xsl:if test="@edition != ''"> (<xsl:value-of <xsl:value-of select="@title"/>
select="@edition"/>)</xsl:if></a></td> <xsl:if test="@edition != ''">
(<xsl:value-of select="@edition"/>)
</xsl:if>
</a></td>
<td><xsl:value-of select="@author"/></td> <td><xsl:value-of select="@author"/></td>
</tr> </tr>
<xsl:document method="html" href="{translate(concat($root, '/office/books/', @isbn, '.html'), ' ', '_')}"> <xsl:document method="html" href="{translate(concat($root, '/office/books/', @isbn, '.html'), ' ', '_')}">
@ -445,12 +462,13 @@ google_ad_channel = "1106187834";
<head> <head>
<title>Book: <xsl:value-of select="@title"/></title> <title>Book: <xsl:value-of select="@title"/></title>
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
<xsl:call-template name="header"> <xsl:call-template name="header">
<xsl:with-param name="title" select="@title"/> <xsl:with-param name="title" select="@title"/>
<!-- TODO -->
<xsl:with-param name="pwd" select="concat($pwd, '/books')"/> <xsl:with-param name="pwd" select="concat($pwd, '/books')"/>
</xsl:call-template> </xsl:call-template>
<p> <p>
@ -497,7 +515,7 @@ google_ad_channel = "1106187834";
<head> <head>
<title>Events for <xsl:value-of select="csc:term(@date)"/></title> <title>Events for <xsl:value-of select="csc:term(@date)"/></title>
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">
@ -540,7 +558,7 @@ google_ad_channel = "1106187834";
<head> <head>
<title>News for <xsl:value-of select="csc:term(@date)"/></title> <title>News for <xsl:value-of select="csc:term(@date)"/></title>
<style type="text/css"> <style type="text/css">
<![CDATA[<!-- @import url('/default.css'); -->]]> <![CDATA[<!-- ]]>@import url('<xsl:value-of select="$pre"/>default.css');<![CDATA[ -->]]>
</style> </style>
</head> </head>
<body bgcolor="#ffffff"> <body bgcolor="#ffffff">

View File

@ -2,7 +2,7 @@
<!DOCTYPE cscpage SYSTEM "csc.dtd"> <!DOCTYPE cscpage SYSTEM "csc.dtd">
<cscpage title="Computer Science Club of the University of Waterloo: Home"> <cscpage title="Computer Science Club of the University of Waterloo: Home" pre="./">
<biglogo /> <biglogo />
<menu /> <menu />