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

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

Fix header and stylesheet so that eventView link works in portlet

Also fix up b=de v be=d confusion in header.jsp and Rewrite tag


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