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

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

set and remove xprops for aliases explicitly

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