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

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

user clients:

- RSS feeds now use listEvent action to return discrete

events for an arbitrary number of days (3 in the
default stylesheets); rss.xsl is deprecated in favor
of rss-list.xsl

- RSS switched to UTC
- updated the mobile web skin to be more usable and added

it to the list of example skins

- some general cleanup

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3 <xsl:output method="xhtml"
4     indent="yes"
5     media-type="text/html"
6     doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
7     doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
8     standalone="yes"
9     omit-xml-declaration="yes"/>
10
11   <!-- ===============================================
12              BEDEWORK MOBILE STYLESHEET
13
14         Renders Bedework public client for mobile
15         devices.  Call this stylesheet using:
16
17         http://localhost:8080/cal/setup.do?browserTypeSticky=PDA
18         to revert to the default browserType, use
19         http://localhost:8080/cal/setup.do?browserTypeSticky=default
20
21        ==============================================  -->
22
23   <!-- URL of resources common to all bedework apps (javascript, images) -->
24   <xsl:variable name="resourceCommons">../../../bedework-common</xsl:variable>
25
26   <!-- DEFINE INCLUDES -->
27   <!-- cannot use the resourceCommons variable in xsl:include paths -->
28   <xsl:include href="../../../bedework-common/default/default/errors.xsl"/>
29   <xsl:include href="../../../bedework-common/default/default/messages.xsl"/>
30
31   <!-- DEFINE GLOBAL CONSTANTS -->
32
33   <!-- URL of the XSL template directory -->
34   <!-- The approot is an appropriate place to put
35        included stylesheets and xml fragments. These are generally
36        referenced relatively (like errors.xsl and messages.xsl above);
37        this variable is here for your convenience if you choose to
38        reference it explicitly.  It is not used in this stylesheet, however,
39        and can be safely removed if you so choose. -->
40   <xsl:variable name="appRoot" select="/bedework/approot"/>
41
42   <!-- URL of html resources (images, css, other html); by default this is
43        set to the application root -->
44   <xsl:variable name="resourcesRoot" select="/bedework/approot"/>
45
46   <!-- Properly encoded prefixes to the application actions; use these to build
47        urls; allows the application to be used without cookies or within a portal.
48        These urls are rewritten in header.jsp and simply passed through for use
49        here. Every url includes a query string (either ?b=de or a real query
50        string) so that all links constructed in this stylesheet may begin the
51        query string with an ampersand. -->
52   <xsl:variable name="setup" select="/bedework/urlPrefixes/setup"/>
53   <xsl:variable name="setSelection" select="/bedework/urlPrefixes/main/setSelection"/>
54   <xsl:variable name="fetchPublicCalendars" select="/bedework/urlPrefixes/calendar/fetchPublicCalendars"/>
55   <xsl:variable name="setViewPeriod" select="/bedework/urlPrefixes/main/setViewPeriod"/>
56   <xsl:variable name="eventView" select="/bedework/urlPrefixes/event/eventView"/>
57   <xsl:variable name="addEventRef" select="/bedework/urlPrefixes/event/addEventRef"/>
58   <xsl:variable name="export" select="/bedework/urlPrefixes/misc/export/a/@href"/>
59   <xsl:variable name="search" select="/bedework/urlPrefixes/search/search"/>
60   <xsl:variable name="search-next" select="/bedework/urlPrefixes/search/next"/>
61   <xsl:variable name="mailEvent" select="/bedework/urlPrefixes/mail/mailEvent"/>
62   <xsl:variable name="showPage" select="/bedework/urlPrefixes/main/showPage"/>
63   <xsl:variable name="stats" select="/bedework/urlPrefixes/stats/stats"/>
64
65   <!-- URL of the web application - includes web context -->
66   <xsl:variable name="urlPrefix" select="/bedework/urlprefix"/>
67
68   <!-- Other generally useful global variables -->
69   <xsl:variable name="privateCal">/ucal</xsl:variable>
70   <xsl:variable name="prevdate" select="/bedework/previousdate"/>
71   <xsl:variable name="nextdate" select="/bedework/nextdate"/>
72   <xsl:variable name="curdate" select="/bedework/currentdate/date"/>
73
74
75   <!-- MAIN TEMPLATE -->
76   <xsl:template match="/">
77     <html xml:lang="en">
78       <head>
79         <title>Bedework Events Calendar</title>
80         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
81         <meta http-equiv="Pragma" content="no-cache"/>
82         <meta http-equiv="Expires" content="-1"/>
83         <link rel="stylesheet" href="{$resourcesRoot}/default/PDA/pda.css"/>
84       </head>
85       <body>
86         <h1 id="homeTitle">
87           Home Title Here
88           <span id="homeLink">
89             [<a href="{$setup}&amp;browserTypeSticky=default">home</a>]
90           </span>
91         </h1>
92         <div id="titleBar">
93           Bedework Events Calendar
94         </div>
95         <xsl:call-template name="infoAndNavigation"/>
96         <xsl:choose>
97           <xsl:when test="/bedework/page='event'">
98             <!-- show an event -->
99             <xsl:apply-templates select="/bedework/event"/>
100           </xsl:when>
101           <xsl:when test="/bedework/page='calendarList'">
102             <!-- show a list of all calendars -->
103             <xsl:apply-templates select="/bedework/calendars"/>
104           </xsl:when>
105           <xsl:otherwise>
106             <!-- otherwise, show the eventsCalendar -->
107             <!-- main eventCalendar content -->
108             <xsl:call-template name="listView"/>
109           </xsl:otherwise>
110         </xsl:choose>
111         <!-- footer -->
112         <p id="footer">
113           <a href="{$setup}&amp;browserTypeSticky=PDA">Events Calendar</a> |
114           <a href="{$setup}&amp;browserTypeSticky=default">Home Link</a><br/>
115           <small>Footer Text</small>
116         </p>
117       </body>
118     </html>
119   </xsl:template>
120
121   <!-- === Date Info and Navigation == -->
122   <xsl:template name="infoAndNavigation">
123     <div id="dateInfo">
124       <xsl:if test="/bedework/page!='calendarList' and /bedework/page!='event'">
125         &lt;<a href="{$setViewPeriod}&amp;date={$prevdate}">prev</a>
126         <xsl:text> </xsl:text>
127         <strong>
128           <xsl:choose>
129             <xsl:when test="/bedework/periodname='Day'">
130               <xsl:value-of select="substring(/bedework/eventscalendar/year/month/week/day/name,1,3)"/>, <xsl:value-of select="/bedework/eventscalendar/year/month/shortname"/>&#160;<xsl:value-of select="/bedework/eventscalendar/year/month/week/day/value"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
131             </xsl:when>
132             <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
133               Week of <xsl:value-of select="/bedework/eventscalendar/year/month/shortname"/>&#160;<xsl:value-of select="/bedework/eventscalendar/year/month/week/day/value"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
134             </xsl:when>
135             <xsl:when test="/bedework/periodname='Month'">
136               <xsl:value-of select="/bedework/eventscalendar/year/month/longname"/>, <xsl:value-of select="/bedework/eventscalendar/year/value"/>
137             </xsl:when>
138             <xsl:otherwise>
139               <xsl:value-of select="/bedework/eventscalendar/year/value"/>
140             </xsl:otherwise>
141           </xsl:choose>
142         </strong>
143         <xsl:text> </xsl:text>
144         <a href="{$setViewPeriod}&amp;date={$nextdate}">next</a>&gt;
145         <br />
146       </xsl:if>
147     </div>
148     <div id="mainNav">
149       <xsl:choose>
150         <xsl:when test="/bedework/page='eventscalendar'">
151           <xsl:choose>
152             <xsl:when test="/bedework/periodname='Day'">
153               day
154             </xsl:when>
155             <xsl:otherwise>
156               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}">day</a>
157             </xsl:otherwise>
158           </xsl:choose> |
159           <xsl:choose>
160             <xsl:when test="/bedework/periodname='Week' or /bedework/periodname=''">
161               week
162              </xsl:when>
163             <xsl:otherwise>
164               <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}">week</a>
165              </xsl:otherwise>
166           </xsl:choose> |
167           <xsl:choose>
168             <xsl:when test="/bedework/periodname='Month'">
169               month
170             </xsl:when>
171             <xsl:otherwise>
172               <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}">month</a>
173             </xsl:otherwise>
174           </xsl:choose> |
175         </xsl:when>
176         <xsl:otherwise>
177           <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}">day</a> |
178           <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}">week</a> |
179           <a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}">month</a> |
180         </xsl:otherwise>
181       </xsl:choose>
182       <a href="{$setViewPeriod}&amp;viewType=todayView&amp;date={$curdate}">
183         today
184       </a><br />
185       <xsl:choose>
186         <xsl:when test="/bedework/selectionState/selectionType = 'calendar'">
187           Calendar: <xsl:value-of select="/bedework/selectionState/subscriptions/subscription/calendar/name"/>
188           <span class="link">[<a href="{$setSelection}">show all</a>]</span>
189         </xsl:when>
190         <xsl:otherwise>
191           <xsl:if test="/bedework/page != 'calendarList'">
192             <span class="calLinks"><a href="{$fetchPublicCalendars}">available calendars</a></span>
193           </xsl:if>
194         </xsl:otherwise>
195       </xsl:choose>
196     </div>
197   </xsl:template>
198
199   <!--==== SINGLE EVENT ====-->
200   <xsl:template match="event">
201     <xsl:variable name="subscriptionId" select="subscription/id"/>
202     <xsl:variable name="calPath" select="calendar/encodedPath"/>
203     <xsl:variable name="guid" select="guid"/>
204     <xsl:variable name="recurrenceId" select="recurrenceId"/>
205     <xsl:variable name="statusClass">
206       <xsl:choose>
207         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
208         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
209         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
210       </xsl:choose>
211     </xsl:variable>
212     <h2 class="{$statusClass}">
213       <xsl:if test="status='CANCELLED'">CANCELLED: </xsl:if>
214       <xsl:choose>
215         <xsl:when test="link != ''">
216           <xsl:variable name="link" select="link"/>
217           <a href="{$link}">
218             <xsl:value-of select="summary"/>
219           </a>
220         </xsl:when>
221         <xsl:otherwise>
222           <xsl:value-of select="summary"/>
223         </xsl:otherwise>
224       </xsl:choose>
225     </h2>
226     <table id="eventTable" cellpadding="0" cellspacing="0">
227       <tr>
228         <td class="fieldname">When:</td>
229         <td class="fieldval">
230           <!-- always display local time -->
231           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
232           <xsl:if test="start/allday = 'false'">
233             <span class="time"><xsl:value-of select="start/time"/></span>
234           </xsl:if>
235           <xsl:if test="(end/longdate != start/longdate) or
236                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
237           <xsl:if test="end/longdate != start/longdate">
238             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
239           </xsl:if>
240           <xsl:choose>
241             <xsl:when test="start/allday = 'true'">
242               <span class="time"><em>(all day)</em></span>
243             </xsl:when>
244             <xsl:when test="end/longdate != start/longdate">
245               <span class="time"><xsl:value-of select="end/time"/></span>
246             </xsl:when>
247             <xsl:when test="end/time != start/time">
248               <span class="time"><xsl:value-of select="end/time"/></span>
249             </xsl:when>
250           </xsl:choose>
251           <!-- if timezones are not local, or if floating add labels: -->
252           <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
253             <xsl:text> </xsl:text>
254             --
255             <strong>
256               <xsl:choose>
257                 <xsl:when test="start/floating = 'true'">
258                   Floating time
259                 </xsl:when>
260                 <xsl:otherwise>
261                   Local time
262                 </xsl:otherwise>
263               </xsl:choose>
264             </strong>
265             <br/>
266           </xsl:if>
267           <!-- display in timezone if not local or floating time) -->
268           <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
269             <xsl:choose>
270               <xsl:when test="start/timezone/id != end/timezone/id">
271                 <!-- need to display both timezones if they differ from start to end -->
272                 <table border="0" cellspacing="0" id="tztable">
273                   <tr>
274                     <td>
275                       <strong>Start:</strong>
276                     </td>
277                     <td>
278                       <xsl:choose>
279                         <xsl:when test="start/timezone/islocal='true'">
280                           <xsl:value-of select="start/dayname"/>,
281                           <xsl:value-of select="start/longdate"/>
282                           <xsl:text> </xsl:text>
283                           <span class="time"><xsl:value-of select="start/time"/></span>
284                         </xsl:when>
285                         <xsl:otherwise>
286                           <xsl:value-of select="start/timezone/dayname"/>,
287                           <xsl:value-of select="start/timezone/longdate"/>
288                           <xsl:text> </xsl:text>
289                           <span class="time"><xsl:value-of select="start/timezone/time"/></span>
290                         </xsl:otherwise>
291                       </xsl:choose>
292                     </td>
293                     <td>
294                       --
295                       <strong><xsl:value-of select="start/timezone/id"/></strong>
296                     </td>
297                   </tr>
298                   <tr>
299                     <td>
300                       <strong>End:</strong>
301                     </td>
302                     <td>
303                       <xsl:choose>
304                         <xsl:when test="end/timezone/islocal='true'">
305                           <xsl:value-of select="end/dayname"/>,
306                           <xsl:value-of select="end/longdate"/>
307                           <xsl:text> </xsl:text>
308                           <span class="time"><xsl:value-of select="end/time"/></span>
309                         </xsl:when>
310                         <xsl:otherwise>
311                           <xsl:value-of select="end/timezone/dayname"/>,
312                           <xsl:value-of select="end/timezone/longdate"/>
313                           <xsl:text> </xsl:text>
314                           <span class="time"><xsl:value-of select="end/timezone/time"/></span>
315                         </xsl:otherwise>
316                       </xsl:choose>
317                     </td>
318                     <td>
319                       --
320                       <strong><xsl:value-of select="end/timezone/id"/></strong>
321                     </td>
322                   </tr>
323                 </table>
324               </xsl:when>
325               <xsl:otherwise>
326                 <!-- otherwise, timezones are the same: display as a single line  -->
327                 <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
328                 <xsl:if test="start/allday = 'false'">
329                   <span class="time"><xsl:value-of select="start/timezone/time"/></span>
330                 </xsl:if>
331                 <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
332                               ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
333                 <xsl:if test="end/timezone/longdate != start/timezone/longdate">
334                   <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
335                 </xsl:if>
336                 <xsl:choose>
337                   <xsl:when test="start/allday = 'true'">
338                     <span class="time"><em>(all day)</em></span>
339                   </xsl:when>
340                   <xsl:when test="end/timezone/longdate != start/timezone/longdate">
341                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
342                   </xsl:when>
343                   <xsl:when test="end/timezone/time != start/timezone/time">
344                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
345                   </xsl:when>
346                 </xsl:choose>
347                 <xsl:text> </xsl:text>
348                 --
349                 <strong><xsl:value-of select="start/timezone/id"/></strong>
350               </xsl:otherwise>
351             </xsl:choose>
352           </xsl:if>
353         </td>
354         <th class="icalIcon" rowspan="2">
355           <div id="eventIcons">
356             <!--<a href="{$privateCal}/event/addEventRef.do?subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="Add event to MyCalendar" target="myCalendar">
357               <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="Add event to MyCalendar"/>
358             add to my calendar</a>-->
359             <!--<xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
360             <a href="{$export}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;skinName=ical&amp;contentType=text/calendar&amp;contentName={$eventIcalName}" title="Download event as ical - for Outlook, PDAs, iCal, and other desktop calendars">
361               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
362              download</a>-->
363           </div>
364         </th>
365       </tr>
366       <tr>
367         <td class="fieldname">Where:</td>
368         <td class="fieldval">
369           <xsl:choose>
370             <xsl:when test="location/link=''">
371               <xsl:value-of select="location/address"/>
372             </xsl:when>
373             <xsl:otherwise>
374               <xsl:variable name="locationLink" select="location/link"/>
375               <a href="{$locationLink}">
376                 <xsl:value-of select="location/address"/>
377               </a>
378             </xsl:otherwise>
379           </xsl:choose>
380           <xsl:if test="location/subaddress!=''">
381             <br/><xsl:value-of select="location/subaddress"/>
382           </xsl:if>
383         </td>
384       </tr>
385       <tr>
386         <td class="fieldname">Description:</td>
387         <td colspan="2" class="fieldval description">
388           <xsl:call-template name="replace">
389             <xsl:with-param name="string" select="description"/>
390             <xsl:with-param name="pattern" select="'&#xA;'"/>
391             <xsl:with-param name="replacement"><br/></xsl:with-param>
392           </xsl:call-template>
393         </td>
394       </tr>
395       <xsl:if test="status !='' and status != 'CONFIRMED'">
396         <tr>
397           <td class="fieldname">Status:</td>
398           <td class="fieldval">
399             <xsl:value-of select="status"/>
400           </td>
401         </tr>
402       </xsl:if>
403       <xsl:if test="cost!=''">
404         <tr>
405           <td class="fieldname">Cost:</td>
406           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
407         </tr>
408       </xsl:if>
409       <xsl:if test="link != ''">
410         <tr>
411           <td class="fieldname">See:</td>
412           <td colspan="2" class="fieldval">
413             <xsl:variable name="link" select="link"/>
414             <a href="{$link}"><xsl:value-of select="link"/></a>
415           </td>
416         </tr>
417       </xsl:if>
418       <xsl:if test="contact/name!='none'">
419         <tr>
420           <td class="fieldname">Contact:</td>
421           <td colspan="2" class="fieldval">
422             <xsl:choose>
423               <xsl:when test="contact/link=''">
424                 <xsl:value-of select="contact/name"/>
425               </xsl:when>
426               <xsl:otherwise>
427                 <xsl:variable name="sponsorLink" select="contact/link"/>
428                 <a href="{$sponsorLink}">
429                   <xsl:value-of select="contact/name"/>
430                 </a>
431               </xsl:otherwise>
432             </xsl:choose>
433             <xsl:if test="contact/phone!=''">
434               <br /><xsl:value-of select="contact/phone"/>
435             </xsl:if>
436             <!-- If you want to display email addresses, uncomment the
437                  following 8 lines. -->
438             <!-- <xsl:if test="contact/email!=''">
439               <br />
440               <xsl:variable name="email" select="contact/email"/>
441               <xsl:variable name="subject" select="summary"/>
442               <a href="mailto:{$email}&amp;subject={$subject}">
443                 <xsl:value-of select="contact/email"/>
444               </a>
445             </xsl:if> -->
446           </td>
447         </tr>
448       </xsl:if>
449       <xsl:if test="calendar/path!=''">
450         <tr>
451           <td class="fieldname">Calendar:</td>
452           <td class="fieldval">
453             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
454             <a href="{$setSelection}&amp;calUrl={$calUrl}">
455               <xsl:value-of select="calendar/name"/>
456             </a>
457           </td>
458         </tr>
459       </xsl:if>
460       <xsl:if test="categories/category">
461         <tr>
462           <td class="fieldname">Categories:</td>
463           <td class="fieldval">
464             <xsl:for-each select="categories/category">
465               <xsl:value-of select="word"/><xsl:if test="position() != last()">, </xsl:if>
466             </xsl:for-each>
467           </td>
468         </tr>
469       </xsl:if>
470     </table>
471   </xsl:template>
472
473   <!--==== LIST VIEW  (for day, week, and month) ====-->
474   <xsl:template name="listView">
475     <xsl:choose>
476       <xsl:when test="not(/bedework/eventscalendar/year/month/week/day/event)">
477         <p>No events to display.</p>
478       </xsl:when>
479       <xsl:otherwise>
480         <xsl:for-each select="/bedework/eventscalendar/year/month/week/day[count(event)!=0]">
481           <xsl:if test="/bedework/periodname='Week' or /bedework/periodname='Month' or /bedework/periodname=''">
482             <h3>
483               <xsl:variable name="date" select="date"/>
484               <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$date}">
485                 <xsl:value-of select="name"/>, <xsl:value-of select="longdate"/>
486               </a>
487             </h3>
488           </xsl:if>
489           <table class="eventList" border="0" cellpadding="0" cellspacing="0">
490             <xsl:for-each select="event">
491               <xsl:variable name="id" select="id"/>
492               <xsl:variable name="subscriptionId" select="subscription/id"/>
493               <xsl:variable name="calPath" select="calendar/encodedPath"/>
494               <xsl:variable name="guid" select="guid"/>
495               <xsl:variable name="recurrenceId" select="recurrenceId"/>
496               <tr>
497                 <xsl:choose>
498                   <xsl:when test="position() mod 2 = 0">
499                     <xsl:attribute name="class">a</xsl:attribute>
500                   </xsl:when>
501                   <xsl:otherwise>
502                     <xsl:attribute name="class">b</xsl:attribute>
503                   </xsl:otherwise>
504                 </xsl:choose>
505                 <td class="date">
506                   <xsl:choose>
507                     <xsl:when test="start/allday = 'true' and
508                                     start/shortdate = end/shortdate">
509                       all day
510                     </xsl:when>
511                     <xsl:when test="start/shortdate = end/shortdate and
512                                     start/time = end/time">
513                       <xsl:value-of select="start/time"/>
514                     </xsl:when>
515                     <xsl:otherwise>
516                       <xsl:choose>
517                         <xsl:when test="start/allday = 'true' and
518                                         parent::day/shortdate = start/shortdate">
519                           today
520                         </xsl:when>
521                         <xsl:when test="parent::day/shortdate != start/shortdate">
522                           <span class="littleArrow">&#171;</span>
523                           <xsl:value-of select="start/month"/>/<xsl:value-of select="start/day"/>
524                         </xsl:when>
525                         <xsl:otherwise>
526                           <xsl:value-of select="start/time"/>
527                         </xsl:otherwise>
528                       </xsl:choose>
529                       -
530                       <xsl:choose>
531                         <xsl:when test="end/allday = 'true' and
532                                         parent::day/shortdate = end/shortdate">
533                           today
534                         </xsl:when>
535                         <xsl:when test="parent::day/shortdate != end/shortdate">
536                           <xsl:value-of select="end/month"/>/<xsl:value-of select="end/day"/>
537                           <span class="littleArrow">&#187;</span>
538                         </xsl:when>
539                         <xsl:otherwise>
540                           <xsl:value-of select="end/time"/>
541                         </xsl:otherwise>
542                       </xsl:choose>
543                     </xsl:otherwise>
544                   </xsl:choose>
545                 </td>
546                 <td class="description">
547                   <xsl:if test="status='CANCELLED'"><strong>CANCELLED: </strong></xsl:if>
548                   <xsl:choose>
549                     <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
550                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
551                         <strong>
552                           <xsl:value-of select="summary"/>:
553                         </strong>
554                         <xsl:value-of select="description"/>&#160;
555                         <em>
556                           <xsl:value-of select="location/address"/>
557                           <xsl:if test="location/subaddress != ''">
558                             , <xsl:value-of select="location/subaddress"/>
559                           </xsl:if>.&#160;
560                           <xsl:if test="cost!=''">
561                             <xsl:value-of select="cost"/>.&#160;
562                           </xsl:if>
563                           <xsl:if test="contact/name!='none'">
564                             Contact: <xsl:value-of select="contact/name"/>
565                           </xsl:if>
566                         </em>
567                         - <xsl:value-of select="calendar/name"/>
568                       </a>
569                       <xsl:if test="link != ''">
570                         <xsl:variable name="link" select="link"/>
571                         <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
572                       </xsl:if>
573                     </xsl:when>
574                     <xsl:otherwise>
575                       <a href="{$eventView}&amp;subid={$subscriptionId}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}">
576                         <xsl:value-of select="summary"/>
577                       </a>
578                     </xsl:otherwise>
579                   </xsl:choose>
580                 </td>
581               </tr>
582             </xsl:for-each>
583           </table>
584         </xsl:for-each>
585       </xsl:otherwise>
586     </xsl:choose>
587   </xsl:template>
588
589   <!--==== CALENDARS PAGE ====-->
590   <xsl:template match="calendars">
591     <p><b>All Calendars</b><br />
592     Select a calendar from the list below to see only that calendar's events.</p>
593     <ul class="calendarTree">
594       <xsl:apply-templates select="calendar/calendar" mode="calTree"/>
595     </ul>
596   </xsl:template>
597
598   <xsl:template match="calendar" mode="calTree">
599     <xsl:variable name="itemClass">
600       <xsl:choose>
601         <xsl:when test="calendarCollection='false'">folder</xsl:when>
602         <xsl:otherwise>calendar</xsl:otherwise>
603       </xsl:choose>
604     </xsl:variable>
605     <xsl:variable name="url" select="encodedPath"/>
606     <li class="{$itemClass}">
607       <a href="{$setSelection}&amp;calUrl={$url}" title="view calendar"><xsl:value-of select="name"/></a>
608       <xsl:if test="calendar">
609         <ul>
610           <xsl:apply-templates select="calendar" mode="calTree"/>
611         </ul>
612       </xsl:if>
613     </li>
614   </xsl:template>
615
616
617
618   <!--==== NAVIGATION  ====-->
619
620   <xsl:template name="dateSelect">
621     <form name="calForm" method="post" action="{$urlPrefix}/setView.do">
622       <table border="0" cellpadding="0" cellspacing="0">
623         <tr>
624           <xsl:if test="/bedework/periodname!='Year'">
625             <td>
626               <select name="viewStartDate.month">
627                 <xsl:for-each select="/bedework/monthvalues/val">
628                   <xsl:variable name="temp" select="."/>
629                   <xsl:variable name="pos" select="position()"/>
630                   <xsl:choose>
631                     <xsl:when test="/bedework/monthvalues[start=$temp]">
632                       <option value="{$temp}" selected="selected">
633                         <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
634                       </option>
635                     </xsl:when>
636                     <xsl:otherwise>
637                       <option value="{$temp}">
638                         <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
639                       </option>
640                     </xsl:otherwise>
641                   </xsl:choose>
642                 </xsl:for-each>
643               </select>
644             </td>
645             <xsl:if test="/bedework/periodname!='Month'">
646               <td>
647                 <select name="viewStartDate.day">
648                   <xsl:for-each select="/bedework/dayvalues/val">
649                     <xsl:variable name="temp" select="."/>
650                     <xsl:variable name="pos" select="position()"/>
651                     <xsl:choose>
652                       <xsl:when test="/bedework/dayvalues[start=$temp]">
653                         <option value="{$temp}" selected="selected">
654                           <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
655                         </option>
656                       </xsl:when>
657                       <xsl:otherwise>
658                         <option value="{$temp}">
659                           <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
660                         </option>
661                       </xsl:otherwise>
662                     </xsl:choose>
663                   </xsl:for-each>
664                 </select>
665               </td>
666             </xsl:if>
667           </xsl:if>
668           <td>
669             <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
670             <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
671           </td>
672           <td>
673             <input name="submit" type="submit" value="go"/>
674           </td>
675         </tr>
676       </table>
677     </form>
678   </xsl:template>
679
680   <!--==== UTILITY TEMPLATES ====-->
681
682   <!-- search and replace template taken from
683        http://www.biglist.com/lists/xsl-list/archives/200211/msg00337.html -->
684   <xsl:template name="replace">
685     <xsl:param name="string" select="''"/>
686     <xsl:param name="pattern" select="''"/>
687     <xsl:param name="replacement" select="''"/>
688     <xsl:choose>
689       <xsl:when test="$pattern != '' and $string != '' and contains($string, $pattern)">
690         <xsl:value-of select="substring-before($string, $pattern)"/>
691         <xsl:copy-of select="$replacement"/>
692         <xsl:call-template name="replace">
693           <xsl:with-param name="string" select="substring-after($string, $pattern)"/>
694           <xsl:with-param name="pattern" select="$pattern"/>
695           <xsl:with-param name="replacement" select="$replacement"/>
696         </xsl:call-template>
697       </xsl:when>
698       <xsl:otherwise>
699         <xsl:value-of select="$string"/>
700       </xsl:otherwise>
701     </xsl:choose>
702   </xsl:template>
703
704 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.