Changeset 1889 for swish_website/lib/page/search.html
- Timestamp:
- 02/06/07 14:53:36 (2 years ago)
- Files:
-
- swish_website/lib/page/search.html (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
swish_website/lib/page/search.html
r1629 r1889 1 1 [%- # $id$ 2 # Page for sh woing search results2 # Page for showing search results 3 3 -%] 4 4 [%- META … … 11 11 12 12 page.title = 'Search'; 13 page.no_search = 1; 14 15 include_javascript( 'search' ); 13 16 14 17 … … 20 23 END; 21 24 25 page_ids = {}; 26 MACRO radio( name, value, label, checked ) BLOCK; 27 page_ids.$name = page_ids.$name + 1; 28 id = page_ids.$name; 29 ck = checked ? ' checked="checked"' : ''; 30 %] 31 <input id="[% name; id %]" type="radio" name="[% name %]" value="[% value | html %]"[% ck %]/> 32 <label for="[% name; id %]">[% label | html %]</label> 33 [% 34 END; 35 36 37 MACRO select( name, value, label, checked ) BLOCK; 38 ck = checked ? ' selected="selected"' : ''; 39 %] 40 <option id="[% name; value %]" value="[% value | html %]"[% ck %]>[% label | html %]</option> 41 [% 42 END; 43 22 44 USE myurl = url( request.myself, query=request.query, 23 45 metaname=request.metaname, size=request.pagesize ); … … 26 48 27 49 28 UNLESS result; 29 message( "Must enter a query" ); 30 ELSE; 31 50 51 PROCESS search_form; 52 53 54 IF result; 32 55 # Show results 33 56 34 57 message( result.message ) IF result.message; 58 35 59 36 60 IF result.results.size; … … 49 73 </div> 50 74 75 <div id="hidingplace" style="display:none"></div> 76 77 78 79 [% BLOCK search_form %] 80 <form id="searchform" method="get" action="index.html"> 81 <h2>Enter your query</h2> 82 <div id="simpleform"> 83 <input type="text" size="30" name="query" /> 84 <input type="submit" name="submit" value="Search!" /> 85 </div> 86 <div id="advancedform" style="display: none"> 87 <input id="advflag" name="adv" type="hidden" value="0" /> 88 Limit to: 89 [% 90 radio( 'meta', '', 'Subject/Title & Body', 1 ); 91 radio( 'meta', 'title', 'Subject/Title' ); 92 radio( 'meta', 'name', "Poster's Name" ); 93 radio( 'meta', 'email', "Poster's Email" ); 94 %] 95 96 <br /> 97 98 Search: 99 <select name="section"> 100 [% 101 select( 'section', '', 'Everywhere',1 ); 102 select( 'section', 'docs', 'Documentation' ); 103 select( 'section', 'devel', 'Development Docs' ); 104 select( 'section', 'archive', 'List Archives' ); 105 select( 'section', 'website', 'Site web pages' ); 106 %] 107 </select> 108 109 Sort by: 110 <select name="sort"> 111 <option value="rank">Rank</option> 112 <option value="title">Subject/Title</option> 113 <option value="email">Email</option> 114 <option value="date">Date</option> 115 </select> 116 <input id="rsort" type="checkbox" name="reverse" /><label for="rsort">Reverse Sort</label> 117 118 <br /> 119 Limit to date: 120 [% 121 radio( 'date', '', 'All', 1); 122 radio( 'date', 'day', 'Today' ); 123 radio( 'date', 'week', 'This Week' ); 124 radio( 'date', 'month', 'This Month' ); 125 radio( 'date', '90', 'Last 90 Days' ); 126 '<br />'; 127 radio( 'date', 'select', 'Select date range' ); 128 129 130 PROCESS select_date name = 's'; 131 ' through '; 132 PROCESS select_date name = 'e'; 133 %] 134 </div><!-- /#advancedform --> 135 </form> 136 [% END %] 137 138 [% BLOCK select_date %] 139 <select name="[% name %]month"> 140 <option value="1">Jan</option> 141 <option value="2">Feb</option> 142 <option value="3">Mar</option> 143 <option value="4">Apr</option> 144 <option value="5">May</option> 145 <option value="6">Jun</option> 146 <option value="7">Jul</option> 147 <option value="8">Aug</option> 148 <option value="9">Sep</option> 149 <option value="10">Oct</option> 150 <option value="11">Nov</option> 151 <option value="12">Dec</option> 152 </select> 153 154 <select name="[% name %]day"> 155 [% i = 1; WHILE i < 32 %] 156 <option value="[% i %]">[% i %]</option> 157 [% i = i + 1; END %] 158 </select> 159 160 <select name="[% name %]year"> 161 [% i = cur_year; WHILE i > 1995 %] 162 <option value="[% i %]">[% i %]</option> 163 [% i = i - 1; END %] 164 </select> 165 [% END %] 166 167 168 51 169 52 170 … … 67 185 <div class="search-header"> 68 186 Results for <b>[% request.query | html %]</b><br /> 187 </div> 188 [% END %] 189 190 191 192 193 [% BLOCK next_links %] 69 194 Showing page [% result.page %] 70 195 ([% result.start +1 %] - [% (result.start + result.shown) %] of [% result.hits %] hits) 71 196 72 </div>73 [% END %]74 75 76 77 78 [% BLOCK next_links %]79 197 [% IF result.prev %] 80 198 <a class="next" href="[% myurl( page=result.prev ) %]">Previous</a> … … 94 212 %] 95 213 96 <div class="search-title"> 97 214 <h2 id="result-heading"> 215 <a href="[% item.Property('swishdocpath') %]"> 216 [% item.Property('swishtitle') || 'missing title' | highlight('swishtitle', item ) %] 217 </a> 218 </h2> 219 220 <div class="search-subtitle"> 98 221 [% IF is_list %] 99 222 <span class='indxtype'>[List Archive]</span> … … 104 227 [% END %] 105 228 106 <a href="[% item.Property('swishdocpath') %]"> 107 [% item.Property('swishtitle') || 'missing title' | highlight('swishtitle', item ) %]</a> 108 109 <span class="search-rank"> -- rank: <b>[% item.Property('swishrank') %]</b></span> 229 <span class="search-rank">Rank: <b>[% item.Property('swishrank') %]</b></span> 110 230 </div> 111 231 … … 134 254 SET name = item.Property('name'); 135 255 SET email = item.Property('email'); 136 SET name_href = myurl( query=" name=\"$name\"" );137 SET email_href = myurl( query=" email=\"$email\"" );256 SET name_href = myurl( query="\"$name\"", meta="name" ); 257 SET email_href = myurl( query="\"$email\"", meta="email" ); 138 258 %] 139 259
