root/trunk/deployment/webuser/webapp/resources/demoskins/themes/bedeworkTheme/subscriptions.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   <!--+++++++++++++++ Subscriptions ++++++++++++++++++++-->
25   <xsl:template name="subsMenu">
26     <!-- This top-level menu adds subscriptions to the root of the user's calendar tree.
27          Contextual menus on the calendar tree (will) allow for adding subscriptions under
28          subfolders.  -->
29     <xsl:variable name="userid" select="/bedework/userid"/>
30     <h2><xsl:copy-of select="$bwStr-SuMe-AddSubs"/></h2>
31     <div id="content">
32       <h4><xsl:copy-of select="$bwStr-SuMe-SubscribeTo"/></h4>
33       <ul id="subsMenu">
34         <li>
35           <a href="{$calendar-initAddPublicAlias}&amp;calPath=/user/{$userid}" title="{$bwStr-SuMe-SubscribeToPublicCalendar}">
36             <xsl:copy-of select="$bwStr-SuMe-PublicCal"/>
37           </a>
38         </li>
39         <li>
40           <a href="{$calendar-initAddAlias}&amp;calPath=/user/{$userid}" title="{$bwStr-SuMe-SubscribeToUserCalendar}">
41             <xsl:copy-of select="$bwStr-SuMe-UserCal"/>
42           </a>
43         </li>
44         <li>
45           <a href="{$calendar-initAddExternal}&amp;calPath=/user/{$userid}" title="{$bwStr-SuMe-SubscribeToExternalCalendar}">
46             <xsl:copy-of select="$bwStr-SuMe-ExternalFeed"/>
47           </a>
48         </li>
49       </ul>
50     </div>
51   </xsl:template>
52
53
54   <xsl:template match="calendar" mode="subscribe">
55     <xsl:variable name="calPath" select="encodedPath"/>
56     <xsl:variable name="itemClass">
57       <xsl:choose>
58         <xsl:when test="calType = '0'"><xsl:copy-of select="$bwStr-Calr-Folder"/></xsl:when>
59         <xsl:otherwise><xsl:copy-of select="$bwStr-Calr-Calendar"/></xsl:otherwise>
60       </xsl:choose>
61     </xsl:variable>
62     <li class="{$itemClass}">
63       <a href="{$subscriptions-initAdd}&amp;calPath={$calPath}">
64         <xsl:value-of select="name"/>
65       </a>
66       <xsl:if test="calendar">
67         <ul>
68           <xsl:apply-templates select="calendar" mode="subscribe">
69             <!--<xsl:sort select="title" order="ascending" case-order="upper-first"/>-->
70           </xsl:apply-templates>
71         </ul>
72       </xsl:if>
73     </li>
74   </xsl:template>
75
76   <!-- add a subscription to a user calendar by user and path -->
77   <xsl:template name="addAlias">
78     <h2><xsl:copy-of select="$bwStr-AddA-SubscribeToUserCal"/></h2>
79     <div id="content">
80       <p class="note"><xsl:copy-of select="$bwStr-AddA-SubscriptionMustBeUnique"/></p>
81       <form name="subscribeForm" action="{$calendar-update}" onsubmit="return setBwSubscriptionUri(this, false)" method="post">
82         <table class="common" cellspacing="0">
83           <tr>
84             <td class="fieldname"><xsl:copy-of select="$bwStr-AddA-Name"/></td>
85             <td>
86               <input type="text" value="" name="calendar.name" size="60"/>
87             </td>
88           </tr>
89           <!-- the following would be for an arbitrary URI.  We'll add this later.
90           <tr>
91             <td class="fieldname">Uri:</td>
92             <td>
93               <input type="text" value="" name="aliasUri" size="60"/>
94             </td>
95           </tr>-->
96           <tr>
97             <td class="fieldname"><xsl:copy-of select="$bwStr-AddA-UserID"/></td>
98             <td>
99               <input type="hidden" value="" name="aliasUri"/>
100               <input type="text" value="" name="userId" size="20"/>
101               <span class="note"><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AddA-ExJaneDoe"/></span>
102             </td>
103           </tr>
104           <tr>
105             <td class="fieldname"><xsl:copy-of select="$bwStr-AddA-CalendarPath"/></td>
106             <td>
107               <input type="text" value="" name="userPath" size="20"/>
108               <span class="note"><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AddA-ExCalendar"/></span>
109             </td>
110           </tr>
111           <!--<tr>
112             <td class="fieldname">Display:</td>
113             <td>
114               <input type="radio" value="true" name="display" checked="checked"/> yes
115               <input type="radio" value="false" name="display"/> no
116             </td>
117           </tr>-->
118           <tr>
119             <td class="fieldname"><xsl:copy-of select="$bwStr-AddA-AffectsFreeBusy"/></td>
120             <td>
121               <input type="radio" value="true" name="affectsFreeBusy"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AddA-Yes"/>
122               <input type="radio" value="false" name="affectsFreeBusy" checked="checked"/><xsl:text> </xsl:text><xsl:copy-of select="$bwStr-AddA-No"/>
123             </td>
124           </tr>
125           <tr>
126             <td class="fieldname">Color:</td>
127             <td>
128               <select name="calendar.color">
129                 <option value="default"><xsl:copy-of select="$bwStr-AddA-Default"/></option>
130                 <xsl:for-each select="document('subColors.xml')/subscriptionColors/color">
131                   <xsl:variable name="subColor" select="."/>
132                   <option value="{$subColor}" class="{$subColor}">
133                     <xsl:value-of select="@name"/>
134                   </option>
135                 </xsl:for-each>
136               </select>
137             </td>
138           </tr>
139           <!--<tr>
140             <td class="fieldname">Unremovable:</td>
141             <td>
142               <input type="radio" value="true" name="unremoveable" size="60"/> true
143               <input type="radio" value="false" name="unremoveable" size="60" checked="checked"/> false
144             </td>
145           </tr>-->
146         </table>
147         <table border="0" id="submitTable">
148           <tr>
149             <td>
150               <input type="submit" name="addSubscription" value="{$bwStr-AddA-AddSubscription}"/>
151               <input type="submit" name="cancelled" value="{$bwStr-AddA-Cancel}"/>
152             </td>
153           </tr>
154         </table>
155       </form>
156
157       <xsl:copy-of select="$bwStr-AddA-NoteAboutAccess"/>
158     </div>
159   </xsl:template>
160
161  
162 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.