root/trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 1054 (checked in by johnsa, 7 years ago)

simplify display of categories in public events UI

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output
4   method="html"
5   indent="yes"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD HTML 4.01 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/html4/loose.dtd"
9   standalone="yes"
10 />
11
12 <!-- =========================================================
13
14               DEMONSTRATION CALENDAR STYLESHEET
15
16      This stylesheet is devoid of school branding.  It is a good
17      starting point for development of a customized calendar.
18
19      For detailed instructions on how to work with the XSLT
20      stylesheets included with this distribution, please see the
21      Bedework Design Guide at
22      http://www.bedework.org/bedework/update.do?artcenterkey=24
23
24 ===============================================================  -->
25 <!-- **********************************************************************
26     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
27
28     Redistribution and use of this distribution in source and binary forms,
29     with or without modification, are permitted provided that:
30        The above copyright notice and this permission notice appear in all
31         copies and supporting documentation;
32
33         The name, identifiers, and trademarks of Rensselaer Polytechnic
34         Institute are not used in advertising or publicity without the
35         express prior written permission of Rensselaer Polytechnic Institute;
36
37     DISCLAIMER: The software is distributed" AS IS" without any express or
38     implied warranty, including but not limited to, any implied warranties
39     of merchantability or fitness for a particular purpose or any warrant)'
40     of non-infringement of any current or pending patent rights. The authors
41     of the software make no representations about the suitability of this
42     software for any particular purpose. The entire risk as to the quality
43     and performance of the software is with the user. Should the software
44     prove defective, the user assumes the cost of all necessary servicing,
45     repair or correction. In particular, neither Rensselaer Polytechnic
46     Institute, nor the authors of the software are liable for any indirect,
47     special, consequential, or incidental damages related to the software,
48     to the maximum extent the law permits. -->
49
50   <!-- ================================= -->
51   <!--  DEMO PUBLIC CALENDAR STYLESHEET  -->
52   <!-- ================================= -->
53
54   <!-- DEFINE INCLUDES -->
55   <xsl:include href="errors.xsl"/>
56
57   <!-- DEFINE GLOBAL CONSTANTS -->
58
59   <!-- URL of the XSL template directory -->
60   <!-- The approot is an appropriate place to put
61        included stylesheets and xml fragments. These are generally
62        referenced relatively (like errors.xsl and messages.xsl above);
63        this variable is here for your convenience if you choose to
64        reference it explicitly.  It is not used in this stylesheet, however,
65        and can be safely removed if you so choose. -->
66   <xsl:variable name="appRoot" select="/bedework/approot"/>
67
68   <!-- URL of html resources (images, css, other html); by default this is
69        set to the application root -->
70   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
71
72   <!-- Properly encoded prefixes to the application actions; use these to build
73        urls; allows the application to be used without cookies or within a portal.
74        These urls are rewritten in header.jsp and simply passed through for use
75        here. Every url includes a query string (either ?b=de or a real query
76        string) so that all links constructed in this stylesheet may begin the
77        query string with an ampersand. -->
78   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
79   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/setSelection"/>
80   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/fetchPublicCalendars"/>
81   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/setViewPeriod"/>
82   <xsl:variable name="eventView" select="/bedework/urlPrefixes/eventView"/>
83   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/addEventRef"/>
84   <xsl:variable name="export" select="/bedework/urlPrefixes/export/a/@href"/>
85   <xsl:variable name="search" select="/bedework/urlPrefixes/search"/>
86   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mailEvent"/>
87   <xsl:variable name="showPage" select="/bedework/urlPrefixes/showPage"/>
88   <xsl:variable name="stats" select="/bedework/urlPrefixes/stats"/>
89
90   <!-- Other generally useful global variables -->
91   <xsl:variable name="privateCal">/ucal</xsl:variable>
92   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
93   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
94   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
95
96
97   <!-- MAIN TEMPLATE -->
98   <xsl:template match="/">
99     <html lang="en">
100       <head>
101         <title>Bedework Events Calendar</title>
102         <link rel="stylesheet" type="text/css" href="{$resourcesRoot}/default/default/common.css" />
103         <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
104         <xsl:choose>
105           <xsl:when test="/bedework/appvar[key='style']/value='red'">
106             <link rel="stylesheet" href="{$resourcesRoot}/default/default/red.css"/>
107           </xsl:when>
108           <xsl:when test="/bedework/appvar[key='style']/value='green'">
109             <link rel="stylesheet" href="{$resourcesRoot}/default/default/green.css"/>
110           </xsl:when>
111           <xsl:otherwise>
112             <link rel="stylesheet" href="{$resourcesRoot}/default/default/blue.css"/>
113           </xsl:otherwise>
114         </xsl:choose>
115         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
116       </head>
117       <body>
118         <xsl:call-template name="headBar"/>
119         <xsl:if test="/bedework/error">
120           <div id="errors">
121             <xsl:apply-templates select="/bedework/error"/>
122           </div>
123         </xsl:if>
124         <xsl:call-template name="tabs"/>
125         <xsl:call-template name="navigation"/>
126         <xsl:call-template name="searchBar"/>
127         <xsl:choose>
128           <xsl:when test="/bedework/page='event'">
129             <!-- show an event -->
130             <xsl:apply-templates select="/bedework/event"/>
131           </xsl:when>
132           <xsl:when test="/bedework/page='showSysStats'">
133             <!-- show system stats -->
134             <xsl:call-template name="stats"/>
135           </xsl:when>
136           <xsl:when test="/bedework/page='calendarList'">
137             <!-- show a list of all calendars -->
138             <xsl:apply-templates select="/bedework/calendars"/>
139           </xsl:when>
140           <xsl:when test="/bedework/page='searchResult'">
141             <!-- show a list of all calendars -->
142             <xsl:call-template name="searchResult"/>
143           </xsl:when>
144           <xsl:otherwise>
145             <!-- otherwise, show the eventsCalendar
146             <xsl:if test="/bedework/periodname!='Year'">
147               <xsl:call-template name="searchBar"/>
148             </xsl:if>-->
149             <!-- main eventCalendar content -->
150             <xsl:choose>
151               <xsl:when test="/bedework/periodname='Day'">
152                 <xsl:call-template name="listView"/>
153               </xsl:when>
154               <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
155                 <xsl:choose>
156                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
157                     <xsl:call-template name="listView"/>
158                   </xsl:when>
159                   <xsl:otherwise>
160                     <xsl:call-template name="weekView"/>
161                   </xsl:otherwise>
162                 </xsl:choose>
163               </xsl:when>
164               <xsl:when test="/bedework/periodname='Month'">
165                 <xsl:choose>
166                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
167                     <xsl:call-template name="listView"/>
168                   </xsl:when>
169                   <xsl:otherwise>
170                     <xsl:call-template name="monthView"/>
171                   </xsl:otherwise>
172                 </xsl:choose>
173               </xsl:when>
174               <xsl:otherwise>
175                 <xsl:call-template name="yearView"/>
176               </xsl:otherwise>
177             </xsl:choose>
178           </xsl:otherwise>
179         </xsl:choose>
180         <!-- footer -->
181         <xsl:call-template name="footer"/>
182       </body>
183     </html>
184   </xsl:template>
185
186   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
187   <!-- these templates are separated out for convenience and to simplify the default template -->
188
189   <xsl:template name="headBar">
190     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
191       <tr>
192         <td colspan="3" id="logoCell"><a href="http://www.bedework.org/"><img src="{$resourcesRoot}/images/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
193         <td colspan="2" id="schoolLinksCell">
194           <h2>Public Calendar</h2>
195           <a href="{$privateCal}">Personal Calendar</a> |
196           <a href="http://www.yourschoolhere.edu">School Home</a> |
197           <a href="http://www.bedework.org/">Other Link</a> |
198           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
199             Example Calendar Help
200           </a>
201         </td>
202       </tr>
203     </table>
204     <table id="curDateRangeTable"  cellspacing="0">
205       <tr>
206         <td class="sideBarOpenCloseIcon">
207           &#160;
208           <!--
209           we may choose to implement calendar selection in the public calendar
210           using a sidebar; leave this comment here for now.
211           <xsl:choose>
212             <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
213               <a href="?setappvar=sidebar(opened)">
214                 <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
215               </a>
216             </xsl:when>
217             <xsl:otherwise>
218               <a href="?setappvar=sidebar(closed)">
219                 <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
220               </a>
221             </xsl:otherwise>
222           </xsl:choose>-->
223         </td>
224         <td class="date">
225           <xsl:choose>
226             <xsl:when test="/bedework/page='event'">
227               Event Information
228             </xsl:when>
229             <xsl:when test="/bedework/page='showSysStats' or
230                             /bedework/page='calendars'">
231               &#160;
232             </xsl:when>
233             <xsl:otherwise>
234               <xsl:value-of select="/bedework/firstday/longdate"/>
235               <xsl:if test="/bedework/periodname!='Day'">
236                 -
237                 <xsl:value-of select="/bedework/lastday/longdate"/>
238               </xsl:if>
239             </xsl:otherwise>
240           </xsl:choose>
241         </td>
242         <td class="rssPrint">
243           <a href="javascript:window.print()" title="print this view">
244             <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
245           </a>
246           <a class="rss" href="{$setSelection}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
247         </td>
248       </tr>
249     </table>
250   </xsl:template>
251
252   <xsl:template name="tabs">
253     <xsl:choose>
254       <xsl:when test="/bedework/page='eventscalendar'">
255         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
256           <tr>
257             <td>
258               <xsl:choose>
259                 <xsl:when test="/bedework/periodname='Day'">
260                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-day-on.gif" width="91" height="20" border="0" alt="DAY"/></a>
261                 </xsl:when>
262                 <xsl:otherwise>
263                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
264                 </xsl:otherwise>
265               </xsl:choose>
266             </td>
267             <td>
268               <xsl:choose>
269                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
270                   <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-week-on.gif" width="92" height="20" border="0" alt="WEEK"/></a>
271                  </xsl:when>
272                 <xsl:otherwise>
273                   <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
274                  </xsl:otherwise>
275               </xsl:choose>
276             </td>
277             <td>
278               <xsl:choose>
279                 <xsl:when test="/bedework/periodname='Month'">
280                   <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-month-on.gif" width="90" height="20" border="0" alt="MONTH"/></a>
281                 </xsl:when>
282                 <xsl:otherwise>
283                   <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
284                 </xsl:otherwise>
285               </xsl:choose>
286             </td>
287             <td>
288               <xsl:choose>
289                 <xsl:when test="/bedework/periodname='Year'">
290                   <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-year-on.gif" width="92" height="20" border="0" alt="YEAR"/></a>
291                 </xsl:when>
292                 <xsl:otherwise>
293                   <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
294                 </xsl:otherwise>
295               </xsl:choose>
296             </td>
297             <td class="centerCell">
298               &#160;<!--<img src="{$resourcesRoot}/images/std-button-today.gif" width="46" height="17" border="0" alt="TODAY"/>-->
299             </td>
300             <td class="rightCell">
301               &#160;
302             </td>
303           </tr>
304         </table>
305       </xsl:when>
306       <xsl:otherwise>
307         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
308           <tr>
309             <td>
310               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-day-off.gif" width="91" height="20" border="0" alt="DAY"/></a>
311             </td>
312             <td>
313               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-week-off.gif" width="92" height="20" border="0" alt="WEEK"/></a>
314             </td>
315             <td>
316               <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-month-off.gif" width="90" height="20" border="0" alt="MONTH"/></a>
317             </td>
318             <td>
319               <a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><img src="{$resourcesRoot}/images/std-tab-year-off.gif" width="92" height="20" border="0" alt="YEAR"/></a>
320             </td>
321             <td class="centerCell">
322               &#160;<!--<img src="{$resourcesRoot}/images/std-button-today.gif" width="46" height="17" border="0" alt="TODAY"/>-->
323             </td>
324             <td class="rightCell">
325               &#160;
326             </td>
327           </tr>
328         </table>
329       </xsl:otherwise>
330     </xsl:choose>
331   </xsl:template>
332
333   <xsl:template name="navigation">
334     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
335       <tr>
336         <td class="leftCell">
337           <a id="prevViewPeriod" href="{$setViewPeriod}&amp;date={$prevdate}"><img src="{$resourcesRoot}/images/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
338           <a id="nextViewPeriod" href="{$setViewPeriod}&amp;date={$nextdate}"><img src="{$resourcesRoot}/images/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
339           <xsl:choose>
340             <xsl:when test="/bedework/periodname='Year'">
341               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
342             </xsl:when>
343             <xsl:when test="/bedework/periodname='Month'">
344               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
345             </xsl:when>
346             <xsl:when test="/bedework/periodname='Week'">
347               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
348             </xsl:when>
349             <xsl:otherwise>
350               <xsl:value-of select="/bedework/firstday/longdate"/>
351             </xsl:otherwise>
352           </xsl:choose>
353         </td>
354         <td class="todayButton">
355           <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
356             <img src="{$resourcesRoot}/images/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
357           </a>
358         </td>
359         <td align="right" class="gotoForm">
360           <form name="calForm" method="post" action="{$setViewPeriod}">
361              <table border="0" cellpadding="0" cellspacing="0">
362               <tr>
363                 <xsl:if test="/bedework/periodname!='Year'">
364                   <td>
365                     <select name="viewStartDate.month">
366                       <xsl:for-each select="/bedework/monthvalues/val">
367                         <xsl:variable name="temp" select="."/>
368                         <xsl:variable name="pos" select="position()"/>
369                         <xsl:choose>
370                           <xsl:when test="/bedework/monthvalues[start=$temp]">
371                             <option value="{$temp}" selected="selected">
372                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
373                             </option>
374                           </xsl:when>
375                           <xsl:otherwise>
376                             <option value="{$temp}">
377                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
378                             </option>
379                           </xsl:otherwise>
380                         </xsl:choose>
381                       </xsl:for-each>
382                     </select>
383                   </td>
384                   <xsl:if test="/bedework/periodname!='Month'">
385                     <td>
386                       <select name="viewStartDate.day">
387                         <xsl:for-each select="/bedework/dayvalues/val">
388                           <xsl:variable name="temp" select="."/>
389                           <xsl:variable name="pos" select="position()"/>
390                           <xsl:choose>
391                             <xsl:when test="/bedework/dayvalues[start=$temp]">
392                               <option value="{$temp}" selected="selected">
393                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
394                               </option>
395                             </xsl:when>
396                             <xsl:otherwise>
397                               <option value="{$temp}">
398                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
399                               </option>
400                             </xsl:otherwise>
401                           </xsl:choose>
402                         </xsl:for-each>
403                       </select>
404                     </td>
405                   </xsl:if>
406                 </xsl:if>
407                 <td>
408                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
409                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
410                 </td>
411                 <td>
412                   <input name="submit" type="submit" value="go"/>
413                 </td>
414               </tr>
415             </table>
416           </form>
417         </td>
418         <td class="rightCell">
419         </td>
420       </tr>
421     </table>
422   </xsl:template>
423
424   <xsl:template name="searchBar">
425     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable">
426        <tr>
427          <td class="leftCell">
428            <xsl:choose>
429              <xsl:when test="/bedework/selectionState/selectionType = 'calendar'">
430                Calendar: <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/>
431                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
432              </xsl:when>
433              <xsl:when test="/bedework/selectionState/selectionType = 'search'">
434                Current search: <xsl:value-of select="/bedework/search"/>
435                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
436              </xsl:when>
437              <xsl:when test="/bedework/selectionState/selectionType = 'subscription'">
438                Subscription: (not implemented yet)
439                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
440              </xsl:when>
441              <xsl:when test="/bedework/selectionState/selectionType = 'filter'">
442                Filter: (not implemented yet)
443                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
444              </xsl:when>
445              <xsl:otherwise><!-- view -->
446                View:
447                <form name="selectViewForm" method="post" action="{$setSelection}">
448                 <select name="viewName" onChange="submit()" >
449                   <xsl:for-each select="/bedework/views/view">
450                     <xsl:variable name="name" select="name"/>
451                     <xsl:choose>
452                       <xsl:when test="name=/bedework/selectionState/view/name">
453                         <option value="{$name}" selected="selected"><xsl:value-of select="name"/></option>
454                       </xsl:when>
455                       <xsl:otherwise>
456                         <option value="{$name}"><xsl:value-of select="name"/></option>
457                       </xsl:otherwise>
458                     </xsl:choose>
459                   </xsl:for-each>
460                 </select>
461               </form>
462               <span class="calLinks"><a href="{$setSelection}">default view</a> | <a href="{$fetchPublicCalendars}">available calendars</a></span>
463              </xsl:otherwise>
464            </xsl:choose>
465          </td>
466          <td class="rightCell">
467             <form name="searchForm" method="post" action="{$search}">
468               Search:
469               <input type="text" name="query" size="15">
470                 <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
471               </input>
472               <input type="submit" name="submit" value="go"/>
473             </form>
474             <xsl:choose>
475               <xsl:when test="/bedework/periodname='Day'">
476                 <img src="{$resourcesRoot}/images/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
477               </xsl:when>
478               <xsl:when test="/bedework/periodname='Year'">
479                 <img src="{$resourcesRoot}/images/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
480               </xsl:when>
481               <xsl:when test="/bedework/periodname='Month'">
482                 <xsl:choose>
483                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
484                     <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
485                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
486                     </a>
487                   </xsl:when>
488                   <xsl:otherwise>
489                     <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
490                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
491                     </a>
492                   </xsl:otherwise>
493                 </xsl:choose>
494               </xsl:when>
495               <xsl:otherwise>
496                 <xsl:choose>
497                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
498                     <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
499                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
500                     </a>
501                   </xsl:when>
502                   <xsl:otherwise>
503                     <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
504                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
505                     </a>
506                   </xsl:otherwise>
507                 </xsl:choose>
508               </xsl:otherwise>
509             </xsl:choose>
510             <xsl:choose>
511               <xsl:when test="/bedework/periodname='Year' or
512                               (/bedework/periodname='Month' and
513                               (/bedework/appvar[key='monthViewMode']/value='cal' or
514                                not(/bedework/appvar[key='monthViewMode']))) or
515                               (/bedework/periodname='Week' and
516                               (/bedework/appvar[key='weekViewMode']/value='cal' or
517                                not(/bedework/appvar[key='weekViewMode'])))">
518                 <xsl:choose>
519                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
520                     <img src="{$resourcesRoot}/images/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
521                   </xsl:when>
522                   <xsl:otherwise>
523                     <img src="{$resourcesRoot}/images/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
524                   </xsl:otherwise>
525                 </xsl:choose>
526               </xsl:when>
527               <xsl:otherwise>
528                 <xsl:choose>
529                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
530                     <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
531                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
532                     </a>
533                   </xsl:when>
534                   <xsl:otherwise>
535                     <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
536                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
537                     </a>
538                   </xsl:otherwise>
539                 </xsl:choose>
540               </xsl:otherwise>
541             </xsl:choose>
542             <a href="setup.do"><img src="{$resourcesRoot}/images/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
543           </td>
544        </tr>
545     </table>
546   </xsl:template>
547
548   <!--==== SINGLE EVENT ====-->
549   <xsl:template match="event">
550     <xsl:variable name="statusClass">
551       <xsl:choose>
552         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
553         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
554         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
555       </xsl:choose>
556     </xsl:variable>
557     <h2 class="{$statusClass}">
558       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
559       <xsl:choose>
560         <xsl:when test="link != ''">
561           <xsl:variable name="link" select="link"/>
562           <a href="{$link}">
563             <xsl:value-of select="summary"/>
564           </a>
565         </xsl:when>
566         <xsl:otherwise>
567           <xsl:value-of select="summary"/>
568         </xsl:otherwise>
569       </xsl:choose>
570     </h2>
571     <table id="eventTable" cellpadding="0" cellspacing="0">
572       <tr>
573         <td class="fieldname">When:</td>
574         <td class="fieldval">
575           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
576           <xsl:if test="start/allday = 'false'">
577             <span class="time"><xsl:value-of select="start/time"/></span>
578           </xsl:if>
579           <xsl:if test="(end/longdate != start/longdate) or
580                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
581           <xsl:if test="end/longdate != start/longdate">
582             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
583           </xsl:if>
584           <xsl:choose>
585             <xsl:when test="start/allday = 'true'">
586               <span class="time"><em>(all day)</em></span>
587             </xsl:when>
588             <xsl:when test="end/longdate != start/longdate">
589               <span class="time"><xsl:value-of select="end/time"/></span>
590             </xsl:when>
591             <xsl:when test="end/time != start/time">
592               <span class="time"><xsl:value-of select="end/time"/></span>
593             </xsl:when>
594           </xsl:choose>
595         </td>
596         <th class="icalIcon" rowspan="2">
597           <div id="eventIcons">
598             <xsl:variable name="id" select="id"/>
599             <xsl:variable name="subscriptionId" select="subscription/id"/>
600             <xsl:variable name="calPath" select="calendar/encodedPath"/>
601             <xsl:variable name="guid" select="guid"/>
602             <xsl:variable name="recurrenceId" select="recurrenceId"/>
603             <a href="{$privateCal}/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
604               <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
605             add to my calendar</a>
606             <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
607             <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
608               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
609              download</a>
610           </div>
611         </th>
612       </tr>
613       <tr>
614         <td class="fieldname">Where:</td>
615         <td class="fieldval">
616           <xsl:choose>
617             <xsl:when test="location/link=''">
618               <xsl:value-of select="location/address"/>
619             </xsl:when>
620             <xsl:otherwise>
621               <xsl:variable name="locationLink" select="location/link"/>
622               <a href="{$locationLink}">
623                 <xsl:value-of select="location/address"/>
624               </a>
625             </xsl:otherwise>
626           </xsl:choose>
627           <xsl:if test="location/subaddress!=''">
628             <br/><xsl:value-of select="location/subaddress"/>
629           </xsl:if>
630         </td>
631       </tr>
632       <tr>
633         <td class="fieldname">Description:</td>
634         <td colspan="2" class="fieldval description">
635           <xsl:call-template name="replace">
636             <xsl:with-param name="string" select="description"/>
637             <xsl:with-param name="pattern" select="'&#xA;'"/>
638             <xsl:with-param name="replacement"><br/></xsl:with-param>
639           </xsl:call-template>
640         </td>
641       </tr>
642       <xsl:if test="status !='' and status != 'CONFIRMED'">
643         <tr>
644           <td class="fieldname">Status:</td>
645           <td class="fieldval">
646             <xsl:value-of select="status"/>
647           </td>
648         </tr>
649       </xsl:if>
650       <xsl:if test="cost!=''">
651         <tr>
652           <td class="fieldname">Cost:</td>
653           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
654         </tr>
655       </xsl:if>
656       <xsl:if test="link != ''">
657         <tr>
658           <td class="fieldname">See:</td>
659           <td colspan="2" class="fieldval">
660             <xsl:variable name="link" select="link"/>
661             <a href="{$link}"><xsl:value-of select="link"/></a>
662           </td>
663         </tr>
664       </xsl:if>
665       <xsl:if test="sponsor/name!='none'">
666         <tr>
667           <td class="fieldname">Contact:</td>
668           <td colspan="2" class="fieldval">
669             <xsl:choose>
670               <xsl:when test="sponsor/link=''">
671                 <xsl:value-of select="sponsor/name"/>
672               </xsl:when>
673               <xsl:otherwise>
674                 <xsl:variable name="sponsorLink" select="sponsor/link"/>
675                 <a href="{$sponsorLink}">
676                   <xsl:value-of select="sponsor/name"/>
677                 </a>
678               </xsl:otherwise>
679             </xsl:choose>
680             <xsl:if test="sponsor/phone!=''">
681               <br /><xsl:value-of select="sponsor/phone"/>
682             </xsl:if>
683             <!-- If you want to display email addresses, uncomment the
684                  following 8 lines. -->
685             <!-- <xsl:if test="sponsor/email!=''">
686               <br />
687               <xsl:variable name="email" select="sponsor/email"/>
688               <xsl:variable name="subject" select="summary"/>
689               <a href="mailto:{$email}&amp;subject={$subject}">
690                 <xsl:value-of select="sponsor/email"/>
691               </a>
692             </xsl:if> -->
693           </td>
694         </tr>
695       </xsl:if>
696       <tr>
697         <td class="fieldname">Calendar:</td>
698         <td class="fieldval">
699           <xsl:variable name="calUrl" select="calendar/encodedPath"/>
700           <a href="{$setSelection}&amp;calUrl={$calUrl}">
701             <xsl:value-of select="calendar/name"/>
702           </a>
703         </td>
704       </tr>
705       <xsl:if test="categories/category">
706         <tr>
707           <td class="fieldname">Categories:</td>
708           <td class="fieldval">
709             <!--<ul id="eventCategories">-->
710               <xsl:for-each select="categories/category">
711                 <!--<li>--><xsl:value-of select="word"/><br/><!--</li>-->
712               </xsl:for-each>
713             <!--</ul>-->
714           </td>
715         </tr>
716       </xsl:if>
717     </table>
718   </xsl:template>
719
720   <!--==== LIST VIEW  (for day, week, and month) ====-->
721   <xsl:template name="listView">
722     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
723       <xsl:choose>
724         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
725           <tr>
726             <td class="noEventsCell">
727               No events to display.
728             </td>
729           </tr>
730         </xsl:when>
731         <xsl:otherwise>
732           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
733             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
734               <tr>
735                 <td colspan="5" class="dateRow">
736                    <xsl:variable name="date" select="date"/>
737                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
738                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
739                    </a>
740                 </td>
741               </tr>
742             </xsl:if>
743             <xsl:for-each select="event">
744               <xsl:variable name="id" select="id"/>
745               <xsl:variable name="subscriptionId" select="subscription/id"/>
746               <xsl:variable name="calPath" select="calendar/encodedPath"/>
747               <xsl:variable name="guid" select="guid"/>
748               <xsl:variable name="recurrenceId" select="recurrenceId"/>
749               <tr>
750                 <xsl:variable name="dateRangeStyle">
751                   <xsl:choose>
752                     <xsl:when test="start/shortdate = parent::day/shortdate">
753                       <xsl:choose>
754                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
755                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
756                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
757                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
758                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
759                       </xsl:choose>
760                     </xsl:when>
761                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
762                   </xsl:choose>
763                 </xsl:variable>
764                 <xsl:choose>
765                   <xsl:when test="start/allday = 'true' and
766                                   start/shortdate = end/shortdate">
767                     <td class="{$dateRangeStyle} center" colspan="3">
768                       all day
769                     </td>
770                   </xsl:when>
771                   <xsl:when test="start/shortdate = end/shortdate and
772                                   start/time = end/time">
773                     <td class="{$dateRangeStyle} center" colspan="3">
774                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
775                         <xsl:value-of select="start/time"/>
776                       </a>
777                     </td>
778                   </xsl:when>
779                   <xsl:otherwise>
780                     <td class="{$dateRangeStyle} right">
781                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
782                       <xsl:choose>
783                         <xsl:when test="start/allday = 'true' and
784                                         parent::day/shortdate = start/shortdate">
785                           today
786                         </xsl:when>
787                         <xsl:when test="parent::day/shortdate != start/shortdate">
788                           <span class="littleArrow">&#171;</span>&#160;
789                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
790                         </xsl:when>
791                         <xsl:otherwise>
792                           <xsl:value-of select="start/time"/>
793                         </xsl:otherwise>
794                       </xsl:choose>
795                       </a>
796                     </td>
797                     <td class="{$dateRangeStyle} center">
798                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
799                     </td>
800                     <td class="{$dateRangeStyle} left">
801                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
802                       <xsl:choose>
803                         <xsl:when test="end/allday = 'true' and
804                                         parent::day/shortdate = end/shortdate">
805                           today
806                         </xsl:when>
807                         <xsl:when test="parent::day/shortdate != end/shortdate">
808                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
809                           &#160;<span class="littleArrow">&#187;</span>
810                         </xsl:when>
811                         <xsl:otherwise>
812                           <xsl:value-of select="end/time"/>
813                         </xsl:otherwise>
814                       </xsl:choose>
815                       </a>
816                     </td>
817                   </xsl:otherwise>
818                 </xsl:choose>
819                 <xsl:variable name="descriptionClass">
820                   <xsl:choose>
821                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
822                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
823                     <xsl:otherwise>description</xsl:otherwise>
824                   </xsl:choose>
825                 </xsl:variable>
826                 <td class="{$descriptionClass}">
827                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
828                   <xsl:choose>
829                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
830                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
831                         <strong>
832                           <xsl:value-of select="summary"/>:
833                         </strong>
834                         <xsl:value-of select="description"/>&#160;
835                         <em>
836                           <xsl:value-of select="location/address"/>
837                           <xsl:if test="location/subaddress != ''">
838                             , <xsl:value-of select="location/subaddress"/>
839                           </xsl:if>.&#160;
840                           <xsl:if test="cost!=''">
841                             <xsl:value-of select="cost"/>.&#160;
842                           </xsl:if>
843                           <xsl:if test="sponsor/name!='none'">
844                             Contact: <xsl:value-of select="sponsor/name"/>
845                           </xsl:if>
846                         </em>
847                       </a>
848                       <xsl:if test="link != ''">
849                         <xsl:variable name="link" select="link"/>
850                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
851                       </xsl:if>
852                     </xsl:when>
853                     <xsl:otherwise>
854                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
855                         <xsl:value-of select="summary"/>
856                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
857                       </a>
858                     </xsl:otherwise>
859                   </xsl:choose>
860                 </td>
861                 <td class="icons">
862                   <variable name="confId" select="/bedework/confirmationid"/>
863                   <a href="{$privateCal}/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
864                     <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="Add event to MyCalendar"/>
865                   </a>
866                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
867                   <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
868                     <img src="{$resourcesRoot}/images/std-ical_icon_small.gif" width="12" height="16" border="0" alt="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars"/>
869                   </a>
870                 </td>
871               </tr>
872             </xsl:for-each>
873           </xsl:for-each>
874         </xsl:otherwise>
875       </xsl:choose>
876     </table>
877   </xsl:template>
878
879   <!--==== WEEK CALENDAR VIEW ====-->
880   <xsl:template name="weekView">
881     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
882       <tr>
883         <xsl:for-each select="/bedework/daynames/val">
884           <th class="dayHeading"><xsl:value-of select="."/></th>
885         </xsl:for-each>
886       </tr>
887       <tr>
888         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
889           <xsl:variable name="dayPos" select="position()"/>
890           <xsl:if test="filler='false'">
891             <td>
892               <xsl:variable name="dayDate" select="date"/>
893               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
894                 <xsl:value-of select="value"/>
895               </a>
896               <ul>
897                 <xsl:apply-templates select="event" mode="calendarLayout">
898                   <xsl:with-param name="dayPos" select="$dayPos"/>
899                 </xsl:apply-templates>
900               </ul>
901             </td>
902           </xsl:if>
903         </xsl:for-each>
904       </tr>
905     </table>
906   </xsl:template>
907
908   <!--==== MONTH CALENDAR VIEW ====-->
909   <xsl:template name="monthView">
910     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
911       <tr>
912         <xsl:for-each select="/bedework/daynames/val">
913           <th class="dayHeading"><xsl:value-of select="."/></th>
914         </xsl:for-each>
915       </tr>
916       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
917         <tr>
918           <xsl:for-each select="day">
919             <xsl:variable name="dayPos" select="position()"/>
920             <xsl:choose>
921               <xsl:when test="filler='true'">
922                 <td class="filler">&#160;</td>
923               </xsl:when>
924               <xsl:otherwise>
925                 <td>
926                   <xsl:variable name="dayDate" select="date"/>
927                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
928                     <xsl:value-of select="value"/>
929                   </a>
930                   <ul>
931                     <xsl:apply-templates select="event" mode="calendarLayout">
932                       <xsl:with-param name="dayPos" select="$dayPos"/>
933                     </xsl:apply-templates>
934                   </ul>
935                 </td>
936               </xsl:otherwise>
937             </xsl:choose>
938           </xsl:for-each>
939         </tr>
940       </xsl:for-each>
941     </table>
942   </xsl:template>
943
944   <xsl:template match="event" mode="calendarLayout">
945     <xsl:param name="dayPos"/>
946     <xsl:variable name="subscriptionId" select="subscription/id"/>
947     <xsl:variable name="calPath" select="calendar/encodedPath"/>
948     <xsl:variable name="guid" select="guid"/>
949     <xsl:variable name="recurrenceId" select="recurrenceId"/>
950     <xsl:variable name="eventClass">
951       <xsl:choose>
952         <!-- Special styles for the month grid -->
953         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
954         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
955         <xsl:when test="calendar/name='Holidays'">holiday</xsl:when>
956         <!-- Alternating colors for all standard events -->
957         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
958         <xsl:otherwise>eventLinkB</xsl:otherwise>
959       </xsl:choose>
960     </xsl:variable>
961     <li>
962       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass}">
963         <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
964         <xsl:value-of select="summary"/>
965         <xsl:variable name="eventTipClass">
966           <xsl:choose>
967             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
968             <xsl:otherwise>eventTip</xsl:otherwise>
969           </xsl:choose>
970         </xsl:variable>
971         <span class="{$eventTipClass}">
972           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled">CANCELLED</span></xsl:if>
973           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative">TENTATIVE</span></xsl:if>
974           <strong><xsl:value-of select="summary"/></strong><br/>
975           Time:
976           <xsl:choose>
977             <xsl:when test="start/allday = 'false'">
978               <xsl:value-of select="start/time"/>
979               <xsl:if test="start/time != end/time">
980                 - <xsl:value-of select="end/time"/>
981               </xsl:if>
982             </xsl:when>
983             <xsl:otherwise>
984               all day
985             </xsl:otherwise>
986           </xsl:choose><br/>
987           <xsl:if test="location/address">
988             Location: <xsl:value-of select="location/address"/><br/>
989           </xsl:if>
990           Calendar: <xsl:value-of select="calendar/name"/>
991         </span>
992       </a>
993     </li>
994   </xsl:template>
995
996   <!--==== YEAR VIEW ====-->
997   <xsl:template name="yearView">
998     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
999       <tr>
1000         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
1001       </tr>
1002       <tr>
1003         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
1004       </tr>
1005       <tr>
1006         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
1007       </tr>
1008       <tr>
1009         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
1010       </tr>
1011     </table>
1012   </xsl:template>
1013
1014   <!-- year view month tables -->
1015   <xsl:template match="month">
1016     <td>
1017       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
1018         <tr>
1019           <td colspan="8" class="monthName">
1020             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
1021             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
1022               <xsl:value-of select="longname"/>
1023             </a>
1024           </td>
1025         </tr>
1026         <tr>
1027           <th>&#160;</th>
1028           <xsl:for-each select="/bedework/shortdaynames/val">
1029             <th><xsl:value-of select="."/></th>
1030           </xsl:for-each>
1031         </tr>
1032         <xsl:for-each select="week">
1033           <tr>
1034             <td class="weekCell">
1035               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1036               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1037                 <xsl:value-of select="value"/>
1038               </a>
1039             </td>
1040             <xsl:for-each select="day">
1041               <xsl:choose>
1042                 <xsl:when test="filler='true'">
1043                   <td class="filler">&#160;</td>
1044                 </xsl:when>
1045                 <xsl:otherwise>
1046                   <td>
1047                     <xsl:variable name="dayDate" select="date"/>
1048                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1049                       <xsl:value-of select="value"/>
1050                     </a>
1051                   </td>
1052                 </xsl:otherwise>
1053               </xsl:choose>
1054             </xsl:for-each>
1055           </tr>
1056         </xsl:for-each>
1057       </table>
1058     </td>
1059   </xsl:template>
1060
1061   <!--==== CALENDARS PAGE ====-->
1062   <xsl:template match="calendars">
1063     <xsl:variable name="topLevelCalCount" select="count(calendar/calendar)"/>
1064     <table id="calPageTable" border="0" cellpadding="0" cellspacing="0">
1065       <tr>
1066         <th colspan="2">
1067           All Calendars
1068         </th>
1069       </tr>
1070       <tr>
1071         <td colspan="2" class="infoCell">
1072           Select a calendar from the list below to see only that calendar's events.
1073         </td>
1074       </tr>
1075       <tr>
1076         <td class="leftCell">
1077           <ul class="calendarTree">
1078             <xsl:apply-templates select="calendar/calendar[position() &lt;= ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1079           </ul>
1080         </td>
1081         <td>
1082           <ul class="calendarTree">
1083             <xsl:apply-templates select="calendar/calendar[position() &gt; ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1084           </ul>
1085         </td>
1086       </tr>
1087     </table>
1088   </xsl:template>
1089
1090   <xsl:template match="calendar" mode="calTree">
1091     <xsl:variable name="itemClass">
1092       <xsl:choose>
1093         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1094         <xsl:otherwise>calendar</xsl:otherwise>
1095       </xsl:choose>
1096     </xsl:variable>
1097     <xsl:variable name="url" select="encodedPath"/>
1098     <li class="{$itemClass}">
1099       <a href="{$setSelection}&amp;calUrl={$url}"><xsl:value-of select="name"/></a>
1100       <xsl:if test="calendar">
1101         <ul>
1102           <xsl:apply-templates select="calendar" mode="calTree"/>
1103         </ul>
1104       </xsl:if>
1105     </li>
1106   </xsl:template>
1107
1108   <!--==== SEARCH RESULT ====-->
1109   <xsl:template name="searchResult">
1110     <h2 class="bwStatusConfirmed">Search Result</h2>
1111     <table id="searchTable" cellpadding="0" cellspacing="0">
1112       <tr>
1113         <th colspan="5">
1114           <form name="searchForm" method="post" action="{$search}" id="searchPageForm">
1115             Search:
1116             <input type="text" name="query" size="30">
1117               <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
1118             </input>
1119             <input type="submit" name="submit" value="go"/>
1120           </form>
1121           <xsl:value-of select="/bedework/searchResults/resultSize"/>
1122           result<xsl:if test="/bedework/searchResults/resultSize != 1">s</xsl:if> returned
1123           for <em><xsl:value-of select="/bedework/searchResults/query"/></em>
1124         </th>
1125       </tr>
1126       <xsl:for-each select="/bedework/searchResults/searchResult">
1127         <xsl:variable name="subscriptionId" select="event/subscription/id"/>
1128         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
1129         <xsl:variable name="guid" select="event/guid"/>
1130         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
1131         <tr>
1132           <td>
1133             <xsl:value-of select="ceiling(number(score)*100)"/>%
1134             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
1135               <xsl:attribute name="width"><xsl:value-of select="ceiling(number(score)*100)"/></xsl:attribute>
1136             </img>
1137           </td>
1138           <td>
1139             <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1140               <xsl:value-of select="event/summary"/>
1141             </a>
1142           </td>
1143           <td>
1144             <xsl:value-of select="event/start/longdate"/>
1145             <xsl:text> </xsl:text>
1146             <xsl:value-of select="event/start/time"/>
1147             <xsl:choose>
1148               <xsl:when test="event/start/longdate != event/end/longdate">
1149                 - <xsl:value-of select="event/start/longdate"/>
1150                 <xsl:text> </xsl:text>
1151                 <xsl:value-of select="event/end/time"/>
1152               </xsl:when>
1153               <xsl:when test="event/start/time != event/end/time">
1154                 - <xsl:value-of select="event/end/time"/>
1155               </xsl:when>
1156             </xsl:choose>
1157           </td>
1158           <td>
1159             <xsl:variable name="calUrl" select="event/calendar/encodedPath"/>
1160             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1161               <xsl:value-of select="event/calendar/name"/>
1162             </a>
1163           </td>
1164           <td>
1165             <xsl:value-of select="event/location/address"/>
1166           </td>
1167         </tr>
1168       </xsl:for-each>
1169     </table>
1170   </xsl:template>
1171
1172   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
1173   <xsl:template name="stats">
1174     <div id="stats">
1175       <h2>System Statistics</h2>
1176
1177       <p>
1178         Stats collection:
1179       </p>
1180       <ul>
1181         <li>
1182           <a href="{$stats}&amp;enable=yes">enable</a> |
1183           <a href="{$stats}&amp;disable=yes">disable</a>
1184         </li>
1185         <li><a href="{$stats}&amp;fetch=yes">fetch statistics</a></li>
1186         <li><a href="{$stats}&amp;dump=yes">dump stats to log</a></li>
1187       </ul>
1188       <table id="statsTable" cellpadding="0">
1189         <xsl:for-each select="/bedework/sysStats/*">
1190           <xsl:choose>
1191             <xsl:when test="name(.) = 'header'">
1192               <tr>
1193                 <th colspan="2">
1194                   <xsl:value-of select="."/>
1195                 </th>
1196               </tr>
1197             </xsl:when>
1198             <xsl:otherwise>
1199               <tr>
1200                 <td class="label">
1201                   <xsl:value-of select="label"/>
1202                 </td>
1203                 <td class="value">
1204                   <xsl:value-of select="value"/>
1205                 </td>
1206               </tr>
1207             </xsl:otherwise>
1208           </xsl:choose>
1209         </xsl:for-each>
1210       </table>
1211     </div>
1212   </xsl:template>
1213
1214   <!--==== UTILITY TEMPLATES ====-->
1215
1216   <!-- search and replace template taken from
1217        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1218   <xsl:template name="replace">
1219     <xsl:param name="string" select="''"/>
1220     <xsl:param name="pattern" select="''"/>
1221     <xsl:param name="replacement" select="''"/>
1222     <xsl:choose>
1223       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1224         <xsl:value-of select="substring-before($string, $pattern)"/>
1225         <xsl:copy-of select="$replacement"/>
1226         <xsl:call-template name="replace">
1227           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1228           <xsl:with-param name="pattern" select="$pattern"/>
1229           <xsl:with-param name="replacement" select="$replacement"/>
1230         </xsl:call-template>
1231       </xsl:when>
1232       <xsl:otherwise>
1233         <xsl:value-of select="$string"/>
1234       </xsl:otherwise>
1235     </xsl:choose>
1236   </xsl:template>
1237
1238   <!--==== FOOTER ====-->
1239
1240   <xsl:template name="footer">
1241     <div id="footer">
1242       Demonstration calendar; place footer information here.
1243     </div>
1244     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
1245       <tr>
1246         <td class="leftCell">
1247           Based on the <a href="http://www.bedework.org/">Bedework Calendar</a> |
1248           <a href="?noxslt=yes">show XML</a> |
1249           <a href="?refreshXslt=yes">refresh XSLT</a>
1250         </td>
1251         <td class="rightCell">
1252           <form name="styleSelectForm" method="post" action="{$setup}">
1253             <select name="setappvar" onChange="submit()">
1254               <option>example styles:</option>
1255               <option value="style(green)">green</option>
1256               <option value="style(red)">red</option>
1257               <option value="style(blue)">blue</option>
1258             </select>
1259           </form>
1260           <form name="skinSelectForm" method="post" action="{$setup}">
1261             <input type="hidden" name="setappvar" value="summaryMode(details)"/>
1262             <select name="skinPicker" onchange="window.location = this.value">
1263               <option>example skins:</option>
1264               <option value="{$setViewPeriod}&amp;viewType=weekView&amp;skinName=rss&amp;setappvar=summaryMode(details)">rss feed</option>
1265               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=jsToday&amp;contentType=text/javascript&amp;contentName=bedework.js">javascript feed</option>
1266               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=videocal">video feed</option>
1267               <option value="{$setup}&amp;skinName=default">reset to calendar default</option>
1268             </select>
1269           </form>
1270           <form name="skinSelectForm" method="post" action="">
1271             <select name="sitePicker" onchange="window.location = this.value">
1272               <option>production examples:</option>
1273               <option value="http://events.dal.ca/">Dalhousie</option>
1274               <option value="http://events.rpi.edu">Rensselaer</option>
1275               <option value="http://myuw.washington.edu/cal/">Washington</option>
1276             </select>
1277           </form>
1278         </td>
1279       </tr>
1280     </table>
1281   </xsl:template>
1282 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.