Changesets can be listed by changeset number.
The Git repository is here.
- Revision:
- 82
- Log:
Improved the Search display, including some instructions on how
it works and a description of why it doesn't!
- Author:
- adh
- Date:
- Wed Aug 09 00:39:20 +0100 2006
- Size:
- 2920 Bytes
1 | <div class="forum"> |
2 | <div class="search"> |
3 | <div class="box"> |
4 | <% if @forums.empty? %> |
5 | <%=h l(:no_forums_to_search) %> |
6 | <% else %> |
7 | <!-- Search form --> |
8 | <form action="<%= url_for() %>"> |
9 | <table border="0" cellspacing="0" cellpadding="0" align="left" style="padding-right: 10px; margin-right: 10px; border-right: 1px solid #e5ffd4"> |
10 | <tr valign="top" align="left"> |
11 | <th><label><%=h l(:search_for) %></label></th> |
12 | <th> </th> |
13 | <th><label><%=h l(:search_in_forums) %></label></th> |
14 | </tr> |
15 | <tr valign="top" align="left"> |
16 | <td><input type="text" name="query" value="<%=h @query %>" /></td> |
17 | <td rowspan="2"> </td> |
18 | <td rowspan="2"> |
19 | <select name="forums[]" size="<%= [5, @forums.size].min %>" multiple="multiple"> |
20 | <%= options_from_collection_for_select(@forums, :id, :name, @selected_forums) %> |
21 | </select> |
22 | </td> |
23 | </tr> |
24 | <tr valign="bottom" align="left"> |
25 | <td><input type="submit" value="Go!" /></td> |
26 | </tr> |
27 | </table> |
28 | |
29 | <p /> |
30 | <%=h l(:search_help_1) %> |
31 | <%=h l(:search_help_2) %> |
32 | |
33 | </form> |
34 | <% end %> |
35 | </div> |
36 | |
37 | <p /> |
38 | The search engine is called Ferret, which is a Ruby version of an engine |
39 | called Lucene. To find out more about the query syntax, see the Lucene |
40 | documentation held on |
41 | <a href="http://lucene.apache.org/java/docs/queryparsersyntax.html">this |
42 | page</a>. |
43 | |
44 | <p /> |
45 | <em><strong>Please note:</strong></em> |
46 | There are still a few bugs in the forum search engine at the |
47 | moment. Queries that return a great many results will tend to say that |
48 | nothing could be found, so avoid including common words like "and", |
49 | "the" or "this" unless as part of a wider, explicit phrase. If you try |
50 | to search more than one forum at a time the engine usually finds |
51 | nothing at all, so restrict searches to one forum for better results. |
52 | |
53 | <% if @results %> |
54 | <!-- Query submitted --> |
55 | |
56 | <br clear="all" /> |
57 | <h4>Search results:</h4> |
58 | |
59 | <p /> |
60 | <div class="box search_results"> |
61 | <% if @results.size == 0 %> |
62 | <%=h l(:search_no_result) %> |
63 | <% else %> |
64 | <table class="searchresults"> |
65 | <% @results.each do |result| %> |
66 | <tr valign="top"> |
67 | <td class="subject"><%= link_to h(result.subject), :controller => 'topic', :action => 'show', :id => result.topic_id, :anchor => result.id %></td> |
68 | <td class="text"> |
69 | <%= searchresult_text_excerpt(result.text, @query) %> |
70 | </td> |
71 | </tr> |
72 | <% end %> |
73 | </table> |
74 | <% end %> |
75 | </div> |
76 | <% else %> |
77 | <!-- No query submitted --> |
78 | <% end %> |
79 | </div> |
80 | </div> |