Changeset 32652
- Timestamp:
- 2018-12-04T13:46:35+13:00 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone3/web/interfaces/default/transform/pages/query.xsl
r32625 r32652 75 75 76 76 <xsl:template name="displayResults"> 77 <xsl:if test="/page/pageResponse/facetList/facet"> 78 <xsl:call-template name="displayFacets"/> 79 </xsl:if> 80 <div id="resultsArea"> 81 <xsl:attribute name="class"> 82 <xsl:if test="/page/pageResponse/facetList/facet">facetedResults</xsl:if> 83 </xsl:attribute> 84 <table id="resultsTable"> 85 <xsl:for-each select="pageResponse/documentNodeList/documentNode"> 86 <tr id="div{@nodeID}" class="document"> 87 <xsl:apply-templates select="."/> 88 <!-- The berry (optional) --> 89 <td> 90 <xsl:call-template name="documentBerryForClassifierOrSearchPage"/> 91 </td> 92 <xsl:call-template name="highlightSnippet"> 93 <xsl:with-param name="nodeHASH"> 94 <xsl:value-of select="@nodeID"/> 95 </xsl:with-param> 96 <xsl:with-param name="collection" select="@collection"/> 97 <!--<xsl:choose> <xsl:when test="@collection"><xsl:value-of select="@collection"/></xsl:with-param>--> 98 </xsl:call-template> 99 <xsl:call-template name="documentNodePost"/> 100 </tr> 101 </xsl:for-each> 102 <br/> 103 </table> 104 105 <!-- Previous/Next buttons--> 106 <xsl:call-template name="prevNextButtons"/> 107 </div> 77 108 <xsl:if test="/page/pageResponse/facetList/facet"> 109 <div style="clear:both;"> 110 <xsl:text> </xsl:text> 111 </div> 112 </xsl:if> 113 </xsl:template> 114 115 <xsl:template name="displayFacets"> 78 116 <script type="text/javascript" src="interfaces/{$interface_name}/js/facet-scripts.js"> 79 117 <xsl:text> </xsl:text> … … 125 163 </xsl:for-each> 126 164 </div> 127 </xsl:if> 128 <div id="resultsArea"> 129 <xsl:attribute name="class"> 130 <xsl:if test="/page/pageResponse/facetList/facet">facetedResults</xsl:if> 131 </xsl:attribute> 132 <table id="resultsTable"> 133 <xsl:for-each select="pageResponse/documentNodeList/documentNode"> 134 <tr id="div{@nodeID}" class="document"> 135 <xsl:apply-templates select="."/> 136 <!-- The berry (optional) --> 137 <td> 138 <xsl:call-template name="documentBerryForClassifierOrSearchPage"/> 139 </td> 140 <xsl:call-template name="highlightSnippet"> 141 <xsl:with-param name="nodeHASH"> 142 <xsl:value-of select="@nodeID"/> 143 </xsl:with-param> 144 </xsl:call-template> 145 <xsl:call-template name="documentNodePost"/> 146 </tr> 147 </xsl:for-each> 148 <br/> 149 </table> 150 151 <!-- Previous/Next buttons--> 152 <xsl:call-template name="prevNextButtons"/> 153 </div> 154 <xsl:if test="/page/pageResponse/facetList/facet"> 155 <div style="clear:both;"> 156 <xsl:text> </xsl:text> 157 </div> 158 </xsl:if> 159 </xsl:template> 160 165 166 </xsl:template> 161 167 <!-- this usually gets overriden in collectionConfig.xml --> 162 168 <gsf:template match="documentNode"> … … 174 180 175 181 <xsl:template name="highlightSnippet"> 176 <xsl:param name="nodeHASH"> 177 </xsl:param> 178 <xsl:for-each select="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]"> 182 <xsl:param name="nodeHASH"/> 183 <xsl:param name="collection"/> 184 <xsl:for-each select="/page/pageResponse/highlightSnippetList/highlightSnippet[@nodeID = $nodeHASH]"> 185 <xsl:if test="not($collection) or $collection = @collection]"> 179 186 <tr> 180 187 <td> … … 186 193 </td> 187 194 </tr> 195 </xsl:if> 188 196 </xsl:for-each> 189 197 </xsl:template> 198 190 199 <xsl:template name="queryPage"> 191 200 <xsl:for-each select="pageResponse/service"> 192 <form name="QueryForm" method="get" action="{$library_name}/collection/{$collName}/search/{@name}"> 193 <div> 201 <xsl:variable name="form_action"><xsl:value-of select="$library_name"/>/<xsl:if test="$collName">collection/<xsl:value-of select="$collName"/>/</xsl:if>search/<xsl:value-of select="@name"/></xsl:variable> 202 <form name="QueryForm" method="get" action="{$form_action}"> 203 <div> 194 204 <input type="hidden" name="a" value="q"/> 195 205 <input type="hidden" name="sa"> … … 203 213 <xsl:choose> 204 214 <xsl:when test="/page/pageResponse/hierarchy and paramList/param[@name ='collection']"> 205 <xsl:call-template name=" hierarchy">215 <xsl:call-template name="CCSParams"> <!-- cross coll search --> 206 216 <xsl:with-param name="ns" select="$ns" /> 207 217 </xsl:call-template> … … 235 245 </xsl:template> 236 246 237 <xsl:template name="hierarchy"> 238 <xsl:param name="ns" /> 239 <div class="paramLabel"> 240 <xsl:value-of 241 select="paramList/param[@name='collection']/displayItem[@name='name']/text()" /> 247 <xsl:template name="CCSParams"> 248 <xsl:param name="ns" /> 249 <xsl:variable name="currentSelection"><xsl:value-of select="util:getFormattedCCSSelection(/page/pageRequest/paramList/param[@name='s1.collection']/@value,/page/pageRequest/paramList/param[@name='s1.group']/@value)"/></xsl:variable> 250 <!-- display the collection param --> 251 <div class="paramLabel"> 252 <xsl:value-of select="paramList/param[@name='collection']/displayItem[@name='name']/text()" /> 242 253 </div> 243 254 <div class="paramValue"> … … 249 260 <xsl:for-each select="/page/pageResponse/hierarchy/*"> 250 261 <xsl:call-template name="hierarchy-display"> 251 <xsl:with-param name="padding"> 252 0 253 </xsl:with-param> 254 <xsl:with-param name="path"> 255 <xsl:text>/</xsl:text> 256 </xsl:with-param> 262 <xsl:with-param name="padding">0</xsl:with-param> 263 <xsl:with-param name="currentSelection" select="$currentSelection"/> 257 264 </xsl:call-template> 258 265 </xsl:for-each> … … 260 267 </div> 261 268 <br class="clear" /> 269 <!-- display all the other params --> 262 270 <xsl:for-each select="paramList/param[@name !='collection']"> 263 271 <xsl:choose> … … 279 287 <xsl:param name="padding" /> 280 288 <xsl:param name="path" /> 289 <xsl:param name="currentSelection"/> 281 290 <xsl:choose> 282 <xsl:when test="name(.) = 'group'"> 291 <xsl:when test="name(.) = 'group'"> 292 <xsl:variable name="group-name">group.<xsl:if test="$path"><xsl:value-of select="$path" />.</xsl:if><xsl:value-of select="@name" /></xsl:variable> 283 293 <option> 284 294 <xsl:attribute name="style"> … … 286 296 <xsl:value-of select="concat($padding,'px')" /> 287 297 </xsl:attribute> 288 <xsl:attribute name="value"> 289 <xsl:text>group</xsl:text> 290 <xsl:value-of select="$path" /> 291 <xsl:value-of select="@name" /> 292 </xsl:attribute> 293 <xsl:if test="contains(/page/pageRequest/paramList/param[@name='s1.collection']/@value, @name)"> 298 <xsl:attribute name="value"><xsl:value-of select="$group-name"/></xsl:attribute> 299 <xsl:if test="util:csvContains($currentSelection, $group-name)"> 294 300 <xsl:attribute name="selected">selected</xsl:attribute> 295 301 </xsl:if> … … 300 306 <xsl:value-of select="$padding + 20" /> 301 307 </xsl:with-param> 302 <xsl:with-param name="path"> 303 <xsl:value-of select="$path" /> 304 <xsl:text>/</xsl:text> 305 <xsl:value-of select="../@name" /> 306 </xsl:with-param> 308 <xsl:with-param name="path"><xsl:if test="$path"><xsl:value-of select="$path" />.</xsl:if><xsl:value-of select="../@name" /></xsl:with-param> 309 <xsl:with-param name="currentSelection" select="$currentSelection"/> 307 310 </xsl:call-template> 308 311 </xsl:for-each> … … 316 319 <xsl:text>px</xsl:text> 317 320 </xsl:attribute> 318 <xsl:if test=" contains(/page/pageRequest/paramList/param[@name='s1.collection']/@value, @name)">321 <xsl:if test="util:csvContains($currentSelection, @name)"> 319 322 <xsl:attribute name="selected">selected</xsl:attribute> 320 323 </xsl:if>
Note:
See TracChangeset
for help on using the changeset viewer.