root/trunk/deployment/feeder/webapp/resources/demoskins/MainCampus/default/default/list-html.xsl

Revision 2843 (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.

  • Property svn:mime-type set to text/plain
Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3     Licensed to Jasig under one or more contributor license
4     agreements. See the NOTICE file distributed with this work
5     for additional information regarding copyright ownership.
6     Jasig licenses this file to you under the Apache License,
7     Version 2.0 (the "License"); you may not use this file
8     except in compliance with the License. You may obtain a
9     copy of the License at:
10    
11     http://www.apache.org/licenses/LICENSE-2.0
12    
13     Unless required by applicable law or agreed to in writing,
14     software distributed under the License is distributed on
15     an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16     KIND, either express or implied. See the License for the
17     specific language governing permissions and limitations
18     under the License.
19 -->
20 <xsl:stylesheet
21   version="1.0"
22   xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
23   xmlns="http://www.w3.org/1999/xhtml">
24
25 <xsl:output
26   method="xml"
27   indent="no"
28   media-type="text/html"
29   doctype-public="-//W3C//DTD XHTML 1.0 Transitional//EN"
30   doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
31   standalone="yes"
32   omit-xml-declaration="yes"/>
33
34   <!-- Bring in settings and included xsl -->
35   <xsl:include href="globals.xsl"/>
36   <xsl:include href="../strings.xsl"/>
37   <!-- Provides event template -->
38   <xsl:include href="./xsl/htmlEvent.xsl"/>
39   <!-- Provides category filter templates -->
40   <xsl:include href="./xsl/htmlCategoryFiltering.xsl"/>
41
42
43   <!-- MAIN TEMPLATE -->
44   <xsl:template match="/">
45     <html lang="en">
46       <head>
47         <title><xsl:copy-of select="$bwStr-Root-PageTitle"/></title>
48         <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
49         <link rel="stylesheet" href="{$resourcesRoot}/css/blue.css"/>
50         <link rel="stylesheet" type="text/css" media="print" href="/bedework/common/css/print.css" />
51         <!-- load javascript -->
52         <xsl:if test="/bedework/page='event'">
53           <script type="text/javascript" src="/bedework-common/javascript/jquery/jquery-1.3.2.min.js">&#160;</script>
54           <script type="text/javascript" src="/bedework-common/javascript/jquery/jquery-ui-1.7.1.custom.min.js">&#160;</script>
55           <link rel="stylesheet" href="/bedework-common/javascript/jquery/css/custom-theme/jquery-ui-1.7.1.custom.css"/>
56           <link rel="stylesheet" href="/bedework-common/javascript/jquery/css/custom-theme/bedeworkJquery.css"/>
57           <script type="text/javascript" src="/bedework-common/javascript/bedework.js">&#160;</script>
58         </xsl:if>
59         <!-- address bar icon -->
60         <link rel="icon" type="image/ico" href="{$resourcesRoot}/images/bedework.ico" />
61       </head>
62       <body>
63         <xsl:if test="/bedework/error">
64           <div id="errors">
65             <xsl:apply-templates select="/bedework/error"/>
66           </div>
67         </xsl:if>
68         <xsl:choose>
69           <xsl:when test="/bedework/page='event'">
70             <!-- show an event -->
71             <xsl:apply-templates select="/bedework/event"/>
72           </xsl:when>
73           <xsl:when test="/bedework/page='eventList'">
74             <!-- show a list of discrete events in a time period -->
75             <xsl:apply-templates select="/bedework/events" mode="eventList"/>
76           </xsl:when>
77         </xsl:choose>
78       </body>
79     </html>
80   </xsl:template>
81
82   <!--==== LIST EVENTS - for listing discrete events ====-->
83   <xsl:template match="events" mode="eventList">
84     <div id="listEvents">
85       <ul>
86         <xsl:choose>
87           <xsl:when test="not(event)">
88             <li><xsl:copy-of select="$bwStr-LsEv-NoEventsToDisplay"/></li>
89           </xsl:when>
90           <xsl:otherwise>
91             <xsl:for-each select="event">
92
93               <xsl:choose>
94             <xsl:when test="/bedework/appvar/key = 'filter'">
95               <xsl:variable name="filterName" select="substring-before(/bedework/appvar[key='filter']/value,':')"/>
96               <xsl:variable name="filterVal" select="substring-after(/bedework/appvar[key='filter']/value,':')"/>
97               <!-- Define filters here: -->
98               <xsl:choose>
99                 <xsl:when test="$filterName = 'grpAndCats'">
100                   <xsl:call-template name="preprocessCats">
101                     <xsl:with-param name="allCats" select="$filterVal"/>
102                   </xsl:call-template>
103                 </xsl:when>
104                 <xsl:otherwise>
105                   <!-- Filter name not defined? Turn off filtering. -->
106                   <xsl:call-template name="processListEvent" />
107                 </xsl:otherwise>
108               </xsl:choose>
109             </xsl:when>
110             <xsl:otherwise>
111               <xsl:call-template name="processListEvent" />
112             </xsl:otherwise>
113           </xsl:choose>
114
115             </xsl:for-each>
116           </xsl:otherwise>
117         </xsl:choose>
118       </ul>
119     </div>
120   </xsl:template>
121
122   <xsl:template name="buildListEventsDaysOptions">
123     <xsl:param name="i">1</xsl:param>
124     <xsl:param name="total">31</xsl:param>
125     <xsl:param name="default">7</xsl:param>
126     <xsl:variable name="selected"><xsl:value-of select="/bedework/appvar[key='listEventsDays']/value"/></xsl:variable>
127
128     <option onclick="this.form.setappvar.value='listEventsDay({$i})'">
129       <xsl:attribute name="value"><xsl:value-of select="$i"/></xsl:attribute>
130       <xsl:if test="($selected != '' and $i = $selected) or ($selected = '' and $i = $default)"><xsl:attribute name="selected">selected</xsl:attribute></xsl:if>
131       <xsl:value-of select="$i"/>
132     </option>
133
134     <xsl:if test="$i &lt; $total">
135       <xsl:call-template name="buildListEventsDaysOptions">
136         <xsl:with-param name="i"><xsl:value-of select="$i + 1"/></xsl:with-param>
137         <xsl:with-param name="total"><xsl:value-of select="$total"/></xsl:with-param>
138         <xsl:with-param name="default"><xsl:value-of select="$default"/></xsl:with-param>
139       </xsl:call-template>
140     </xsl:if>
141
142   </xsl:template>
143
144 <xsl:template name="processListEvent">
145  <xsl:variable name="id" select="id"/>
146  <xsl:variable name="calPath" select="calendar/encodedPath"/>
147  <xsl:variable name="guid" select="guid"/>
148  <xsl:variable name="recurrenceId" select="recurrenceId"/>
149  <li>
150    <xsl:attribute name="class">
151      <xsl:choose>
152        <xsl:when test="status='CANCELLED'">bwStatusCancelled</xsl:when>
153        <xsl:when test="status='TENTATIVE'">bwStatusTentative</xsl:when>
154      </xsl:choose>
155    </xsl:attribute>
156
157    <xsl:if test="status='CANCELLED'"><strong><xsl:copy-of select="$bwStr-LsEv-Canceled"/><xsl:text> </xsl:text></strong></xsl:if>
158    <xsl:if test="status='TENTATIVE'"><em><xsl:copy-of select="$bwStr-LsEv-Tentative"/><xsl:text> </xsl:text></em></xsl:if>
159    <a href="{$bwCacheHostUrl}/v1.0/htmlEvent/list-html/{$recurrenceId}/{$guid}.html">
160      <xsl:value-of select="summary"/>
161    </a><xsl:if test="location/address != ''">, <xsl:value-of select="location/address"/></xsl:if>
162    <xsl:if test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
163      <xsl:if test="location/subaddress != ''">
164        , <xsl:value-of select="location/subaddress"/>
165      </xsl:if>
166    </xsl:if>
167
168    <xsl:text> </xsl:text>
169    <a href="{$privateCal}/event/addEventRef.do?calPath={$calPath}&amp;guid={$guid}&amp;recurrenceId={$recurrenceId}" title="{$bwStr-LsVw-AddEventToMyCalendar}" target="myCalendar">
170      <img class="addref" src="{$resourcesRoot}/images/add2mycal-icon-small.gif" width="12" height="16" border="0" alt="{$bwStr-LsVw-AddEventToMyCalendar}"/>
171    </a>
172    <xsl:text> </xsl:text>
173    <xsl:variable name="eventIcalName" select="concat($id,'.ics')"/>
174    <a href="{$bwCacheHostUrl}/v1.0/download/{$recurrenceId}/{$guid}/{$eventIcalName}" title="{$bwStr-SgEv-DownloadEvent}">
175      <img src="{$resourcesRoot}/images/std-ical_icon_small.gif" width="12" height="16" border="0" alt="{$bwStr-LsEv-DownloadEvent}"/>
176    </a>
177    <br/>
178
179    <xsl:value-of select="substring(start/dayname,1,3)"/>,
180    <xsl:value-of select="start/longdate"/>
181    <xsl:text> </xsl:text>
182    <xsl:if test="start/allday != 'true'">
183      <xsl:value-of select="start/time"/>
184    </xsl:if>
185    <xsl:choose>
186      <xsl:when test="start/shortdate != end/shortdate">
187        -
188        <xsl:value-of select="substring(end/dayname,1,3)"/>,
189        <xsl:value-of select="end/longdate"/>
190        <xsl:text> </xsl:text>
191        <xsl:if test="start/allday != 'true'">
192          <xsl:value-of select="end/time"/>
193        </xsl:if>
194      </xsl:when>
195      <xsl:otherwise>
196        <xsl:if test="start/time != end/time">
197          -
198          <xsl:value-of select="end/time"/>
199        </xsl:if>
200      </xsl:otherwise>
201    </xsl:choose>
202
203    <xsl:if test="/bedework/appvar[key='listEventsSummaryMode']/value='details'">
204      <br/>
205      <xsl:value-of select="description"/>
206      <xsl:if test="link != ''">
207        <br/>
208        <xsl:variable name="link" select="link"/>
209        <a href="{$link}" class="moreLink"><xsl:value-of select="link"/></a>
210      </xsl:if>
211      <xsl:if test="categories/category">
212        <br/>
213        <xsl:copy-of select="$bwStr-LsEv-Categories"/>
214        <xsl:for-each select="categories/category">
215          <xsl:value-of select="value"/><xsl:if test="position() != last()">, </xsl:if>
216        </xsl:for-each>
217      </xsl:if>
218      <br/>
219      <em>
220        <xsl:if test="cost!=''">
221          <xsl:value-of select="cost"/>.&#160;
222        </xsl:if>
223        <xsl:if test="contact/name!='none'">
224          <xsl:copy-of select="$bwStr-LsEv-Contact"/><xsl:text> </xsl:text><xsl:value-of select="contact/name"/>
225        </xsl:if>
226      </em>
227    </xsl:if>
228  </li>
229 </xsl:template>
230
231 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.