root/releases/bedework-3.4.1.1/deployment/webpublic/webapp/resources/demoskins/MainCampus/default/default/default.xsl

Revision 1870 (checked in by johnsa, 5 years ago)

web submit: add cost field to event; other minor updates

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