root/branches/REL-3.1rc4/calendar3/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

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

adding rc4 branch

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