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

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

make <html> tags valid for xhtml

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="xhtml"
5   indent="no"
6   media-type="text/html"
7   doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
8   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
9   standalone="yes"
10   omit-xml-declaration="yes"/>
11
12 <!-- =========================================================
13
14               DEMONSTRATION CALENDAR STYLESHEET
15
16                   MainCampus Calendar Suite
17
18      This stylesheet is devoid of school branding.  It is a good
19      starting point for development of a customized calendar.
20
21      For detailed instructions on how to work with the XSLT
22      stylesheets included with this distribution, please see the
23      Bedework Design Guide at
24      http://www.bedework.org/bedework/update.do?artcenterkey=24
25
26 ===============================================================  -->
27 <!-- **********************************************************************
28     Copyright 2006 Rensselaer Polytechnic Institute. All worldwide rights reserved.
29
30     Redistribution and use of this distribution in source and binary forms,
31     with or without modification, are permitted provided that:
32        The above copyright notice and this permission notice appear in all
33         copies and supporting documentation;
34
35         The name, identifiers, and trademarks of Rensselaer Polytechnic
36         Institute are not used in advertising or publicity without the
37         express prior written permission of Rensselaer Polytechnic Institute;
38
39     DISCLAIMER: The software is distributed" AS IS" without any express or
40     implied warranty, including but not limited to, any implied warranties
41     of merchantability or fitness for a particular purpose or any warrant)'
42     of non-infringement of any current or pending patent rights. The authors
43     of the software make no representations about the suitability of this
44     software for any particular purpose. The entire risk as to the quality
45     and performance of the software is with the user. Should the software
46     prove defective, the user assumes the cost of all necessary servicing,
47     repair or correction. In particular, neither Rensselaer Polytechnic
48     Institute, nor the authors of the software are liable for any indirect,
49     special, consequential, or incidental damages related to the software,
50     to the maximum extent the law permits. -->
51
52   <!-- ================================= -->
53   <!--  DEMO PUBLIC CALENDAR STYLESHEET  -->
54   <!-- ================================= -->
55
56   <!-- URL of resources common to all bedework apps (javascript, images) -->
57   <xsl:variable name="resourceCommons">../../../bedework-common</xsl:variable>
58
59   <!-- DEFINE INCLUDES -->
60   <!-- cannot use the resourceCommons variable in xsl:include paths -->
61   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
62   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
63
64   <!-- DEFINE GLOBAL CONSTANTS -->
65
66   <!-- URL of the XSL template directory -->
67   <!-- The approot is an appropriate place to put
68        included stylesheets and xml fragments. These are generally
69        referenced relatively (like errors.xsl and messages.xsl above);
70        this variable is here for your convenience if you choose to
71        reference it explicitly.  It is not used in this stylesheet, however,
72        and can be safely removed if you so choose. -->
73   <xsl:variable name="appRoot" select="/bedework/approot"/>
74
75   <!-- URL of html resources (images, css, other html); by default this is
76        set to the application root -->
77   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
78
79   <!-- Properly encoded prefixes to the application actions; use these to build
80        urls; allows the application to be used without cookies or within a portal.
81        These urls are rewritten in header.jsp and simply passed through for use
82        here. Every url includes a query string (either ?b=de or a real query
83        string) so that all links constructed in this stylesheet may begin the
84        query string with an ampersand. -->
85   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
86   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/main/setSelection"/>
87   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/calendar/fetchPublicCalendars"/>
88   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/main/setViewPeriod"/>
89   <xsl:variable name="eventView" select="/bedework/urlPrefixes/event/eventView"/>
90   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/event/addEventRef"/>
91   <xsl:variable name="export" select="/bedework/urlPrefixes/misc/export"/>
92   <xsl:variable name="search" select="/bedework/urlPrefixes/search/search"/>
93   <xsl:variable name="search-next" select="/bedework/urlPrefixes/search/next"/>
94   <xsl:variable name="calendar-fetchForExport" select="/bedework/urlPrefixes/calendar/fetchForExport"/>
95   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mail/mailEvent"/>
96   <xsl:variable name="showPage" select="/bedework/urlPrefixes/main/showPage"/>
97   <xsl:variable name="stats" select="/bedework/urlPrefixes/stats/stats"/>
98
99   <!-- URL of the web application - includes web context -->
100   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/>
101
102   <!-- Other generally useful global variables -->
103   <xsl:variable name="privateCal">/ucal</xsl:variable>
104   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
105   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
106   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
107
108
109   <!-- MAIN TEMPLATE -->
110   <xsl:template match="/">
111     <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
112       <head>
113         <title>Bedework Events Calendar</title>
114         <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
115         <!-- load css -->
116         <xsl:choose>
117           <xsl:when test="/bedework/appvar[key='style']/value='red'">
118             <link rel="stylesheet" href="{$resourcesRoot}/default/default/red.css"/>
119           </xsl:when>
120           <xsl:when test="/bedework/appvar[key='style']/value='green'">
121             <link rel="stylesheet" href="{$resourcesRoot}/default/default/green.css"/>
122           </xsl:when>
123           <xsl:otherwise>
124             <link rel="stylesheet" href="{$resourcesRoot}/default/default/blue.css"/>
125           </xsl:otherwise>
126         </xsl:choose>
127         <link rel="stylesheet" href="{$resourcesRoot}/default/default/subColors.css"/>
128         <link rel="stylesheet" type="text/css" media="print" href="{$resourcesRoot}/default/default/print.css" />
129         <!-- load javascript -->
130         <xsl:if test="/bedework/page='calendarList' or /bedework/page='displayCalendarForExport'">
131           <script type="text/javascript" src="{$resourceCommons}/javascript/dojo/dojo.js">&#160;</script>
132           <script type="text/javascript" src="{$resourcesRoot}/resources/javascript/bedework.js">&#160;</script>
133         </xsl:if>
134         <!-- address bar icon -->
135         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
136       </head>
137       <body>
138         <xsl:call-template name="headBar"/>
139         <xsl:if test="/bedework/error">
140           <div id="errors">
141             <xsl:apply-templates select="/bedework/error"/>
142           </div>
143         </xsl:if>
144         <xsl:call-template name="tabs"/>
145         <xsl:call-template name="navigation"/>
146         <xsl:call-template name="searchBar"/>
147         <xsl:choose>
148           <xsl:when test="/bedework/page='event'">
149             <!-- show an event -->
150             <xsl:apply-templates select="/bedework/event"/>
151           </xsl:when>
152           <xsl:when test="/bedework/page='showSysStats'">
153             <!-- show system stats -->
154             <xsl:call-template name="stats"/>
155           </xsl:when>
156           <xsl:when test="/bedework/page='calendarList'">
157             <!-- show a list of all calendars -->
158             <xsl:apply-templates select="/bedework/calendars"/>
159           </xsl:when>
160           <xsl:when test="/bedework/page='displayCalendarForExport'">
161             <!-- page for calendar export (can optionally be replaced by
162                  a pop-up widget; see the calendars template) -->
163             <xsl:apply-templates select="/bedework/currentCalendar" mode="export"/>
164           </xsl:when>
165           <xsl:when test="/bedework/page='searchResult'">
166             <!-- display search results -->
167             <xsl:call-template name="searchResult"/>
168           </xsl:when>
169           <xsl:otherwise>
170             <!-- otherwise, show the eventsCalendar -->
171             <!-- main eventCalendar content -->
172             <xsl:choose>
173               <xsl:when test="/bedework/periodname='Day'">
174                 <xsl:call-template name="listView"/>
175               </xsl:when>
176               <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
177                 <xsl:choose>
178                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
179                     <xsl:call-template name="listView"/>
180                   </xsl:when>
181                   <xsl:otherwise>
182                     <xsl:call-template name="weekView"/>
183                   </xsl:otherwise>
184                 </xsl:choose>
185               </xsl:when>
186               <xsl:when test="/bedework/periodname='Month'">
187                 <xsl:choose>
188                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
189                     <xsl:call-template name="listView"/>
190                   </xsl:when>
191                   <xsl:otherwise>
192                     <xsl:call-template name="monthView"/>
193                   </xsl:otherwise>
194                 </xsl:choose>
195               </xsl:when>
196               <xsl:otherwise>
197                 <xsl:call-template name="yearView"/>
198               </xsl:otherwise>
199             </xsl:choose>
200           </xsl:otherwise>
201         </xsl:choose>
202         <!-- footer -->
203         <xsl:call-template name="footer"/>
204       </body>
205     </html>
206   </xsl:template>
207
208   <!--==== HEADER TEMPLATES and NAVIGATION  ====-->
209   <!-- these templates are separated out for convenience and to simplify the default template -->
210
211   <xsl:template name="headBar">
212     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="logoTable">
213       <tr>
214         <td colspan="3" id="logoCell"><a href="/bedework/"><img src="{$resourcesRoot}/images/bedeworkLogo.gif" width="292" height="75" border="0" alt="Bedework"/></a></td>
215         <td colspan="2" id="schoolLinksCell">
216           <h2>Public Calendar</h2>
217           <a href="{$privateCal}">Personal Calendar</a> |
218           <a href="http://www.yourschoolhere.edu">School Home</a> |
219           <a href="http://www.bedework.org/">Other Link</a> |
220           <a href="http://helpdesk.rpi.edu/update.do?catcenterkey=51">
221             Example Calendar Help
222           </a>
223         </td>
224       </tr>
225     </table>
226     <table id="curDateRangeTable"  cellspacing="0">
227       <tr>
228         <td class="sideBarOpenCloseIcon">
229           &#160;
230           <!--
231           we may choose to implement calendar selection in the public calendar
232           using a sidebar; leave this comment here for now.
233           <xsl:choose>
234             <xsl:when test="/bedework/appvar[key='sidebar']/value='closed'">
235               <a href="?setappvar=sidebar(opened)">
236                 <img alt="open sidebar" src="{$resourcesRoot}/resources/sideBarArrowOpen.gif" width="21" height="16" border="0" align="left"/>
237               </a>
238             </xsl:when>
239             <xsl:otherwise>
240               <a href="?setappvar=sidebar(closed)">
241                 <img alt="close sidebar" src="{$resourcesRoot}/resources/sideBarArrowClose.gif" width="21" height="16" border="0" align="left"/>
242               </a>
243             </xsl:otherwise>
244           </xsl:choose>-->
245         </td>
246         <td class="date">
247           <xsl:choose>
248             <xsl:when test="/bedework/page='event'">
249               Event Information
250             </xsl:when>
251             <xsl:when test="/bedework/page='showSysStats' or
252                             /bedework/page='calendars'">
253               &#160;
254             </xsl:when>
255             <xsl:otherwise>
256               <xsl:value-of select="/bedework/firstday/longdate"/>
257               <xsl:if test="/bedework/periodname!='Day'">
258                 -
259                 <xsl:value-of select="/bedework/lastday/longdate"/>
260               </xsl:if>
261             </xsl:otherwise>
262           </xsl:choose>
263         </td>
264         <td class="rssPrint">
265           <a href="javascript:window.print()" title="print this view">
266             <img alt="print this view" src="{$resourcesRoot}/images/std-print-icon.gif" width="20" height="14" border="0"/> print
267           </a>
268           <a class="rss" href="{$setup}&amp;setappvar=summaryMode(details)&amp;skinName=rss" title="RSS feed">RSS</a>
269         </td>
270       </tr>
271     </table>
272   </xsl:template>
273
274   <xsl:template name="tabs">
275     <xsl:choose>
276       <xsl:when test="/bedework/page='eventscalendar'">
277         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
278           <tr>
279             <td>
280               <xsl:choose>
281                 <xsl:when test="/bedework/periodname='Day'">
282                   <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>
283                 </xsl:when>
284                 <xsl:otherwise>
285                   <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>
286                 </xsl:otherwise>
287               </xsl:choose>
288             </td>
289             <td>
290               <xsl:choose>
291                 <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
292                   <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>
293                  </xsl:when>
294                 <xsl:otherwise>
295                   <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>
296                  </xsl:otherwise>
297               </xsl:choose>
298             </td>
299             <td>
300               <xsl:choose>
301                 <xsl:when test="/bedework/periodname='Month'">
302                   <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>
303                 </xsl:when>
304                 <xsl:otherwise>
305                   <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>
306                 </xsl:otherwise>
307               </xsl:choose>
308             </td>
309             <td>
310               <xsl:choose>
311                 <xsl:when test="/bedework/periodname='Year'">
312                   <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>
313                 </xsl:when>
314                 <xsl:otherwise>
315                   <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>
316                 </xsl:otherwise>
317               </xsl:choose>
318             </td>
319             <td class="centerCell">
320               &#160;<!--<img src="{$resourcesRoot}/images/std-button-today.gif" width="46" height="17" border="0" alt="TODAY"/>-->
321             </td>
322             <td class="rightCell">
323               &#160;
324             </td>
325           </tr>
326         </table>
327       </xsl:when>
328       <xsl:otherwise>
329         <table border="0" cellpadding="0" cellspacing="0" id="tabsTable">
330           <tr>
331             <td>
332               <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>
333             </td>
334             <td>
335               <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>
336             </td>
337             <td>
338               <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>
339             </td>
340             <td>
341               <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>
342             </td>
343             <td class="centerCell">
344               &#160;<!--<img src="{$resourcesRoot}/images/std-button-today.gif" width="46" height="17" border="0" alt="TODAY"/>-->
345             </td>
346             <td class="rightCell">
347               &#160;
348             </td>
349           </tr>
350         </table>
351       </xsl:otherwise>
352     </xsl:choose>
353   </xsl:template>
354
355   <xsl:template name="navigation">
356     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
357       <tr>
358         <td class="leftCell">
359           <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>
360           <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>
361           <xsl:choose>
362             <xsl:when test="/bedework/periodname='Year'">
363               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
364             </xsl:when>
365             <xsl:when test="/bedework/periodname='Month'">
366               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
367             </xsl:when>
368             <xsl:when test="/bedework/periodname='Week'">
369               Week of <xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
370             </xsl:when>
371             <xsl:otherwise>
372               <xsl:value-of select="/bedework/firstday/longdate"/>
373             </xsl:otherwise>
374           </xsl:choose>
375         </td>
376         <td class="todayButton">
377           <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
378             <img src="{$resourcesRoot}/images/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
379           </a>
380         </td>
381         <td align="right" class="gotoForm">
382           <form name="calForm" method="post" action="{$setViewPeriod}">
383              <table border="0" cellpadding="0" cellspacing="0">
384               <tr>
385                 <xsl:if test="/bedework/periodname!='Year'">
386                   <td>
387                     <select name="viewStartDate.month">
388                       <xsl:for-each select="/bedework/monthvalues/val">
389                         <xsl:variable name="temp" select="."/>
390                         <xsl:variable name="pos" select="position()"/>
391                         <xsl:choose>
392                           <xsl:when test="/bedework/monthvalues[start=$temp]">
393                             <option value="{$temp}" selected="selected">
394                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
395                             </option>
396                           </xsl:when>
397                           <xsl:otherwise>
398                             <option value="{$temp}">
399                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
400                             </option>
401                           </xsl:otherwise>
402                         </xsl:choose>
403                       </xsl:for-each>
404                     </select>
405                   </td>
406                   <xsl:if test="/bedework/periodname!='Month'">
407                     <td>
408                       <select name="viewStartDate.day">
409                         <xsl:for-each select="/bedework/dayvalues/val">
410                           <xsl:variable name="temp" select="."/>
411                           <xsl:variable name="pos" select="position()"/>
412                           <xsl:choose>
413                             <xsl:when test="/bedework/dayvalues[start=$temp]">
414                               <option value="{$temp}" selected="selected">
415                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
416                               </option>
417                             </xsl:when>
418                             <xsl:otherwise>
419                               <option value="{$temp}">
420                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
421                               </option>
422                             </xsl:otherwise>
423                           </xsl:choose>
424                         </xsl:for-each>
425                       </select>
426                     </td>
427                   </xsl:if>
428                 </xsl:if>
429                 <td>
430                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
431                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
432                 </td>
433                 <td>
434                   <input name="submit" type="submit" value="go"/>
435                 </td>
436               </tr>
437             </table>
438           </form>
439         </td>
440         <td class="rightCell">
441         </td>
442       </tr>
443     </table>
444   </xsl:template>
445
446   <xsl:template name="searchBar">
447     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="searchBarTable">
448        <tr>
449          <td class="leftCell">
450            <xsl:choose>
451              <xsl:when test="/bedework/selectionState/selectionType = 'calendar'">
452                Calendar: <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/>
453                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
454              </xsl:when>
455              <xsl:when test="/bedework/selectionState/selectionType = 'search'">
456                Current search: <xsl:value-of select="/bedework/search"/>
457                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
458              </xsl:when>
459              <xsl:when test="/bedework/selectionState/selectionType = 'subscription'">
460                Subscription: (not implemented yet)
461                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
462              </xsl:when>
463              <xsl:when test="/bedework/selectionState/selectionType = 'filter'">
464                Filter: (not implemented yet)
465                <span class="link">[<a href="{$setSelection}">default view</a>]</span>
466              </xsl:when>
467              <xsl:otherwise><!-- view -->
468                View:
469                <form name="selectViewForm" method="post" action="{$setSelection}">
470                 <select name="viewName" onchange="submit()" >
471                   <xsl:for-each select="/bedework/views/view">
472                     <xsl:variable name="name" select="name"/>
473                     <xsl:choose>
474                       <xsl:when test="name=/bedework/selectionState/view/name">
475                         <option value="{$name}" selected="selected"><xsl:value-of select="name"/></option>
476                       </xsl:when>
477                       <xsl:otherwise>
478                         <option value="{$name}"><xsl:value-of select="name"/></option>
479                       </xsl:otherwise>
480                     </xsl:choose>
481                   </xsl:for-each>
482                 </select>
483               </form>
484               <span class="link"><a href="{$setSelection}">default view</a> | <a href="{$fetchPublicCalendars}">available calendars</a></span>
485              </xsl:otherwise>
486            </xsl:choose>
487          </td>
488          <td class="rightCell">
489             <xsl:if test="/bedework/page!='searchResult'">
490               <form name="searchForm" id="searchForm" method="post" action="{$search}">
491                 Search:
492                 <input type="text" name="query" size="15">
493                   <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
494                 </input>
495                 <input type="submit" name="submit" value="go"/>
496               </form>
497               <xsl:text> </xsl:text>
498             </xsl:if>
499             <xsl:choose>
500               <xsl:when test="/bedework/periodname='Day'">
501                 <img src="{$resourcesRoot}/images/std-button-listview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
502               </xsl:when>
503               <xsl:when test="/bedework/periodname='Year'">
504                 <img src="{$resourcesRoot}/images/std-button-calview-off.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
505               </xsl:when>
506               <xsl:when test="/bedework/periodname='Month'">
507                 <xsl:choose>
508                   <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
509                     <a href="{$setup}&amp;setappvar=monthViewMode(cal)" title="toggle list/calendar view">
510                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
511                     </a>
512                   </xsl:when>
513                   <xsl:otherwise>
514                     <a href="{$setup}&amp;setappvar=monthViewMode(list)" title="toggle list/calendar view">
515                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
516                     </a>
517                   </xsl:otherwise>
518                 </xsl:choose>
519               </xsl:when>
520               <xsl:otherwise>
521                 <xsl:choose>
522                   <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
523                     <a href="{$setup}&amp;setappvar=weekViewMode(cal)" title="toggle list/calendar view">
524                       <img src="{$resourcesRoot}/images/std-button-calview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
525                     </a>
526                   </xsl:when>
527                   <xsl:otherwise>
528                     <a href="{$setup}&amp;setappvar=weekViewMode(list)" title="toggle list/calendar view">
529                       <img src="{$resourcesRoot}/images/std-button-listview.gif" width="46" height="21" border="0" alt="toggle list/calendar view"/>
530                     </a>
531                   </xsl:otherwise>
532                 </xsl:choose>
533               </xsl:otherwise>
534             </xsl:choose>
535             <xsl:choose>
536               <xsl:when test="/bedework/periodname='Year' or
537                               (/bedework/periodname='Month' and
538                               (/bedework/appvar[key='monthViewMode']/value='cal' or
539                                not(/bedework/appvar[key='monthViewMode']))) or
540                               (/bedework/periodname='Week' and
541                               (/bedework/appvar[key='weekViewMode']/value='cal' or
542                                not(/bedework/appvar[key='weekViewMode'])))">
543                 <xsl:choose>
544                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
545                     <img src="{$resourcesRoot}/images/std-button-summary-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
546                   </xsl:when>
547                   <xsl:otherwise>
548                     <img src="{$resourcesRoot}/images/std-button-details-off.gif" width="62" height="21" border="0" alt="only summaries of events supported in this view"/>
549                   </xsl:otherwise>
550                 </xsl:choose>
551               </xsl:when>
552               <xsl:otherwise>
553                 <xsl:choose>
554                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
555                     <a href="{$setup}&amp;setappvar=summaryMode(summary)" title="toggle summary/detailed view">
556                       <img src="{$resourcesRoot}/images/std-button-summary.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
557                     </a>
558                   </xsl:when>
559                   <xsl:otherwise>
560                     <a href="{$setup}&amp;setappvar=summaryMode(details)" title="toggle summary/detailed view">
561                       <img src="{$resourcesRoot}/images/std-button-details.gif" width="62" height="21" border="0" alt="toggle summary/detailed view"/>
562                     </a>
563                   </xsl:otherwise>
564                 </xsl:choose>
565               </xsl:otherwise>
566             </xsl:choose>
567             <a href="{$setup}"><img src="{$resourcesRoot}/images/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a>
568           </td>
569        </tr>
570     </table>
571   </xsl:template>
572
573   <!--==== SINGLE EVENT ====-->
574   <xsl:template match="event">
575     <xsl:variable name="subscriptionId" select="subscription/id"/>
576     <xsl:variable name="calPath" select="calendar/encodedPath"/>
577     <xsl:variable name="guid" select="guid"/>
578     <xsl:variable name="recurrenceId" select="recurrenceId"/>
579     <xsl:variable name="statusClass">
580       <xsl:choose>
581         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
582         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
583         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
584       </xsl:choose>
585     </xsl:variable>
586     <h2 class="{$statusClass}">
587       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
588       <xsl:choose>
589         <xsl:when test="link != ''">
590           <xsl:variable name="link" select="link"/>
591           <a href="{$link}">
592             <xsl:value-of select="summary"/>
593           </a>
594         </xsl:when>
595         <xsl:otherwise>
596           <xsl:value-of select="summary"/>
597         </xsl:otherwise>
598       </xsl:choose>
599     </h2>
600     <table id="eventTable" cellpadding="0" cellspacing="0">
601       <tr>
602         <td class="fieldname">When:</td>
603         <td class="fieldval">
604           <!-- always display local time -->
605           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
606           <xsl:if test="start/allday = 'false'">
607             <span class="time"><xsl:value-of select="start/time"/></span>
608           </xsl:if>
609           <xsl:if test="(end/longdate != start/longdate) or
610                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
611           <xsl:if test="end/longdate != start/longdate">
612             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
613           </xsl:if>
614           <xsl:choose>
615             <xsl:when test="start/allday = 'true'">
616               <span class="time"><em>(all day)</em></span>
617             </xsl:when>
618             <xsl:when test="end/longdate != start/longdate">
619               <span class="time"><xsl:value-of select="end/time"/></span>
620             </xsl:when>
621             <xsl:when test="end/time != start/time">
622               <span class="time"><xsl:value-of select="end/time"/></span>
623             </xsl:when>
624           </xsl:choose>
625           <!-- if timezones are not local, or if floating add labels: -->
626           <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
627             <xsl:text> </xsl:text>
628             --
629             <strong>
630               <xsl:choose>
631                 <xsl:when test="start/floating = 'true'">
632                   Floating time
633                 </xsl:when>
634                 <xsl:otherwise>
635                   Local time
636                 </xsl:otherwise>
637               </xsl:choose>
638             </strong>
639             <br/>
640           </xsl:if>
641           <!-- display in timezone if not local or floating time) -->
642           <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
643             <xsl:choose>
644               <xsl:when test="start/timezone/id != end/timezone/id">
645                 <!-- need to display both timezones if they differ from start to end -->
646                 <table border="0" cellspacing="0" id="tztable">
647                   <tr>
648                     <td>
649                       <strong>Start:</strong>
650                     </td>
651                     <td>
652                       <xsl:choose>
653                         <xsl:when test="start/timezone/islocal='true'">
654                           <xsl:value-of select="start/dayname"/>,
655                           <xsl:value-of select="start/longdate"/>
656                           <xsl:text> </xsl:text>
657                           <span class="time"><xsl:value-of select="start/time"/></span>
658                         </xsl:when>
659                         <xsl:otherwise>
660                           <xsl:value-of select="start/timezone/dayname"/>,
661                           <xsl:value-of select="start/timezone/longdate"/>
662                           <xsl:text> </xsl:text>
663                           <span class="time"><xsl:value-of select="start/timezone/time"/></span>
664                         </xsl:otherwise>
665                       </xsl:choose>
666                     </td>
667                     <td>
668                       --
669                       <strong><xsl:value-of select="start/timezone/id"/></strong>
670                     </td>
671                   </tr>
672                   <tr>
673                     <td>
674                       <strong>End:</strong>
675                     </td>
676                     <td>
677                       <xsl:choose>
678                         <xsl:when test="end/timezone/islocal='true'">
679                           <xsl:value-of select="end/dayname"/>,
680                           <xsl:value-of select="end/longdate"/>
681                           <xsl:text> </xsl:text>
682                           <span class="time"><xsl:value-of select="end/time"/></span>
683                         </xsl:when>
684                         <xsl:otherwise>
685                           <xsl:value-of select="end/timezone/dayname"/>,
686                           <xsl:value-of select="end/timezone/longdate"/>
687                           <xsl:text> </xsl:text>
688                           <span class="time"><xsl:value-of select="end/timezone/time"/></span>
689                         </xsl:otherwise>
690                       </xsl:choose>
691                     </td>
692                     <td>
693                       --
694                       <strong><xsl:value-of select="end/timezone/id"/></strong>
695                     </td>
696                   </tr>
697                 </table>
698               </xsl:when>
699               <xsl:otherwise>
700                 <!-- otherwise, timezones are the same: display as a single line  -->
701                 <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
702                 <xsl:if test="start/allday = 'false'">
703                   <span class="time"><xsl:value-of select="start/timezone/time"/></span>
704                 </xsl:if>
705                 <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
706                               ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
707                 <xsl:if test="end/timezone/longdate != start/timezone/longdate">
708                   <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
709                 </xsl:if>
710                 <xsl:choose>
711                   <xsl:when test="start/allday = 'true'">
712                     <span class="time"><em>(all day)</em></span>
713                   </xsl:when>
714                   <xsl:when test="end/timezone/longdate != start/timezone/longdate">
715                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
716                   </xsl:when>
717                   <xsl:when test="end/timezone/time != start/timezone/time">
718                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
719                   </xsl:when>
720                 </xsl:choose>
721                 <xsl:text> </xsl:text>
722                 --
723                 <strong><xsl:value-of select="start/timezone/id"/></strong>
724               </xsl:otherwise>
725             </xsl:choose>
726           </xsl:if>
727         </td>
728         <th class="icalIcon" rowspan="2">
729           <div id="eventIcons">
730             <xsl:if test="recurrenceId = ''">
731               <!-- hide this for a 3.3.1 bug: can't add a reference to a recurring event at this time -->
732               <a href="{$privateCal}/event/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
733                 <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
734               add to my calendar</a>
735             </xsl:if>
736             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
737             <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
738               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
739              download</a>
740           </div>
741         </th>
742       </tr>
743       <tr>
744         <td class="fieldname">Where:</td>
745         <td class="fieldval">
746           <xsl:choose>
747             <xsl:when test="location/link=''">
748               <xsl:value-of select="location/address"/>
749             </xsl:when>
750             <xsl:otherwise>
751               <xsl:variable name="locationLink" select="location/link"/>
752               <a href="{$locationLink}">
753                 <xsl:value-of select="location/address"/>
754               </a>
755             </xsl:otherwise>
756           </xsl:choose>
757           <xsl:if test="location/subaddress!=''">
758             <br/><xsl:value-of select="location/subaddress"/>
759           </xsl:if>
760         </td>
761       </tr>
762       <tr>
763         <td class="fieldname">Description:</td>
764         <td colspan="2" class="fieldval description">
765           <xsl:call-template name="replace">
766             <xsl:with-param name="string" select="description"/>
767             <xsl:with-param name="pattern" select="'&#xA;'"/>
768             <xsl:with-param name="replacement"><br/></xsl:with-param>
769           </xsl:call-template>
770         </td>
771       </tr>
772       <xsl:if test="status !='' and status != 'CONFIRMED'">
773         <tr>
774           <td class="fieldname">Status:</td>
775           <td class="fieldval">
776             <xsl:value-of select="status"/>
777           </td>
778         </tr>
779       </xsl:if>
780       <xsl:if test="cost!=''">
781         <tr>
782           <td class="fieldname">Cost:</td>
783           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
784         </tr>
785       </xsl:if>
786       <xsl:if test="link != ''">
787         <tr>
788           <td class="fieldname">See:</td>
789           <td colspan="2" class="fieldval">
790             <xsl:variable name="link" select="link"/>
791             <a href="{$link}"><xsl:value-of select="link"/></a>
792           </td>
793         </tr>
794       </xsl:if>
795       <xsl:if test="contact/name!='none'">
796         <tr>
797           <td class="fieldname">Contact:</td>
798           <td colspan="2" class="fieldval">
799             <xsl:choose>
800               <xsl:when test="contact/link=''">
801                 <xsl:value-of select="contact/name"/>
802               </xsl:when>
803               <xsl:otherwise>
804                 <xsl:variable name="sponsorLink" select="contact/link"/>
805                 <a href="{$sponsorLink}">
806                   <xsl:value-of select="contact/name"/>
807                 </a>
808               </xsl:otherwise>
809             </xsl:choose>
810             <xsl:if test="contact/phone!=''">
811               <br /><xsl:value-of select="contact/phone"/>
812             </xsl:if>
813             <!-- If you want to display email addresses, uncomment the
814                  following 8 lines. -->
815             <!-- <xsl:if test="contact/email!=''">
816               <br />
817               <xsl:variable name="email" select="contact/email"/>
818               <xsl:variable name="subject" select="summary"/>
819               <a href="mailto:{$email}&amp;subject={$subject}">
820                 <xsl:value-of select="contact/email"/>
821               </a>
822             </xsl:if> -->
823           </td>
824         </tr>
825       </xsl:if>
826       <xsl:if test="calendar/path!=''">
827         <tr>
828           <td class="fieldname">Calendar:</td>
829           <td class="fieldval">
830             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
831             <a href="{$setSelection}&amp;calUrl={$calUrl}">
832               <xsl:value-of select="calendar/name"/>
833             </a>
834           </td>
835         </tr>
836       </xsl:if>
837       <xsl:if test="categories/category">
838         <tr>
839           <td class="fieldname">Categories:</td>
840           <td class="fieldval">
841             <xsl:for-each select="categories/category">
842               <xsl:value-of select="word"/><xsl:if test="position() != last()">, </xsl:if>
843             </xsl:for-each>
844           </td>
845         </tr>
846       </xsl:if>
847       <xsl:if test="comments/comment">
848         <tr>
849           <td class="fieldname">Comments:</td>
850           <td class="fieldval comments">
851             <xsl:for-each select="comments/comment">
852               <p><xsl:value-of select="value"/></p>
853             </xsl:for-each>
854           </td>
855         </tr>
856       </xsl:if>
857     </table>
858   </xsl:template>
859
860   <!--==== LIST VIEW  (for day, week, and month) ====-->
861   <xsl:template name="listView">
862     <table id="listTable" border="0" cellpadding="0" cellspacing="0">
863       <xsl:choose>
864         <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
865           <tr>
866             <td class="noEventsCell">
867               No events to display.
868             </td>
869           </tr>
870         </xsl:when>
871         <xsl:otherwise>
872           <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[event]">
873             <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
874               <tr>
875                 <td colspan="5" class="dateRow">
876                    <xsl:variable name="date" select="date"/>
877                    <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
878                      <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
879                    </a>
880                 </td>
881               </tr>
882             </xsl:if>
883             <xsl:for-each select="event">
884               <xsl:variable name="id" select="id"/>
885               <xsl:variable name="subscriptionId" select="subscription/id"/>
886               <xsl:variable name="calPath" select="calendar/encodedPath"/>
887               <xsl:variable name="guid" select="guid"/>
888               <xsl:variable name="recurrenceId" select="recurrenceId"/>
889               <tr>
890                 <xsl:variable name="dateRangeStyle">
891                   <xsl:choose>
892                     <xsl:when test="start/shortdate = parent::day/shortdate">
893                       <xsl:choose>
894                         <xsl:when test="start/allday = 'true'">dateRangeCrossDay</xsl:when>
895                         <xsl:when test="start/hour24 &lt; 6">dateRangeEarlyMorning</xsl:when>
896                         <xsl:when test="start/hour24 &lt; 12">dateRangeMorning</xsl:when>
897                         <xsl:when test="start/hour24 &lt; 18">dateRangeAfternoon</xsl:when>
898                         <xsl:otherwise>dateRangeEvening</xsl:otherwise>
899                       </xsl:choose>
900                     </xsl:when>
901                     <xsl:otherwise>dateRangeCrossDay</xsl:otherwise>
902                   </xsl:choose>
903                 </xsl:variable>
904                 <xsl:choose>
905                   <xsl:when test="start/allday = 'true' and
906                                   start/shortdate = end/shortdate">
907                     <td class="{$dateRangeStyle} center" colspan="3">
908                       all day
909                     </td>
910                   </xsl:when>
911                   <xsl:when test="start/shortdate = end/shortdate and
912                                   start/time = end/time">
913                     <td class="{$dateRangeStyle} center" colspan="3">
914                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
915                         <xsl:value-of select="start/time"/>
916                       </a>
917                     </td>
918                   </xsl:when>
919                   <xsl:otherwise>
920                     <td class="{$dateRangeStyle} right">
921                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
922                       <xsl:choose>
923                         <xsl:when test="start/allday = 'true' and
924                                         parent::day/shortdate = start/shortdate">
925                           today
926                         </xsl:when>
927                         <xsl:when test="parent::day/shortdate != start/shortdate">
928                           <span class="littleArrow">&#171;</span>&#160;
929                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
930                         </xsl:when>
931                         <xsl:otherwise>
932                           <xsl:value-of select="start/time"/>
933                         </xsl:otherwise>
934                       </xsl:choose>
935                       </a>
936                     </td>
937                     <td class="{$dateRangeStyle} center">
938                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">-</a>
939                     </td>
940                     <td class="{$dateRangeStyle} left">
941                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
942                       <xsl:choose>
943                         <xsl:when test="end/allday = 'true' and
944                                         parent::day/shortdate = end/shortdate">
945                           today
946                         </xsl:when>
947                         <xsl:when test="parent::day/shortdate != end/shortdate">
948                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
949                           &#160;<span class="littleArrow">&#187;</span>
950                         </xsl:when>
951                         <xsl:otherwise>
952                           <xsl:value-of select="end/time"/>
953                         </xsl:otherwise>
954                       </xsl:choose>
955                       </a>
956                     </td>
957                   </xsl:otherwise>
958                 </xsl:choose>
959                 <xsl:variable name="descriptionClass">
960                   <xsl:choose>
961                     <xsl:when test="status='CANCELLED'">description bwStatusCancelled</xsl:when>
962                     <xsl:when test="status='TENTATIVE'">description bwStatusTentative</xsl:when>
963                     <xsl:otherwise>description</xsl:otherwise>
964                   </xsl:choose>
965                 </xsl:variable>
966                 <!-- Subscription styles.
967                      These are set in the add/modify subscription forms in the admin client;
968                      if present, these override the background-color set by eventClass. The
969                      subscription styles should not be used for cancelled events (tentative is ok). -->
970                 <xsl:variable name="subscriptionClass">
971                   <xsl:if test="status != 'CANCELLED' and
972                                 subscription/subStyle != '' and
973                                 subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if>
974                 </xsl:variable>
975                 <td class="{$descriptionClass} {$subscriptionClass}">
976                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
977                   <xsl:choose>
978                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
979                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
980                         <strong>
981                           <xsl:value-of select="summary"/>:
982                         </strong>
983                         <xsl:value-of select="description"/>&#160;
984                         <em>
985                           <xsl:value-of select="location/address"/>
986                           <xsl:if test="location/subaddress != ''">
987                             , <xsl:value-of select="location/subaddress"/>
988                           </xsl:if>.&#160;
989                           <xsl:if test="cost!=''">
990                             <xsl:value-of select="cost"/>.&#160;
991                           </xsl:if>
992                           <xsl:if test="contact/name!='none'">
993                             Contact: <xsl:value-of select="contact/name"/>
994                           </xsl:if>
995                         </em>
996                         - <xsl:value-of select="calendar/name"/>
997                       </a>
998                       <xsl:if test="link != ''">
999                         <xsl:variable name="link" select="link"/>
1000                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
1001                       </xsl:if>
1002                     </xsl:when>
1003                     <xsl:otherwise>
1004                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1005                         <xsl:value-of select="summary"/>
1006                         <xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
1007                          - <em><xsl:value-of select="calendar/name"/></em>
1008                       </a>
1009                     </xsl:otherwise>
1010                   </xsl:choose>
1011                 </td>
1012                 <td class="icons">
1013                   <xsl:if test="recurrenceId = ''">
1014                     <!-- hide this for a 3.3.1 bug: can't add a reference to a recurring event at this time -->
1015                     <a href="{$privateCal}/event/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
1016                       <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="Add event to MyCalendar"/>
1017                     </a>
1018                   </xsl:if>
1019                   <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
1020                   <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
1021                     <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"/>
1022                   </a>
1023                 </td>
1024               </tr>
1025             </xsl:for-each>
1026           </xsl:for-each>
1027         </xsl:otherwise>
1028       </xsl:choose>
1029     </table>
1030   </xsl:template>
1031
1032   <!--==== WEEK CALENDAR VIEW ====-->
1033   <xsl:template name="weekView">
1034     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
1035       <tr>
1036         <xsl:for-each select="/bedework/daynames/val">
1037           <th class="dayHeading"><xsl:value-of select="."/></th>
1038         </xsl:for-each>
1039       </tr>
1040       <tr>
1041         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day">
1042           <xsl:variable name="dayPos" select="position()"/>
1043           <xsl:if test="filler='false'">
1044             <td>
1045               <xsl:if test="/bedework/now/date = date">
1046                 <xsl:attribute name="class">today</xsl:attribute>
1047               </xsl:if>
1048               <xsl:variable name="dayDate" select="date"/>
1049               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
1050                 <xsl:value-of select="value"/>
1051               </a>
1052               <xsl:if test="event">
1053                 <ul>
1054                   <xsl:apply-templates select="event" mode="calendarLayout">
1055                     <xsl:with-param name="dayPos" select="$dayPos"/>
1056                   </xsl:apply-templates>
1057                 </ul>
1058               </xsl:if>
1059             </td>
1060           </xsl:if>
1061         </xsl:for-each>
1062       </tr>
1063     </table>
1064   </xsl:template>
1065
1066   <!--==== MONTH CALENDAR VIEW ====-->
1067   <xsl:template name="monthView">
1068     <table id="monthCalendarTable" border="0" cellpadding="0" cellspacing="0">
1069       <tr>
1070         <xsl:for-each select="/bedework/daynames/val">
1071           <th class="dayHeading"><xsl:value-of select="."/></th>
1072         </xsl:for-each>
1073       </tr>
1074       <xsl:for-each select="/bedework/eventscalendar/year/month/week">
1075         <tr>
1076           <xsl:for-each select="day">
1077             <xsl:variable name="dayPos" select="position()"/>
1078             <xsl:choose>
1079               <xsl:when test="filler='true'">
1080                 <td class="filler">&#160;</td>
1081               </xsl:when>
1082               <xsl:otherwise>
1083                 <td>
1084                   <xsl:if test="/bedework/now/date = date">
1085                     <xsl:attribute name="class">today</xsl:attribute>
1086                   </xsl:if>
1087                   <xsl:variable name="dayDate" select="date"/>
1088                   <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}" class="dayLink">
1089                     <xsl:value-of select="value"/>
1090                   </a>
1091                   <xsl:if test="event">
1092                     <ul>
1093                       <xsl:apply-templates select="event" mode="calendarLayout">
1094                         <xsl:with-param name="dayPos" select="$dayPos"/>
1095                       </xsl:apply-templates>
1096                     </ul>
1097                   </xsl:if>
1098                 </td>
1099               </xsl:otherwise>
1100             </xsl:choose>
1101           </xsl:for-each>
1102         </tr>
1103       </xsl:for-each>
1104     </table>
1105   </xsl:template>
1106
1107   <!--== EVENTS IN THE CALENDAR GRID ==-->
1108   <xsl:template match="event" mode="calendarLayout">
1109     <xsl:param name="dayPos"/>
1110     <xsl:variable name="subscriptionId" select="subscription/id"/>
1111     <xsl:variable name="calPath" select="calendar/encodedPath"/>
1112     <xsl:variable name="guid" select="guid"/>
1113     <xsl:variable name="recurrenceId" select="recurrenceId"/>
1114     <xsl:variable name="eventClass">
1115       <xsl:choose>
1116         <!-- Special styles for the month grid -->
1117         <xsl:when test="status='CANCELLED'">eventCancelled</xsl:when>
1118         <xsl:when test="status='TENTATIVE'">eventTentative</xsl:when>
1119         <!-- Default alternating colors for all standard events -->
1120         <xsl:when test="position() mod 2 = 1">eventLinkA</xsl:when>
1121         <xsl:otherwise>eventLinkB</xsl:otherwise>
1122       </xsl:choose>
1123     </xsl:variable>
1124     <!-- Subscription styles.
1125          These are set in the add/modify subscription forms in the admin client;
1126          if present, these override the background-color set by eventClass. The
1127          subscription styles should not be used for cancelled events (tentative is ok). -->
1128     <xsl:variable name="subscriptionClass">
1129       <xsl:if test="status != 'CANCELLED' and
1130                     subscription/subStyle != '' and
1131                     subscription/subStyle != 'default'"><xsl:value-of select="subscription/subStyle"/></xsl:if>
1132     </xsl:variable>
1133     <li>
1134       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" class="{$eventClass} {$subscriptionClass}">
1135         <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
1136         <xsl:choose>
1137           <xsl:when test="start/shortdate != ../shortdate">
1138             (cont)
1139           </xsl:when>
1140           <xsl:when test="start/allday = 'false'">
1141             <xsl:value-of select="start/time"/>:
1142           </xsl:when>
1143           <xsl:otherwise>
1144             all day:
1145           </xsl:otherwise>
1146         </xsl:choose>
1147         <xsl:value-of select="summary"/>
1148         <xsl:variable name="eventTipClass">
1149           <xsl:choose>
1150             <xsl:when test="$dayPos &gt; 5">eventTipReverse</xsl:when>
1151             <xsl:otherwise>eventTip</xsl:otherwise>
1152           </xsl:choose>
1153         </xsl:variable>
1154         <span class="{$eventTipClass}">
1155           <xsl:if test="status='CANCELLED'"><span class="eventTipStatusCancelled">CANCELLED</span></xsl:if>
1156           <xsl:if test="status='TENTATIVE'"><span class="eventTipStatusTentative">TENTATIVE</span></xsl:if>
1157           <strong><xsl:value-of select="summary"/></strong><br/>
1158           Time:
1159           <xsl:choose>
1160             <xsl:when test="start/allday = 'true'">
1161               all day
1162             </xsl:when>
1163             <xsl:otherwise>
1164               <xsl:if test="start/shortdate != ../shortdate">
1165                 <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
1166                 <xsl:text> </xsl:text>
1167               </xsl:if>
1168               <xsl:value-of select="start/time"/>
1169               <xsl:if test="(start/time != end/time) or (start/shortdate != end/shortdate)">
1170                 -
1171                 <xsl:if test="end/shortdate != ../shortdate">
1172                   <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
1173                   <xsl:text> </xsl:text>
1174                 </xsl:if>
1175                 <xsl:value-of select="end/time"/>
1176               </xsl:if>
1177             </xsl:otherwise>
1178           </xsl:choose><br/>
1179           <xsl:if test="location/address">
1180             Location: <xsl:value-of select="location/address"/><br/>
1181           </xsl:if>
1182           Calendar: <xsl:value-of select="calendar/name"/>
1183         </span>
1184       </a>
1185     </li>
1186   </xsl:template>
1187
1188   <!--==== YEAR VIEW ====-->
1189   <xsl:template name="yearView">
1190     <table id="yearCalendarTable" border="0" cellpadding="0" cellspacing="0">
1191       <tr>
1192         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &lt;= 3]"/>
1193       </tr>
1194       <tr>
1195         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 3) and (position() &lt;= 6)]"/>
1196       </tr>
1197       <tr>
1198         <xsl:apply-templates select="/bedework/eventscalendar/year/month[(position() &gt; 6) and (position() &lt;= 9)]"/>
1199       </tr>
1200       <tr>
1201         <xsl:apply-templates select="/bedework/eventscalendar/year/month[position() &gt; 9]"/>
1202       </tr>
1203     </table>
1204   </xsl:template>
1205
1206   <!-- year view month tables -->
1207   <xsl:template match="month">
1208     <td>
1209       <table class="yearViewMonthTable" border="0" cellpadding="0" cellspacing="0">
1210         <tr>
1211           <td colspan="8" class="monthName">
1212             <xsl:variable name="firstDayOfMonth" select="week/day/date"/>
1213             <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$firstDayOfMonth}">
1214               <xsl:value-of select="longname"/>
1215             </a>
1216           </td>
1217         </tr>
1218         <tr>
1219           <th>&#160;</th>
1220           <xsl:for-each select="/bedework/shortdaynames/val">
1221             <th><xsl:value-of select="."/></th>
1222           </xsl:for-each>
1223         </tr>
1224         <xsl:for-each select="week">
1225           <tr>
1226             <td class="weekCell">
1227               <xsl:variable name="firstDayOfWeek" select="day/date"/>
1228               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$firstDayOfWeek}">
1229                 <xsl:value-of select="value"/>
1230               </a>
1231             </td>
1232             <xsl:for-each select="day">
1233               <xsl:choose>
1234                 <xsl:when test="filler='true'">
1235                   <td class="filler">&#160;</td>
1236                 </xsl:when>
1237                 <xsl:otherwise>
1238                   <td>
1239                     <xsl:if test="/bedework/now/date = date">
1240                       <xsl:attribute name="class">today</xsl:attribute>
1241                     </xsl:if>
1242                     <xsl:variable name="dayDate" select="date"/>
1243                     <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$dayDate}">
1244                       <xsl:attribute name="class">today</xsl:attribute>
1245                       <xsl:value-of select="value"/>
1246                     </a>
1247                   </td>
1248                 </xsl:otherwise>
1249               </xsl:choose>
1250             </xsl:for-each>
1251           </tr>
1252         </xsl:for-each>
1253       </table>
1254     </td>
1255   </xsl:template>
1256
1257   <!--==== CALENDARS ====-->
1258
1259   <!-- list of available calendars -->
1260   <xsl:template match="calendars">
1261     <xsl:variable name="topLevelCalCount" select="count(calendar/calendar)"/>
1262     <table id="calPageTable" border="0" cellpadding="0" cellspacing="0">
1263       <tr>
1264         <th colspan="2">
1265           All Calendars
1266         </th>
1267       </tr>
1268       <tr>
1269         <td colspan="2" class="infoCell">
1270           <p class="info">
1271             Select a calendar from the list below to see only that calendar's events.
1272           </p>
1273           <!-- Uncomment this block, and change the links on the download calendar
1274                icon (in the following template) to use a dojo floating
1275                widget instead of a separate page
1276                for downloading whole calendars (this method does not work
1277                portal-agnostically: it is not intended for use in portals).
1278
1279           <div dojoType="FloatingPane" id="bwCalendarExportWidget"
1280                title="Export Calendar as iCal" toggle="plain"
1281                windowState="minimized" hasShadow="true"
1282                displayMinimizeAction="true" resizable="false">
1283              <p>
1284               <strong>Calendar to export:</strong>
1285               <span id="bwCalendarExportWidgetCalName"></span>
1286             </p>
1287             <strong>Event date limits:</strong>
1288             <form name="exportCalendarForm" id="exportCalendarForm" action="{$export}" method="post">
1289               <input type="hidden" name="calPath" value=""/>
1290               <input type="hidden" name="eventStartDate.year" value=""/>
1291               <input type="hidden" name="eventStartDate.month" value=""/>
1292               <input type="hidden" name="eventStartDate.day" value=""/>
1293               <input type="hidden" name="eventEndDate.year" value=""/>
1294               <input type="hidden" name="eventEndDate.month" value=""/>
1295               <input type="hidden" name="eventEndDate.day" value=""/>
1296               <input type="hidden" name="nocache" value="no"/>
1297               <input type="hidden" name="skinName" value="ical"/>
1298               <input type="hidden" name="contentType" value="text/calendar"/>
1299               <input type="hidden" name="contentName" value="calendar.ics"/>
1300               <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> today forward
1301               <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/> all dates
1302               <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/> date range
1303               <div id="exportDateRange" class="invisible">
1304                 Start: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetStartDate"><xsl:text> </xsl:text></div>
1305                 End: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetEndDate"><xsl:text> </xsl:text></div>
1306               </div>
1307               <p><input type="submit" value="export" class="bwWidgetSubmit" onclick="fillExportFields(this.form);hideWidget('bwCalendarExportWidget')"/></p>
1308             </form>
1309           </div>-->
1310         </td>
1311       </tr>
1312       <tr>
1313         <td class="leftCell">
1314           <ul class="calendarTree">
1315             <xsl:apply-templates select="calendar/calendar[position() &lt;= ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1316           </ul>
1317         </td>
1318         <td>
1319           <ul class="calendarTree">
1320             <xsl:apply-templates select="calendar/calendar[position() &gt; ceiling($topLevelCalCount div 2)]" mode="calTree"/>
1321           </ul>
1322         </td>
1323       </tr>
1324     </table>
1325   </xsl:template>
1326
1327   <xsl:template match="calendar" mode="calTree">
1328     <xsl:variable name="itemClass">
1329       <xsl:choose>
1330         <xsl:when test="calendarCollection='false'">folder</xsl:when>
1331         <xsl:otherwise>calendar</xsl:otherwise>
1332       </xsl:choose>
1333     </xsl:variable>
1334     <xsl:variable name="url" select="encodedPath"/>
1335     <li class="{$itemClass}">
1336       <a href="{$setSelection}&amp;calUrl={$url}" title="view calendar"><xsl:value-of select="name"/></a>
1337       <xsl:if test="calendarCollection='true'">
1338         <xsl:variable name="calPath" select="path"/>
1339         <span class="exportCalLink">
1340           <!-- To use the dojo floating widget from the template above, uncomment
1341                this block:
1342           <xsl:variable name="name" select="name"/>
1343           <xsl:variable name="idForCal" select="translate(translate(path,'/','S'),' ','s')"/>
1344           <a href="javascript:launchExportWidget('exportCalendarForm','{$export}','{$name}','{$calPath}')" id="{$idForCal}" title="export calendar as iCal">
1345             <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/>
1346           </a> -->
1347           <a href="{$calendar-fetchForExport}&amp;calPath={$calPath}" title="export calendar as iCal">
1348             <img src="{$resourcesRoot}/images/calIconExport-sm.gif" width="13" height="13" alt="export calendar" border="0"/>
1349           </a>
1350         </span>
1351       </xsl:if>
1352       <xsl:if test="calendar">
1353         <ul>
1354           <xsl:apply-templates select="calendar" mode="calTree"/>
1355         </ul>
1356       </xsl:if>
1357     </li>
1358   </xsl:template>
1359
1360   <!-- calendar export page -->
1361   <xsl:template match="currentCalendar" mode="export">
1362     <h2 class="bwStatusConfirmed">Export Calendar</h2>
1363     <div id="export">
1364       <p>
1365         <strong>Calendar to export:</strong>
1366       </p>
1367       <div class="indent">
1368         Name: <strong><em><xsl:value-of select="name"/></em></strong><br/>
1369         Path: <xsl:value-of select="path"/>
1370       </div>
1371       <p>
1372         <strong>Event date limits:</strong>
1373       </p>
1374       <form name="exportCalendarForm" id="exportCalendarForm" action="{$export}" method="post">
1375         <input type="hidden" name="calPath">
1376           <xsl:attribute name="value"><xsl:value-of select="path"/></xsl:attribute>
1377         </input>
1378         <!-- fill these on submit -->
1379         <input type="hidden" name="eventStartDate.year" value=""/>
1380         <input type="hidden" name="eventStartDate.month" value=""/>
1381         <input type="hidden" name="eventStartDate.day" value=""/>
1382         <input type="hidden" name="eventEndDate.year" value=""/>
1383         <input type="hidden" name="eventEndDate.month" value=""/>
1384         <input type="hidden" name="eventEndDate.day" value=""/>
1385         <!-- static fields -->
1386         <input type="hidden" name="nocache" value="no"/>
1387         <input type="hidden" name="skinName" value="ical"/>
1388         <input type="hidden" name="contentType" value="text/calendar"/>
1389         <input type="hidden" name="contentName">
1390           <xsl:attribute name="value"><xsl:value-of select="name"/>.ics</xsl:attribute>
1391         </input>
1392         <!-- visible fields -->
1393         <input type="radio" name="dateLimits" value="active" checked="checked" onclick="changeClass('exportDateRange','invisible')"/> today forward
1394         <input type="radio" name="dateLimits" value="none" onclick="changeClass('exportDateRange','invisible')"/> all dates
1395         <input type="radio" name="dateLimits" value="limited" onclick="changeClass('exportDateRange','visible')"/> date range
1396         <div id="exportDateRange" class="invisible">
1397           Start: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetStartDate"><xsl:text> </xsl:text></div>
1398           End: <div dojoType="dropdowndatepicker" formatLength="medium" saveFormat="yyyyMMdd" id="bwExportCalendarWidgetEndDate"><xsl:text> </xsl:text></div>
1399         </div>
1400         <p><input type="submit" value="export" class="bwWidgetSubmit" onclick="fillExportFields(this.form)"/></p>
1401       </form>
1402     </div>
1403   </xsl:template>
1404
1405   <!--==== SEARCH RESULT ====-->
1406   <xsl:template name="searchResult">
1407     <h2 class="bwStatusConfirmed">
1408       <div id="searchFilter">
1409         <form name="searchForm" method="post" action="{$search}">
1410           Search:
1411           <input type="text" name="query" size="15">
1412             <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
1413           </input>
1414           <input type="submit" name="submit" value="go"/>
1415           Limit:
1416           <xsl:choose>
1417             <xsl:when test="/bedework/searchResults/searchLimits = 'beforeToday'">
1418               <input type="radio" name="searchLimits" value="fromToday"/>today forward
1419               <input type="radio" name="searchLimits" value="beforeToday" checked="checked"/>past dates
1420               <input type="radio" name="searchLimits" value="none"/>all dates
1421             </xsl:when>
1422             <xsl:when test="/bedework/searchResults/searchLimits = 'none'">
1423               <input type="radio" name="searchLimits" value="fromToday"/>today forward
1424               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
1425               <input type="radio" name="searchLimits" value="none" checked="checked"/>all dates
1426             </xsl:when>
1427             <xsl:otherwise>
1428               <input type="radio" name="searchLimits" value="fromToday" checked="checked"/>today forward
1429               <input type="radio" name="searchLimits" value="beforeToday"/>past dates
1430               <input type="radio" name="searchLimits" value="none"/>all dates
1431             </xsl:otherwise>
1432           </xsl:choose>
1433         </form>
1434       </div>
1435       Search Result
1436     </h2>
1437     <table id="searchTable" cellpadding="0" cellspacing="0">
1438       <tr>
1439         <th colspan="5">
1440           <xsl:if test="/bedework/searchResults/numPages &gt; 1">
1441             <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1442             <div id="searchPageForm">
1443               page:
1444               <xsl:if test="/bedework/searchResults/curPage != 1">
1445                 <xsl:variable name="prevPage" select="number($curPage) - 1"/>
1446                 &lt;<a href="{$search-next}&amp;pageNum={$prevPage}">prev</a>
1447               </xsl:if>
1448               <xsl:text> </xsl:text>
1449
1450               <xsl:call-template name="searchResultPageNav">
1451                 <xsl:with-param name="page">
1452                   <xsl:choose>
1453                     <xsl:when test="number($curPage) - 10 &lt; 1">1</xsl:when>
1454                     <xsl:otherwise><xsl:value-of select="number($curPage) - 6"/></xsl:otherwise>
1455                   </xsl:choose>
1456                 </xsl:with-param>
1457               </xsl:call-template>
1458
1459               <xsl:text> </xsl:text>
1460               <xsl:choose>
1461                 <xsl:when test="$curPage != /bedework/searchResults/numPages">
1462                   <xsl:variable name="nextPage" select="number($curPage) + 1"/>
1463                   <a href="{$search-next}&amp;pageNum={$nextPage}">next</a>&gt;
1464                 </xsl:when>
1465                 <xsl:otherwise>
1466                   <span class="hidden">next&gt;</span><!-- occupy the space to keep the navigation from moving around -->
1467                 </xsl:otherwise>
1468               </xsl:choose>
1469             </div>
1470           </xsl:if>
1471           <xsl:value-of select="/bedework/searchResults/resultSize"/>
1472           result<xsl:if test="/bedework/searchResults/resultSize != 1">s</xsl:if> returned
1473           for <em><xsl:value-of select="/bedework/searchResults/query"/></em>
1474         </th>
1475       </tr>
1476       <xsl:if test="/bedework/searchResults/searchResult">
1477         <tr class="fieldNames">
1478           <td>
1479             relevance
1480           </td>
1481           <td>
1482             summary
1483           </td>
1484           <td>
1485             date &amp; time
1486           </td>
1487           <td>
1488             calendar
1489           </td>
1490           <td>
1491             location
1492           </td>
1493         </tr>
1494       </xsl:if>
1495       <xsl:for-each select="/bedework/searchResults/searchResult">
1496         <xsl:variable name="subscriptionId" select="event/subscription/id"/>
1497         <xsl:variable name="calPath" select="event/calendar/encodedPath"/>
1498         <xsl:variable name="guid" select="event/guid"/>
1499         <xsl:variable name="recurrenceId" select="event/recurrenceId"/>
1500         <tr>
1501           <td class="relevance">
1502             <xsl:value-of select="ceiling(number(score)*100)"/>%
1503             <img src="{$resourcesRoot}/images/spacer.gif" height="4" class="searchRelevance">
1504               <xsl:attribute name="width"><xsl:value-of select="ceiling((number(score)*100) div 1.5)"/></xsl:attribute>
1505             </img>
1506           </td>
1507           <td>
1508             <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
1509               <xsl:value-of select="event/summary"/>
1510             </a>
1511           </td>
1512           <td>
1513             <xsl:value-of select="event/start/longdate"/>
1514             <xsl:text> </xsl:text>
1515             <xsl:value-of select="event/start/time"/>
1516             <xsl:choose>
1517               <xsl:when test="event/start/longdate != event/end/longdate">
1518                 - <xsl:value-of select="event/start/longdate"/>
1519                 <xsl:text> </xsl:text>
1520                 <xsl:value-of select="event/end/time"/>
1521               </xsl:when>
1522               <xsl:when test="event/start/time != event/end/time">
1523                 - <xsl:value-of select="event/end/time"/>
1524               </xsl:when>
1525             </xsl:choose>
1526           </td>
1527           <td>
1528             <xsl:variable name="calUrl" select="event/calendar/encodedPath"/>
1529             <a href="{$setSelection}&amp;calUrl={$calUrl}">
1530               <xsl:value-of select="event/calendar/name"/>
1531             </a>
1532           </td>
1533           <td>
1534             <xsl:value-of select="event/location/address"/>
1535           </td>
1536         </tr>
1537       </xsl:for-each>
1538     </table>
1539   </xsl:template>
1540
1541   <xsl:template name="searchResultPageNav">
1542     <xsl:param name="page">1</xsl:param>
1543     <xsl:variable name="curPage" select="/bedework/searchResults/curPage"/>
1544     <xsl:variable name="numPages" select="/bedework/searchResults/numPages"/>
1545     <xsl:variable name="endPage">
1546       <xsl:choose>
1547         <xsl:when test="number($curPage) + 6 &gt; number($numPages)"><xsl:value-of select="$numPages"/></xsl:when>
1548         <xsl:otherwise><xsl:value-of select="number($curPage) + 6"/></xsl:otherwise>
1549       </xsl:choose>
1550     </xsl:variable>
1551     <xsl:choose>
1552       <xsl:when test="$page = $curPage">
1553         <xsl:value-of select="$page"/>
1554       </xsl:when>
1555       <xsl:otherwise>
1556         <a href="{$search-next}&amp;pageNum={$page}">
1557           <xsl:value-of select="$page"/>
1558         </a>
1559       </xsl:otherwise>
1560     </xsl:choose>
1561     <xsl:text> </xsl:text>
1562     <xsl:if test="$page &lt; $endPage">
1563        <xsl:call-template name="searchResultPageNav">
1564          <xsl:with-param name="page" select="number($page)+1"/>
1565       </xsl:call-template>
1566     </xsl:if>
1567   </xsl:template>
1568
1569   <!--+++++++++++++++ System Stats ++++++++++++++++++++-->
1570   <xsl:template name="stats">
1571     <div id="stats">
1572       <h2>System Statistics</h2>
1573
1574       <p>
1575         Stats collection:
1576       </p>
1577       <ul>
1578         <li>
1579           <a href="{$stats}&amp;enable=yes">enable</a> |
1580           <a href="{$stats}&amp;disable=yes">disable</a>
1581         </li>
1582         <li><a href="{$stats}&amp;fetch=yes">fetch statistics</a></li>
1583         <li><a href="{$stats}&amp;dump=yes">dump stats to log</a></li>
1584       </ul>
1585       <table id="statsTable" cellpadding="0">
1586         <xsl:for-each select="/bedework/sysStats/*">
1587           <xsl:choose>
1588             <xsl:when test="name(.) = 'header'">
1589               <tr>
1590                 <th colspan="2">
1591                   <xsl:value-of select="."/>
1592                 </th>
1593               </tr>
1594             </xsl:when>
1595             <xsl:otherwise>
1596               <tr>
1597                 <td class="label">
1598                   <xsl:value-of select="label"/>
1599                 </td>
1600                 <td class="value">
1601                   <xsl:value-of select="value"/>
1602                 </td>
1603               </tr>
1604             </xsl:otherwise>
1605           </xsl:choose>
1606         </xsl:for-each>
1607       </table>
1608     </div>
1609   </xsl:template>
1610
1611   <!--==== UTILITY TEMPLATES ====-->
1612
1613   <!-- search and replace template taken from
1614        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
1615   <xsl:template name="replace">
1616     <xsl:param name="string" select="''"/>
1617     <xsl:param name="pattern" select="''"/>
1618     <xsl:param name="replacement" select="''"/>
1619     <xsl:choose>
1620       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
1621         <xsl:value-of select="substring-before($string, $pattern)"/>
1622         <xsl:copy-of select="$replacement"/>
1623         <xsl:call-template name="replace">
1624           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
1625           <xsl:with-param name="pattern" select="$pattern"/>
1626           <xsl:with-param name="replacement" select="$replacement"/>
1627         </xsl:call-template>
1628       </xsl:when>
1629       <xsl:otherwise>
1630         <xsl:value-of select="$string"/>
1631       </xsl:otherwise>
1632     </xsl:choose>
1633   </xsl:template>
1634
1635   <!--==== FOOTER ====-->
1636
1637   <xsl:template name="footer">
1638     <div id="footer">
1639       Demonstration calendar; place footer information here.
1640     </div>
1641     <table id="skinSelectorTable" border="0" cellpadding="0" cellspacing="0">
1642       <tr>
1643         <td class="leftCell">
1644           Based on the <a href="http://www.bedework.org/">Bedework Website</a> |
1645           <a href="?noxslt=yes">show XML</a> |
1646           <a href="?refreshXslt=yes">refresh XSLT</a>
1647         </td>
1648         <td class="rightCell">
1649           <form name="styleSelectForm" method="post" action="{$setup}">
1650             <select name="setappvar" onchange="submit()">
1651               <option value="">example styles:</option>
1652               <option value="style(green)">green</option>
1653               <option value="style(red)">red</option>
1654               <option value="style(blue)">blue</option>
1655             </select>
1656           </form>
1657           <form name="skinSelectForm" method="post" action="{$setup}">
1658             <input type="hidden" name="setappvar" value="summaryMode(details)"/>
1659             <select name="skinPicker" onchange="window.location = this.value">
1660               <option value="{$setup}&amp;skinNameSticky=default">example skins:</option>
1661               <option value="{$setViewPeriod}&amp;viewType=weekView&amp;skinName=rss&amp;setappvar=summaryMode(details)">rss feed</option>
1662               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=jsToday&amp;contentType=text/javascript&amp;contentName=bedework.js">javascript feed</option>
1663               <option value="{$setViewPeriod}&amp;viewType=todayView&amp;skinName=videocal">video feed</option>
1664               <option value="{$setup}&amp;skinNameSticky=default">reset to calendar default</option>
1665             </select>
1666           </form>
1667           <form name="skinSelectForm" method="post" action="">
1668             <select name="sitePicker" onchange="window.location = this.value">
1669               <option>production examples:</option>
1670               <option value="http://events.dal.ca/">Dalhousie</option>
1671               <option value="http://events.rpi.edu">Rensselaer</option>
1672               <option value="http://myuw.washington.edu/cal/">Washington</option>
1673             </select>
1674           </form>
1675         </td>
1676       </tr>
1677     </table>
1678   </xsl:template>
1679 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.