source: greenstone3/trunk/web/ui/skins/oran/xsl/collectDocument.xsl@ 20160

Last change on this file since 20160 was 16601, checked in by max, 16 years ago

Added onMouseOver event to show the table of contents.

File size: 6.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2
3<xsl:stylesheet version="1.0"
4 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
5 xmlns:gslib="http://www.greenstone.org/skinning">
6
7<xsl:import href="./util.xsl"/>
8
9<xsl:template match="/">
10<html>
11 <head>
12 <title>
13 <gslib:metadataItem name="siteName" />
14 /
15 <gslib:metadataItem name="collectionName" />
16 </title>
17
18 <gslib:css/>
19 <gslib:js/>
20 </head>
21 <body>
22 <xsl:if test="$document_currentSection/@nodeType = 'root'">
23 <xsl:attribute name="onload">showContents()</xsl:attribute>
24 </xsl:if>
25
26 <div id="container">
27 <div id="header">
28 <div class="title_minor">
29 <a href="{$site_homeUrl}">
30 <gslib:metadataItem name="siteName" />
31 </a>
32 </div>
33
34 <div class="title_major">
35 <gslib:metadataItem name="collectionName" />
36 </div>
37
38 <div id="tablist" class="linklist">
39 <ul>
40 <xsl:for-each select="$services">
41 <li>
42 <a href="">
43 <xsl:attribute name="href"> <gslib:service_url/> </xsl:attribute>
44 <xsl:attribute name="title"> <gslib:service_description/> </xsl:attribute>
45 <gslib:service_title/>
46 </a>
47 </li>
48 </xsl:for-each>
49
50 <li>
51 <a href="{$collection_homeUrl}">
52 Home
53 </a>
54 </li>
55 </ul>
56 </div>
57
58 <div class="quicksearchBox" >
59 <form method="get" name="quickSearch">
60 <input type="text" name="s1.query" value="{$search_query}"/>
61
62 <input type="submit" value="Quick Search"/>
63 <gslib:search_hiddenInputs/>
64 </form>
65 </div>
66
67 </div>
68
69 <div id="content" class="noSidebar">
70
71 <br/>
72
73 <xsl:if test="$document_coverImage_exists='true'">
74 <div class="coverImage">
75 <img src="{$document_coverImage_url}"> </img>
76 </div>
77 </xsl:if>
78
79 <h1>
80 <gslib:document_title/>
81 </h1>
82
83 <xsl:choose>
84 <xsl:when test="$document_type='simple'">
85 <div id="subServiceList" class="linklist">
86 <ul>
87 <li>
88 <a href="" target="_blank" title="open in new window">detach</a>
89 </li>
90 </ul>
91 </div>
92
93 <br/><br/>
94
95 <div class="documentBody">
96 <gslib:document_content/>
97 </div>
98 </xsl:when>
99
100 <xsl:when test="$document_type='hierarchy' and $document_is_expanded != 'true'">
101 <div id="subServiceList" class="linklist">
102 <ul>
103 <li>
104 <a href="{$document_expanded_url}" title="view entire document">expand</a>
105 </li>
106 <li>
107 <a href="" target="_blank" title="open in new window">detach</a>
108 </li>
109 </ul>
110 </div>
111
112 <a id="contentsLink" onClick="showContents()" onMouseOver="showContents()">Show contents</a>
113
114 <div id="contents">
115 <ul>
116 <xsl:for-each select="$document_topLevelNodes">
117 <xsl:call-template name="addDocNodeToContents"/>
118 </xsl:for-each>
119 </ul>
120 </div>
121
122 <br/><br/>
123
124 <div class="documentBody">
125
126 <xsl:choose>
127 <xsl:when test="$document_ancestorSections!=''">
128 <p class="ancestorSections">
129 <xsl:for-each select="$document_ancestorSections_titles">
130 <xsl:value-of select="."/> /
131 </xsl:for-each>
132 </p>
133
134 <h2 class="subsectionHeader"> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
135
136 </xsl:when>
137
138 <xsl:otherwise>
139 <xsl:if test="$document_currentSection/@nodeType != 'root'">
140 <h2> <xsl:value-of disable-output-escaping='yes' select="$document_currentSection_title"/> </h2>
141 </xsl:if>
142 </xsl:otherwise>
143 </xsl:choose>
144
145 <xsl:call-template name="section_navigation" />
146
147 <gslib:document_currentSection_content/>
148
149 <xsl:call-template name="section_navigation" />
150 </div>
151 </xsl:when>
152
153 <xsl:when test="$document_type='hierarchy' and $document_is_expanded">
154 <div id="subServiceList" class="linklist">
155 <ul>
156 <li>
157 <a href="{$document_collapsed_url}" title="view document as sections">collapse</a>
158 </li>
159 <li>
160 <a href="" target="_blank" title="open in new window">detach</a>
161 </li>
162 </ul>
163 </div>
164
165
166 <br/><br/>
167 <xsl:for-each select="$document_allSections">
168
169 <xsl:variable name="depth"><gslib:document_section_depth/></xsl:variable>
170
171 <xsl:element name="h{$depth + 1}">
172 <gslib:document_section_title/>
173 </xsl:element>
174
175 <gslib:document_section_content/>
176 </xsl:for-each>
177 </xsl:when>
178
179 </xsl:choose>
180 </div>
181
182 <div id="footer" >
183 <gslib:uiItem name="collectionFooter"/>
184 </div>
185 </div>
186 </body>
187</html>
188</xsl:template>
189
190<xsl:template name="addDocNodeToContents">
191
192 <xsl:variable name="sId"> <gslib:document_section_id/></xsl:variable>
193
194 <li class="expanded" id="{$sId}">
195 <xsl:choose>
196 <xsl:when test="@nodeType='leaf'">
197 <xsl:attribute name="class">leaf</xsl:attribute>
198 </xsl:when>
199 <xsl:otherwise>
200 <xsl:attribute name="class">collapsed</xsl:attribute>
201 </xsl:otherwise>
202 </xsl:choose>
203 <a>
204 <xsl:choose>
205 <xsl:when test=".=$document_currentSection">
206 <xsl:attribute name="id">currentSection</xsl:attribute>
207 </xsl:when>
208 <xsl:when test="@nodeType='leaf'">
209 <xsl:attribute name="href"><gslib:documentNode_url/>&amp;ec=1</xsl:attribute>
210 </xsl:when>
211 <xsl:otherwise>
212 <xsl:attribute name="onclick">toggleNode('<gslib:document_section_id/>')</xsl:attribute>
213 </xsl:otherwise>
214 </xsl:choose>
215
216 <gslib:document_section_title/>
217 </a>
218
219 <xsl:if test="./documentNode">
220 <ul>
221 <xsl:for-each select="./documentNode">
222 <xsl:call-template name="addDocNodeToContents"/>
223 </xsl:for-each>
224 </ul>
225 </xsl:if>
226 </li>
227</xsl:template>
228
229<xsl:template name="section_navigation">
230 <xsl:if test="$document_previousSection!='' or $document_nextSection!=''">
231 <div class="sectionNav">
232 <xsl:if test="$document_previousSection!=''">
233 <a class="prevSection" href="{$document_previousSection_url}" title="{$document_previousSection_title}"> &lt; Previous Section</a>
234 </xsl:if>
235 <xsl:if test="$document_nextSection!=''">
236 <a class="nextSection" href="{$document_nextSection_url}" title="{$document_nextSection_title}">Next Section &gt;</a>
237 </xsl:if>
238 </div>
239 </xsl:if>
240</xsl:template>
241
242</xsl:stylesheet>
Note: See TracBrowser for help on using the repository browser.