Ignore:
Timestamp:
19/05/09 11:23:47 (10 years ago)
Author:
cbyrom
Message:

Improve structure of DiscoveryState? module by adding a new object,
PagerState? to hold the data connected to the results table paging.
Also tidy up code layout and simplify logic. Create new template
method, pagerControl, to represent the results table paging control

  • to allow reuse across the results and short_results templates.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • MILK/trunk/milk_server/milk_server/templates/browse/short_results.kid

    r4979 r5305  
    1717                ${c.state.hits} results for ${c.state.searchString} (${XML(c.state.constraints)})</div> 
    1818            <div id="SemanticSearchBox"/> 
    19              
    20             <?python 
    21             n,p=c.state.getNext() 
    22             if p!=[]:purl=c.state.geturl(offset=p[0],stride=p[1]) 
    23             if n!=[]:nurl=c.state.geturl(offset=n[0],stride=n[1]) 
    24             upper=c.state.offset+c.state.stride-1 
    25             ?> 
    2619            <div class="resultsBar">  
    2720                 <div class="resultsLeft"> 
     
    3023                    <span py:replace="helpIcon('semser_help')"/> 
    3124                 </div> 
    32                  <div> 
    33                  <a href="${c.state.constrainedurl}"> Refine Search</a><span py:replace="helpIcon('refser_help')"/> 
    34                 | Found ${c.state.hits} | Showing ${c.state.offset}-$upper  
    35                   <span py:if="p!=[]"> | <a href="$purl"> Previous ${p[1]}</a> </span> 
    36                   <span py:if="n!=[]"> | <a href="$nurl"> Next ${n[1]}</a></span> | </div> 
     25                        <div py:replace="pageControl(c.state, c.discoveryUrl)"/> 
    3726                <div id="semser_help" class="hidden"> 
    3827                    <div class="helptxt"><p> 
    3928                    The semantic search option allows you to see how many hits a search using your current parameters would return if you 
    4029                    used a slightly different vocabulary in your search term. 
    41                     </p></div> 
    42                 </div> 
    43                 <div id="refser_help" class="hidden"> 
    44                     <div class="helptxt"><p> 
    45                     The refined search option allows you to constrain your search by returning you to the advanced search page, but retaining your current search parameters 
    4630                    </p></div> 
    4731                </div> 
     
    5640                </table> 
    5741            </div> 
    58             <div class="resultsBar"> 
    59                 <a href="${c.state.constrainedurl}"> Refine search</a>  
    60                 | Found ${c.state.hits} | Showing ${c.state.offset}-$upper  
    61                   <span py:if="p!=[]"> | <a href="$purl"> Previous ${p[1]}</a> </span> 
    62                   <span py:if="n!=[]"> | <a href="$nurl"> Next ${n[1]}</a></span> | 
    63             </div> 
     42                <div py:replace="pageControl(c.state, None)"/> 
    6443        </div> 
    6544        <div py:replace="footer()"/> 
Note: See TracChangeset for help on using the changeset viewer.