root/trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/navigation.xsl

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

user client: start of breaking user client into smaller files

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   <xsl:template name="tabs">
25     <xsl:variable name="navAction">
26       <xsl:choose>
27         <xsl:when test="/bedework/page='attendees'"><xsl:value-of select="$event-attendeesForEvent"/></xsl:when>
28         <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
29         <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
30       </xsl:choose>
31     </xsl:variable>
32     <div id="bwTabs">
33       <div id="bwUserInfo">
34         <xsl:copy-of select="$bwStr-Tabs-LoggedInAs"/><xsl:text> </xsl:text>
35         <xsl:text> </xsl:text>
36         <strong><xsl:value-of select="/bedework/userid"/></strong>
37         <xsl:text> </xsl:text>
38         <span class="logout"><a href="{$setup}&amp;logout=true"><xsl:copy-of select="$bwStr-Tabs-Logout"/></a></span>
39       </div>
40       <ul>
41         <li>
42           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Day'">
43             <xsl:attribute name="class">selected</xsl:attribute>
44           </xsl:if>
45           <a href="{$setViewPeriod}&amp;viewType=dayView&amp;date={$curdate}"><xsl:copy-of select="$bwStr-Tabs-Day"/></a>
46         </li>
47         <li>
48           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Week' or /bedework/periodname=''">
49             <xsl:attribute name="class">selected</xsl:attribute>
50           </xsl:if>
51           <a href="{$setViewPeriod}&amp;viewType=weekView&amp;date={$curdate}"><xsl:copy-of select="$bwStr-Tabs-Week"/></a>
52         </li>
53         <li>
54           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Month'">
55             <xsl:attribute name="class">selected</xsl:attribute>
56           </xsl:if><a href="{$setViewPeriod}&amp;viewType=monthView&amp;date={$curdate}"><xsl:copy-of select="$bwStr-Tabs-Month"/></a>
57         </li>
58         <li>
59           <xsl:if test="/bedework/page='eventscalendar' and /bedework/periodname='Year'">
60             <xsl:attribute name="class">selected</xsl:attribute>
61           </xsl:if><a href="{$setViewPeriod}&amp;viewType=yearView&amp;date={$curdate}"><xsl:copy-of select="$bwStr-Tabs-Year"/></a>
62         </li>
63         <li>
64           <xsl:if test="/bedework/page='eventList'">
65             <xsl:attribute name="class">selected</xsl:attribute>
66           </xsl:if><a href="{$listEvents}"><xsl:copy-of select="$bwStr-Tabs-Agenda"/></a>
67         </li>
68       </ul>
69     </div>
70   </xsl:template>
71
72   <xsl:template name="navigation">
73     <xsl:variable name="navAction">
74       <xsl:choose>
75         <xsl:when test="/bedework/page='attendees'"><xsl:value-of select="$event-attendeesForEvent"/></xsl:when>
76         <xsl:when test="/bedework/page='freeBusy'"><xsl:value-of select="$freeBusy-fetch"/></xsl:when>
77         <xsl:otherwise><xsl:value-of select="$setViewPeriod"/></xsl:otherwise>
78       </xsl:choose>
79     </xsl:variable>
80     <table border="0" cellpadding="0" cellspacing="0" id="navigationBarTable">
81       <tr>
82         <td class="leftCell">
83           <a href="{$navAction}&amp;date={$prevdate}"><img src="{$resourcesRoot}/resources/std-arrow-left.gif" alt="previous" width="13" height="16" class="prevImg" border="0"/></a>
84           <a href="{$navAction}&amp;date={$nextdate}"><img src="{$resourcesRoot}/resources/std-arrow-right.gif" alt="next" width="13" height="16" class="nextImg" border="0"/></a>
85           <xsl:choose>
86             <xsl:when test="/bedework/periodname='Year'">
87               <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
88             </xsl:when>
89             <xsl:when test="/bedework/periodname='Month'">
90               <xsl:value-of select="/bedework/firstday/monthname"/>, <xsl:value-of select="substring(/bedework/firstday/date,1,4)"/>
91             </xsl:when>
92             <xsl:when test="/bedework/periodname='Week'">
93               <xsl:copy-of select="$bwStr-Navi-WeekOf"/><xsl:text> </xsl:text><xsl:value-of select="substring-after(/bedework/firstday/longdate,', ')"/>
94             </xsl:when>
95             <xsl:otherwise>
96               <xsl:value-of select="/bedework/firstday/longdate"/>
97             </xsl:otherwise>
98           </xsl:choose>
99         </td>
100         <td class="todayButton">
101           <a href="{$navAction}&amp;viewType=todayView&amp;date={$curdate}">
102             <img src="{$resourcesRoot}/resources/std-button-today-off.gif" width="54" height="22" border="0" alt="Go to Today" align="left"/>
103           </a>
104         </td>
105         <td align="right" class="gotoForm">
106           <form name="calForm" method="post" action="{$navAction}">
107              <table border="0" cellpadding="0" cellspacing="0">
108               <tr>
109                 <xsl:if test="/bedework/periodname!='Year'">
110                   <td>
111                     <select name="viewStartDate.month">
112                       <xsl:for-each select="/bedework/monthvalues/val">
113                         <xsl:variable name="temp" select="."/>
114                         <xsl:variable name="pos" select="position()"/>
115                         <xsl:choose>
116                           <xsl:when test="/bedework/monthvalues[start=$temp]">
117                             <option value="{$temp}" selected="selected">
118                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
119                             </option>
120                           </xsl:when>
121                           <xsl:otherwise>
122                             <option value="{$temp}">
123                               <xsl:value-of select="/bedework/monthlabels/val[position()=$pos]"/>
124                             </option>
125                           </xsl:otherwise>
126                         </xsl:choose>
127                       </xsl:for-each>
128                     </select>
129                   </td>
130                   <xsl:if test="/bedework/periodname!='Month'">
131                     <td>
132                       <select name="viewStartDate.day">
133                         <xsl:for-each select="/bedework/dayvalues/val">
134                           <xsl:variable name="temp" select="."/>
135                           <xsl:variable name="pos" select="position()"/>
136                           <xsl:choose>
137                             <xsl:when test="/bedework/dayvalues[start=$temp]">
138                               <option value="{$temp}" selected="selected">
139                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
140                               </option>
141                             </xsl:when>
142                             <xsl:otherwise>
143                               <option value="{$temp}">
144                                 <xsl:value-of select="/bedework/daylabels/val[position()=$pos]"/>
145                               </option>
146                             </xsl:otherwise>
147                           </xsl:choose>
148                         </xsl:for-each>
149                       </select>
150                     </td>
151                   </xsl:if>
152                 </xsl:if>
153                 <td>
154                   <xsl:variable name="temp" select="/bedework/yearvalues/start"/>
155                   <input type="text" name="viewStartDate.year" maxlength="4" size="4" value="{$temp}"/>
156                 </td>
157                 <td>
158                   <input name="submit" type="submit" value="{$bwStr-Navi-Go}"/>
159                 </td>
160               </tr>
161             </table>
162           </form>
163         </td>
164       </tr>
165     </table>
166   </xsl:template>
167
168   <xsl:template name="utilBar">
169     <table width="100%" border="0" cellpadding="0" cellspacing="0" id="utilBarTable">
170        <tr>
171          <td class="leftCell">
172            <xsl:if test="/bedework/page != 'addEvent' or /bedework/page='editEvent'">
173              <input type="button" value="{$bwStr-Util-Add}" id="bwAddButton"/>
174              <xsl:call-template name="actionIcons">
175                <xsl:with-param name="actionIconsId">bwActionIcons-0</xsl:with-param>
176                <xsl:with-param name="startDate">
177                  <xsl:choose>
178                    <xsl:when test="/bedework/periodname = 'Day'"><xsl:value-of select="/bedework/firstday/date"/></xsl:when>
179                    <xsl:otherwise><xsl:value-of select="/bedework/now/date"/></xsl:otherwise>
180                  </xsl:choose>
181                </xsl:with-param>
182              </xsl:call-template>
183            </xsl:if>
184          </td>
185          <td class="rightCell">
186
187            <!-- search -->
188            <xsl:if test="/bedework/page!='searchResult'">
189              <form name="searchForm" method="post" action="{$search}">
190                <xsl:copy-of select="$bwStr-Util-Search"/>:
191                <input type="text" name="query" size="15">
192                  <xsl:attribute name="value"><xsl:value-of select="/bedework/searchResults/query"/></xsl:attribute>
193                </input>
194                <input type="submit" name="submit" value="{$bwStr-Util-Go}"/>
195              </form>
196            </xsl:if>
197
198            <!-- show free / busy -->
199            <xsl:choose>
200              <xsl:when test="/bedework/periodname!='Year'">
201                <xsl:choose>
202                  <xsl:when test="/bedework/page='freeBusy'">
203                    <a class="utilButton" href="{$setViewPeriod}&amp;date={$curdate}" title="{$bwStr-Util-ShowEvents}">
204                      <xsl:copy-of select="$bwStr-Util-Events"/>
205                    </a>
206                  </xsl:when>
207                  <xsl:otherwise>
208                    <a class="utilButton" href="{$freeBusy-fetch}&amp;date={$curdate}" title="{$bwStr-Util-ShowFreebusy}">
209                      <xsl:copy-of select="$bwStr-Util-Freebusy"/>
210                    </a>
211                  </xsl:otherwise>
212                </xsl:choose>
213              </xsl:when>
214              <xsl:otherwise>
215                <span class="utilButtonOff"><xsl:copy-of select="$bwStr-Util-Freebusy"/></span>
216              </xsl:otherwise>
217            </xsl:choose>
218
219            <!-- toggle list / calendar view -->
220            <xsl:choose>
221              <xsl:when test="/bedework/periodname='Day' or /bedework/page='eventList'">
222                <span class="utilButtonOff"><xsl:copy-of select="$bwStr-Util-List"/></span>
223              </xsl:when>
224              <xsl:when test="/bedework/periodname='Year'">
225                <span class="utilButtonOff"><xsl:copy-of select="$bwStr-Util-Cal"/></span>
226              </xsl:when>
227              <xsl:when test="/bedework/periodname='Month'">
228                <xsl:choose>
229                  <xsl:when test="/bedework/appvar[key='monthViewMode']/value='list'">
230                    <a class="utilButton" href="{$setup}&amp;setappvar=monthViewMode(cal)" title="{$bwStr-Util-ToggleListCalView}">
231                      <xsl:copy-of select="$bwStr-Util-Cal"/>
232                    </a>
233                  </xsl:when>
234                  <xsl:otherwise>
235                    <a class="utilButton" href="{$setup}&amp;setappvar=monthViewMode(list)" title="{$bwStr-Util-ToggleListCalView}">
236                      <xsl:copy-of select="$bwStr-Util-List"/>
237                    </a>
238                  </xsl:otherwise>
239                </xsl:choose>
240              </xsl:when>
241              <xsl:otherwise>
242                <xsl:choose>
243                  <xsl:when test="/bedework/appvar[key='weekViewMode']/value='list'">
244                    <a class="utilButton" href="{$setup}&amp;setappvar=weekViewMode(cal)" title="{$bwStr-Util-ToggleListCalView}">
245                      <xsl:copy-of select="$bwStr-Util-Cal"/>
246                    </a>
247                  </xsl:when>
248                  <xsl:otherwise>
249                    <a class="utilButton" href="{$setup}&amp;setappvar=weekViewMode(list)" title="{$bwStr-Util-ToggleListCalView}">
250                      <xsl:copy-of select="$bwStr-Util-List"/>
251                    </a>
252                  </xsl:otherwise>
253                </xsl:choose>
254              </xsl:otherwise>
255            </xsl:choose>
256
257            <!-- summary / detailed mode toggle -->
258            <xsl:choose>
259               <xsl:when test="/bedework/page = 'eventList'">
260                 <xsl:choose>
261                   <xsl:when test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
262                     <a class="utilButton" href="{$listEvents}&amp;setappvar=listEventsSummaryMode(summary)" title="{$bwStr-Util-ToggleSummDetView}">
263                       <xsl:copy-of select="$bwStr-Util-Summary"/>
264                     </a>
265                   </xsl:when>
266                   <xsl:otherwise>
267                     <a class="utilButton" href="{$listEvents}&amp;setappvar=listEventsSummaryMode(details)" title="{$bwStr-Util-ToggleSummDetView}">
268                       <xsl:copy-of select="$bwStr-Util-Details"/>
269                     </a>
270                   </xsl:otherwise>
271                 </xsl:choose>
272               </xsl:when>
273               <xsl:when test="/bedework/periodname='Year' or
274                               (/bedework/periodname='Month' and
275                               (/bedework/appvar[key='monthViewMode']/value='cal' or
276                                not(/bedework/appvar[key='monthViewMode']))) or
277                               (/bedework/periodname='Week' and
278                               (/bedework/appvar[key='weekViewMode']/value='cal' or
279                                not(/bedework/appvar[key='weekViewMode'])))">
280                 <xsl:choose>
281                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
282                     <span class="utilButtonOff"><xsl:copy-of select="$bwStr-Util-Summary"/></span>
283                   </xsl:when>
284                   <xsl:otherwise>
285                     <span class="utilButtonOff"><xsl:copy-of select="$bwStr-Util-Details"/></span>
286                   </xsl:otherwise>
287                 </xsl:choose>
288               </xsl:when>
289               <xsl:otherwise>
290                 <xsl:choose>
291                   <xsl:when test="/bedework/appvar[key='summaryMode']/value='details'">
292                     <a class="utilButton" href="{$setup}&amp;setappvar=summaryMode(summary)" title="{$bwStr-Util-ToggleSummDetView}">
293                       <xsl:copy-of select="$bwStr-Util-Summary"/>
294                     </a>
295                   </xsl:when>
296                   <xsl:otherwise>
297                     <a class="utilButton" href="{$setup}&amp;setappvar=summaryMode(details)" title="{$bwStr-Util-ToggleSummDetView}">
298                       <xsl:copy-of select="$bwStr-Util-Details"/>
299                     </a>
300                   </xsl:otherwise>
301                 </xsl:choose>
302               </xsl:otherwise>
303             </xsl:choose>
304
305            <!-- refresh button -->
306            <!-- deprecate? -->
307            <!-- <a href="{$setup}"><img src="{$resourcesRoot}/resources/std-button-refresh.gif" width="70" height="21" border="0" alt="refresh view"/></a> -->
308          </td>
309        </tr>
310     </table>
311   </xsl:template>
312
313   <xsl:template name="actionIcons">
314     <xsl:param name="startDate"/>
315     <xsl:param name="startTime"/>
316     <xsl:param name="actionIconsId"/>
317     <xsl:variable name="dateTime">
318       <xsl:choose>
319         <xsl:when test="$startTime != ''"><xsl:value-of select="$startDate"/>T<xsl:value-of select="$startTime"/></xsl:when>
320         <xsl:otherwise><xsl:value-of select="$startDate"/></xsl:otherwise>
321       </xsl:choose>
322     </xsl:variable>
323     <br/>
324     <div id="{$actionIconsId}" class="bwActionIcons">
325        <a href="{$initEvent}&amp;entityType=event&amp;startdate={$dateTime}" title="{$bwStr-Actn-AddEvent}" onclick="javascript:changeClass('{$actionIconsId}','invisible')">
326           <img src="{$resourcesRoot}/resources/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="add event"/>
327           <xsl:text> </xsl:text>
328           <xsl:copy-of select="$bwStr-Actn-AddEvent"/>
329        </a>
330        <a href="{$event-initMeeting}&amp;entityType=event&amp;schedule=request&amp;startdate={$dateTime}" title="schedule a meeting" onclick="javascript:changeClass('{$actionIconsId}','invisible')">
331           <img src="{$resourcesRoot}/resources/std-icalMeeting-icon-small.gif" width="12" height="16" border="0" alt="schedule meeting"/>
332           <xsl:text> </xsl:text>
333           <xsl:copy-of select="$bwStr-Actn-ScheduleMeeting"/>
334        </a>
335        <a href="{$initEvent}&amp;entityType=task&amp;startdate={$dateTime}" title="{$bwStr-Actn-AddTask}" onclick="javascript:changeClass('{$actionIconsId}','invisible')">
336           <img src="{$resourcesRoot}/resources/std-icalTask-icon-small.gif" width="12" height="16" border="0" alt="add task"/>
337           <xsl:text> </xsl:text>
338           <xsl:copy-of select="$bwStr-Actn-AddTask"/>
339        </a>
340        <a href="{$event-initMeeting}&amp;entityType=task&amp;schedule=request&amp;startdate={$dateTime}" title="{$bwStr-Actn-ScheduleTask}" onclick="javascript:changeClass('{$actionIconsId}','invisible')">
341           <img src="{$resourcesRoot}/resources/std-icalSchTask-icon-small.gif" width="12" height="16" border="0" alt="schedule task"/>
342           <xsl:text> </xsl:text>
343           <xsl:copy-of select="$bwStr-Actn-ScheduleTask"/>
344        </a>
345        <a href="{$initUpload}" title="{$bwStr-Actn-UploadEvent}" onclick="javascript:changeClass('{$actionIconsId}','invisible')">
346           <img src="{$resourcesRoot}/resources/std-icalUpload-icon-small.gif" width="12" height="16" border="0" alt="upload event"/>
347           <xsl:text> </xsl:text>
348           <xsl:copy-of select="$bwStr-Actn-Upload"/>
349        </a>
350      </div>
351   </xsl:template>
352
353  
354 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.