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

Revision 2195 (checked in by johnsa, 4 years ago)

check status and updated text cancelled to canceled

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