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

Revision 2448 (checked in by johnsa, 3 years ago)

public client: full restructuring in preparation for new default skin

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