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

Revision 2837 (checked in by bleibson, 3 years ago)

o add Jasig licensing info to header of source files
o in some cases, remove RPI copyright info.

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 id="singleEvent">
39
40       <h1 class="{$statusClass} eventTitle">
41         <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text></xsl:if>
42         <xsl:value-of select="summary" />
43         <xsl:if test="summary = ''">
44           <xsl:copy-of select="$bwStr-SgEv-NoTitle" />
45         </xsl:if>
46       </h1>
47
48       <div class="eventWhen">
49         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-When"/><xsl:text> </xsl:text></span>
50         <xsl:value-of select="start/dayname" />,
51         <xsl:value-of select="start/longdate" />
52         <xsl:text> </xsl:text>
53         <xsl:if test="start/allday = 'false'">
54           <span class="time">
55             <xsl:value-of select="start/time" />
56           </span>
57         </xsl:if>
58         <xsl:if
59           test="(end/longdate != start/longdate) or
60                 ((end/longdate = start/longdate) and (end/time != start/time))">
61           -
62         </xsl:if>
63         <xsl:if test="end/longdate != start/longdate">
64           <xsl:value-of select="substring(end/dayname,1,3)" />
65           ,
66           <xsl:value-of select="end/longdate" />
67           <xsl:text> </xsl:text>
68         </xsl:if>
69         <xsl:choose>
70           <xsl:when test="start/allday = 'true'">
71             <xsl:text> </xsl:text>
72             <span class="time">
73               <em><xsl:copy-of select="$bwStr-SgEv-AllDay"/></em>
74             </span>
75           </xsl:when>
76           <xsl:when test="end/longdate != start/longdate">
77             <span class="time">
78               <xsl:value-of select="end/time" />
79             </span>
80           </xsl:when>
81           <xsl:when test="end/time != start/time">
82             <span class="time">
83               <xsl:value-of select="end/time" />
84             </span>
85           </xsl:when>
86         </xsl:choose>
87         <!-- if timezones are not local, or if floating add labels: -->
88         <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
89           <xsl:text> </xsl:text>
90           --
91           <strong>
92             <xsl:choose>
93               <xsl:when test="start/floating = 'true'">
94                 <xsl:copy-of select="$bwStr-SgEv-FloatingTime"/>
95               </xsl:when>
96               <xsl:otherwise>
97                 <xsl:copy-of select="$bwStr-SgEv-LocalTime"/>
98               </xsl:otherwise>
99             </xsl:choose>
100           </strong>
101           <br/>
102         </xsl:if>
103         <!-- display in timezone if not local or floating time) -->
104         <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
105           <xsl:choose>
106             <xsl:when test="start/timezone/id != end/timezone/id">
107               <!-- need to display both timezones if they differ from start to end -->
108               <div class="tzdates">
109                 <em><xsl:copy-of select="$bwStr-SgEv-Start"/><xsl:text> </xsl:text></em>
110                 <xsl:choose>
111                   <xsl:when test="start/timezone/islocal='true'">
112                     <xsl:value-of select="start/dayname"/>,
113                     <xsl:value-of select="start/longdate"/>
114                     <xsl:text> </xsl:text>
115                     <span class="time"><xsl:value-of select="start/time"/></span>
116                   </xsl:when>
117                   <xsl:otherwise>
118                     <xsl:value-of select="start/timezone/dayname"/>,
119                     <xsl:value-of select="start/timezone/longdate"/>
120                     <xsl:text> </xsl:text>
121                     <span class="time"><xsl:value-of select="start/timezone/time"/></span>
122                   </xsl:otherwise>
123                 </xsl:choose>
124                 --
125                 <strong><xsl:value-of select="start/timezone/id"/></strong>
126                 <br/>
127                 <em><xsl:copy-of select="$bwStr-SgEv-End"/><xsl:text> </xsl:text></em>
128                 <xsl:choose>
129                   <xsl:when test="end/timezone/islocal='true'">
130                     <xsl:value-of select="end/dayname"/>,
131                     <xsl:value-of select="end/longdate"/>
132                     <xsl:text> </xsl:text>
133                     <span class="time"><xsl:value-of select="end/time"/></span>
134                   </xsl:when>
135                   <xsl:otherwise>
136                     <xsl:value-of select="end/timezone/dayname"/>,
137                     <xsl:value-of select="end/timezone/longdate"/>
138                     <xsl:text> </xsl:text>
139                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
140                   </xsl:otherwise>
141                 </xsl:choose>
142                 --
143                 <strong><xsl:value-of select="end/timezone/id"/></strong>
144               </div>
145             </xsl:when>
146             <xsl:otherwise>
147               <!-- otherwise, timezones are the same: display as a single line  -->
148               <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
149               <xsl:if test="start/allday = 'false'">
150                 <span class="time"><xsl:value-of select="start/timezone/time"/></span>
151               </xsl:if>
152               <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
153                             ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
154               <xsl:if test="end/timezone/longdate != start/timezone/longdate">
155                 <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
156               </xsl:if>
157               <xsl:choose>
158                 <xsl:when test="start/allday = 'true'">
159                   <span class="time"><em> <xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
160                 </xsl:when>
161                 <xsl:when test="end/timezone/longdate != start/timezone/longdate">
162                   <span class="time"><xsl:value-of select="end/timezone/time"/></span>
163                 </xsl:when>
164                 <xsl:when test="end/timezone/time != start/timezone/time">
165                   <span class="time"><xsl:value-of select="end/timezone/time"/></span>
166                 </xsl:when>
167               </xsl:choose>
168               <xsl:text> </xsl:text>
169               --
170               <strong><xsl:value-of select="start/timezone/id"/></strong>
171             </xsl:otherwise>
172           </xsl:choose>
173         </xsl:if>
174       </div>
175
176       <div class="eventWhere">
177         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Where"/><xsl:text> </xsl:text></span>
178         <xsl:choose>
179           <xsl:when test="location/link=''">
180             <xsl:value-of select="location/address" />
181             <xsl:text> </xsl:text>
182             <xsl:if test="location/subaddress!=''">
183               <xsl:text> </xsl:text>
184               <xsl:value-of select="location/subaddress" />
185             </xsl:if>
186           </xsl:when>
187           <xsl:otherwise>
188             <a>
189               <xsl:attribute name="href"><xsl:value-of select="location/link"/></xsl:attribute>
190               <xsl:value-of select="location/address"/>
191               <xsl:if test="location/subaddress!=''">
192                 <xsl:text> </xsl:text>
193                 <xsl:value-of select="location/subaddress" />
194               </xsl:if>
195             </a>
196           </xsl:otherwise>
197         </xsl:choose>
198       </div>
199
200       <xsl:if test="cost!=''">
201         <div class="eventCost">
202           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Cost"/><xsl:text> </xsl:text></span>
203           <xsl:value-of select="cost" />
204         </div>
205       </xsl:if>
206
207       <xsl:if test="link != ''">
208         <div class="eventLink">
209           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-See"/><xsl:text> </xsl:text></span>
210           <a class="underline">
211             <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
212             <xsl:value-of select="link"/>
213           </a>
214         </div>
215       </xsl:if>
216
217       <!-- if you wish to include images, uncomment the following -->
218       <!--
219       <xsl:if test="xproperties/node()[name()='X-BEDEWORK-IMAGE']">
220         <img class="bwEventImage">
221           <xsl:attribute name="src"><xsl:value-of select="xproperties/node()[name()='X-BEDEWORK-IMAGE']/values/text" /></xsl:attribute>
222         </img>
223       </xsl:if>
224       -->
225
226       <div class="eventDescription">
227         <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Description"/><xsl:text> </xsl:text></span>
228         <!-- to preserve line breaks in descriptions, set <br/> as the replacement string
229              in this replace template call: -->
230         <xsl:call-template name="replace">
231           <xsl:with-param name="string" select="description" />
232           <xsl:with-param name="pattern" select="'&#xA;'" />
233           <xsl:with-param name="replacement"></xsl:with-param>
234         </xsl:call-template>
235       </div>
236
237       <!--   <div class="eventListingCal">
238         <xsl:if test="calendar/path!=''">
239         Calendar:
240         <xsl:variable name="calUrl" select="calendar/encodedPath"/>
241         <a href="{$setSelection}&amp;calUrl={$calUrl}">
242         <xsl:value-of select="calendar/name"/>
243         </a>
244         </xsl:if>
245         </div>-->
246
247       <xsl:if test="status !='' and status != 'CONFIRMED'">
248         <div class="eventStatus">
249           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-STATUS"/><xsl:text> </xsl:text></span>
250           <xsl:value-of select="status" />
251         </div>
252       </xsl:if>
253
254       <xsl:if test="contact/name!='None'">
255         <div class="eventContact">
256           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Contact"/><xsl:text> </xsl:text></span>
257           <xsl:choose>
258             <xsl:when test="contact/link=''">
259               <xsl:value-of select="contact/name" />
260             </xsl:when>
261             <xsl:otherwise>
262               <a>
263                 <xsl:attribute name="href"><xsl:value-of select="contact/link" /></xsl:attribute>
264                 <xsl:value-of select="contact/name" />
265               </a>
266             </xsl:otherwise>
267           </xsl:choose>
268           <xsl:if test="contact/phone!=''">
269             <xsl:text> </xsl:text>
270             <xsl:value-of select="contact/phone" />
271           </xsl:if>
272           <xsl:if test="contact/link!=''">
273             <xsl:text> </xsl:text>
274             <xsl:variable name="contactLink"
275               select="contact/link" />
276             <a href="{$contactLink}">
277               <xsl:value-of select="$contactLink" />
278             </a>
279           </xsl:if>
280         </div>
281       </xsl:if>
282
283       <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
284         <div class="eventAliases">
285           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-TopicalArea"/><xsl:text> </xsl:text></span>
286           <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
287             <xsl:variable name="calUrl" select="values/text"/>
288             <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})">
289               <xsl:call-template name="substring-afterLastInstanceOf">
290                 <xsl:with-param name="string" select="values/text"/>
291                 <xsl:with-param name="char">/</xsl:with-param>
292               </xsl:call-template>
293             </a><xsl:if test="position()!=last()">, </xsl:if>
294           </xsl:for-each>
295         </div>
296       </xsl:if>
297
298       <xsl:if test="categories[1]/category">
299         <div class="eventCategories">
300           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Categories"/><xsl:text> </xsl:text></span>
301           <xsl:for-each select="categories/category">
302             <xsl:value-of select="value"/><xsl:if test="position() != last()">, </xsl:if>
303           </xsl:for-each>
304         </div>
305       </xsl:if>
306
307       <xsl:if test="comments/comment">
308         <div class="eventComments">
309           <span class="infoTitle"><xsl:copy-of select="$bwStr-SgEv-Comments"/><xsl:text> </xsl:text></span>
310           <xsl:for-each select="comments/comment">
311             <p>
312               <xsl:value-of select="value" />
313             </p>
314           </xsl:for-each>
315         </div>
316       </xsl:if>
317     </div>
318
319     <div id="navlink-back" class="navlink backlink" onclick="gotourl(this,'javascript:history.back()')">
320       <xsl:copy-of select="$bwStr-HdBr-Back"/>
321     </div>
322
323   </xsl:template>
324
325 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.