Changeset 36037 for main


Ignore:
Timestamp:
2022-02-02T11:29:41+13:00 (2 years ago)
Author:
cstephen
Message:

Consistent indentation - 2 spaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/wmtb/transform/layouts/main.xsl

    r36036 r36037  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<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"
     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"
    88    xmlns:gsf="http://www.greenstone.org/greenstone3/schema/ConfigFormat"
    99   
     
    1212    xmlns:exsl="http://exslt.org/common"
    1313
    14     extension-element-prefixes="java util result exsl"
    15     exclude-result-prefixes="util java util">
     14  extension-element-prefixes="java util result exsl"
     15  exclude-result-prefixes="util java util">
    1616  <!--
    1717  <xsl:import href="footer.xsl"/>
     
    3030      <div id="spacer-for-nav">&#160;</div>
    3131      <div class="wrapper">
    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(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;) ;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(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;);" >
    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>&#160;
    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 -->
     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(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;) ;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(&quot;interfaces/{$interface_name}/images/digital-library.jpg&quot;);" >
     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>&#160;
     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 -->
    137137      </div> <!-- end shifted-frame -->
    138138      </div> <!-- end wrapper-->
    139         </body>
    140     </html>
     139    </body>
     140  </html>
    141141</xsl:template>
    142142
    143143<xsl:template name="sideNavBar">
    144144  <div class="side-navbar">
    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>
     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>
    177177</xsl:template>
    178178
    179179<!--
    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>
     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>
    200200-->
    201201
     
    205205    <xsl:choose>
    206206      <!--
    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             -->
     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      -->
    212212      <xsl:when test="not(displayItem[@name='name'] ='')">
    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>
     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>
    246246</xsl:template>
    247247
    248248<xsl:template name="crossCollSearch">
    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" />
     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" />
    262262</xsl:template>
    263263
     
    319319
    320320<xsl:template name="loginLinks">
    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&amp;sa=login&amp;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>
     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&amp;sa=login&amp;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>
    351351</xsl:template>
    352352
     
    356356
    357357      <div id="quicksearcharea">
    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>
     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>
    472472
    473473      </div>
     
    492492      <!-- The list of other search types -->     
    493493      <div class="query-form-links">
    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>
     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>
    508508      </div>
    509509   
     
    512512  <!-- navigation bar for login, preferences and help links -->
    513513  <xsl:template name="login-prefs-help-links">
    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>   
     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>   
    531531  </xsl:template>
    532532 
Note: See TracChangeset for help on using the changeset viewer.