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

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

Draft interface for use in Defining Libraries tutorial.

File size: 11.9 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 class="wrapper cf">
30 <div id="logo">
31 <a href="{$library_name}" ><img src="interfaces/{$interface_name}/img/logo.png" alt="" /></a>
32 </div>
33 </div><!-- ENDS header wrapper -->
34 <!-- ENDS header wrapper -->
35
36
37
38 <!-- nav -->
39 <nav class="cf">
40 <div class="wrapper cf">
41 <ul id="nav" class="sf-menu">
42 <xsl:call-template name="navBar"/>
43 </ul>
44 <div id="combo-holder"></div>
45 </div>
46 </nav>
47 <!-- ends nav -->
48
49 </header>
50 <div role="main" id="main">
51 <div class="wrapper">
52 <xsl:apply-templates select="/page"/>
53 </div>
54 </div>
55 <xsl:call-template name="gs_footer"/>
56
57 <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"><xsl:text> </xsl:text></script>
58
59
60 <!-- scripts concatenated and minified via build script -->
61 <script src="interfaces/{$interface_name}/js/custom.js"><xsl:text> </xsl:text></script>
62
63 <!-- superfish -->
64 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/hoverIntent.js"><xsl:text> </xsl:text></script>
65 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/superfish.js"><xsl:text> </xsl:text></script>
66 <script src="interfaces/{$interface_name}/js/superfish-1.4.8/js/supersubs.js"><xsl:text> </xsl:text></script>
67 <!-- ENDS superfish -->
68
69 <script src="interfaces/{$interface_name}/js/tweet/jquery.tweet.js" ><xsl:text> </xsl:text></script>
70 <script src="interfaces/{$interface_name}/js/jquery.isotope.min.js"><xsl:text> </xsl:text></script>
71 <script src="interfaces/{$interface_name}/js/jquery.nivo.slider.js" ><xsl:text> </xsl:text></script>
72 <script src="interfaces/{$interface_name}/js/css3-mediaqueries.js"><xsl:text> </xsl:text></script>
73 <script src="interfaces/{$interface_name}/js/tabs.js"><xsl:text> </xsl:text></script>
74 <script src="interfaces/{$interface_name}/js/poshytip-1.1/src/jquery.poshytip.min.js"><xsl:text> </xsl:text></script>
75
76
77 </body>
78</html>
79</xsl:template>
80
81<!-- Template controlling the footer. -->
82<xsl:template name="gs_footer">
83<!-- Put footer in here. -->
84<footer>
85 <!-- wrapper -->
86 <div class="wrapper cf">
87 <!-- social -->
88 <div class="sb-holder cf">
89 <ul id="social-bar" class="cf">
90 <li class="left-corner"><i></i></li>
91 <li><a href="http://www.facebook.com" title="Become a fan" ><img src="interfaces/{$interface_name}/img/social/Facebook.png" alt="Facebook" /></a></li>
92 <li><a href="http://www.twitter.com" title="Follow my tweets" ><img src="interfaces/{$interface_name}/img/social/Twitter.png" alt="twitter" /></a></li>
93 <li><a href="http://www.google.com" title="Add to the circle" ><img src="interfaces/{$interface_name}/img/social/Google+.png" alt="Google plus" /></a></li>
94 <li class="right-corner"><i></i></li>
95 <li><a href="http://www.google.com" title="Add to the circle" ><img src="interfaces/{$interface_name}/img/social/RSS.png" alt="RSS" /></a></li>
96 <li class="right-corner"><i></i></li>
97 </ul>
98 </div>
99 <!-- ENDS social -->
100 <!-- widgets -->
101 <ul class="widget-cols cf">
102 <li class="first-col">
103 <div class="widget-block">
104 <h4>RECENT POSTS</h4>
105 <div class="recent-post cf">
106 <a href="#" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
107 <div class="post-head">
108 <a href="#">Pellentesque habitant morbi senectus </a><span> March 12, 2011</span>
109 </div>
110 </div>
111 <div class="recent-post cf">
112 <a href="#" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
113 <div class="post-head">
114 <a href="#">Pellentesque habitant morbi senectus</a><span> March 12, 2011</span>
115 </div>
116 </div>
117 <div class="recent-post cf">
118 <a href="#" class="thumb"><img src="interfaces/{$interface_name}/images/54x54.jpg" alt="Post" /></a>
119 <div class="post-head">
120 <a href="#">Pellentesque habitant morbi senectus</a><span> March 12, 2011</span>
121 </div>
122 </div>
123 </div>
124 </li>
125 <li class="second-col">
126 <div class="widget-block">
127 <h4>ABOUT</h4>
128 <p>Vintage Template it's completely free this means you don't have to pay anything <a href="http://luiszuno.com/blog/license" >read license</a>.</p>
129
130 <p>Placeholder images by <a href="http://twistedfork.me/" >Dan Matutina</a></p>
131 <p>Visit <a href="http://templatecreme.com/" >Template Creme</a> and find the most beautiful free templates up to date.</p></div>
132 </li>
133 <li class="third-col">
134 <div class="widget-block">
135 <div id="tweets" class="footer-col tweet">
136 <h4>TWITTER WIDGET</h4>
137 </div>
138 </div>
139 </li>
140 <li class="fourth-col">
141 <div class="widget-block">
142 <h4>CATEGORIES</h4>
143 <ul>
144 <li class="cat-item"><a href="#" >Design</a></li>
145 <li class="cat-item"><a href="#" >Photo</a></li>
146 <li class="cat-item"><a href="#" >Art</a></li>
147 <li class="cat-item"><a href="#" >Game</a></li>
148 <li class="cat-item"><a href="#" >Film</a></li>
149 <li class="cat-item"><a href="#" >TV</a></li>
150 </ul>
151 </div>
152
153 </li>
154 </ul>
155 <!-- ENDS widgets -->
156 <div id="footer-bottom">Vintage Template designed by <a href="http://www.luiszuno.com" >luiszuno.com</a></div>
157
158 </div><!-- ENDS wrapper -->
159 </footer>
160</xsl:template>
161<xsl:template name="navBar">
162<xsl:choose>
163<xsl:when test="page/pageResponse/collection">
164<xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
165<xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>
166
167<li><a href="{$library_name}">Home</a></li>
168<li>
169<xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">active</xsl:attribute></xsl:if>
170<a href="{$library_name}/collection/{$collNameChecked}/page/about">About</a>
171</li>
172
173<xsl:choose>
174<xsl:when test="$count > 3">
175<li><a href="{$currentPage}">Browse</a>
176<ul>
177<xsl:call-template name="Browsing"/>
178</ul>
179</li>
180</xsl:when>
181<xsl:otherwise>
182<xsl:call-template name="Browsing"/>
183</xsl:otherwise>
184</xsl:choose>
185
186<xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
187<li><a href="{$currentPage}">Search</a>
188<ul>
189<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
190<xsl:variable name="search" select="@name"/>
191<xsl:variable name="search_name" select="displayItem[@name='name']"/>
192<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
193</xsl:for-each>
194</ul>
195</li>
196</xsl:if>
197
198</xsl:when>
199<xsl:otherwise> </xsl:otherwise>
200</xsl:choose>
201</xsl:template>
202
203<xsl:template name="Browsing">
204<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
205<li>
206<xsl:choose>
207<!-- If this tab is selected then colour it differently -->
208<xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
209<xsl:attribute name='class'>active</xsl:attribute>
210</xsl:when>
211<xsl:otherwise> </xsl:otherwise>
212</xsl:choose>
213
214<a>
215<!-- Add a title element to the <a> tag if a description exists for this classifier -->
216<xsl:if test="displayItem[@name='description']">
217<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
218</xsl:if>
219
220<!-- Add the href element to the <a> tag -->
221<xsl:choose>
222<xsl:when test="@name">
223<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>
224</xsl:when>
225<xsl:otherwise>
226<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>
227</xsl:otherwise>
228</xsl:choose>
229
230<!-- Add the actual text of the <a> tag -->
231<xsl:value-of select="displayItem[@name='name']"/>
232</a>
233</li>
234</xsl:for-each>
235</xsl:template>
236
237</xsl:stylesheet>
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255<!--
256<xsl:template name="navBar">
257<xsl:choose>
258<xsl:when test="page/pageResponse/collection">
259<xsl:variable name="count" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier)"/>
260<xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/>
261
262<li><a href="{$library_name}">Home<i><b><xsl:text> </xsl:text></b></i></a></li>
263<li>
264<xsl:if test="page/pageRequest/@subaction='about'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
265<a href="{$library_name}/collection/{$collNameChecked}/page/about">About<i><b><xsl:text> </xsl:text></b></i></a>
266</li>
267
268<xsl:choose>
269<xsl:when test="$count > 3">
270<li>
271<xsl:if test="page/pageRequest/@action='b'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if>
272<a href="{$currentPage}">Browse<i><b><xsl:text> </xsl:text></b></i></a>
273<ul>
274<xsl:call-template name="Browsing"/>
275</ul>
276</li>
277</xsl:when>
278<xsl:otherwise>
279<xsl:call-template name="Browsing"/>
280</xsl:otherwise>
281</xsl:choose>
282
283<xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'">
284<li><xsl:if test="page/pageRequest/@action='q'"><xsl:attribute name="class">current-menu-item</xsl:attribute></xsl:if><a><xsl:attribute name="href"><xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="/page/pageResponse/collection/serviceList/service[@type='query'][1]/@name"/></xsl:attribute>Search<i><b><xsl:text> </xsl:text></b></i></a>
285<ul>
286<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']">
287<xsl:variable name="search" select="@name"/>
288<xsl:variable name="search_name" select="displayItem[@name='name']"/>
289<li><a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"><xsl:value-of select="$search_name"/></a></li>
290</xsl:for-each>
291</ul>
292</li>
293</xsl:if>
294
295</xsl:when>
296<xsl:otherwise> </xsl:otherwise>
297</xsl:choose>
298</xsl:template>
299
300<xsl:template name="Browsing">
301<xsl:for-each select="/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier">
302<li>
303<xsl:choose>
304<xsl:when test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)">
305<xsl:attribute name='class'>current-menu-item</xsl:attribute>
306</xsl:when>
307<xsl:otherwise> </xsl:otherwise>
308</xsl:choose>
309
310<a>
311
312<xsl:if test="displayItem[@name='description']">
313<xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute>
314</xsl:if>
315
316
317<xsl:choose>
318<xsl:when test="@name">
319<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>
320</xsl:when>
321<xsl:otherwise>
322<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>
323</xsl:otherwise>
324</xsl:choose>
325
326<xsl:value-of select="displayItem[@name='name']"/><i><b><xsl:text> </xsl:text></b></i>
327</a>
328</li>
329</xsl:for-each>
330</xsl:template>
331 -->
332
333
334
335
336
337
Note: See TracBrowser for help on using the repository browser.