OSDN Git Service

13ec567d978770e07da803c42338afbb24969de2
[redminele/redmine.git] / app / views / search / index.rhtml
1 <h2><%= l(:label_search) %></h2>
2
3 <div class="box">
4 <% form_tag({}, :method => :get) do %>
5 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
6 <%= javascript_tag "Field.focus('search-input')" %>
7 <%= project_select_tag %>
8 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
9 <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
10 </p>
11 <p>
12 <% @object_types.each do |t| %>
13 <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
14 <% end %>
15 </p>
16
17 <p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
18 <% end %>
19 </div>
20
21 <% if @results %>
22     <div id="search-results-counts">
23     <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
24     </div>
25     
26     <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
27     <dl id="search-results">
28       <% @results.each do |e| %>
29         <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>
30         <dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
31         <span class="author"><%= format_time(e.event_datetime) %></span></dd>
32       <% end %>
33     </dl>
34 <% end %>
35
36 <p><center>
37 <% if @pagination_previous_date %>
38 <%= link_to_content_update('&#171; ' + l(:label_previous),
39       params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>&nbsp;
40 <% end %>
41 <% if @pagination_next_date %>
42 <%= link_to_content_update(l(:label_next) + ' &#187;',
43       params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
44 <% end %>
45 </center></p>
46
47 <% html_title(l(:label_search)) -%>