##// END OF EJS Templates
Add hook view_search_index_options_content_bottom (#23153)....
Jean-Philippe Lang -
r15202:48c1cbe69b63
parent child
Show More
@@ -1,77 +1,78
1 1 <h2><%= l(:label_search) %></h2>
2 2
3 3 <%= form_tag({}, :method => :get, :id => 'search-form') do %>
4 4 <div class="box">
5 5 <%= label_tag "search-input", l(:description_search), :class => "hidden-for-sighted" %>
6 6 <p><%= text_field_tag 'q', @question, :size => 60, :id => 'search-input' %>
7 7 <%= project_select_tag %>
8 8 <%= hidden_field_tag 'all_words', '', :id => nil %>
9 9 <label><%= check_box_tag 'all_words', 1, @all_words %> <%= l(:label_all_words) %></label>
10 10 <%= hidden_field_tag 'titles_only', '', :id => nil %>
11 11 <label><%= check_box_tag 'titles_only', 1, @titles_only %> <%= l(:label_search_titles_only) %></label>
12 12 </p>
13 13
14 14 <p id="search-types">
15 15 <% @object_types.each do |t| %>
16 16 <label><%= check_box_tag t, 1, @scope.include?(t) %> <%= link_to type_label(t), "#" %></label>
17 17 <% end %>
18 18 </p>
19 19
20 20 <fieldset class="collapsible collapsed">
21 21 <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
22 22 <div id="options-content" style="display:none;">
23 23 <p><label><%= check_box_tag 'open_issues', 1, @open_issues %> <%= l(:label_search_open_issues_only) %></label></p>
24 24 <p>
25 25 <label><%= radio_button_tag 'attachments', '0', @search_attachments == '0' %> <%= l(:label_search_attachments_no) %></label>
26 26 <label><%= radio_button_tag 'attachments', '1', @search_attachments == '1' %> <%= l(:label_search_attachments_yes) %></label>
27 27 <label><%= radio_button_tag 'attachments', 'only', @search_attachments == 'only' %> <%= l(:label_search_attachments_only) %></label>
28 28 </p>
29 <%= call_hook(:view_search_index_options_content_bottom) %>
29 30 </div>
30 31 </fieldset>
31 32 <%= hidden_field_tag 'options', '', :id => 'show-options' %>
32 33
33 34 </div>
34 35 <p><%= submit_tag l(:button_submit) %></p>
35 36 <% end %>
36 37
37 38 <% if @results %>
38 39 <div id="search-results-counts">
39 40 <%= render_results_by_type(@result_count_by_type) unless @scope.size == 1 %>
40 41 </div>
41 42 <h3><%= l(:label_result_plural) %> (<%= @result_count %>)</h3>
42 43 <dl id="search-results">
43 44 <% @results.each do |e| %>
44 45 <dt class="<%= e.event_type %>">
45 46 <%= content_tag('span', e.project, :class => 'project') unless @project == e.project %>
46 47 <%= link_to(highlight_tokens(e.event_title.truncate(255), @tokens), e.event_url) %>
47 48 </dt>
48 49 <dd><span class="description"><%= highlight_tokens(e.event_description, @tokens) %></span>
49 50 <span class="author"><%= format_time(e.event_datetime) %></span></dd>
50 51 <% end %>
51 52 </dl>
52 53 <% end %>
53 54
54 55 <% if @result_pages %>
55 56 <span class="pagination"><%= pagination_links_full @result_pages, @result_count, :per_page_links => false %></span>
56 57 <% end %>
57 58
58 59 <% html_title(l(:label_search)) -%>
59 60
60 61 <%= javascript_tag do %>
61 62 $("#search-types a").click(function(e){
62 63 e.preventDefault();
63 64 $("#search-types input[type=checkbox]").prop('checked', false);
64 65 $(this).siblings("input[type=checkbox]").prop('checked', true);
65 66 if ($("#search-input").val() != "") {
66 67 $("#search-form").submit();
67 68 }
68 69 });
69 70
70 71 $("#search-form").submit(function(){
71 72 $("#show-options").val($("#options-content").is(":visible") ? '1' : '0');
72 73 });
73 74
74 75 <% if params[:options] == '1' %>
75 76 toggleFieldset($("#options-content"));
76 77 <% end %>
77 78 <% end %>
General Comments 0
You need to be logged in to leave comments. Login now