Chris@909
|
1 <h2><%= l(:label_search) %></h2>
|
Chris@909
|
2
|
Chris@909
|
3 <div class="box">
|
Chris@909
|
4 <% form_tag({}, :method => :get) do %>
|
Chris@909
|
5 <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
|
Chris@909
|
6 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
|
Chris@909
|
7 <%= javascript_tag "Field.focus('search-input')" %>
|
Chris@909
|
8 <%= project_select_tag %>
|
Chris@909
|
9 <%= hidden_field_tag 'all_words', '', :id => nil %>
|
Chris@909
|
10 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
|
Chris@909
|
11 <%= hidden_field_tag 'titles_only', '', :id => nil %>
|
Chris@909
|
12 <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
|
Chris@909
|
13 </p>
|
Chris@909
|
14 <p>
|
Chris@909
|
15 <% @object_types.each do |t| %>
|
Chris@909
|
16 <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
|
Chris@909
|
17 <% end %>
|
Chris@909
|
18 </p>
|
Chris@909
|
19
|
Chris@909
|
20 <p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
|
Chris@909
|
21 <% end %>
|
Chris@909
|
22 </div>
|
Chris@909
|
23
|
Chris@909
|
24 <% if @results %>
|
Chris@909
|
25 <div id="search-results-counts">
|
Chris@909
|
26 <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
|
Chris@909
|
27 </div>
|
Chris@909
|
28
|
Chris@909
|
29 <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
|
Chris@909
|
30 <dl id="search-results">
|
Chris@909
|
31 <% @results.each do |e| %>
|
Chris@909
|
32 <dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(h(e.event_title), :length => 255), @tokens), e.event_url %></dt>
|
Chris@909
|
33 <dd><span class="description"><%= highlight_tokens(h(e.event_description), @tokens) %></span>
|
Chris@909
|
34 <span class="author"><%= format_time(e.event_datetime) %></span></dd>
|
Chris@909
|
35 <% end %>
|
Chris@909
|
36 </dl>
|
Chris@909
|
37 <% end %>
|
Chris@909
|
38
|
Chris@909
|
39 <p><center>
|
Chris@909
|
40 <% if @pagination_previous_date %>
|
Chris@909
|
41 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
|
Chris@909
|
42 params.merge(:previous => 1,
|
Chris@909
|
43 :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>
|
Chris@909
|
44 <% end %>
|
Chris@909
|
45 <% if @pagination_next_date %>
|
Chris@909
|
46 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
|
Chris@909
|
47 params.merge(:previous => nil,
|
Chris@909
|
48 :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
|
Chris@909
|
49 <% end %>
|
Chris@909
|
50 </center></p>
|
Chris@909
|
51
|
Chris@909
|
52 <% html_title(l(:label_search)) -%>
|