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

Revision 1104 (checked in by johnsa, 6 years ago)

overhaul of recipients and attendees - for now it is a pop-up window;

make logo of each web client link to the home state of the web client rather than the bedework homepage; make homepage link more explicit in footer.

error and message work in personal client.

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