source: MILK/trunk/milk_server/milk_server/templates/browse/short_results.kid @ 5305

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/MILK/trunk/milk_server/milk_server/templates/browse/short_results.kid@5305
Revision 5305, 2.0 KB checked in by cbyrom, 10 years ago (diff)

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.
Line 
1<html py:extends="'../ndgPage.kid','../meta.kid'" xmlns="http://www.w3.org/1999/xhtml" xmlns:py="http://purl.org/kid/ns#">
2
3    <head>
4    <replace py:replace="pagehead()"/>
5    </head>
6    <body>
7    <tr py:def="resultsrow(item)" class="shortResult">
8        <td><a href="${item.link}">${item.name}</a></td><td>${item.type}</td>
9    </tr>
10   
11    <div id="entirepage">
12        <div py:replace="header()"/>
13        <div py:replace="PageTabs('Results')"/>
14        <div py:replace="searchOneLine(targets=c.searchTarget)"/>
15        <div id="results">
16            <div id="context">
17                ${c.state.hits} results for ${c.state.searchString} (${XML(c.state.constraints)})</div>
18            <div id="SemanticSearchBox"/>
19            <div class="resultsBar">
20                 <div class="resultsLeft">
21                    ${XML(h.link_to_remote("Semantic Search",dict(update="SemanticSearchBox",
22                            url='%s?%s'%(h.url_for(action='semantic'),c.querystring))))}
23                    <span py:replace="helpIcon('semser_help')"/>
24                 </div>
25                        <div py:replace="pageControl(c.state, c.discoveryUrl)"/>
26                <div id="semser_help" class="hidden">
27                    <div class="helptxt"><p>
28                    The semantic search option allows you to see how many hits a search using your current parameters would return if you
29                    used a slightly different vocabulary in your search term.
30                    </p></div>
31                </div>
32            </div>
33            <div id="resultsTab">
34                <table width="100%">
35                    <thead><tr><th rowspan="2">Name</th><th colspan="1">Type</th></tr>
36                    </thead>
37                    <tbody>
38                        <tr py:for="item in c.results" py:replace="resultsrow(item)"/>
39                    </tbody>
40                </table>
41            </div>
42                <div py:replace="pageControl(c.state, None)"/>
43        </div>
44        <div py:replace="footer()"/>
45    </div>
46    </body>
47</html>
Note: See TracBrowser for help on using the repository browser.