annotate app/views/search/index.rhtml @ 507:0c939c159af4 redmine-1.2

Update to Redmine 1.2.1 on 1.2-stable branch (Redmine SVN rev 6270)
author Chris Cannam
date Thu, 14 Jul 2011 10:32:19 +0100
parents cbce1fd3b1b7
children 851510f1b535
rev   line source
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@0 23 <% if @results %>
Chris@0 24 <div id="search-results-counts">
Chris@0 25 <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
Chris@0 26 </div>
Chris@0 27
Chris@0 28 <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
Chris@0 29 <dl id="search-results">
Chris@0 30 <% @results.each do |e| %>
Chris@0 31 <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 32 <dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
Chris@0 33 <span class="author"><%= format_time(e.event_datetime) %></span></dd>
Chris@0 34 <% end %>
Chris@0 35 </dl>
Chris@0 36 <% end %>
Chris@0 37
Chris@0 38 <p><center>
Chris@0 39 <% if @pagination_previous_date %>
Chris@441 40 <%= link_to_content_update('&#171; ' + l(:label_previous),
Chris@441 41 params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>&nbsp;
Chris@0 42 <% end %>
Chris@0 43 <% if @pagination_next_date %>
Chris@441 44 <%= link_to_content_update(l(:label_next) + ' &#187;',
Chris@441 45 params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
Chris@0 46 <% end %>
Chris@0 47 </center></p>
Chris@0 48
Chris@0 49 <% html_title(l(:label_search)) -%>