source: main/trunk/model-interfaces-dev/wmtb/transform/layouts/main.xsl@ 34275

Last change on this file since 34275 was 34275, checked in by ak19, 4 years ago

Bugfixes to whakatohea interface: 1. Overflow from coll or group description into footer area fixed. Strangely, a self closing divider was ending up with its following siblings as its children instead. Added a hack in home.xsl to fix this. 2. GS3 collection title on banner now. It was expanding the banner section. 2. Corrected Environment pou link name in navbar to Taiao. 4. Some spacing corrections in 2nd column of footer. 5. Tidied up some unused xsl.

File size: 18.7 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4
5 xmlns:java="http://xml.apache.org/xslt/java"
6 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
7 xmlns:gslib="http://www.greenstone.org/skinning"
8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
9
10 xmlns:lxslt="http://xml.apache.org/xslt"
11 xmlns:result="http://www.example.com/results"
12 xmlns:exsl="http://exslt.org/common"
13
14 extension-element-prefixes="java util result exsl"
15 exclude-result-prefixes="util java util">
16
17 <xsl:import href="footer.xsl"/>
18<!-- The main layout is defined here -->
19<!-- Every page in our library uses this template -->
20<xsl:template name="mainTemplate">
21 <html>
22 <head>
23 <!-- ***** in header.xsl ***** -->
24 <xsl:call-template name="create-html-header"/>
25 <xsl:call-template name="basketHeadTags"/>
26 </head>
27 <body id="top" class="banner-overlay-on">
28 <div class="wrapper">
29
30 <!-- Whakatohea.co.nz's navbar -->
31 <xsl:call-template name="whakatohea-navbar"/>
32
33 <div class="site-canvas">
34 <div class="wrapper-old col0">
35 <div id="topline">
36 <ul>
37 <xsl:call-template name="loginLinks"/>
38 <li><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li>
39 <li><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li>
40 </ul>
41 <br class="clear" />
42 </div>
43 </div>
44 <div class="wrapper-old">
45 <div id="header-old">
46
47 <div class="banner-wrap">
48 <div class="wsite-elements wsite-not-footer wsite-header-elements">
49 <div class="wsite-section-wrap">
50 <div class="wsite-section wsite-header-section wsite-section-bg-image" style="height: auto;background-image: url(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;) ;background-repeat: no-repeat ;background-position: 50.00% 21.94% ;background-size: 100% ;background-color: transparent ;background-size: cover;" >
51 <div class="wsite-section-content">
52
53 <div class="container">
54 <div class="banner">
55 <div class="wsite-section-elements">
56 <h2 class="wsite-content-title" style="text-align:center;"><font size="6"><a href="{$library_name}"><xsl:call-template name="siteName"/></a></font></h2>
57
58 <!-- Why does this feel like it's still inside the banner-wrap? -->
59 <xsl:if test="page/pageResponse/collection">
60 <div>
61 <p>&#160;
62 <a href="{$library_name}/collection/{$collNameChecked}/page/about">
63 <xsl:value-of select="page/pageResponse/collection/displayItemList/displayItem[@name='name']"/>
64 </a>
65 </p>
66 <br class="clear"/>
67 </div>
68 </xsl:if>
69 </div>
70 </div>
71 </div>
72
73 </div>
74 <!--<div class=""></div>-->
75 </div>
76 </div>
77
78 </div>
79
80 </div><!-- end banner-wrap -->
81 </div>
82 </div>
83
84 <div class="wrapper-old col2">
85 <div id="topbar">
86 <div id="topnav">
87 <ul>
88 <xsl:call-template name="navBar"/>
89 </ul>
90 </div>
91 <!--**********************************************************************-->
92 <xsl:choose>
93 <xsl:when test="page/pageRequest/@subaction='home'">
94 <xsl:call-template name="crossCollSearch"/>
95 </xsl:when>
96 <xsl:when test="page/pageRequest/paramList/param/@name='c' and /page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
97 <xsl:call-template name="quick-search-area"/>
98 </xsl:when>
99 <xsl:otherwise/>
100 </xsl:choose>
101 <!--**********************************************************************-->
102 </div>
103 </div>
104
105 <div class="outer">
106 <div id="gs_content">
107 <xsl:apply-templates select="/page"/>
108 </div>
109 <br class="clear" />
110
111 </div><!-- end class main-wrap-->
112 <xsl:call-template name="wmtb-footer"/>
113
114 </div> <!-- end site-canvas -->
115 </div> <!-- end wrapper-->
116 </body>
117</html>
118</xsl:template>
119
120
121<xsl:template name="navBar">
122<xsl:choose>
123<xsl:when test="page/pageResponse/collection">
124<xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
125<xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>
126
127<li><a href="{$library_name}">DL Home</a></li>
128<li>
129<xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">active</xsl:attribute></xsl:if>
130<a href="{$library_name}/collection/{$collNameChecked}/page/about">About</a>
131</li>
132
133<xsl:choose>
134<xsl:when test="$count > 3">
135<li><a href="{$currentPage}">Browse</a>
136<ul>
137<xsl:call-template name="Browsing"/>
138</ul>
139</li>
140</xsl:when>
141<xsl:otherwise>
142<xsl:call-template name="Browsing"/>
143</xsl:otherwise>
144</xsl:choose>
145<!--
146<xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
147<li><a href="{$currentPage}">Search</a>
148<ul>
149<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
150<xsl:variable name="search" select="@name"/>
151<xsl:variable name="search_name" select="displayItem[@name='name']"/>
152<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
153</xsl:for-each>
154</ul>
155</li>
156</xsl:if>
157-->
158</xsl:when>
159<xsl:otherwise> </xsl:otherwise>
160</xsl:choose>
161</xsl:template>
162
163<xsl:template name="Browsing">
164 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
165 <li>
166 <xsl:choose>
167 <!-- If this tab is selected then colour it differently -->
168 <xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
169 <xsl:attribute name='class'>active</xsl:attribute>
170 </xsl:when>
171 <xsl:otherwise> </xsl:otherwise>
172 </xsl:choose>
173 <a>
174 <!-- Add a title element to the <a> tag if a description exists for this classifier -->
175 <xsl:if test="displayItem[@name='description']">
176 <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
177 </xsl:if>
178
179 <!-- Add the href element to the <a> tag -->
180 <xsl:choose>
181 <xsl:when test="@name">
182 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/></xsl:attribute>
183 </xsl:when>
184 <xsl:otherwise>
185 <xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1</xsl:attribute>
186 </xsl:otherwise>
187 </xsl:choose>
188
189 <!-- Add the actual text of the <a> tag -->
190 <xsl:value-of select="displayItem[@name='name']"/>
191 </a>
192 </li>
193 </xsl:for-each>
194</xsl:template>
195
196<xsl:template name="crossCollSearch">
197 <div id="search">
198 <xsl:for-each select="/page/pageResponse/serviceList/service[@name='TextQuery']">
199 <form name="QuickSearch" method="get" action="{$library_name}">
200 <input type="hidden" name="a" value="q"/>
201 <input type="hidden" name="rt" value="rd"/>
202 <input type="hidden" name="s" value="{@name}"/>
203 <input type="hidden" name="s1.collection" value="all"/>
204 <input type="text" name="s1.query" id="search-text" value="Search all collections
" onfocus="this.value=(this.value=='Search all collections
')? '' : this.value ;" />
205 <input type="submit" name="go" id="go" value="Search" />
206 </form>
207 </xsl:for-each>
208 </div>
209 <br class="clear" />
210</xsl:template>
211
212<xsl:template name="CollectionSearch">
213<div id="search">
214<xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
215<form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
216<!-- This parameter says that we have come from the quick search area -->
217<input type="hidden" name="qs" value="1"/>
218<input type="hidden" name="rt" value="rd"/>
219<input type="hidden" name="s1.level">
220<xsl:attribute name="value">
221<xsl:choose>
222<xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']">
223<xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/>
224</xsl:when>
225<xsl:otherwise>
226<xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
227</xsl:otherwise>
228</xsl:choose>
229</xsl:attribute>
230</input>
231<xsl:choose>
232<xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
233<input type="hidden" name="s1.startPage" value="1"/>
234</xsl:when>
235<xsl:otherwise>
236<input type="hidden" name="startPage" value="1"/>
237</xsl:otherwise>
238</xsl:choose>
239<xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
240<input type="hidden" name="s1.hitsPerPage" value="20"/>
241</xsl:if>
242<xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
243<input type="hidden" name="s1.maxDocs" value="100"/>
244</xsl:if>
245<!-- The query text box -->
246<span class="querybox">
247<xsl:variable name="qs">
248<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
249</xsl:variable>
250<nobr>
251<xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
252<xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
253</xsl:apply-templates>
254</nobr>
255</span>
256<!-- The submit button (for TextQuery) -->
257<xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
258<input type="submit" name="go" id="go" value="Search" > </input>
259<br/>
260</xsl:if>
261</form>
262</div>
263<br class="clear" />
264<!--<div id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/TextQuery">advanced search</a></div>-->
265</xsl:template>
266
267
268<xsl:template name="loginLinks">
269 <xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
270 <xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
271
272 <xsl:choose>
273 <xsl:when test="$username">
274 <!-- Depositor link: only for logged-in users.
275 CSS class=login to make Depositor link blue to indicate it's only available when logged in.
276 Don't put this depositorTitleAndLink inside the test for whether user 'admin' is
277 in the current list of groups, as we want the depositor link to be visible for any
278 logged in user. The collection they want to deposit a doc into will determine whether
279 that user has the right to modify that collection.
280 -->
281 <li class="login"><gslib:depositorTitleAndLink/></li>
282 <xsl:if test="contains($groups,'admin')">
283 <li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li>
284 <li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
285 </xsl:if>
286 <li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
287 <li class="login"><a href="{$library_name}?logout=">Logout</a></li>
288 </xsl:when>
289 <xsl:otherwise>
290 <li class="login">
291 <a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
292 <xsl:attribute name="title">
293 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
294 </xsl:attribute>
295 </a>
296 </li>
297 </xsl:otherwise>
298 </xsl:choose>
299</xsl:template>
300
301<xsl:template name="quick-search-area">
302 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
303 <xsl:variable name="subaction" select="/page/pageRequest/@subaction"/>
304
305 <div id="quicksearcharea">
306 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
307 <xsl:choose>
308 <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'">
309 <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
310 <!-- This parameter says that we have come from the quick search area -->
311
312 <input type="hidden" name="qs" value="1"/>
313 <input type="hidden" name="rt" value="rd"/>
314 <!-- don't hide indexing levels: code further down will hide it if there's only 1 indexing level.
315 and display a dropdown if the collection's configured with more than 1 index level available -->
316 <!--<input type="hidden" name="s1.level">
317 <xsl:attribute name="value">
318 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
319 </xsl:attribute>
320 </input>
321 -->
322 <xsl:choose>
323 <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
324 <input type="hidden" name="s1.startPage" value="1"/>
325 </xsl:when>
326 <xsl:otherwise>
327 <input type="hidden" name="startPage" value="1"/>
328 </xsl:otherwise>
329 </xsl:choose>
330
331 <!-- The query text box -->
332 <span class="querybox">
333 <xsl:variable name="qs">
334 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/>
335 </xsl:variable>
336 <nobr>
337 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']">
338 <!--
339 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/>
340 -->
341 <xsl:with-param name="default" select="normalize-space($qs)"/>
342
343 </xsl:apply-templates>
344 </nobr>
345 </span>
346 <!-- The index selection list -->
347 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
348 <span class="textselect">
349 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
350 <xsl:with-param name="default">
351 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
352 </xsl:with-param>
353 <xsl:with-param name="hideSingle">false</xsl:with-param>
354 <xsl:with-param name="quickSearch">true</xsl:with-param>
355 </xsl:apply-templates>
356 </span>
357 </xsl:if>
358 <!-- The partition selection list -->
359 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
360 <span class="textselect">
361 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
362 <xsl:with-param name="default">
363 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
364 </xsl:with-param>
365 <xsl:with-param name="hideSingle">true</xsl:with-param>
366 <xsl:with-param name="quickSearch">true</xsl:with-param>
367 </xsl:apply-templates>
368 </span>
369 </xsl:if>
370
371 <!-- The index level selection list. hideSingle=true to hide the dropdown if there's only 1 level (the default). -->
372 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']/@type = 'enum_single'">
373 <span class="textselect">
374 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']">
375 <xsl:with-param name="default">
376 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']" mode="calculate-default"/>
377 </xsl:with-param>
378 <xsl:with-param name="hideSingle">true</xsl:with-param>
379 <xsl:with-param name="quickSearch">true</xsl:with-param>
380 </xsl:apply-templates>
381 </span>
382 </xsl:if>
383
384 <!-- The language selection list -->
385 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'">
386 <span class="textselect">
387 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']">
388 <xsl:with-param name="default">
389 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/>
390 </xsl:with-param>
391 <xsl:with-param name="hideSingle">true</xsl:with-param>
392 <xsl:with-param name="quickSearch">true</xsl:with-param>
393 </xsl:apply-templates>
394 </span>
395 </xsl:if>
396 <!-- The submit button (for TextQuery) -->
397 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
398 <input type="submit" id="quickSearchSubmitButton">
399 <xsl:attribute name="value">
400 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/>
401 </xsl:attribute>
402 </input>
403 <br/>
404 </xsl:if>
405 </form>
406 </xsl:when>
407 <xsl:otherwise><br/></xsl:otherwise>
408 </xsl:choose>
409 </xsl:if>
410
411 </div>
412 <!--<br class="clear" />-->
413 <!--<span id="advanced">-->
414
415 <!-- The list of other search types -->
416 <div class="query-form-links">
417 <ul>
418 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
419 <xsl:if test="/page/pageRequest/paramList/param[@name='qs']/@value = 1 or not(@name = /page/pageRequest/paramList/param[@name='s']/@value)">
420 <li class="ui-state-default ui-corner-all">
421 <a class="query-form-links">
422 <xsl:attribute name="href">
423 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/>
424 </xsl:attribute>
425 <xsl:value-of select="displayItem[@name='name']"/>
426 </a>
427 </li>
428 </xsl:if>
429 </xsl:for-each>
430 </ul>
431 </div>
432 </xsl:if>
433 <!--<br class="clear" />
434 <div id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/TextQuery">form search</a></div>
435 <div id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/AdvancedFieldQuery">advanced search</a></div>
436 -->
437 </xsl:template>
438
439</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.