root/branches/xslt-rewrite/deployment/resources/xsl/default/default/category-location.xsl

Revision 1705 (checked in by kllin, 5 years ago)

merging our xsl and i18n changes to xslt-rewrite branch

Line 
1 <?xml version="1.0" encoding="UTF-8"?>
2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
3   <!--+++++++++++++++ Categories ++++++++++++++++++++-->
4   <xsl:template name="categoryList">
5     <h2>
6       <xsl:value-of select="$category-location.categoryList.h2" />
7       <input type="button" name="return" value="Add new category" onclick="javascript:location.replace('{$category-initAdd}')" class="titleButton"/>
8     </h2>
9     <table class="common" id="manage" cellspacing="0">
10       <tr>
11         <th class="commonHeader" colspan="2"><xsl:value-of select="$category-location.categoryList.edit.delete" /></th>
12       </tr>
13       <tr>
14         <th><xsl:value-of select="$category-location.keyword" /></th>
15         <th><xsl:value-of select="$category-location.description" /></th>
16       </tr>
17       <xsl:choose>
18         <xsl:when test="/bedework/categories/category">
19           <xsl:for-each select="/bedework/categories/category">
20             <xsl:variable name="categoryKey" select="normalize-space(keyword)"/>
21             <tr>
22               <td>
23                 <a href="{$category-fetchForUpdate}&amp;categoryKey={$categoryKey}">
24                   <xsl:value-of select="keyword"/>
25                 </a>
26               </td>
27               <td>
28                 <xsl:value-of select="desc"/>
29               </td>
30             </tr>
31           </xsl:for-each>
32         </xsl:when>
33         <xsl:otherwise>
34           <tr>
35             <td colspan="2">
36               <xsl:value-of select="$category-location.categoryList.not.defined" />
37             </td>
38           </tr>
39         </xsl:otherwise>
40       </xsl:choose>
41     </table>
42   </xsl:template>
43
44   <xsl:template name="modCategory">
45     <xsl:choose>
46       <xsl:when test="/bedework/creating='true'">
47         <h2><xsl:value-of select="$category-location.modCategory.add.category" /></h2>
48         <form action="{$category-update}" method="post">
49           <table class="common" cellspacing="0">
50             <tr>
51               <th class="commonHeader" colspan="2"><xsl:value-of select="$category-location.modCategory.add.category" /></th>
52             </tr>
53             <tr>
54               <td class="fieldname">
55                 <xsl:value-of select="$category-location.keyword" />
56               </td>
57               <td>
58                 <input type="text" name="categoryWord.value" value="" size="40"/>
59               </td>
60             </tr>
61             <tr>
62               <td class="fieldname optional">
63                 <xsl:value-of select="$category-location.description" />
64               </td>
65               <td>
66                 <textarea name="categoryDesc.value" rows="3" cols="60">
67                   <xsl:text> </xsl:text>
68                 </textarea>
69               </td>
70             </tr>
71           </table>
72           <table border="0" id="submitTable">
73             <tr>
74               <td>
75                 <input type="submit" name="addCategory" value="Add Category"/>
76                 <input type="submit" name="cancelled" value="cancel"/>
77                 <input type="reset" value="Clear"/>
78               </td>
79             </tr>
80           </table>
81         </form>
82       </xsl:when>
83       <xsl:otherwise>
84         <h2><xsl:value-of select="$category-location.modCategory.update.category" /></h2>
85         <form action="{$category-update}" method="post">
86           <table class="common" cellspacing="0">
87             <tr>
88               <th class="commonHeader" colspan="2"><xsl:value-of select="$category-location.modCategory.update.category" /></th>
89             </tr>
90             <tr>
91               <td class="fieldname">
92                 <xsl:value-of select="$category-location.keyword" />
93               </td>
94               <td>
95                 <xsl:variable name="keyword" select="normalize-space(/bedework/currentCategory/category/keyword)"/>
96                 <input type="text" name="categoryWord.value" value="{$keyword}" size="40"/>
97               </td>
98             </tr>
99             <tr>
100               <td class="fieldname optional">
101                 <xsl:value-of select="$category-location.description" />
102               </td>
103               <td>
104                 <textarea name="categoryDesc.value" rows="3" cols="60">
105                   <xsl:value-of select="normalize-space(/bedework/currentCategory/category/desc)"/>
106                   <xsl:if test="normalize-space(/bedework/currentCategory/category/desc/textarea) = ''">
107                     <xsl:text> </xsl:text>
108                     <!-- keep this space to avoid browser
109                     rendering errors when the text area is empty -->
110                   </xsl:if>
111                 </textarea>
112               </td>
113             </tr>
114           </table>
115
116           <table border="0" id="submitTable">
117             <tr>
118               <td>
119                 <input type="submit" name="updateCategory" value="Update Category"/>
120                 <input type="submit" name="cancelled" value="cancel"/>
121                 <input type="reset" value="Reset"/>
122               </td>
123               <td align="right">
124                 <input type="submit" name="delete" value="Delete Category"/>
125               </td>
126             </tr>
127           </table>
128         </form>
129       </xsl:otherwise>
130     </xsl:choose>
131   </xsl:template>
132
133   <xsl:template name="deleteCategoryConfirm">
134     <h2><xsl:value-of select="$category-location.deleteCategoryConfirm.h2" /></h2>
135
136     <table class="common" cellspacing="0">
137       <tr>
138         <th class="commonHeader" colspan="2"><xsl:value-of select="$category-location.deleteCategoryConfirm.delete.category" /></th>
139       </tr>
140       <tr>
141         <td class="fieldname">
142           <xsl:value-of select="$category-location.keyword" />
143         </td>
144         <td>
145           <xsl:value-of select="/bedework/currentCategory/category/keyword"/>
146         </td>
147       </tr>
148       <tr>
149         <td class="fieldname optional">
150           <xsl:value-of select="$category-location.description" />
151         </td>
152         <td>
153           <xsl:value-of select="/bedework/currentCategory/category/desc"/>
154         </td>
155       </tr>
156     </table>
157
158     <form action="{$category-delete}" method="post">
159       <input type="submit" name="deleteCategory" value="Yes: Delete Category"/>
160       <input type="submit" name="cancelled" value="No: Cancel"/>
161     </form>
162   </xsl:template>
163
164   <!--==== MANAGE LOCATIONS ====-->
165   <xsl:template name="locationList">
166     <h2> <xsl:value-of select="$category-location.locationList.h2" /></h2>
167     <p>
168        <xsl:value-of select="$category-location.locationList.info" />
169       <input type="button" name="return" value="Add new location" onclick="javascript:location.replace('{$location-initAdd}')"/>
170     </p>
171
172     <table id="commonListTable">
173       <tr>
174         <th><xsl:value-of select="$category-location.locationList.address" /></th>
175         <th><xsl:value-of select="$category-location.locationList.subaddress" /></th>
176         <th><xsl:value-of select="$category-location.locationList.url" /></th>
177       </tr>
178
179       <xsl:for-each select="/bedework/locations/location">
180         <tr>
181           <td>
182             <xsl:copy-of select="address/*"/>
183           </td>
184           <td>
185             <xsl:value-of select="subaddress"/>
186           </td>
187           <td>
188             <xsl:variable name="link" select="link" />
189             <a href="{$link}" target="linktest">
190               <xsl:value-of select="link" />
191             </a>
192           </td>
193         </tr>
194       </xsl:for-each>
195     </table>
196   </xsl:template>
197
198
199   <xsl:template name="modLocation">
200     <xsl:choose>
201       <xsl:when test="/bedework/creating='true'">
202         <h2> <xsl:value-of select="$category-location.modLocation.h2" /></h2>
203       </xsl:when>
204       <xsl:otherwise>
205         <h2> <xsl:value-of select="$category-location.modLocation.otherwise" /></h2>
206       </xsl:otherwise>
207     </xsl:choose>
208
209     <form action="{$location-update}" method="post">
210       <table id="eventFormTable">
211         <tr>
212           <td class="fieldName">
213             <xsl:value-of select="$category-location.locationList.address" />
214           </td>
215           <td>
216             <xsl:copy-of select="/bedework/formElements/form/address/*"/>
217           </td>
218         </tr>
219         <tr>
220           <td class="optional">
221             <xsl:value-of select="$category-location.locationList.subaddress" />
222           </td>
223           <td>
224             <xsl:copy-of select="/bedework/formElements/form/subaddress/*"/>
225             <span class="fieldInfo"> <xsl:value-of select="$category-location.optional" /></span>
226           </td>
227         </tr>
228         <tr>
229           <td class="optional">
230             <xsl:value-of select="$category-location.modLocation.location.url" />
231           </td>
232           <td>
233             <xsl:copy-of select="/bedework/formElements/form/link/*"/>
234             <span class="fieldInfo"> <xsl:value-of select="$category-location.optional" /></span>
235           </td>
236         </tr>
237       </table>
238
239       <table border="0" id="submitTable">
240         <tr>
241           <xsl:choose>
242             <xsl:when test="/bedework/creating='true'">
243               <td>
244                 <input type="submit" name="addLocation" value="Add Location"/>
245                 <input type="submit" name="cancelled" value="Cancel"/>
246                 <input type="reset" value="Clear"/>
247               </td>
248             </xsl:when>
249             <xsl:otherwise>
250               <td>
251                 <input type="submit" name="updateLocation" value="Update Location"/>
252                 <input type="submit" name="cancelled" value="Cancel"/>
253                 <input type="reset" value="Reset"/>
254               </td>
255               <td align="right">
256                 <input type="submit" name="delete" value="Delete Location"/>
257               </td>
258             </xsl:otherwise>
259           </xsl:choose>
260         </tr>
261       </table>
262     </form>
263   </xsl:template>
264
265   <xsl:template name="deleteLocationConfirm">
266     <h2><xsl:value-of select="$category-location.deleteLocationConfirm.h2" /></h2>
267
268     <table class="common" cellspacing="0">
269       <tr>
270         <th class="commonHeader" colspan="2"><xsl:value-of select="$category-location.deleteLocationConfirm.delete" /></th>
271       </tr>
272       <tr>
273         <td class="fieldname">
274           <xsl:value-of select="$category-location.deleteLocationConfirm.main.address" />
275         </td>
276         <td align="left">
277           <xsl:value-of select="/bedework/currentLocation/address"/>
278         </td>
279       </tr>
280       <tr>
281         <td class="fieldname">
282            <xsl:value-of select="$category-location.locationList.subaddress" />
283         </td>
284         <td align="left">
285           <xsl:value-of select="/bedework/currentLocation/subaddress"/>
286         </td>
287       </tr>
288       <tr>
289         <td class="fieldname">
290            <xsl:value-of select="$category-location.deleteLocationConfirm.location.link" />
291         </td>
292         <td>
293           <xsl:variable name="link" select="/bedework/currentLocation/link"/>
294           <a href="{$link}"><xsl:value-of select="$link"/></a>
295         </td>
296       </tr>
297     </table>
298
299     <form action="{$location-delete}" method="post">
300       <input type="submit" name="updateCategory" value="Yes: Delete Location"/>
301       <input type="submit" name="cancelled" value="No: Cancel"/>
302     </form>
303   </xsl:template>
304 </xsl:stylesheet>
Note: See TracBrowser for help on using the browser.