Changeset 36037 for main/trunk/model-interfaces-dev
- Timestamp:
- 2022-02-02T11:29:41+13:00 (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/model-interfaces-dev/wmtb/transform/layouts/main.xsl
r36036 r36037 1 1 <?xml version="1.0" encoding="UTF-8"?> 2 2 <xsl:stylesheet version="1.0" 3 4 5 6 7 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 8 xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat" 9 9 … … 12 12 xmlns:exsl="http://exslt.org/common" 13 13 14 15 14 extension-element-prefixes="java util result exsl" 15 exclude-result-prefixes="util java util"> 16 16 <!-- 17 17 <xsl:import href="footer.xsl"/> … … 30 30 <div id="spacer-for-nav"> </div> 31 31 <div class="wrapper"> 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 32 <div class="shifted-frame"> 33 34 <!-- Whakatohea.co.nz's navbar - no longer in use now that the dl site is 35 embedded in iframe on whakatohea.co.nz site which provides the navbar --> 36 <!--<xsl:call-template name="whakatohea-navbar"/>--> 37 38 <div class="site-canvas"> 39 40 <div class="wrapper-old"> 41 <div id="header-old"> 42 43 <div class="banner-wrap"> 44 <div class="wsite-elements wsite-not-footer wsite-header-elements"> 45 <div class="wsite-section-wrap"> 46 <!--<div class="wsite-section wsite-header-section wsite-section-bg-image" style="height: auto;background-image: url("interfaces/{$interface_name}/images/digital-library.jpg") ;background-repeat: no-repeat ;background-position: 50.00% 21.94% ;background-size: 100% ;background-color: transparent ;background-size: cover;" >--> 47 <div style="background-image: url("interfaces/{$interface_name}/images/digital-library.jpg");" > 48 <xsl:choose> 49 <xsl:when test="/page/pageResponse/collection or /page/pageResponse/pathList/group"> 50 <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image crop-bg</xsl:attribute> 51 </xsl:when> 52 <xsl:otherwise> 53 <xsl:attribute name="class">wsite-section wsite-header-section wsite-section-bg-image full-bg</xsl:attribute> 54 </xsl:otherwise> 55 </xsl:choose> 56 57 <div class="wsite-section-content"> 58 59 <div class="container"> 60 <div class="banner"> 61 <div class="wsite-section-elements"> 62 <h2 class="wsite-content-title" style="text-align:center;"><font size="6"><a href="{$library_name}"><xsl:call-template name="siteName"/></a></font></h2> 63 64 <!-- Why does this feel like it's still inside the banner-wrap? --> 65 <xsl:choose> 66 <xsl:when test="page/pageResponse/collection"> 67 <div id="coll-name-link"> 68 <p>  69 <a href="{$library_name}/collection/{$collNameChecked}/page/about"> 70 <xsl:value-of select="page/pageResponse/collection/displayItemList/displayItem[@name='name']"/> 71 </a> 72 </p> 73 <br class="clear"/> 74 </div> 75 </xsl:when> 76 77 <xsl:when test="/page/pageRequest/paramList/param[@name='group']/@value"> 78 <div id="coll-name-link"> 79 <p> 80 <xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/> 81 </p> 82 <br class="clear"/> 83 </div> 84 </xsl:when> 85 </xsl:choose> 86 </div> 87 </div> 88 </div> 89 90 </div> 91 <!--<div class=""></div>--> 92 </div> 93 </div> 94 95 </div> 96 97 98 <div class="container wrapper-old col2" id="browse-search-bars"> 99 <div id="topbar"> 100 <xsl:choose> 101 <xsl:when test="page/pageRequest/@subaction='home'"> 102 <div id="cross-coll-div"> 103 <xsl:call-template name="crossCollSearch"/> 104 </div> 105 </xsl:when> 106 <xsl:when test="page/pageRequest/paramList/param/@name='c' and /page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']"> 107 <xsl:call-template name="quick-search-area"/> 108 </xsl:when> 109 <xsl:otherwise/> 110 </xsl:choose> 111 <!--**********************************************************************--> 112 </div> 113 </div> 114 115 116 </div><!-- end banner-wrap --> 117 </div> 118 </div> 119 120 <!--<xsl:call-template name="login-prefs-help-links"/>--> 121 <!--<hr class="spacer" />--> 122 <div class="outer"> 123 <xsl:if test="page/pageResponse/collection"> 124 <xsl:attribute name="class">outer collectionDisplay</xsl:attribute> 125 <xsl:call-template name="sideNavBar"/> 126 </xsl:if> 127 128 <div id="gs_content" class="container"> 129 <xsl:apply-templates select="/page"/> 130 </div> 131 <br class="clear" /> 132 133 </div><!-- end class main-wrap--> 134 <xsl:call-template name="wmtb-footer"/> 135 136 </div> <!-- end site-canvas --> 137 137 </div> <!-- end shifted-frame --> 138 138 </div> <!-- end wrapper--> 139 140 139 </body> 140 </html> 141 141 </xsl:template> 142 142 143 143 <xsl:template name="sideNavBar"> 144 144 <div class="side-navbar"> 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 145 <!-- 146 Using select statement to count only non-empty elements, is harder than testing 147 for non-empty elements. Solution of using normalize-space() is from 148 https://stackoverflow.com/questions/31602369/xsl-return-only-the-first-non-empty-element 149 --> 150 <xsl:variable name="classifierCount" select="count(/page/pageResponse/collection/serviceList/service[@name='ClassifierBrowse']/classifierList/classifier/displayItem[@name = 'name'][normalize-space()])"/> 151 152 <!-- TODO: Hardcoded strings! --> 153 154 <a href="{$library_name}">Our Six Pou</a> 155 156 <a href="{$library_name}/collection/{$collNameChecked}/page/about"> 157 <xsl:if test="page/pageRequest/@subaction='about'"> 158 <xsl:attribute name="class">active</xsl:attribute> 159 </xsl:if> 160 161 About Collection 162 </a> 163 164 <hr class="side-navbar-separator" /> 165 166 <xsl:if test="$classifierCount > 0"> 167 <span>Browse by:</span> 168 <ul> 169 <xsl:call-template name="listBrowsingClassifiers"/> 170 </ul> 171 </xsl:if> 172 173 <!--Login link is disabled, as it was determined to be confusing with Whakatohea's existing login elements --> 174 <!-- <hr class="side-navbar-separator" /> 175 <xsl:call-template name="loginLinks"/> --> 176 </div> 177 177 </xsl:template> 178 178 179 179 <!-- 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 180 This was in the old navbar. Might come in useful? 181 182 <xsl:variable name="currentPage" select="page/pageRequest/@fullURL"/> 183 <xsl:if test="/page/pageResponse/collection/serviceList/service/@type='query'"> 184 <li> 185 <a href="{$currentPage}">Search</a> 186 <ul> 187 <xsl:for-each select="/page/pageResponse/collection/serviceList/service[@type='query']"> 188 <xsl:variable name="search" select="@name"/> 189 <xsl:variable name="search_name" select="displayItem[@name='name']"/> 190 191 <li> 192 <a href="{$library_name}/collection/{$collNameChecked}/search/{$search}"> 193 <xsl:value-of select="$search_name"/> 194 </a> 195 </li> 196 </xsl:for-each> 197 </ul> 198 </li> 199 </xsl:if> 200 200 --> 201 201 … … 205 205 <xsl:choose> 206 206 <!-- 207 208 209 210 211 207 Only display browsing classifiers that have a name. 208 Those that don't have a name are empty classifiers 209 denoted by no value/empty value for displayItem name=name elements. 210 Testing for non empty elements is easy: not() test. 211 --> 212 212 <xsl:when test="not(displayItem[@name='name'] ='')"> 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 213 <li> 214 <a> 215 <!-- Indicates that this classifier's content is being displayed --> 216 <xsl:if test="util:contains(/page/pageRequest/paramList/param[@name = 'cl' and /page/pageRequest/@action = 'b']/@value, @name)"> 217 <xsl:attribute name="class">active</xsl:attribute> 218 </xsl:if> 219 220 <!-- Add a title element to the <a> tag if a description exists for this classifier --> 221 <xsl:if test="displayItem[@name='description']"> 222 <xsl:attribute name='title'><xsl:value-of select="displayItem[@name='description']"/></xsl:attribute> 223 </xsl:if> 224 225 <!-- Add the href element to the <a> tag --> 226 <xsl:choose> 227 <xsl:when test="@name"> 228 <xsl:attribute name="href"> 229 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/<xsl:value-of select="@name"/> 230 </xsl:attribute> 231 </xsl:when> 232 <xsl:otherwise> 233 <xsl:attribute name="href"> 234 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/@name"/>/browse/1 235 </xsl:attribute> 236 </xsl:otherwise> 237 </xsl:choose> 238 239 <!-- Add the actual text of the <a> tag --> 240 <xsl:value-of select="displayItem[@name='name']"/> 241 </a> 242 </li> 243 </xsl:when> 244 </xsl:choose> 245 </xsl:for-each> 246 246 </xsl:template> 247 247 248 248 <xsl:template name="crossCollSearch"> 249 250 251 252 253 254 255 256 257 258 259 260 261 249 <div id="search"> 250 <xsl:for-each select="/page/pageResponse/serviceList/service[@name='TextQuery']"> 251 <form name="QuickSearch" method="get" action="{$library_name}"> 252 <input type="hidden" name="a" value="q"/> 253 <input type="hidden" name="rt" value="rd"/> 254 <input type="hidden" name="s" value="{@name}"/> 255 <input type="hidden" name="s1.collection" value="all"/> 256 <input type="text" name="s1.query" id="search-text" value="Search all collectionsâŠ" onfocus="this.value=(this.value=='Search all collectionsâŠ')? '' : this.value ;" /> 257 <input type="submit" name="go" id="go" value="Search" /> 258 </form> 259 </xsl:for-each> 260 </div> 261 <br class="clear" /> 262 262 </xsl:template> 263 263 … … 319 319 320 320 <xsl:template name="loginLinks"> 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 321 <xsl:variable name="username" select="/page/pageRequest/userInformation/@username"/> 322 <xsl:variable name="groups" select="/page/pageRequest/userInformation/@groups"/> 323 324 <xsl:choose> 325 <xsl:when test="$username"> 326 <!-- Depositor link: only for logged-in users. 327 CSS class=login to make Depositor link blue to indicate it's only available when logged in. 328 Don't put this depositorTitleAndLink inside the test for whether user 'admin' is 329 in the current list of groups, as we want the depositor link to be visible for any 330 logged in user. The collection they want to deposit a doc into will determine whether 331 that user has the right to modify that collection. 332 --> 333 <xsl:if test="contains($groups,'admin')"> 334 <li class="login"><gslib:depositorTitleAndLink/></li> <!-- move back up/outside if admin test if non-admin members should be able to deposit --> 335 <li class="login"><a href="{$library_name}/admin/AddUser">Add user</a></li> 336 <li class="login"><a href="{$library_name}/admin/ListUsers">Administration</a></li> 337 <li class="login"><a href="{$library_name}/admin/AccountSettings?s1.username={$username}">Logged in as: <xsl:value-of select="$username"/></a></li><!-- move back up/outside if admin test if non-admin members should be able to reset their password --> 338 </xsl:if> 339 <li class="login"><a href="{$library_name}?logout=">Logout</a></li> 340 </xsl:when> 341 <xsl:otherwise> 342 <li class="login"> 343 <a href="{$library_name}?a=p&sa=login&redirectURL={$library_name}%3Fa=p%26sa=home">Login 344 <xsl:attribute name="title"> 345 <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'login_tip')"/> 346 </xsl:attribute> 347 </a> 348 </li> 349 </xsl:otherwise> 350 </xsl:choose> 351 351 </xsl:template> 352 352 … … 356 356 357 357 <div id="quicksearcharea"> 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 358 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']"> 359 <xsl:choose> 360 <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'"> 361 <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery"> 362 <!-- This parameter says that we have come from the quick search area --> 363 364 <input type="hidden" name="qs" value="1"/> 365 <input type="hidden" name="rt" value="rd"/> 366 <!-- don't hide indexing levels: code further down will hide it if there's only 1 indexing level. 367 and display a dropdown if the collection's configured with more than 1 index level available --> 368 <!--<input type="hidden" name="s1.level"> 369 <xsl:attribute name="value"> 370 <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/> 371 </xsl:attribute> 372 </input> 373 --> 374 <xsl:choose> 375 <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']"> 376 <input type="hidden" name="s1.startPage" value="1"/> 377 </xsl:when> 378 <xsl:otherwise> 379 <input type="hidden" name="startPage" value="1"/> 380 </xsl:otherwise> 381 </xsl:choose> 382 383 <!-- The query text box --> 384 Search for 385 <span class="querybox"> 386 <xsl:variable name="qs"> 387 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']" mode="calculate-default"/> 388 </xsl:variable> 389 <nobr> 390 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='query']"> 391 <!-- 392 <xsl:with-param name="default" select="java:org.greenstone.gsdl3.util.XSLTUtil.tidyWhitespace($qs, /page/@lang)"/> 393 --> 394 <xsl:with-param name="default" select="normalize-space($qs)"/> 395 396 </xsl:apply-templates> 397 </nobr> 398 </span> 399 <!-- The index selection list --> 400 in 401 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'"> 402 <span class="textselect"> 403 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']"> 404 <xsl:with-param name="default"> 405 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/> 406 </xsl:with-param> 407 <xsl:with-param name="hideSingle">false</xsl:with-param> 408 <xsl:with-param name="quickSearch">true</xsl:with-param> 409 </xsl:apply-templates> 410 </span> 411 </xsl:if> 412 <!-- The partition selection list --> 413 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'"> 414 <span class="textselect"> 415 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']"> 416 <xsl:with-param name="default"> 417 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/> 418 </xsl:with-param> 419 <xsl:with-param name="hideSingle">true</xsl:with-param> 420 <xsl:with-param name="quickSearch">true</xsl:with-param> 421 </xsl:apply-templates> 422 </span> 423 </xsl:if> 424 425 <!-- The index level selection list. hideSingle=true to hide the dropdown if there's only 1 level (the default). --> 426 at 427 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']/@type = 'enum_single'"> 428 <span class="textselect"> 429 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']"> 430 <xsl:with-param name="default"> 431 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='level']" mode="calculate-default"/> 432 </xsl:with-param> 433 <xsl:with-param name="hideSingle">true</xsl:with-param> 434 <xsl:with-param name="quickSearch">true</xsl:with-param> 435 </xsl:apply-templates> 436 </span> 437 </xsl:if> 438 level 439 440 <!-- The language selection list --> 441 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']/@type = 'enum_single'"> 442 <span class="textselect"> 443 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']"> 444 <xsl:with-param name="default"> 445 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexLanguage']" mode="calculate-default"/> 446 </xsl:with-param> 447 <xsl:with-param name="hideSingle">true</xsl:with-param> 448 <xsl:with-param name="quickSearch">true</xsl:with-param> 449 </xsl:apply-templates> 450 </span> 451 </xsl:if> 452 <!-- The submit button (for TextQuery) --> 453 <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']"> 454 <!--<input type="submit" id="quickSearchSubmitButton"> 455 <xsl:attribute name="value"> 456 <xsl:value-of select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/displayItem[@name='submit']"/> 457 </xsl:attribute> 458 </input>--> 459 460 <input type="submit" id="quickSearchSubmitButton" value="Go"/> 461 462 <br/> 463 </xsl:if> 464 </form> 465 466 <div class="query-form-links" id="advanced"><a href="{$library_name}/collection/{$collNameChecked}/search/AdvancedFieldQuery">Advanced search</a></div> 467 468 </xsl:when> 469 <xsl:otherwise><br/></xsl:otherwise> 470 </xsl:choose> 471 </xsl:if> 472 472 473 473 </div> … … 492 492 <!-- The list of other search types --> 493 493 <div class="query-form-links"> 494 495 496 497 498 499 500 501 502 503 504 505 506 507 494 <ul> 495 <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']"> 496 <xsl:if test="/page/pageRequest/paramList/param[@name='qs']/@value = 1 or not(@name = /page/pageRequest/paramList/param[@name='s']/@value)"> 497 <li class="ui-state-default ui-corner-all"> 498 <a class="query-form-links"> 499 <xsl:attribute name="href"> 500 <xsl:value-of select="$library_name"/>/collection/<xsl:value-of select="$collNameChecked"/>/search/<xsl:value-of select="@name"/> 501 </xsl:attribute> 502 <xsl:value-of select="displayItem[@name='name']"/> 503 </a> 504 </li> 505 </xsl:if> 506 </xsl:for-each> 507 </ul> 508 508 </div> 509 509 … … 512 512 <!-- navigation bar for login, preferences and help links --> 513 513 <xsl:template name="login-prefs-help-links"> 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 514 <div class="container wrapper-old col0" style="margin:10px auto"> <!-- used to be 10px 30px --> 515 <div id="topline"> 516 <ul> 517 <xsl:call-template name="loginLinks"/> 518 <li><a href="{$library_name}/collection/{$collNameChecked}/page/pref">Preferences</a></li> 519 <xsl:choose> 520 <xsl:when test="/page/pageResponse/collection"> 521 <li><a href="{$library_name}/collection/{$collNameChecked}/page/help">Help</a></li> 522 </xsl:when> 523 <xsl:otherwise> 524 <li><a href="{$library_name}/page/help">Help</a></li> 525 </xsl:otherwise> 526 </xsl:choose> 527 </ul> 528 <br class="clear" /> 529 </div> 530 </div> 531 531 </xsl:template> 532 532
Note:
See TracChangeset
for help on using the changeset viewer.