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

Revision 952 (checked in by douglm, 7 years ago)

--

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