source: MILK/trunk/milk_server/milk_server/templates/browse/results.kid @ 5302

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

Simplify structure of discovery controller, using the results template
to render searches even when no results are found. Add new error
dict to avoid confusing with the error dict used by the formencode
input checker. Add additional input checks and improve error handling.
Add dropdown list to select order by values + add new constants
module to store associated data and error keys + tidy up DiscoveryState?
object to make clearer and logic more consistent + fix paging controls
for results data.

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    <div id="entirepage">
8        <div py:replace="header()"/>
9        <div py:replace="PageTabs('Results')"/>
10        <div py:replace="searchOneLine()"/>
11        <div id="results">
12            <div id="context">
13                ${c.state.hits} results for "${c.state.searchString}" (${XML(c.state.constraints)})</div>
14            <div id="SemanticSearchBox"><div id="SemanticSearchResults">
15                <div py:if="c.state.searchString!=''">
16                Not found what you are looking for? Try ${XML(h.link_to_remote("alternative searches",dict(update="SemanticSearchBox",
17                        url='%s?%s'%(h.url_for(action='semantic'),c.querystring))))}.
18                </div></div>
19            </div>
20            <?python
21            n,p=c.state.getNext()
22            if p:
23                purl=c.state.geturl(offset=p[0],stride=p[1])
24            if n:
25                nurl=c.state.geturl(offset=n[0],stride=n[1])
26            upper=c.state.offset+c.state.stride-1
27            ?>
28            <div class="resultsBar">
29                <div>
30                    <form action="$c.discoveryUrl" name="orderByForm">
31                                <input type="hidden" name="constraints" value="${c.state.urlformattedconstraints}"/>
32                    <a href="${c.state.constrainedurl}"> Refine search</a><span py:replace="helpIcon('refser_help')"/>
33                    <span py:if="c.state.hits != 0" py:strip="">
34                                | Order By ${XML(h.select('orderBy',option_tags = c.orderByList, onchange="orderByForm.submit()"))}
35                        | Found ${c.state.hits}
36                            <span py:if="p!=[]"> | <a href="$purl"> Previous ${p[1]}</a> </span>
37                                                | Showing ${c.state.offset}-$upper
38                        <span py:if="n!=[]"> | <a href="$nurl"> Next ${n[1]}</a></span>
39                     </span>
40                            </form>
41                </div><div id="refser_help" class="hidden">
42                    <div class="helptxt"><p>
43                    The refined search option allows you to constrain your search by returning you to the advanced search page, but retaining your current search parameters
44                    </p></div>
45                </div>
46            </div>
47            <div py:if="c.state.hits != 0" id="resultsTab">
48                <table>
49                    <thead><tr><th rowspan="2">Dataset description</th><th colspan="2">Temporal&nbsp;coverage</th>
50                        <th rowspan="2">Spatial coverage</th>
51                        <th rowspan="2" width="60px"/>
52                        </tr>
53                    <tr><th> Start date </th>
54                    <th> End date </th>
55                    </tr>
56                    </thead>
57                    <tbody>
58                        <span py:for="i,d in enumerate(c.difs)" py:replace="result(i,d)"/>
59                    </tbody>
60                </table>
61            </div>
62            <div py:if="c.state.hits != 0" class="resultsBar">
63                <a href="${c.state.constrainedurl}"> Refine search</a>
64                | Order By |
65                | Found ${c.state.hits} | Showing ${c.state.offset}-$upper
66                  <span py:if="p!=[]"> | <a href="$purl"> Previous ${p[1]}</a> </span>
67                  <span py:if="n!=[]"> | <a href="$nurl"> Next ${n[1]}</a></span> |
68            </div>
69        </div>
70        <div py:replace="footer()"/>
71    </div>
72    </body>
73</html>
Note: See TracBrowser for help on using the repository browser.