Changeset 25485


Ignore:
Timestamp:
2012-04-26T11:57:44+12:00 (12 years ago)
Author:
sjm84
Message:

The search status text will now say "sections" if a section search was done. Also fixed the next/prev buttons on the search results page

Location:
main/trunk/greenstone3/web/interfaces/oran/transform
Files:
2 edited

Legend:

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

    r25469 r25485  
    377377                        </xsl:attribute>
    378378                    </input>
    379                     <input type="hidden" name="startPage" value="1"/>
     379                    <xsl:choose>
     380                        <xsl:when test="/page/pageResponse/service[@name = 'TextQuery']/paramList/param[@name = 'startPage']">
     381                            <input type="hidden" name="s1.startPage" value="1"/>
     382                        </xsl:when>
     383                        <xsl:otherwise>
     384                            <input type="hidden" name="startPage" value="1"/>
     385                        </xsl:otherwise>
     386                    </xsl:choose>
     387                    <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.hitsPerPage'])">
     388                        <input type="hidden" name="s1.hitsPerPage" value="20"/>
     389                    </xsl:if>
     390                    <xsl:if test="not(/page/pageRequest/paramList/param[@name = 's1.maxDocs'])">
     391                        <input type="hidden" name="s1.maxDocs" value="100"/>
     392                    </xsl:if>
    380393                    <!-- The query text box -->
    381394                    <span class="querybox">
  • main/trunk/greenstone3/web/interfaces/oran/transform/pages/query.xsl

    r25434 r25485  
    5353   
    5454    <xsl:template name="displayTermInfo">
     55       
     56        <!-- Find the number of documents displayed per page -->
     57        <xsl:variable name="level">
     58            <xsl:choose>
     59                <xsl:when test="/page/pageRequest/paramList/param[@name='level']">
     60                    <xsl:value-of select="/page/pageRequest/paramList/param[@name='level']/@value" />
     61                </xsl:when>
     62                <xsl:when test="/page/pageRequest/paramList/param[@name='s1.level']">
     63                    <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.level']/@value" />
     64                </xsl:when>
     65                <xsl:otherwise>Doc</xsl:otherwise>
     66            </xsl:choose>
     67        </xsl:variable>
     68   
    5569        <!-- The list of search terms with their frequency and document count -->
    5670        <p class="termList">
     
    8397                        <xsl:choose>
    8498                            <xsl:when test="@numDocsMatch = 1">
    85                                 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
     99                                <xsl:text> </xsl:text>
     100                                <xsl:choose>
     101                                    <xsl:when test="$level = 'Doc'">
     102                                        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
     103                                    </xsl:when>
     104                                    <xsl:otherwise>
     105                                        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section')"/>
     106                                    </xsl:otherwise>
     107                                </xsl:choose>
    86108                            </xsl:when>
    87109                            <xsl:otherwise>
    88                                 <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
     110                                <xsl:text> </xsl:text>
     111                                <xsl:choose>
     112                                    <xsl:when test="$level = 'Doc'">
     113                                        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
     114                                    </xsl:when>
     115                                    <xsl:otherwise>
     116                                        <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
     117                                    </xsl:otherwise>
     118                                </xsl:choose>
    89119                            </xsl:otherwise>
    90120                        </xsl:choose>
     
    106136                    <input type="hidden" name="sa"><xsl:attribute name="value"><xsl:value-of select="/page/pageRequest/@subaction"/></xsl:attribute></input>
    107137                    <input type="hidden" name="rt" value="rd"/>
    108                     <xsl:if test="not(paramList/param[@name='startPage'])">
    109                         <input type="hidden" name="startPage" value="1"/>
    110                     </xsl:if>
     138                    <!--<xsl:if test="not(paramList/param[@name='s1.startPage'])">
     139                        <input type="hidden" name="s1.startPage" value="1"/>
     140                    </xsl:if>-->
    111141                    <xsl:choose>
    112142                        <xsl:when test="/page/pageRequest/paramList/param[@name = 's1.maxDocs']">
     
    179209            </xsl:choose>
    180210        </xsl:variable>
     211       
     212        <xsl:variable name="usesS1">
     213            <xsl:choose>
     214                <xsl:when test="/page/pageRequest/paramList/param[@name='s1.startPage']">true</xsl:when>
     215                <xsl:otherwise>false</xsl:otherwise>
     216            </xsl:choose>
     217        </xsl:variable>
    181218   
    182219        <!-- Find the total number of documents returned -->
     
    206243        </xsl:variable>
    207244       
     245        <!-- Find the number of documents displayed per page -->
     246        <xsl:variable name="level">
     247            <xsl:choose>
     248                <xsl:when test="/page/pageRequest/paramList/param[@name='level']">
     249                    <xsl:value-of select="/page/pageRequest/paramList/param[@name='level']/@value" />
     250                </xsl:when>
     251                <xsl:when test="/page/pageRequest/paramList/param[@name='s1.level']">
     252                    <xsl:value-of select="/page/pageRequest/paramList/param[@name='s1.level']/@value" />
     253                </xsl:when>
     254                <xsl:otherwise>Doc</xsl:otherwise>
     255            </xsl:choose>
     256        </xsl:variable>
     257       
    208258        <table id="searchResultNavTable"><tr>
     259            <xsl:variable name="startPageName"><xsl:if test="$usesS1 = 'true'">s1.</xsl:if>startPage</xsl:variable>
     260           
    209261            <!-- Previous button -->
    210262            <td id="prevArrowTD">
    211263                <xsl:if test="$currentPage != 1">
    212                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;startPage={$currentPage - 1}">
     264                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}">
    213265                        <img src="interfaces/oran/images/previous.png"/>
    214266                    </a>
     
    217269            <td id="prevTD">
    218270                <xsl:if test="$currentPage != 1">
    219                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;startPage={$currentPage - 1}">Previous</a>
     271                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/@subaction}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage - 1}">Previous</a>
    220272                </xsl:if>
    221273            </td>
     
    243295                    <!-- "Z" -->
    244296                    <xsl:value-of select="$docMax"/>
    245                     <!-- "document[s]"-->
     297                    <!-- "document[s]/section[s]"-->
    246298                    <xsl:choose>
    247299                        <xsl:when test="$docMax = 1">
    248                             <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
     300                            <xsl:text> </xsl:text>
     301                            <xsl:choose>
     302                                <xsl:when test="$level = 'Doc'">
     303                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document')"/>
     304                                </xsl:when>
     305                                <xsl:otherwise>
     306                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section')"/>
     307                                </xsl:otherwise>
     308                            </xsl:choose>
    249309                        </xsl:when>
    250310                        <xsl:otherwise>
    251                             <xsl:text> </xsl:text><xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
     311                            <xsl:text> </xsl:text>
     312                            <xsl:choose>
     313                                <xsl:when test="$level = 'Doc'">
     314                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.document_plural')"/>
     315                                </xsl:when>
     316                                <xsl:otherwise>
     317                                    <xsl:value-of select="util:getInterfaceText($interface_name, /page/@lang, 'query.section_plural')"/>
     318                                </xsl:otherwise>
     319                            </xsl:choose>
    252320                        </xsl:otherwise>
    253321                    </xsl:choose>
     
    258326            <td id="nextTD">
    259327                <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
    260                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;startPage={$currentPage + 1}">Next</a>
     328                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}">Next</a>
    261329                </xsl:if>
    262330            </td>
    263331            <td id="nextArrowTD">
    264332                <xsl:if test="($currentPage * $docsPerPage + 1) &lt; $docMax">
    265                     <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;startPage={$currentPage + 1}">
     333                    <a href="{$library_name}?a=q&amp;sa={/page/pageRequest/paramList/param[@name = 'sa']/@value}&amp;c={$collName}&amp;s={/page/pageResponse/service/@name}&amp;rt=rd&amp;{$startPageName}={$currentPage + 1}">
    266334                        <img src="interfaces/oran/images/next.png"/>
    267335                    </a>
Note: See TracChangeset for help on using the changeset viewer.