root/releases/bedework-3.6/deployment/webpublic/webapp/resources/demoskins/MainCampus/themes/bwclassicTheme/event.xsl

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

fixed - 549: javascript internationalization in public client
http://www.bedework.org/trac/bedework/ticket/549

Line 
1 <xsl:stylesheet
2   version="1.0"
3   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4   xmlns="http://www.w3.org/1999/xhtml">
5
6   <!--==== SINGLE EVENT ====-->
7   <xsl:template match="event">
8     <xsl:variable name="calPath" select="calendar/encodedPath"/>
9     <xsl:variable name="guid" select="guid"/>
10     <xsl:variable name="recurrenceId" select="recurrenceId"/>
11     <xsl:variable name="statusClass">
12       <xsl:choose>
13         <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
14         <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
15         <xsl:otherwise>bwStatusConfirmed</xsl:otherwise>
16       </xsl:choose>
17     </xsl:variable>
18     <h2 class="{$statusClass}">
19       <a id="linkToEvent" href="javascript:showLink('{$urlPrefix}/event/eventView.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}','{$bwStr-SgEv-EventLink}')" title="{$bwStr-SgEv-GenerateLinkToThisEvent}">
20         <xsl:copy-of select="$bwStr-SgEv-LinkToThisEvent"/>
21       </a>
22       <xsl:if test="status='CANCELLED'"><xsl:copy-of select="$bwStr-SgEv-Canceled"/><xsl:text> </xsl:text></xsl:if>
23       <xsl:choose>
24         <xsl:when test="link != ''">
25           <a>
26             <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
27             <xsl:value-of select="summary"/>
28           </a>
29         </xsl:when>
30         <xsl:otherwise>
31           <xsl:value-of select="summary"/>
32         </xsl:otherwise>
33       </xsl:choose>
34     </h2>
35     <table id="eventTable" cellpadding="0" cellspacing="0">
36       <tr>
37         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-When"/></td>
38         <td class="fieldval">
39           <!-- always display local time -->
40           <xsl:value-of select="start/dayname"/>, <xsl:value-of select="start/longdate"/><xsl:text> </xsl:text>
41           <xsl:if test="start/allday = 'false'">
42             <span class="time"><xsl:value-of select="start/time"/></span>
43           </xsl:if>
44           <xsl:if test="(end/longdate != start/longdate) or
45                         ((end/longdate = start/longdate) and (end/time != start/time))"> - </xsl:if>
46           <xsl:if test="end/longdate != start/longdate">
47             <xsl:value-of select="substring(end/dayname,1,3)"/>, <xsl:value-of select="end/longdate"/><xsl:text> </xsl:text>
48           </xsl:if>
49           <xsl:choose>
50             <xsl:when test="start/allday = 'true'">
51               <span class="time"><em><xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
52             </xsl:when>
53             <xsl:when test="end/longdate != start/longdate">
54               <span class="time"><xsl:value-of select="end/time"/></span>
55             </xsl:when>
56             <xsl:when test="end/time != start/time">
57               <span class="time"><xsl:value-of select="end/time"/></span>
58             </xsl:when>
59           </xsl:choose>
60           <!-- if timezones are not local, or if floating add labels: -->
61           <xsl:if test="start/timezone/islocal = 'false' or end/timezone/islocal = 'false'">
62             <xsl:text> </xsl:text>
63             --
64             <strong>
65               <xsl:choose>
66                 <xsl:when test="start/floating = 'true'">
67                   <xsl:copy-of select="$bwStr-SgEv-FloatingTime"/>
68                 </xsl:when>
69                 <xsl:otherwise>
70                   <xsl:copy-of select="$bwStr-SgEv-LocalTime"/>
71                 </xsl:otherwise>
72               </xsl:choose>
73             </strong>
74             <br/>
75           </xsl:if>
76           <!-- display in timezone if not local or floating time) -->
77           <xsl:if test="(start/timezone/islocal = 'false' or end/timezone/islocal = 'false') and start/floating = 'false'">
78             <xsl:choose>
79               <xsl:when test="start/timezone/id != end/timezone/id">
80                 <!-- need to display both timezones if they differ from start to end -->
81                 <table border="0" cellspacing="0" id="tztable">
82                   <tr>
83                     <td>
84                       <strong><xsl:copy-of select="$bwStr-SgEv-Start"/></strong>
85                     </td>
86                     <td>
87                       <xsl:choose>
88                         <xsl:when test="start/timezone/islocal='true'">
89                           <xsl:value-of select="start/dayname"/>,
90                           <xsl:value-of select="start/longdate"/>
91                           <xsl:text> </xsl:text>
92                           <span class="time"><xsl:value-of select="start/time"/></span>
93                         </xsl:when>
94                         <xsl:otherwise>
95                           <xsl:value-of select="start/timezone/dayname"/>,
96                           <xsl:value-of select="start/timezone/longdate"/>
97                           <xsl:text> </xsl:text>
98                           <span class="time"><xsl:value-of select="start/timezone/time"/></span>
99                         </xsl:otherwise>
100                       </xsl:choose>
101                     </td>
102                     <td>
103                       --
104                       <strong><xsl:value-of select="start/timezone/id"/></strong>
105                     </td>
106                   </tr>
107                   <tr>
108                     <td>
109                       <strong><xsl:copy-of select="$bwStr-SgEv-End"/></strong>
110                     </td>
111                     <td>
112                       <xsl:choose>
113                         <xsl:when test="end/timezone/islocal='true'">
114                           <xsl:value-of select="end/dayname"/>,
115                           <xsl:value-of select="end/longdate"/>
116                           <xsl:text> </xsl:text>
117                           <span class="time"><xsl:value-of select="end/time"/></span>
118                         </xsl:when>
119                         <xsl:otherwise>
120                           <xsl:value-of select="end/timezone/dayname"/>,
121                           <xsl:value-of select="end/timezone/longdate"/>
122                           <xsl:text> </xsl:text>
123                           <span class="time"><xsl:value-of select="end/timezone/time"/></span>
124                         </xsl:otherwise>
125                       </xsl:choose>
126                     </td>
127                     <td>
128                       --
129                       <strong><xsl:value-of select="end/timezone/id"/></strong>
130                     </td>
131                   </tr>
132                 </table>
133               </xsl:when>
134               <xsl:otherwise>
135                 <!-- otherwise, timezones are the same: display as a single line  -->
136                 <xsl:value-of select="start/timezone/dayname"/>, <xsl:value-of select="start/timezone/longdate"/><xsl:text> </xsl:text>
137                 <xsl:if test="start/allday = 'false'">
138                   <span class="time"><xsl:value-of select="start/timezone/time"/></span>
139                 </xsl:if>
140                 <xsl:if test="(end/timezone/longdate != start/timezone/longdate) or
141                               ((end/timezone/longdate = start/timezone/longdate) and (end/timezone/time != start/timezone/time))"> - </xsl:if>
142                 <xsl:if test="end/timezone/longdate != start/timezone/longdate">
143                   <xsl:value-of select="substring(end/timezone/dayname,1,3)"/>, <xsl:value-of select="end/timezone/longdate"/><xsl:text> </xsl:text>
144                 </xsl:if>
145                 <xsl:choose>
146                   <xsl:when test="start/allday = 'true'">
147                     <span class="time"><em> <xsl:copy-of select="$bwStr-SgEv-AllDay"/></em></span>
148                   </xsl:when>
149                   <xsl:when test="end/timezone/longdate != start/timezone/longdate">
150                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
151                   </xsl:when>
152                   <xsl:when test="end/timezone/time != start/timezone/time">
153                     <span class="time"><xsl:value-of select="end/timezone/time"/></span>
154                   </xsl:when>
155                 </xsl:choose>
156                 <xsl:text> </xsl:text>
157                 --
158                 <strong><xsl:value-of select="start/timezone/id"/></strong>
159               </xsl:otherwise>
160             </xsl:choose>
161           </xsl:if>
162         </td>
163         <th class="icalIcon" rowspan="2">
164           <div id="eventIcons">
165             <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="{$bwStr-SgEv-AddEventToMyCalendar}" target="myCalendar">
166               <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon.gif" width="20" height="26" border="0" alt="{$bwStr-SgEv-AddEventToMyCalendar}"/>
167               <xsl:copy-of select="$bwStr-SgEv-AddToMyCalendar"/>
168             </a>
169             <xsl:variable name="eventIcalName" select="concat($guid,'.ics')"/>
170             <a href="{$export}&amp;calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}&amp;nocache=no&amp;contentName={$eventIcalName}" title="{$bwStr-SgEv-DownloadEvent}">
171               <img src="{$resourcesRoot}/images/std-ical_icon.gif" width="20" height="26" border="0" alt="Download this event"/>
172              <xsl:copy-of select="$bwStr-SgEv-Download"/></a>
173           </div>
174         </th>
175       </tr>
176       <tr>
177         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Where"/></td>
178         <td class="fieldval">
179           <xsl:choose>
180             <xsl:when test="location/link=''">
181               <xsl:value-of select="location/address"/>
182             </xsl:when>
183             <xsl:otherwise>
184               <a>
185                 <xsl:attribute name="href"><xsl:value-of select="location/link"/></xsl:attribute>
186                 <xsl:value-of select="location/address"/>
187               </a>
188             </xsl:otherwise>
189           </xsl:choose>
190           <xsl:if test="location/subaddress!=''">
191             <br/><xsl:value-of select="location/subaddress"/>
192           </xsl:if>
193         </td>
194       </tr>
195       <tr>
196         <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Description"/></td>
197         <td colspan="2" class="fieldval description">
198           <xsl:if test="xproperties/node()[name()='X-BEDEWORK-IMAGE']">
199             <img class="bwEventImage">
200               <xsl:attribute name="src"><xsl:value-of select="xproperties/node()[name()='X-BEDEWORK-IMAGE']/values/text" /></xsl:attribute>
201             </img>
202           </xsl:if>
203           <xsl:call-template name="replace">
204             <xsl:with-param name="string" select="description"/>
205             <xsl:with-param name="pattern" select="'&#xA;'"/>
206             <xsl:with-param name="replacement"><br/></xsl:with-param>
207           </xsl:call-template>
208         </td>
209       </tr>
210       <xsl:if test="status !='' and status != 'CONFIRMED'">
211         <tr>
212           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-STATUS"/></td>
213           <td class="fieldval">
214             <xsl:value-of select="status"/>
215           </td>
216         </tr>
217       </xsl:if>
218       <xsl:if test="cost!=''">
219         <tr>
220           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Cost"/></td>
221           <td colspan="2" class="fieldval"><xsl:value-of select="cost"/></td>
222         </tr>
223       </xsl:if>
224       <xsl:if test="link != ''">
225         <tr>
226           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-See"/></td>
227           <td colspan="2" class="fieldval">
228             <a>
229               <xsl:attribute name="href"><xsl:value-of select="link"/></xsl:attribute>
230               <xsl:value-of select="link"/>
231             </a>
232           </td>
233         </tr>
234       </xsl:if>
235       <xsl:if test="contact/name!='none'">
236         <tr>
237           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Contact"/></td>
238           <td colspan="2" class="fieldval">
239             <xsl:choose>
240               <xsl:when test="contact/link=''">
241                 <xsl:value-of select="contact/name"/>
242               </xsl:when>
243               <xsl:otherwise>
244                 <a>
245                   <xsl:attribute name="href"><xsl:value-of select="contact/link" /></xsl:attribute>
246                   <xsl:value-of select="contact/name" />
247                 </a>
248               </xsl:otherwise>
249             </xsl:choose>
250             <xsl:if test="contact/phone!=''">
251               <br /><xsl:value-of select="contact/phone"/>
252             </xsl:if>
253             <!-- If you want to display email addresses, uncomment the
254                  following 8 lines. -->
255             <!-- <xsl:if test="contact/email!=''">
256               <br />
257               <xsl:variable name="email" select="contact/email"/>
258               <xsl:variable name="subject" select="summary"/>
259               <a href="mailto:{$email}&amp;subject={$subject}">
260                 <xsl:value-of select="contact/email"/>
261               </a>
262             </xsl:if> -->
263           </td>
264         </tr>
265       </xsl:if>
266       <xsl:if test="comments/comment">
267         <tr>
268           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Comments"/></td>
269           <td class="fieldval comments">
270             <xsl:for-each select="comments/comment">
271               <p><xsl:value-of select="value"/></p>
272             </xsl:for-each>
273           </td>
274         </tr>
275       </xsl:if>
276       <xsl:if test="xproperties/X-BEDEWORK-ALIAS">
277         <tr>
278           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-TopicalArea"/></td>
279           <td class="fieldval">
280             <xsl:for-each select="xproperties/X-BEDEWORK-ALIAS">
281               <xsl:variable name="calUrl" select="values/text"/>
282               <a href="{$setSelection}&amp;virtualPath={$calUrl}&amp;setappvar=curCollection({$calUrl})">
283                 <xsl:call-template name="substring-afterLastInstanceOf">
284                   <xsl:with-param name="string" select="values/text"/>
285                   <xsl:with-param name="char">/</xsl:with-param>
286                 </xsl:call-template>
287               </a><xsl:if test="position()!=last()">, </xsl:if>
288             </xsl:for-each>
289           </td>
290         </tr>
291       </xsl:if>
292       <xsl:if test="categories/category">
293         <tr>
294           <td class="fieldname"><xsl:copy-of select="$bwStr-SgEv-Categories"/></td>
295           <td class="fieldval">
296             <xsl:for-each select="categories/category">
297               <xsl:value-of select="value"/><xsl:if test="position() != last()">, </xsl:if>
298             </xsl:for-each>
299           </td>
300         </tr>
301       </xsl:if>
302       <!--  xsl:if test="calendar/path!=''">
303         <tr>
304           <td class="fieldname">Calendar:</td>
305           <td class="fieldval">
306             <xsl:variable name="calUrl" select="calendar/encodedPath"/>
307             <a href="{$setSelection}&amp;calUrl={$calUrl}">
308               <xsl:value-of select="calendar/name"/>
309             </a>
310           </td>
311         </tr>
312       </xsl:if-->
313     </table>
314   </xsl:template>
315
316 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.