source: main/trunk/greenstone3/web/interfaces/halftone/transform/layouts/main.xsl@ 31111

Last change on this file since 31111 was 31111, checked in by ak19, 7 years ago

Same change as for althor interface committed in revision 31110: the home navbar link was being shifted down lower than other other links in the navbar.

File size: 11.5 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
18<!-- The main layout is defined here -->
19<xsl:template name="mainTemplate">
20<html>
21 <head>
22 <!-- ***** in header.xsl ***** -->
23 <xsl:call-template name="create-html-header"/>
24 </head>
25 <body>
26 <div class="wrapper cf">
27
28 <header class="cf">
29
30 <!-- social-bar -->
31 <div id="social-bar-holder">
32 <ul id="social-bar" class="cf">
33 <li class="facebook"><a href="https://www.facebook.com/WaikatoUniversity" title="Facebook" ><xsl:text> </xsl:text></a></li>
34 <li class="twitter"><a href="https://twitter.com/WekaMOOC" title="twitter" ><xsl:text> </xsl:text></a></li>
35 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search' or not(@type)]/gsf:option[@name='RSS']/@value = 'true'">
36
37 <li class="rss"><a href="{$library_name}?a=rss&amp;amp;l=en&amp;amp;site={$site_name}&amp;amp;c={$collNameChecked}" title="rss"><xsl:text> </xsl:text></a></li>
38 </xsl:if>
39
40 </ul>
41 </div>
42 <div class="cf"><xsl:text> </xsl:text></div>
43 <!-- ENDS social-bar -->
44
45<div id="top"><xsl:text> </xsl:text></div>
46 <div id="logo">
47 <div id="title"><a id="lib" href="{$library_name}"><xsl:call-template name="siteName"/></a>
48 <xsl:if test="/page/pageResponse/collection"><br/>
49 <xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/></xsl:if>
50 </div>
51 </div>
52
53 <!-- nav -->
54 <nav class="cf">
55 <ul id="nav" class="sf-menu">
56 <xsl:call-template name="navBar"/>
57 </ul>
58 <div id="combo-holder"><xsl:text> </xsl:text></div>
59 </nav>
60 <!-- ends nav -->
61 </header>
62 <div role="main" id="main" class="cf">
63 <xsl:choose>
64 <xsl:when test="not(/page/pageRequest/@subaction='home')">
65 <div class="page-content">
66 <div class="entry-content cf">
67 <xsl:apply-templates select="/page"/>
68 </div>
69 </div>
70
71 </xsl:when>
72 <xsl:otherwise>
73 <xsl:apply-templates select="/page"/>
74 </xsl:otherwise>
75 </xsl:choose>
76 </div>
77 <xsl:call-template name="gs_footer"/>
78 </div>
79 <xsl:call-template name="extra-script"/>
80
81 </body>
82</html>
83</xsl:template>
84
85
86
87
88<xsl:template name="loginLinks">
89<xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
90<xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
91
92<xsl:choose>
93<xsl:when test="$username">
94<li class="login cat-item"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
95<xsl:if test="contains($groups,'admin')">
96<li class="login cat-item"><a href="{$library_name}/admin/AddUser">Add user</a></li>
97<li class="login cat-item"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
98</xsl:if>
99<li class="login cat-item"><a href="{$library_name}?logout=">Logout</a></li>
100</xsl:when>
101<xsl:otherwise>
102<li class="login cat-item">
103<a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
104<xsl:attribute name="title">
105<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
106</xsl:attribute>
107</a>
108</li>
109</xsl:otherwise>
110</xsl:choose>
111</xsl:template>
112
113
114
115
116
117
118
119<xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
120
121
122<!--
123 <li class="current-menu-item"><a href="index.html"><span>HOME</span></a></li>
124 <li><a href="page.html"><span>FEATURES</span></a>
125 <ul>
126 <li><a href="page.html">Columns</a></li>
127 <li><a href="page-typography.html">Typography</a></li>
128 <li><a href="page-elements.html">Elements</a></li>
129 <li><a href="page-sidebar.html">Sidebar Page</a></li>
130 </ul>
131 </li>
132-->
133<xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>
134
135<xsl:template name="navBar">
136<xsl:choose>
137<xsl:when test="page/pageResponse/collection">
138
139<li><a href="{$library_name}"><span>Home</span></a></li>
140<li>
141<xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
142<a href="{$library_name}/collection/{$collNameChecked}/page/about"><span>About</span></a>
143</li>
144
145<xsl:choose>
146<xsl:when test="$count > 5">
147<li>
148<xsl:if test="page/pageRequest/@action='b'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
149<a href="{$library_name}/collection/{$collNameChecked}/browse/CL1"><span>Browse</span></a>
150<ul>
151<xsl:call-template name="Browsing"/>
152</ul>
153</li>
154</xsl:when>
155<xsl:otherwise>
156<xsl:call-template name="Browsing"/>
157</xsl:otherwise>
158</xsl:choose>
159
160<xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
161<xsl:variable name="default_search" select="/page/pageResponse/collection/serviceList/service[@type='query'][1]/@name"/>
162<li>
163<xsl:if test="page/pageRequest/@action='q'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
164<a href="{$library_name}/collection/{$collNameChecked}/search/{$default_search}"><span>Search</span></a>
165<ul>
166<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
167<xsl:variable name="search" select="@name"/>
168<xsl:variable name="search_name" select="displayItem[@name='name']"/>
169<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
170</xsl:for-each>
171<li><a href="{$library_name}?a=q&amp;amp;rt=d&amp;amp;s=TextQuery">Multi-Collection</a></li>
172</ul>
173</li>
174</xsl:if>
175
176</xsl:when>
177<xsl:otherwise> </xsl:otherwise>
178</xsl:choose>
179</xsl:template>
180
181<xsl:template name="Browsing">
182<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
183<li>
184<xsl:choose>
185<!-- If this tab is selected then colour it differently -->
186<xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name) and $count &lt; 5">
187<xsl:attribute name='class'>current-menu-item</xsl:attribute>
188</xsl:when>
189<xsl:otherwise> </xsl:otherwise>
190</xsl:choose>
191
192<a>
193<!-- Add a title element to the a tag if a description exists for this classifier -->
194<xsl:if test="displayItem[@name='description']">
195<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
196</xsl:if>
197
198<!-- Add the href element to the a tag -->
199<xsl:choose>
200<xsl:when test="@name">
201<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>
202</xsl:when>
203<xsl:otherwise>
204<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>
205</xsl:otherwise>
206</xsl:choose>
207
208<!-- Add the actual text of the a tag -->
209
210<xsl:choose>
211<xsl:when test="$count &lt; 5">
212<span><xsl:value-of select="displayItem[@name='name']"/></span>
213</xsl:when>
214<xsl:otherwise>
215<xsl:value-of select="displayItem[@name='name']"/>
216</xsl:otherwise>
217</xsl:choose>
218
219</a>
220</li>
221</xsl:for-each>
222</xsl:template>
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248<!-- Template controlling the footer. -->
249<xsl:template name="gs_footer">
250<!-- Put footer in here. -->
251 <footer>
252
253 <!-- text message -->
254 <div id="twitter-holder">
255 <div class="ribbon-left"><xsl:text> </xsl:text></div>
256 <div class="ribbon">
257 <div id="tweets-bar" class="tweet">
258
259 <ul class="tweet_list">
260 <li>
261 <div class="tweet_time"><xsl:text> </xsl:text></div>
262 </li>
263 </ul>
264
265 </div>
266 </div>
267 <div class="ribbon-right"><xsl:text> </xsl:text></div>
268 </div>
269 <!-- ENDS text message -->
270
271
272 <!-- widgets -->
273 <ul class="widget-cols cf">
274 <li class="first-col">
275 <div class="widget-block">
276 <h4>News</h4>
277 <div class="recent-post cf">
278 <a href="http://www.greenstone.org/download" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
279 <div class="post-head">
280 <a href="http://www.greenstone.org/download">Greenstone 3.07 Released!</a><span>September 2015</span>
281 </div>
282 </div>
283 <div class="recent-post cf">
284 <a href="http://wiki.greenstone.org" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
285 <div class="post-head">
286 <a href="http://wiki.greenstone.org">New Wiki Launched!</a><span>October 2013</span>
287 </div>
288 </div>
289 </div>
290 </li>
291 <li class="second-col">
292 <div class="widget-block">
293 <h4>ABOUT</h4>
294 <p>This interface was created using a free CSS template by <a href="http://luiszuno.com/">http://luiszuno.com/</a>. Be sure to keep the credit line in the footer intact.</p>
295
296 <p>Placeholder images by Jennifer L. Whisler (free for reuse under a <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution</a> license).</p>
297 </div>
298 </li>
299 <li class="third-col">
300 <div class="widget-block">
301 <div id="tweets" class="footer-col tweet">
302 <h4>Library</h4>
303 <ul>
304 <xsl:call-template name="loginLinks"/>
305 <li class="cat-item"><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li>
306 <!--<li class="cat-item"><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li>-->
307 </ul>
308 </div>
309 </div>
310 </li>
311 <li class="fourth-col">
312 <div class="widget-block">
313 <h4>Links</h4>
314 <ul>
315 <li class="cat-item"><a href="http://www.greenstone.org" >Greenstone</a></li>
316 <li class="cat-item"><a href="http://wiki.greenstone.org">Greenstone Wiki</a></li>
317 <li class="cat-item"><a href="http://www.nzdl.org/cgi-bin/library.cgi" >New Zealand Digital Library</a></li>
318 <li class="cat-item"><a href="http://www.greenstone.org/download">Download Greenstone3</a></li>
319 </ul>
320 </div>
321
322 </li>
323 </ul>
324 <!-- ENDS widgets -->
325
326 <!-- bottom -->
327 <div id="bottom">
328 <div id="widget-trigger-holder"><a id="widget-trigger" href="{$currentPage}#" title="View More" class="poshytip"><xsl:text> </xsl:text></a></div>
329 <div id="content">HalfTone Theme by <a href="http://www.luiszuno.com" >luiszuno.com</a> </div>
330 </div>
331 <!-- ENDS bottom -->
332
333 </footer>
334</xsl:template>
335
336
337
338 <xsl:template name="extra-script">
339 <!-- scripts concatenated and minified via build script -->
340
341 <script src="interfaces/{$interface_name}/js/custom.js"><xsl:text> </xsl:text></script>
342
343 <!-- superfish -->
344 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/hoverIntent.js"><xsl:text> </xsl:text></script>
345 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/superfish.js"><xsl:text> </xsl:text></script>
346 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/supersubs.js"><xsl:text> </xsl:text></script>
347 <!-- ENDS superfish -->
348
349 <script src="interfaces/{$interface_name}/js/poshytip-1.1/src/jquery.poshytip.js"><xsl:text> </xsl:text></script>
350 <!-- end scripts -->
351
352 </xsl:template>
353
354</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.