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