|
|
|
@ -1,17 +1,18 @@ |
|
|
|
|
<?xml version='1.0'?> |
|
|
|
|
|
|
|
|
|
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
|
|
|
xmlns:csc="http://www.csclub.uwaterloo.ca/cow" |
|
|
|
|
extension-element-prefixes="csc"> |
|
|
|
|
<xsl:stylesheet version="2.0" |
|
|
|
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
|
|
|
xmlns:xs="http://www.w3.org/2001/XMLSchema" |
|
|
|
|
xmlns:csc="http://www.csclub.uwaterloo.ca/xslt"> |
|
|
|
|
|
|
|
|
|
<xsl:template match="events" name="events"> |
|
|
|
|
<tr> |
|
|
|
|
<th colspan="2" class="news">Upcoming Events</th> |
|
|
|
|
</tr> |
|
|
|
|
<xsl:for-each select="document(concat($pwd, '/events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:for-each select="document(concat($g_root, '/events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:sort select="translate(@date, '-', '')" |
|
|
|
|
order="ascending" data-type="number" /> |
|
|
|
|
<xsl:if test="translate(@date, '-', '') >= translate($date, '-', '')"> |
|
|
|
|
<xsl:if test="translate(@date, '-', '') >= translate($g_date, '-', '')"> |
|
|
|
|
<tr> |
|
|
|
|
<td class="eventdate"><xsl:value-of select="@date" /></td> |
|
|
|
|
<td rowspan="2" valign="top" class="eventitem"> |
|
|
|
@ -36,20 +37,13 @@ |
|
|
|
|
</tr> |
|
|
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
|
<xsl:template match="events-this-term"> |
|
|
|
|
<xsl:call-template name="events-by-term"> |
|
|
|
|
<xsl:with-param name="date" select="$date" /> |
|
|
|
|
</xsl:call-template> |
|
|
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
|
<xsl:template name="events-by-term"> |
|
|
|
|
<xsl:param name="date" /> |
|
|
|
|
<p>The events for <xsl:value-of select="csc:term($date)" /> are listed here. |
|
|
|
|
<p>The events for <xsl:value-of select="csc:term($g_date)" /> are listed here. |
|
|
|
|
You can also <a href="{$pre}events.ics">download an ICS</a> of them.</p> |
|
|
|
|
<xsl:for-each select="document(concat($pwd, '/../events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:for-each select="document(concat($g_root, '/events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:sort select="translate(@date, '-', '')" |
|
|
|
|
order="ascending" data-type="number" /> |
|
|
|
|
<xsl:if test="csc:term(@date) = csc:term($date)"> |
|
|
|
|
<xsl:if test="csc:term(@date) = csc:term($g_date)"> |
|
|
|
|
<h3><a href="{translate(concat($pre, 'events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"><xsl:value-of select="@title" /></a></h3> |
|
|
|
|
<p> |
|
|
|
|
<strong> |
|
|
|
@ -68,19 +62,17 @@ |
|
|
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
|
<xsl:template match="eventitem"> |
|
|
|
|
<xsl:document method="xml" encoding="ISO-8859-1" |
|
|
|
|
<xsl:result-document method="xml" encoding="ISO-8859-1" |
|
|
|
|
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" |
|
|
|
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" |
|
|
|
|
href="{translate(concat($root, '/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"> |
|
|
|
|
href="{translate(concat($g_root, '/events/', @room, '-', @date, '-', @time, '.html'), ' ', '_')}"> |
|
|
|
|
<html> |
|
|
|
|
<head> |
|
|
|
|
<title><xsl:value-of select="@title" /></title> |
|
|
|
|
<link rel="stylesheet" href="{$pre}default.css" type="text/css" /> |
|
|
|
|
</head> |
|
|
|
|
<body><div> |
|
|
|
|
<xsl:call-template name="header"> |
|
|
|
|
<xsl:with-param name="title" select="@title" /> |
|
|
|
|
</xsl:call-template> |
|
|
|
|
<xsl:call-template name="header" /> |
|
|
|
|
<h2>Information</h2> |
|
|
|
|
<div> |
|
|
|
|
Held in <xsl:value-of select="@room" />, on |
|
|
|
@ -91,44 +83,39 @@ |
|
|
|
|
<xsl:call-template name="footer" /> |
|
|
|
|
</div></body> |
|
|
|
|
</html> |
|
|
|
|
</xsl:document> |
|
|
|
|
</xsl:result-document> |
|
|
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
|
<xsl:template match="generate-event-files"> |
|
|
|
|
<xsl:apply-templates select="document(concat($pwd, '/../events.xml'))/eventdefs" /> |
|
|
|
|
<xsl:apply-templates select="document(concat($g_root, '/events.xml'))/eventdefs" /> |
|
|
|
|
</xsl:template> |
|
|
|
|
|
|
|
|
|
<xsl:key name="eventterm" match="/eventdefs/eventitem" use="csc:term(@date)" /> |
|
|
|
|
|
|
|
|
|
<xsl:template match="old-events"> |
|
|
|
|
<xsl:for-each select="document(concat($pwd, '/../events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:for-each select="document(concat($g_root, '/events.xml'))/eventdefs/eventitem"> |
|
|
|
|
<xsl:sort select="translate(@date, '-', '')" |
|
|
|
|
order="descending" data-type="number" /> |
|
|
|
|
<xsl:if test="not(preceding-sibling::*[csc:term(@date)=csc:term(current()/@date)]) and not(csc:term(@date) = csc:term($date))"> |
|
|
|
|
<xsl:if test="not(preceding-sibling::*[csc:term(@date)=csc:term(current()/@date)]) and not(csc:term(@date) = csc:term($g_date))"> |
|
|
|
|
<p><a href="{translate(concat('old-',csc:term(@date), '.html'), ' ', '_')}"> |
|
|
|
|
<xsl:value-of select="csc:term(@date)" /> |
|
|
|
|
</a></p> |
|
|
|
|
<xsl:document method="xml" encoding="ISO-8859-1" |
|
|
|
|
<xsl:result-document method="xml" encoding="ISO-8859-1" |
|
|
|
|
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" |
|
|
|
|
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd" |
|
|
|
|
href="{translate(concat($root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}"> |
|
|
|
|
href="{translate(concat($g_root, '/events/old-', csc:term(@date), '.html'), ' ', '_')}"> |
|
|
|
|
<html> |
|
|
|
|
<head> |
|
|
|
|
<title>Events for <xsl:value-of select="csc:term(@date)" /></title> |
|
|
|
|
<link rel="stylesheet" href="{$pre}default.css" type="text/css" /> |
|
|
|
|
</head> |
|
|
|
|
<body><div> |
|
|
|
|
<xsl:call-template name="header"> |
|
|
|
|
<xsl:with-param name="title" |
|
|
|
|
select="concat('Events for ', csc:term(@date))" /> |
|
|
|
|
</xsl:call-template> |
|
|
|
|
<xsl:call-template name="events-by-term"> |
|
|
|
|
<xsl:with-param name="date" select="@date" /> |
|
|
|
|
</xsl:call-template> |
|
|
|
|
<xsl:call-template name="header" /> |
|
|
|
|
<xsl:call-template name="events-by-term" /> |
|
|
|
|
<xsl:call-template name="footer" /> |
|
|
|
|
</div></body> |
|
|
|
|
</html> |
|
|
|
|
</xsl:document> |
|
|
|
|
</xsl:result-document> |
|
|
|
|
</xsl:if> |
|
|
|
|
</xsl:for-each> |
|
|
|
|
</xsl:template> |
|
|
|
|