source: main/trunk/model-interfaces-dev/heritage-nz/transform/pages/classifier.xsl@ 33271

Last change on this file since 33271 was 33271, checked in by davidb, 5 years ago

Weaving in of Favourites; small width adjustment for classifer CL4 display within iframe

  • Property svn:mime-type set to application/xml
File size: 8.1 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<xsl:stylesheet version="1.0"
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
4 xmlns:java="http://xml.apache.org/xslt/java"
5 xmlns:util="xalan://org.greenstone.gsdl3.util.XSLTUtil"
6 xmlns:gslib="http://www.greenstone.org/skinning"
7 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
8 extension-element-prefixes="java util"
9 exclude-result-prefixes="java util gsf">
10
11
12 <!-- set page title -->
13 <xsl:template name="pageTitle"><gslib:collectionNameLinked/><gslib:rightArrow/><gslib:serviceName/></xsl:template>
14
15
16 <!-- the page content -->
17 <xsl:template match="/page/pageResponse">
18 <xsl:call-template name="classifierPre"/>
19
20 <script type="text/javascript" src="interfaces/{$interface_name}/js/classifier_scripts.js"><xsl:text> </xsl:text></script>
21 <script type="text/javascript">$(window).load(openStoredClassifiers);</script>
22
23 <!-- **** Customized **** -->
24 <xsl:variable name="clName"><xsl:value-of select="classifier/@name"/></xsl:variable>
25 <xsl:variable name="floatRightWidth">
26 <xsl:choose>
27 <xsl:when test="$clName = 'CL4'">20</xsl:when>
28 <xsl:otherwise>20</xsl:otherwise> <!-- used to be 30 -->
29 </xsl:choose>
30 </xsl:variable>
31 <xsl:variable name="floatLeftWidth">
32 <xsl:choose>
33 <xsl:when test="$clName = 'CL4'">45</xsl:when> <!-- **** can go as low as 40 -->
34 <xsl:otherwise>77</xsl:otherwise> <!-- used to be 67 -->
35 </xsl:choose>
36 </xsl:variable>
37
38 <!-- **** Customized **** -->
39 <div id="float-anchor" style="width: {$floatRightWidth}%; min-width:180px; float:right; margin: 0 0 10px 20px;">
40
41 <!-- this right sidebar -->
42 <div id="rightSidebar">
43 <!-- ******** !!!!!! -->
44 <xsl:comment>Filler needed for div</xsl:comment>
45 <xsl:call-template name="viewOptions"/>
46 <xsl:if test="$berryBasketOn or $favouritesBasketOn or ($documentBasketOn and (util:contains(/page/pageRequest/userInformation/@groups, 'administrator') or util:contains(/page/pageRequest/userInformation/@groups, 'all-collections-editor') or util:contains(/page/pageRequest/userInformation/@groups, $thisCollectionEditor)))">
47 <xsl:if test="$berryBasketOn">
48 <!-- show the berry basket if it's turned on -->
49 <div class="tableOfContentsContainer" style="position:relative; z-index: 2;"> <!-- **** -->
50 <gslib:berryBasket/>
51 <xsl:text> </xsl:text>
52 </div>
53 </xsl:if>
54
55 <xsl:if test="$favouritesBasketOn">
56 <!-- show the favourites 'basket' if it's turned on -->
57 <div class="tableOfContentsContainer" style="position:relative; z-index: 2;"> <!-- **** -->
58 <gslib:gotoFavourites/>
59 <xsl:text> </xsl:text>
60 </div>
61 </xsl:if>
62
63 <xsl:if test="$documentBasketOn">
64 <gslib:documentBasket/>
65 <xsl:text> </xsl:text>
66 </xsl:if>
67 </xsl:if>
68 </div>
69 </div>
70
71 <!--
72 show the clasifier results -
73 you can change the appearance of the results by editing
74 the two templates at the bottom of this file
75 -->
76 <!-- **** Customized **** -->
77 <div id="results" style="width: {$floatLeftWidth}%">
78 <xsl:variable name="collName"><xsl:value-of select="/page/pageRequest/paramList/param[@name='c']/@value"/></xsl:variable>
79 <xsl:variable name="serviceName"><xsl:value-of select="service/@name"/></xsl:variable>
80
81 <xsl:call-template name="classifierResultsPre"/>
82
83 <xsl:apply-templates select="classifier">
84 <xsl:with-param name="collName" select="$collName"/>
85 <xsl:with-param name="serviceName" select="$serviceName"/>
86 </xsl:apply-templates>
87 </div>
88
89 <div class="clear"><xsl:text> </xsl:text></div>
90 </xsl:template>
91
92
93
94 <xsl:template name="viewOptions">
95
96 <div id="viewAndZoomOptions" class="ui-state-default ui-corner-all">
97 <ul id="viewOptions">
98
99 <!-- Zoom on/off button -->
100
101 <xsl:if test="not(/page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']) or /page/pageResponse/format[@type='display']/gsf:option[@name='disableZoom']/@value='false'">
102
103 <!-- **** Customized **** -->
104 <xsl:variable name="clName"><xsl:value-of select="classifier/@name"/></xsl:variable>
105 <xsl:if test="$clName = 'CL4'">
106 <li id="zoomOptions" style="display:none;">
107<!--
108 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.zoomTooltip')"/></xsl:attribute>
109-->
110 <xsl:attribute name="title">Enable/disable Zoom feature over map</xsl:attribute>
111 <img id="zoomToggleImage">
112 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'zoom_image')"/></xsl:attribute>
113 </img>
114
115 <input id="zoomToggle" type="checkbox" checked="checked"/>
116 <script type="text/javascript">
117 <xsl:text disable-output-escaping="yes">
118 $("#zoomToggle").change(function()
119 {
120 //console.log("**** zoomToggle.change()");
121 _imageZoomEnabled = $("#zoomToggle").prop("checked");
122 //console.log("**** imageZoomEnable now = " + _imageZoomEnabled);
123 });
124
125 $("#zoomToggleImage").click(function()
126 {
127 //console.log("**** zoomToggle.click()");
128 $("#zoomToggle").prop("checked", !$("#zoomToggle").prop("checked"));
129 _imageZoomEnabled = $("#zoomToggle").prop("checked");
130 //console.log("**** imageZoomEnable now = " + _imageZoomEnabled);
131 });
132 </xsl:text>
133 </script>
134 </li>
135 </xsl:if>
136 </xsl:if>
137
138
139 <!-- Floating TOC on/off button -->
140 <xsl:if test="$berryBasketOn">
141 <li id="floatingTOCOptions">
142<!--
143 <xsl:attribute name="title"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'doc.floatingTooltip')"/></xsl:attribute>
144-->
145 <xsl:attribute name="title">Fix the berry basket to the right side of the screen</xsl:attribute>
146 <img id="floatTOCToggleImage">
147 <xsl:attribute name="src"><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'float_berrybasket_image')"/></xsl:attribute>
148 </img>
149
150 <input id="floatTOCToggle" type="checkbox"/>
151 <script type="text/javascript">
152 <xsl:text disable-output-escaping="yes">
153 $("#floatTOCToggle").prop("checked", false);
154 $("#floatTOCToggle").click(function()
155 {
156 floatMenu($("#floatTOCToggle").prop("checked"));
157 });
158
159 $("#floatTOCToggleImage").click(function()
160 {
161 $("#floatTOCToggle").prop("checked", !$("#floatTOCToggle").prop("checked"))
162 floatMenu($("#floatTOCToggle").prop("checked"));
163 });
164 </xsl:text>
165 </script>
166 </li>
167 <xsl:if test="/page/pageRequest/paramList/param[@name='ftoc']/@value = '1'">
168 <script type="text/javascript">
169 <xsl:text disable-output-escaping="yes">
170 $(window).load(function()
171 {
172 $("#floatTOCToggle").prop("checked", true);
173 floatMenu(true);
174 });
175 </xsl:text>
176 </script>
177 </xsl:if>
178 </xsl:if>
179 </ul>
180 <div style="clear:both;"><xsl:text> </xsl:text></div>
181 </div>
182 </xsl:template>
183
184
185
186
187 <xsl:template match="classifier">
188 <xsl:param name="collName"/>
189 <xsl:param name="serviceName"/>
190 <div id="classifiers">
191 <!-- **** Customized **** -->
192 <xsl:variable name="clName"><xsl:value-of select="@name"/></xsl:variable>
193 <xsl:choose>
194 <xsl:when test="@childType = 'HList'">
195 <xsl:call-template name="HList">
196 <xsl:with-param name='collName' select='$collName'/>
197 <xsl:with-param name='serviceName' select='$serviceName'/>
198 </xsl:call-template>
199 </xsl:when>
200 <xsl:otherwise>
201 <!-- **** Customized **** -->
202 <div style="position: relative">
203 <xsl:if test="$clName = 'CL4'">
204 <!--
205 width="1380.2666"
206 height="1746.2094"
207 -->
208 <iframe src="interfaces/{$interface_name}/iframe/nz-territories.svg"
209 style="float:right; width: 345px; height: 436px; border: none; ">
210 <gsf:comment>filler</gsf:comment>
211 </iframe>
212 </xsl:if>
213
214 <table id="classifiernodelist">
215 <xsl:text> </xsl:text>
216 <xsl:call-template name="processNodeChildren">
217 <xsl:with-param name='collName' select='$collName'/>
218 <xsl:with-param name='serviceName' select='$serviceName'/>
219 </xsl:call-template>
220 </table>
221 </div>
222 </xsl:otherwise>
223 </xsl:choose>
224 </div>
225 </xsl:template>
226
227
228</xsl:stylesheet>
229
Note: See TracBrowser for help on using the repository browser.