annotate app/views/search/index.rhtml @ 904:0a8317a50fa0 redmine-1.1

Close obsolete branch redmine-1.1
author Chris Cannam
date Fri, 14 Jan 2011 12:53:21 +0000
parents 513646585e45
children 1333582e34c4 cbce1fd3b1b7
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@0 8 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
Chris@0 9 <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
Chris@0 10 </p>
Chris@0 11 <p>
Chris@0 12 <% @object_types.each do |t| %>
Chris@0 13 <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
Chris@0 14 <% end %>
Chris@0 15 </p>
Chris@0 16
Chris@0 17 <p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
Chris@0 18 <% end %>
Chris@0 19 </div>
Chris@0 20
Chris@0 21 <% if @results %>
Chris@0 22 <div id="search-results-counts">
Chris@0 23 <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
Chris@0 24 </div>
Chris@0 25
Chris@0 26 <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
Chris@0 27 <dl id="search-results">
Chris@0 28 <% @results.each do |e| %>
Chris@0 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>
Chris@0 30 <dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
Chris@0 31 <span class="author"><%= format_time(e.event_datetime) %></span></dd>
Chris@0 32 <% end %>
Chris@0 33 </dl>
Chris@0 34 <% end %>
Chris@0 35
Chris@0 36 <p><center>
Chris@0 37 <% if @pagination_previous_date %>
Chris@0 38 <%= link_to_remote ('&#171; ' + l(:label_previous)),
Chris@0 39 {:update => :content,
Chris@0 40 :url => params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))
Chris@0 41 }, :href => url_for(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@0 44 <%= link_to_remote (l(:label_next) + ' &#187;'),
Chris@0 45 {:update => :content,
Chris@0 46 :url => params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))
Chris@0 47 }, :href => url_for(params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
Chris@0 48 <% end %>
Chris@0 49 </center></p>
Chris@0 50
Chris@0 51 <% html_title(l(:label_search)) -%>