source: trunk/templates/supersearch.tt @ 586

Last change on this file since 586 was 586, checked in by kake, 17 years ago

Fixed distance search paging bug.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.0 KB
Line 
1[% IF search_terms %]
2[% node_name = "Search results for $search_terms" %]
3[% ELSE %]
4[% node_name = "Search" %]
5[% END %]
6[% INCLUDE header.tt %]
7[% INCLUDE banner.tt %]
8<div id="content">
9<table border="0" cellpadding="0" cellspacing="0" width="100%"
10summary="Results of search queries are displayed here, and new searches can also be entered.">
11  <tr>
12    <td valign="top">
13  [% IF search_terms %]
14  <h2>Search Results for <em>[% search_terms %]</em></h2>
15    [% IF results.size %]
16      <h3>[% total_num %] matches found, showing [% first_num %] - [% last_num %]</h3>
17    [% END %]
18  [% ELSE %]
19  <h2>Search [% site_name %]</h2>
20  [% END %]
21
22  <p><small>
23    Version [% ss_version %].  See the
24    <a href="[% ss_info_url %]">information page</a> for help and more details.
25  </small></p>
26
27  <form method="get" action="supersearch.cgi">
28    <table border="1">
29      <tr>
30         <th>
31           <label for="search_upper">Pages containing text:</label>
32         </th>
33         <td>
34           <input type="text" name="search" value="[% IF search_terms %][% search_terms %][% END %]" size="50" maxlength="80" id="search_upper" />
35         </td>
36       </tr>
37      <tr>
38        <th>Location:</th>
39        <td>
40          <ul>
41            [% IF coord_field_1 == 'os_x' OR coord_field_1 == 'osie_x' %]
42              <li>
43                within <input type="text" name="[% dist_field %]" value="[% dist %]" size="5" maxlength="5" /> metres
44                of [% coord_field_1_name %]
45                <input type="text" name="[% coord_field_1 %]" value="[% coord_field_1_value %]" size="10" maxlength="10" />,
46                [% coord_field_2_name %]
47                <input type="text" name="[% coord_field_2 %]" value="[% coord_field_2_value %]" size="10" maxlength="10" />
48              </li>
49            [% END %]
50            <li>
51              within <input type="text" name="latlong_dist" value="[% dist %]" size="5" maxlength="5" /> metres
52              of latitude <input type="text" name="latitude" value="[% latitude %]" size="10" maxlength="10" />
53              longitude <input type="text" name="longitude" value="[% longitude %]" size="10" maxlength="10" />
54            </li>
55          </ul>
56        </td>
57      </tr>
58      <tr>
59        <td colspan="2" align="right">
60          <input type="submit" name="go" class="form_button" value="Go" />
61        </td>
62      </tr>
63    </table>
64  </form>
65
66  [% IF search_terms OR dist %]
67
68    <hr />
69
70    [% IF results.size %]
71
72      <ol start="[% first_num %]">
73        [% FOREACH result = results %]
74          <li>
75            <a href="[% result.url %]"><b>[% result.name %]</b></a> (score: [% result.score %])
76            [% IF result.distance %]
77              ([% result.distance %] metres away)
78            [% END %]
79            <br />
80            [% result.summary %]
81          </li>
82        [% END %]
83      </ol>
84
85      <p>
86      Matches [% first_num %] - [% last_num %] of [% total_num %].
87      [% IF (first_num > 20) %]
88        <a href="supersearch.cgi?search=[% search_terms %]&next=[% first_num - 21 %]">Previous 20 results</a>
89      [% END %]
90      [% IF ((first_num > 20) and next_page_startpos) %]
91      /
92      [% END %]
93      [% IF next_page_startpos %]
94        <a href="supersearch.cgi?search=[% search_terms %];[% dist_field %]=[% dist %];[% coord_field_1 %]=[% coord_field_1_value %];[% coord_field_2 %]=[% coord_field_2_value %];next=[% next_page_startpos %]">Next
95        [% IF ((total_num - last_num >= 20)) %]
96          20
97        [% ELSE %]
98          [% total_num - last_num %]
99        [% END %]
100        results</a>
101      [% END %]
102      </p>
103
104    [% ELSE %]
105      <h2>No Items Matched</h2>
106    [% END %] 
107
108  <form method="get" action="supersearch.cgi">
109    <label for="search_lower">Search:</label>
110    <input type="text" name="search" id="search_lower" value="[% search_terms %]" size="50" maxlength="80" value="Search text" onclick="this.value=''" />
111    <input type="submit" name="go" class="form_button" value="Go" />
112  </form>
113  [% END %]
114
115    </td>
116    <td valign="top">[% INCLUDE navbar.tt %]</td>
117  </tr>
118</table>
119
120[% INCLUDE footer.tt %]
Note: See TracBrowser for help on using the repository browser.