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