You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.rhtml 2.2KB

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