@@ -1,62 +1,62 | |||||
1 | <%= hidden_field_tag 'set_filter', '1' %> |
|
1 | <%= hidden_field_tag 'set_filter', '1' %> | |
2 | <%= hidden_field_tag 'type', @query.type, :disabled => true, :id => 'query_type' %> |
|
2 | <%= hidden_field_tag 'type', @query.type, :disabled => true, :id => 'query_type' %> | |
3 |
|
3 | |||
4 | <div id="query_form_with_buttons" class="hide-when-print"> |
|
4 | <div id="query_form_with_buttons" class="hide-when-print"> | |
5 | <div id="query_form_content"> |
|
5 | <div id="query_form_content"> | |
6 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> |
|
6 | <fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>"> | |
7 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> |
|
7 | <legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend> | |
8 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> |
|
8 | <div style="<%= @query.new_record? ? "" : "display: none;" %>"> | |
9 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> |
|
9 | <%= render :partial => 'queries/filters', :locals => {:query => @query} %> | |
10 | </div> |
|
10 | </div> | |
11 | </fieldset> |
|
11 | </fieldset> | |
12 |
|
12 | |||
13 | <fieldset id="options" class="collapsible collapsed"> |
|
13 | <fieldset id="options" class="collapsible collapsed"> | |
14 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> |
|
14 | <legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend> | |
15 | <div style="display: none;"> |
|
15 | <div style="display: none;"> | |
16 | <table> |
|
16 | <table> | |
17 | <tr> |
|
17 | <tr> | |
18 | <td class="field"><%= l(:field_column_names) %></td> |
|
18 | <td class="field"><%= l(:field_column_names) %></td> | |
19 | <td><%= render_query_columns_selection(@query) %></td> |
|
19 | <td><%= render_query_columns_selection(@query) %></td> | |
20 | </tr> |
|
20 | </tr> | |
21 | <% if @query.groupable_columns.any? %> |
|
21 | <% if @query.groupable_columns.any? %> | |
22 | <tr> |
|
22 | <tr> | |
23 | <td class="field"><label for='group_by'><%= l(:field_group_by) %></label></td> |
|
23 | <td class="field"><label for='group_by'><%= l(:field_group_by) %></label></td> | |
24 | <td><%= group_by_column_select_tag(@query) %></td> |
|
24 | <td><%= group_by_column_select_tag(@query) %></td> | |
25 | </tr> |
|
25 | </tr> | |
26 | <% end %> |
|
26 | <% end %> | |
27 | <% if @query.available_block_columns.any? %> |
|
27 | <% if @query.available_block_columns.any? %> | |
28 | <tr> |
|
28 | <tr> | |
29 | <td class="field"><%= l(:button_show) %></td> |
|
29 | <td class="field"><%= l(:button_show) %></td> | |
30 | <td><%= available_block_columns_tags(@query) %></td> |
|
30 | <td><%= available_block_columns_tags(@query) %></td> | |
31 | </tr> |
|
31 | </tr> | |
32 | <% end %> |
|
32 | <% end %> | |
33 | <% if @query.available_totalable_columns.any? %> |
|
33 | <% if @query.available_totalable_columns.any? %> | |
34 | <tr> |
|
34 | <tr> | |
35 | <td><%= l(:label_total_plural) %></td> |
|
35 | <td><%= l(:label_total_plural) %></td> | |
36 | <td><%= available_totalable_columns_tags(@query) %></td> |
|
36 | <td><%= available_totalable_columns_tags(@query) %></td> | |
37 | </tr> |
|
37 | </tr> | |
38 | <% end %> |
|
38 | <% end %> | |
39 | </table> |
|
39 | </table> | |
40 | </div> |
|
40 | </div> | |
41 | </fieldset> |
|
41 | </fieldset> | |
42 | </div> |
|
42 | </div> | |
43 |
|
43 | |||
44 | <p class="buttons"> |
|
44 | <p class="buttons"> | |
45 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> |
|
45 | <%= link_to_function l(:button_apply), '$("#query_form").submit()', :class => 'icon icon-checked' %> | |
46 | <%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %> |
|
46 | <%= link_to l(:button_clear), { :set_filter => 1, :sort => '', :project_id => @project }, :class => 'icon icon-reload' %> | |
47 | <% if @query.new_record? %> |
|
47 | <% if @query.new_record? %> | |
48 | <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> |
|
48 | <% if User.current.allowed_to?(:save_queries, @project, :global => true) %> | |
49 | <%= link_to_function l(:button_save), |
|
49 | <%= link_to_function l(:button_save), | |
50 | "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", |
|
50 | "$('#query_type').prop('disabled',false);$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }').submit()", | |
51 | :class => 'icon icon-save' %> |
|
51 | :class => 'icon icon-save' %> | |
52 | <% end %> |
|
52 | <% end %> | |
53 | <% else %> |
|
53 | <% else %> | |
54 | <% if @query.editable_by?(User.current) %> |
|
54 | <% if @query.editable_by?(User.current) %> | |
55 | <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> |
|
55 | <%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %> | |
56 | <%= delete_link query_path(@query) %> |
|
56 | <%= delete_link query_path(@query) %> | |
57 | <% end %> |
|
57 | <% end %> | |
58 | <% end %> |
|
58 | <% end %> | |
59 | </p> |
|
59 | </p> | |
60 | </div> |
|
60 | </div> | |
61 |
|
61 | |||
62 | <%= error_messages_for @query %> |
|
62 | <%= error_messages_for @query %> |
General Comments 0
You need to be logged in to leave comments.
Login now