Changeset 28623


Ignore:
Timestamp:
2013-11-14T12:59:41+13:00 (10 years ago)
Author:
jlwhisler
Message:

Updated quick search area. Added in drop down for partition indexes. Made it so the quick search doesn't appear on actual search pages. Added a "ui-state-active" class to the current search page button.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone3/web/interfaces/default/transform/layouts/header.xsl

    r28581 r28623  
    468468            <div id="quicksearcharea">
    469469                <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
     470                    <xsl:choose>
     471                    <xsl:when test="not(page/pageRequest[@action='q']) or /page/pageRequest/paramList/param[@name='qs']/@value = '1'">
    470472                    <form action="{$library_name}/collection/{$collNameChecked}/search/TextQuery">
    471473                        <!-- This parameter says that we have come from the quick search area -->
     
    474476                        <input type="hidden" name="s1.level">
    475477                            <xsl:attribute name="value">
    476                                 <xsl:choose>
    477                                     <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.level']">
    478                                         <xsl:value-of select="/page/pageRequest/paramList/param[@name = 's1.level']/@value"/>
    479                                     </xsl:when>
    480                                     <xsl:otherwise>
    481478                                            <xsl:value-of select="/page/pageResponse/collection/serviceList/service[@name='TextQuery']/paramList/param[@name = 'level']/@default"/>
    482                                     </xsl:otherwise>
    483                                 </xsl:choose>
    484479                            </xsl:attribute>
    485480                        </input>
     
    498493                            <input type="hidden" name="s1.maxDocs" value="100"/>
    499494                        </xsl:if>
    500                         <!-- The index selection list -->
    501                         <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
    502                             <span class="textselect">
    503                                 <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
    504                                     <xsl:with-param name="default">
    505                                         <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
    506                                     </xsl:with-param>
    507                                     <xsl:with-param name="hideSingle">false</xsl:with-param>
    508                                     <xsl:with-param name="quickSearch">true</xsl:with-param>
    509                                 </xsl:apply-templates>
    510                             </span>
    511                         </xsl:if>
    512495                        <!-- The query text box -->
    513496                        <span class="querybox">
     
    521504                            </nobr>
    522505                        </span>
    523                        
     506                        <!-- The index selection list -->
     507                        <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']/@type = 'enum_single'">
     508                            <span class="textselect">
     509                                <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']">
     510                                    <xsl:with-param name="default">
     511                                        <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='index']" mode="calculate-default"/>
     512                                    </xsl:with-param>
     513                                    <xsl:with-param name="hideSingle">true</xsl:with-param>
     514                                    <xsl:with-param name="quickSearch">true</xsl:with-param>
     515                                </xsl:apply-templates>
     516                            </span>
     517                        </xsl:if>
     518                        <!-- The partition selection list -->                       
     519                        <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']/@type = 'enum_single'">
     520                            <span class="textselect">
     521                                <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']">
     522                                    <xsl:with-param name="default">
     523                                        <xsl:apply-templates select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']/paramList/param[@name='indexSubcollection']" mode="calculate-default"/>
     524                                    </xsl:with-param>
     525                                    <xsl:with-param name="hideSingle">true</xsl:with-param>
     526                                    <xsl:with-param name="quickSearch">true</xsl:with-param>
     527                                </xsl:apply-templates>
     528                            </span>
     529                        </xsl:if>                       
    524530                        <!-- The submit button (for TextQuery) -->
    525531                        <xsl:if test="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@name='TextQuery']">
     
    532538                        </xsl:if>
    533539                    </form>
     540                    </xsl:when>
     541                    <xsl:otherwise><br/></xsl:otherwise>
     542                    </xsl:choose>           
    534543                </xsl:if>
    535544                <!-- The list of other search types -->
    536545                <ul>
    537546                    <xsl:for-each select="/page/pageResponse/collection[@name=$collNameChecked]/serviceList/service[@type='query']">
    538                         <li class="ui-state-default ui-corner-all">
     547                        <li>
     548                        <xsl:choose>
     549                        <xsl:when test="@name = /page/pageRequest/paramList/param[@name='s']/@value">
     550                    <xsl:attribute name="class">ui-state-default ui-corner-all ui-state-active</xsl:attribute>
     551                    </xsl:when>
     552                    <xsl:otherwise>
     553                    <xsl:attribute name="class">ui-state-default ui-corner-all</xsl:attribute>
     554                    </xsl:otherwise>
     555                    </xsl:choose>
    539556                            <a>
    540557                                <xsl:attribute name="href">
Note: See TracChangeset for help on using the changeset viewer.