source: documentation/trunk/tutorial_sample_files/libraries/althor/transform/layouts/main.xsl@ 28602

Last change on this file since 28602 was 28602, checked in by jlwhisler, 10 years ago

A few css changes and added the collection name below the library name.

File size: 11.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
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 <header>
27
28 <!-- header wrapper -->
29 <div id="heading" class="wrapper cf">
30 <div id="top"><xsl:text> </xsl:text></div>
31 <div id="logo">
32 <div id="title"><a id="lib" href="{$library_name}"><xsl:call-template name="siteName"/></a>
33 <xsl:if test="/page/pageResponse/collection"><br/>
34 <a id="coll" href=""><xsl:value-of select="/page/pageResponse/collection/displayItem[@name='name']"/></a></xsl:if>
35 </div>
36 </div>
37 <div id="bottom"><xsl:text> </xsl:text></div>
38 </div><!-- ENDS header wrapper -->
39 <!-- ENDS header wrapper -->
40
41
42
43 <!-- nav -->
44 <nav class="cf">
45 <div class="wrapper cf">
46 <ul id="nav" class="sf-menu">
47 <xsl:call-template name="navBar"/>
48 </ul>
49 <div id="combo-holder"></div>
50 </div>
51 </nav>
52 <!-- ends nav -->
53
54 </header>
55 <div role="main" id="main">
56 <div class="wrapper">
57 <xsl:choose>
58 <xsl:when test="not(/page/pageRequest/@subaction='home')">
59 <div class="page-content">
60 <div class="entry-content cf">
61 <xsl:apply-templates select="/page"/>
62 </div>
63 <div class="c-1"><xsl:text> </xsl:text></div>
64<div class="c-2"><xsl:text> </xsl:text></div>
65<div class="c-3"><xsl:text> </xsl:text></div>
66<div class="c-4"><xsl:text> </xsl:text></div>
67
68 </div>
69
70 </xsl:when>
71 <xsl:otherwise>
72 <xsl:apply-templates select="/page"/>
73 </xsl:otherwise>
74 </xsl:choose>
75 </div>
76 </div>
77 <xsl:call-template name="gs_footer"/>
78
79 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>
80
81
82 <!-- scripts concatenated and minified via build script -->
83 <script src="interfaces/{$interface_name}/js/custom.js"><xsl:text> </xsl:text></script>
84
85 <!-- superfish -->
86 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/hoverIntent.js"><xsl:text> </xsl:text></script>
87 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/superfish.js"><xsl:text> </xsl:text></script>
88 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/supersubs.js"><xsl:text> </xsl:text></script>
89 <!-- ENDS superfish -->
90
91 <script src="interfaces/{$interface_name}/js/tweet/jquery.tweet.js" ><xsl:text> </xsl:text></script>
92 <script src="interfaces/{$interface_name}/js/jquery.isotope.min.js"><xsl:text> </xsl:text></script>
93 <script src="interfaces/{$interface_name}/js/jquery.nivo.slider.js" ><xsl:text> </xsl:text></script>
94 <script src="interfaces/{$interface_name}/js/css3-mediaqueries.js"><xsl:text> </xsl:text></script>
95 <script src="interfaces/{$interface_name}/js/tabs.js"><xsl:text> </xsl:text></script>
96 <script src="interfaces/{$interface_name}/js/poshytip-1.1/src/jquery.poshytip.min.js"><xsl:text> </xsl:text></script>
97
98
99 </body>
100</html>
101</xsl:template>
102
103<!-- Template controlling the footer. -->
104<xsl:template name="gs_footer">
105<!-- Put footer in here. -->
106<footer>
107 <!-- wrapper -->
108 <div class="wrapper cf">
109 <!-- social -->
110 <div class="sb-holder cf">
111 <ul id="social-bar" class="cf">
112 <li class="left-corner"><i></i></li>
113 <li><a href="http://www.facebook.com" title="Become a fan" ><img src="interfaces/{$interface_name}/images/social/Facebook.png" alt="Facebook" /></a></li>
114 <li><a href="http://www.twitter.com" title="Follow my tweets" ><img src="interfaces/{$interface_name}/images/social/Twitter.png" alt="twitter" /></a></li>
115 <li><a href="http://www.google.com" title="Add to the circle" ><img src="interfaces/{$interface_name}/images/social/Google+.png" alt="Google plus" /></a></li>
116 <!-- RSS feed link can appear in a global format statement (where it has no type attribute)
117 or in section specific format statements, such as browse, search, display.
118 If it's present in any format statement, display the RSS link in the bannerlinks section. -->
119 <xsl:if test="/page/pageResponse/format[@type='display' or @type='browse' or @type='search' or not(@type)]/gsf:option[@name='RSS']/@value = 'true'">
120
121 <li><gsf:link type="rss"><gsf:icon file="social/RSS.png"/></gsf:link></li>
122 </xsl:if>
123 <li class="right-corner"><i></i></li>
124 </ul>
125 </div>
126 <!-- ENDS social -->
127 <!-- widgets -->
128 <ul class="widget-cols cf">
129 <li class="first-col">
130 <div class="widget-block">
131 <h4>News</h4>
132 <div class="recent-post cf">
133 <a href="http://www.greenstone.org/download" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
134 <div class="post-head">
135 <a href="http://www.greenstone.org/download">Greenstone 2.86 Released!</a><span> 30 October 2013</span>
136 </div>
137 </div>
138 <div class="recent-post cf">
139 <a href="http://wiki.greenstone.org" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
140 <div class="post-head">
141 <a href="http://wiki.greenstone.org">New Wiki Launched!</a><span>20 October 2013</span>
142 </div>
143 </div>
144 </div>
145 </li>
146 <li class="second-col">
147 <div class="widget-block">
148 <h4>ABOUT</h4>
149 <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>
150
151 <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>
152 </div>
153 </li>
154 <li class="third-col">
155 <div class="widget-block">
156 <div id="tweets" class="footer-col tweet">
157 <h4>Library Links</h4>
158 <ul>
159 <xsl:call-template name="loginLinks"/>
160 <li class="cat-item"><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li>
161 <li class="cat-item"><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li>
162 </ul>
163 </div>
164 </div>
165 </li>
166 <li class="fourth-col">
167 <div class="widget-block">
168 <h4>External Links</h4>
169 <ul>
170 <li class="cat-item"><a href="http://www.greenstone.org" >Greenstone</a></li>
171 <li class="cat-item"><a href="http://wiki.greenstone.org">Greenstone Wiki</a></li>
172 <li class="cat-item"><a href="http://www.nzdl.org/cgi-bin/library.cgi" >NZDL</a></li>
173 <li class="cat-item"><a href="http://www.greenstone.org/greenstone3-home">Download Greenstone3</a></li>
174 </ul>
175 </div>
176
177 </li>
178 </ul>
179 <!-- ENDS widgets -->
180 <div id="footer-bottom">Vintage Template designed by <a href="http://www.luiszuno.com" >luiszuno.com</a></div>
181
182 </div><!-- ENDS wrapper -->
183 </footer>
184</xsl:template>
185
186
187
188
189<xsl:template name="loginLinks">
190<xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/>
191<xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/>
192
193<xsl:choose>
194<xsl:when test="$username">
195<li class="login cat-item"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li>
196<xsl:if test="contains($groups,'admin')">
197<li class="login cat-item"><a href="{$library_name}/admin/AddUser">Add user</a></li>
198<li class="login cat-item"><a href="{$library_name}/admin/ListUsers">Administration</a></li>
199</xsl:if>
200<li class="login cat-item"><a href="{$library_name}?logout=">Logout</a></li>
201</xsl:when>
202<xsl:otherwise>
203<li class="login cat-item">
204<a href="{$library_name}?a=p&amp;sa=login&amp;redirectURL={$library_name}%3Fa=p%26sa=home">Login
205<xsl:attribute name="title">
206<xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/>
207</xsl:attribute>
208</a>
209</li>
210</xsl:otherwise>
211</xsl:choose>
212</xsl:template>
213
214
215
216
217
218
219
220<xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
221
222
223
224
225
226<xsl:template name="navBar">
227<xsl:choose>
228<xsl:when test="page/pageResponse/collection">
229
230<xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>
231
232<li><a href="{$library_name}">Home<i><b><xsl:text> </xsl:text></b></i></a></li>
233<li>
234<xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
235<a href="{$library_name}/collection/{$collNameChecked}/page/about">About<i><b><xsl:text> </xsl:text></b></i></a>
236</li>
237
238<xsl:choose>
239<xsl:when test="$count > 5">
240<li>
241<xsl:if test="page/pageRequest/@action='b'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
242<a href="{$library_name}/collection/{$collNameChecked}/browse/CL1">Browse<i><b><xsl:text> </xsl:text></b></i></a>
243<ul>
244<xsl:call-template name="Browsing"/>
245</ul>
246</li>
247</xsl:when>
248<xsl:otherwise>
249<xsl:call-template name="Browsing"/>
250</xsl:otherwise>
251</xsl:choose>
252
253<xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
254<xsl:variable name="default_search" select="/page/pageResponse/collection/serviceList/service[@type='query'][1]/@name"/>
255<li>
256<xsl:if test="page/pageRequest/@action='q'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
257<a href="{$library_name}/collection/{$collNameChecked}/search/{$default_search}">Search<i><b><xsl:text> </xsl:text></b></i></a>
258<ul>
259<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
260<xsl:variable name="search" select="@name"/>
261<xsl:variable name="search_name" select="displayItem[@name='name']"/>
262<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
263</xsl:for-each>
264</ul>
265</li>
266</xsl:if>
267
268</xsl:when>
269<xsl:otherwise> </xsl:otherwise>
270</xsl:choose>
271</xsl:template>
272
273<xsl:template name="Browsing">
274<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
275<li>
276<xsl:choose>
277<!-- If this tab is selected then colour it differently -->
278<xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name) and $count &lt; 5">
279<xsl:attribute name='class'>current-menu-item</xsl:attribute>
280</xsl:when>
281<xsl:otherwise> </xsl:otherwise>
282</xsl:choose>
283
284<a>
285<!-- Add a title element to the <a> tag if a description exists for this classifier -->
286<xsl:if test="displayItem[@name='description']">
287<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
288</xsl:if>
289
290<!-- Add the href element to the <a> tag -->
291<xsl:choose>
292<xsl:when test="@name">
293<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>
294</xsl:when>
295<xsl:otherwise>
296<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>
297</xsl:otherwise>
298</xsl:choose>
299
300<!-- Add the actual text of the <a> tag -->
301<xsl:value-of select="displayItem[@name='name']"/>
302<xsl:if test="$count &lt; 5"><i><b><xsl:text> </xsl:text></b></i></xsl:if>
303</a>
304</li>
305</xsl:for-each>
306</xsl:template>
307
308</xsl:stylesheet>
309
Note: See TracBrowser for help on using the repository browser.