annotate app/views/search/index.html.erb @ 1479:2d7e82037daa bibplugin_cache

Close obsolete branch bibplugin_cache
author Chris Cannam
date Thu, 22 Nov 2012 15:09:58 +0000
parents 598d53decdd8
children bb32da3bea34
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@909 5 <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
Chris@0 6 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
Chris@0 7 <%= javascript_tag "Field.focus('search-input')" %>
Chris@0 8 <%= project_select_tag %>
Chris@507 9 <%= hidden_field_tag 'all_words', '', :id => nil %>
Chris@0 10 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
Chris@507 11 <%= hidden_field_tag 'titles_only', '', :id => nil %>
Chris@0 12 <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
Chris@0 13 </p>
Chris@0 14 <p>
Chris@0 15 <% @object_types.each do |t| %>
Chris@0 16 <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label>
Chris@0 17 <% end %>
Chris@0 18 </p>
Chris@0 19
Chris@0 20 <p><%= submit_tag l(:button_submit), :name => 'submit' %></p>
Chris@0 21 <% end %>
Chris@0 22 </div>
Chris@0 23
chris@938 24 <% if @project_matches and !@project_matches.empty? and !@pagination_previous_date %>
chris@498 25 <h3><%= l(:label_matching_project_plural) %> (<%= @project_matches.count %>)</h3>
chris@498 26 <dl id="search-results">
chris@498 27 <% @project_matches.each do |e| %>
chris@498 28 <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 29 <dd><span class="description"><%= e.short_description %></span>
chris@498 30 <% end %>
chris@498 31 </dl>
chris@498 32 <% end %>
chris@498 33
Chris@0 34 <% if @results %>
chris@323 35
chris@323 36 <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3>
Chris@0 37 <div id="search-results-counts">
Chris@0 38 <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
Chris@0 39 </div>
Chris@0 40 <dl id="search-results">
Chris@0 41 <% @results.each do |e| %>
Chris@909 42 <dt class="<%= e.event_type %>"><%= content_tag('span', h(e.project), :class => 'project') unless @project == e.project %> <%= link_to highlight_tokens(truncate(h(e.event_title), :length => 255), @tokens), e.event_url %></dt>
Chris@909 43 <dd><span class="description"><%= highlight_tokens(h(e.event_description), @tokens) %></span>
Chris@0 44 <span class="author"><%= format_time(e.event_datetime) %></span></dd>
Chris@0 45 <% end %>
Chris@0 46 </dl>
Chris@0 47 <% end %>
Chris@0 48
Chris@0 49 <p><center>
Chris@0 50 <% if @pagination_previous_date %>
Chris@909 51 <%= link_to_content_update("\xc2\xab " + l(:label_previous),
Chris@909 52 params.merge(:previous => 1,
Chris@909 53 :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %>&nbsp;
Chris@0 54 <% end %>
Chris@0 55 <% if @pagination_next_date %>
Chris@909 56 <%= link_to_content_update(l(:label_next) + " \xc2\xbb",
Chris@909 57 params.merge(:previous => nil,
Chris@909 58 :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
Chris@0 59 <% end %>
Chris@0 60 </center></p>
Chris@0 61
Chris@0 62 <% html_title(l(:label_search)) -%>