To check out this repository please hg clone the following URL, or open the URL using EasyMercurial or your preferred Mercurial client.
root / app / views / search / index.rhtml @ 774:58410c63bb84
History | View | Annotate | Download (3 KB)
| 1 | 0:513646585e45 | Chris | <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 | 507:0c939c159af4 | Chris | <%= hidden_field_tag 'all_words', '', :id => nil %>
|
| 9 | 0:513646585e45 | Chris | <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label> |
| 10 | 507:0c939c159af4 | Chris | <%= hidden_field_tag 'titles_only', '', :id => nil %>
|
| 11 | 0:513646585e45 | Chris | <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label> |
| 12 | </p>
|
||
| 13 | <p>
|
||
| 14 | <% @object_types.each do |t| %>
|
||
| 15 | <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= type_label(t) %></label> |
||
| 16 | <% end %>
|
||
| 17 | </p>
|
||
| 18 | |||
| 19 | <p><%= submit_tag l(:button_submit), :name => 'submit' %></p> |
||
| 20 | <% end %>
|
||
| 21 | </div>
|
||
| 22 | |||
| 23 | 774:58410c63bb84 | chris | <div id="cse" style="width: 100%;">Loading</div> |
| 24 | <script src="//www.google.com/jsapi" type="text/javascript"></script> |
||
| 25 | <script type="text/javascript"> |
||
| 26 | google.load('search', '1', {language : 'en'});
|
||
| 27 | google.setOnLoadCallback(function() {
|
||
| 28 | var customSearchControl = new google.search.CustomSearchControl('009438048077875231531:mfwwmuro5ps');
|
||
| 29 | customSearchControl.setResultSetSize(google.search.Search.FILTERED_CSE_RESULTSET);
|
||
| 30 | customSearchControl.draw('cse');
|
||
| 31 | }, true);
|
||
| 32 | </script>
|
||
| 33 | |||
| 34 | 498:87bfac1079fd | chris | <% if @project_matches and !@project_matches.empty? and (@project_matches.count < 6) and !@pagination_previous_date %>
|
| 35 | <h3><%= l(:label_matching_project_plural) %> (<%= @project_matches.count %>)</h3> |
||
| 36 | <dl id="search-results"> |
||
| 37 | <% @project_matches.each do |e| %>
|
||
| 38 | <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> |
||
| 39 | <dd><span class="description"><%= e.short_description %></span> |
||
| 40 | <% end %>
|
||
| 41 | </dl>
|
||
| 42 | <% end %>
|
||
| 43 | |||
| 44 | 0:513646585e45 | Chris | <% if @results %>
|
| 45 | 323:1333582e34c4 | chris | |
| 46 | <h3><%= l(:label_result_plural) %> (<%= @results_by_type.values.sum %>)</h3> |
||
| 47 | 0:513646585e45 | Chris | <div id="search-results-counts"> |
| 48 | <%= render_results_by_type(@results_by_type) unless @scope.size == 1 %>
|
||
| 49 | </div>
|
||
| 50 | <dl id="search-results"> |
||
| 51 | <% @results.each do |e| %>
|
||
| 52 | <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> |
||
| 53 | <dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span> |
||
| 54 | <span class="author"><%= format_time(e.event_datetime) %></span></dd> |
||
| 55 | <% end %>
|
||
| 56 | </dl>
|
||
| 57 | <% end %>
|
||
| 58 | |||
| 59 | <p><center> |
||
| 60 | <% if @pagination_previous_date %>
|
||
| 61 | 441:cbce1fd3b1b7 | Chris | <%= link_to_content_update('« ' + l(:label_previous),
|
| 62 | params.merge(:previous => 1, :offset => @pagination_previous_date.strftime("%Y%m%d%H%M%S"))) %> |
||
| 63 | 0:513646585e45 | Chris | <% end %>
|
| 64 | <% if @pagination_next_date %>
|
||
| 65 | 441:cbce1fd3b1b7 | Chris | <%= link_to_content_update(l(:label_next) + ' »',
|
| 66 | params.merge(:previous => nil, :offset => @pagination_next_date.strftime("%Y%m%d%H%M%S"))) %>
|
||
| 67 | 0:513646585e45 | Chris | <% end %>
|
| 68 | </center></p> |
||
| 69 | |||
| 70 | <% html_title(l(:label_search)) -%> |