root/trunk/deployment/webpublic/webapp/resources/demoskins/MainCampus/themes/bedeworkTheme/event.xsl

Revision 3575 (checked in by johnsa, 11 months ago)

public client: update settings for event registration features (iframe size, new registration service URL).

Line 
1 <!--
2     Licensed to Jasig under one or more contributor license
3     agreements. See the NOTICE file distributed with this work
4     for additional information regarding copyright ownership.
5     Jasig licenses this file to you under the Apache License,
6     Version 2.0 (the "License"); you may not use this file
7     except in compliance with the License. You may obtain a
8     copy of the License at:
9    
10     http://www.apache.org/licenses/LICENSE-2.0
11    
12     Unless required by applicable law or agreed to in writing,
13     software distributed under the License is distributed on
14     an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15     KIND, either express or implied. See the License for the
16     specific language governing permissions and limitations
17     under the License.
18 -->
19 <xsl:stylesheet
20   version="1.0"
21   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
22   xmlns="http://www.w3.org/1999/xhtml">
23
24   <!--==== SINGLE EVENT ====-->
25   <xsl:template match="event" mode="singleEvent">
26     <xsl:variable name="calPath" select="calendar/encodedPath"/>
27     <xsl:variable name="guid" select="guid"/>
28     <xsl:variable name="guidEsc" select="translate(guid, '.', '_')" />
29     <xsl:variable name="recurrenceId" select="recurrenceId"/>
30     <xsl:variable name="statusClass">
31       <xsl:choose>
32         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
33         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
34         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
35       </xsl:choose>
36     </xsl:variable>
37
38     <div class="secondaryColHeader">
39       <a class="linkBack" href="{$setup}"><xsl:copy-of select="$bwStr-HdBr-BackLink"/></a>
40       <h3>
41         <xsl:copy-of select="$bwStr-HdBr-EventInformation"/>
42       </h3>
43     </div>
44
45     <div class="singleEvent">
46
47       <div id="eventIcons">
48         <xsl:variable name="gStartdate" select="start/utcdate" />
49         <xsl:variable name="gLocation" select="location/address" />
50         <xsl:variable name="gEnddate" select="end/utcdate" />
51         <xsl:variable name="gText" select="summary" />
52         <xsl:variable name="gDetails" select="summary" />
53        
54         <xsl:if test="$eventIconShareThis = 'true'">
55           <a class="eventIcons" href="https://wiki.jasig.org/pages/viewpage.action?pageId=50860497">
56             <img title="{$bwStr-SgEv-ShareThis}" src="{$resourcesRoot}/images/share-icon-16x16.png" alt="{$bwStr-SgEv-ShareThis}"/>
57           </a>
58         </xsl:if>
59         <xsl:if test="$eventIconGoogleCal = 'true'">
60           <a class="eventIcons" href="http://www.google.com/calendar/event?action=TEMPLATE&amp;dates={$gStartdate}/{$gEnddate}&amp;text={$gText}&amp;details={$gDetails}&amp;location={$gLocation}" title="{$bwStr-SgEv-AddToGoogleCalendar}">
61             <img title="{$bwStr-SgEv-AddToGoogleCalendar}" src="{$resourcesRoot}/images/gcal.gif" alt="{$bwStr-SgEv-AddToGoogleCalendar}" />
62           </a>
63         </xsl:if>
64         <xsl:if test="$eventIconFacebook = 'true'">
65           <xsl:choose>
66             <xsl:when test="string-length($recurrenceId)">
67               <a class="eventIcons" href="http://www.facebook.com/share.php?u={$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;t={$gText}" title="{$bwStr-SgEv-AddToFacebook}">
68                 <img title="{$bwStr-SgEv-AddToFacebook}" src="{$resourcesRoot}/images/Facebook_Badge.gif" alt="{$bwStr-SgEv-AddToFacebook}" />
69               </a>
70             </xsl:when>
71             <xsl:otherwise>
72               <a class="eventIcons" href="http://www.facebook.com/share.php?u={$eventView}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;t={$gText}" title="{$bwStr-SgEv-AddToFacebook}">
73                 <img title="{$bwStr-SgEv-AddToFacebook}" src="{$resourcesRoot}/images/Facebook_Badge.gif" alt="{$bwStr-SgEv-AddToFacebook}" />
74               </a>
75             </xsl:otherwise>
76           </xsl:choose>
77         </xsl:if>
78         <xsl:if test="$eventIconAddToMyCal = 'true'">
79           <a class="eventIcons" href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="{$bwStr-SgEv-AddEventToMyCalendar}" target="myCalendar">
80             <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" alt="{$bwStr-SgEv-AddEventToMyCalendar}"/>
81           </a>
82         </xsl:if>
83         <xsl:if test="$eventIconDownloadIcs = 'true'">
84           <xsl:variable name="eventIcalName" select="concat($guid,'.ics')" />
85           <a class="eventIcons" href="{$export}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="{$bwStr-SgEv-DownloadEvent}">
86             <img src="{$resourcesRoot}/images/std-ical_icon.gif" alt="{$bwStr-SgEv-Download}"/>
87           </a>
88         </xsl:if>
89       </div>
90
91       <h2 class="{$statusClass} eventTitle">
92         <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text></xsl:if>
93         <xsl:value-of select="summary" />
94         <xsl:if test="summary = ''">
95           <xsl:copy-of select="$bwStr-SgEv-NoTitle" />
96         </xsl:if>
97       </h2>
98      
99       <xsl:if test="$eventRegEnabled and xproperties/node()[name()='X-BEDEWORK-REGISTRATION-START']">
100         <div id="bwRegistrationBox">
101           <xsl:variable name="eventName"><xsl:value-of select="name"/></xsl:variable>
102           <iframe src="{$eventReg}?href={$calPath}%2F{$eventName}" width="300" height="175">
103                   <p>
104                                 <xsl:copy-of select="$bwStr-Error-IframeUnsupported"/>
105                               </p>
106                       </iframe>
107         </div>
108       </xsl:if>
109
110       <div class="eventWhen">
111         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-When"/><xsl:text> </xsl:text></span>
112         <xsl:value-of select="start/dayname" />,
113         <xsl:value-of select="start/longdate" />
114         <xsl:text> </xsl:text>
115         <xsl:if test="start/allday = 'false'">
116           <span class="time">
117             <xsl:value-of select="start/time" />
118           </span>
119         </xsl:if>
120         <xsl:if
121           test="(end/longdate != start/longdate) or
122                 ((end/longdate = start/longdate) and (end/time != start/time))">
123           -
124         </xsl:if>
125         <xsl:if test="end/longdate != start/longdate">
126           <xsl:value-of select="substring(end/dayname,1,3)" />
127           ,
128           <xsl:value-of select="end/longdate" />
129           <xsl:text> </xsl:text>
130         </xsl:if>
131         <xsl:choose>
132           <xsl:when test="start/allday = 'true'">
133             <span class="time">
134               <em><xsl:copy-of select="$bwStr-SgEv-AllDay"/></em>
135             </span>
136           </xsl:when>
137           <xsl:when test="end/longdate != start/longdate">
138             <span class="time">
139               <xsl:value-of select="end/time" />
140             </span>
141           </xsl:when>
142           <xsl:when test="end/time != start/time">
143             <span class="time">
144               <xsl:value-of select="end/time" />
145             </span>
146           </xsl:when>
147         </xsl:choose>
148         <!-- if timezones are not local, or if floating add labels: -->
149         <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
150           <xsl:text> </xsl:text>
151           --
152           <strong>
153             <xsl:choose>
154               <xsl:when test="start/floating = 'true'">
155                 <xsl:copy-of select="$bwStr-SgEv-FloatingTime"/>
156               </xsl:when>
157               <xsl:otherwise>
158                 <xsl:copy-of select="$bwStr-SgEv-LocalTime"/>
159               </xsl:otherwise>
160             </xsl:choose>
161           </strong>
162           <br/>
163         </xsl:if>
164         <!-- display in timezone if not local or floating time) -->
165         <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
166           <xsl:choose>
167             <xsl:when test="start/timezone/id != end/timezone/id">
168               <!-- need to display both timezones if they differ from start to end -->
169               <div class="tzdates">
170                 <em><xsl:copy-of select="$bwStr-SgEv-Start"/><xsl:text> </xsl:text></em>
171                 <xsl:choose>
172                   <xsl:when test="start/timezone/islocal='true'">
173                     <xsl:value-of select="start/dayname"/>,
174                     <xsl:value-of select="start/longdate"/>
175                     <xsl:text> </xsl:text>
176                     <span class="time"><xsl:value-of select="start/time"/></span>
177                   </xsl:when>
178                   <xsl:otherwise>
179                     <xsl:value-of select="start/timezone/dayname"/>,
180                     <xsl:value-of select="start/timezone/longdate"/>
181                     <xsl:text> </xsl:text>
182                     <span class="time"><xsl:value-of select="start/timezone/time"/></span>
183                   </xsl:otherwise>
184                 </xsl:choose>
185                 --
186                 <strong><xsl:value-of select="start/timezone/id"/></strong>
187                 <br/>
188                 <em><xsl:copy-of select="$bwStr-SgEv-End"/><xsl:text> </xsl:text></em>
189                 <xsl:choose>
190                   <xsl:when test="end/timezone/islocal='true'">
191                     <xsl:value-of select="end/dayname"/>,
192                     <xsl:value-of select="end/longdate"/>
193                     <xsl:text> </xsl:text>
194                     <span class="time"><xsl:value-of select="end/time"/></span>
195                   </xsl:when>
196                   <xsl:otherwise>
197                     <xsl:value-of select="end/timezone/dayname"/>,
198                     <xsl:value-of select="end/timezone/longdate"/>
199                     <xsl:text> </xsl:text>
200                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
201                   </xsl:otherwise>
202                 </xsl:choose>
203                 --
204                 <strong><xsl:value-of select="end/timezone/id"/></strong>
205               </div>
206             </xsl:when>
207             <xsl:otherwise>
208               <!-- otherwise, timezones are the same: display as a single line  -->
209               <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
210               <xsl:if test="start/allday = 'false'">
211                 <span class="time"><xsl:value-of select="start/timezone/time"/></span>
212               </xsl:if>
213               <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
214                             ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
215               <xsl:if test="end/timezone/longdate != start/timezone/longdate">
216                 <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
217               </xsl:if>
218               <xsl:choose>
219                 <xsl:when test="start/allday = 'true'">
220                   <span class="time"><em> <xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
221                 </xsl:when>
222                 <xsl:when test="end/timezone/longdate != start/timezone/longdate">
223                   <span class="time"><xsl:value-of select="end/timezone/time"/></span>
224                 </xsl:when>
225                 <xsl:when test="end/timezone/time != start/timezone/time">
226                   <span class="time"><xsl:value-of select="end/timezone/time"/></span>
227                 </xsl:when>
228               </xsl:choose>
229               <xsl:text> </xsl:text>
230               --
231               <strong><xsl:value-of select="start/timezone/id"/></strong>
232             </xsl:otherwise>
233           </xsl:choose>
234         </xsl:if>
235       </div>
236
237       <div class="eventWhere">
238         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Where"/><xsl:text> </xsl:text></span>
239         <xsl:choose>
240           <xsl:when test="location/link=''">
241             <xsl:value-of select="location/address" />
242             <xsl:text> </xsl:text>
243             <xsl:if test="location/subaddress!=''">
244               <xsl:text> </xsl:text>
245               <xsl:value-of select="location/subaddress" />
246             </xsl:if>
247           </xsl:when>
248           <xsl:otherwise>
249             <a>
250               <xsl:attribute name="href"><xsl:value-of select="location/link"/></xsl:attribute>
251               <xsl:value-of select="location/address"/>
252               <xsl:if test="location/subaddress!=''">
253                 <xsl:text> </xsl:text>
254                 <xsl:value-of select="location/subaddress" />
255               </xsl:if>
256             </a>
257           </xsl:otherwise>
258         </xsl:choose>
259       </div>
260
261       <xsl:if test="cost!=''">
262         <div class="eventCost">
263           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Cost"/><xsl:text> </xsl:text></span>
264           <xsl:value-of select="cost" />
265         </div>
266       </xsl:if>
267
268       <xsl:if test="link != ''">
269         <div class="eventLink">
270           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-See"/><xsl:text> </xsl:text></span>
271             <a>
272               <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
273               <xsl:value-of select="link"/>
274             </a>
275         </div>
276       </xsl:if>
277
278       <xsl:if test="xproperties/node()[name()='X-BEDEWORK-IMAGE']">
279         <xsl:variable name="imgPrefix">
280           <xsl:choose>
281             <xsl:when test="starts-with(xproperties/X-BEDEWORK-IMAGE/values/text,'http')"></xsl:when>
282             <xsl:otherwise><xsl:value-of select="$bwEventImagePrefix"/></xsl:otherwise>
283           </xsl:choose>
284         </xsl:variable>
285         <img class="bwEventImage">
286           <xsl:attribute name="src"><xsl:value-of select="$imgPrefix"/><xsl:value-of select="xproperties/node()[name()='X-BEDEWORK-IMAGE']/values/text" /></xsl:attribute>
287         </img>
288       </xsl:if>
289
290       <div class="eventDescription">
291         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Description"/><xsl:text> </xsl:text></span>
292         <!-- to preserve line breaks in descriptions, set <br/> as the replacement string
293              in this replace template call: -->
294         <xsl:call-template name="replace">
295           <xsl:with-param name="string" select="description" />
296           <xsl:with-param name="pattern" select="'&#xA;'" />
297           <xsl:with-param name="replacement"><br/></xsl:with-param>
298         </xsl:call-template>
299       </div>
300
301       <!--   <div class="eventListingCal">
302         <xsl:if test="calendar/path!=''">
303         Calendar:
304         <xsl:variable name="calUrl" select="calendar/encodedPath"/>
305         <a href="{$setSelection}&amp;calUrl={$calUrl}">
306         <xsl:value-of select="calendar/name"/>
307         </a>
308         </xsl:if>
309         </div>-->
310
311       <xsl:if test="status !='' and status != 'CONFIRMED'">
312         <div class="eventStatus">
313           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-STATUS"/><xsl:text> </xsl:text></span>
314           <xsl:value-of select="status" />
315         </div>
316       </xsl:if>
317
318       <xsl:if test="contact/name!='None'">
319         <div class="eventContact">
320           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Contact"/><xsl:text> </xsl:text></span>
321           <xsl:choose>
322             <xsl:when test="contact/link=''">
323               <xsl:value-of select="contact/name" />
324             </xsl:when>
325             <xsl:otherwise>
326               <a>
327                 <xsl:attribute name="href"><xsl:value-of select="contact/link" /></xsl:attribute>
328                 <xsl:value-of select="contact/name" />
329               </a>
330             </xsl:otherwise>
331           </xsl:choose>
332           <xsl:if test="contact/phone!=''">
333             <xsl:text> </xsl:text>
334             <xsl:value-of select="contact/phone" />
335           </xsl:if>
336           <xsl:if test="contact/link!=''">
337             <xsl:text> </xsl:text>
338             <xsl:variable name="contactLink"
339               select="contact/link" />
340             <a href="{$contactLink}">
341               <xsl:value-of select="$contactLink" />
342             </a>
343           </xsl:if>
344         </div>
345       </xsl:if>
346
347       <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
348         <div class="eventAliases">
349           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-TopicalArea"/><xsl:text> </xsl:text></span>
350           <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
351             <xsl:variable name="calUrl" select="values/text"/>
352             <xsl:choose>
353               <xsl:when test="parameters/X-BEDEWORK-PARAM-DISPLAYNAME">
354                 <xsl:variable name="displayName" select="parameters/X-BEDEWORK-PARAM-DISPLAYNAME"/>
355                 <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$displayName})">
356                   <xsl:value-of select="parameters/X-BEDEWORK-PARAM-DISPLAYNAME"/>
357                 </a>
358               </xsl:when>
359               <xsl:otherwise>
360                 <!-- this is required for backwards compatibility with old events (possibly with imported events;
361                      here we use the alias path value for display (as of 3.7 we use the display name (summary)) -->
362                             <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})">
363                               <xsl:call-template name="substring-afterLastInstanceOf">
364                                 <xsl:with-param name="string" select="values/text"/>
365                                 <xsl:with-param name="char">/</xsl:with-param>
366                               </xsl:call-template>
367                             </a>
368                           </xsl:otherwise>
369             </xsl:choose>
370             <xsl:if test="position()!=last()">, </xsl:if>
371           </xsl:for-each>
372         </div>
373       </xsl:if>
374
375       <xsl:if test="categories[1]/category">
376         <div class="eventCategories">
377           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Categories"/><xsl:text> </xsl:text></span>
378           <xsl:for-each select="categories/category">
379             <xsl:value-of select="value"/><xsl:if test="position() != last()">, </xsl:if>
380           </xsl:for-each>
381         </div>
382       </xsl:if>
383
384       <xsl:if test="comments/comment">
385         <div class="eventComments">
386           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Comments"/><xsl:text> </xsl:text></span>
387           <xsl:for-each select="comments/comment">
388             <p>
389               <xsl:value-of select="value" />
390             </p>
391           </xsl:for-each>
392         </div>
393       </xsl:if>
394     </div>
395
396   </xsl:template>
397
398 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.