%= form_tag(
{controller: 'gantts', action: 'show', project_id: project, month: params[:month], year: params[:year], months: params[:months]},
method: :get,
id: 'query_form',
data: {gantt_target: 'form'}
) do %>
<%= hidden_field_tag 'set_filter', '1' %>
<%= hidden_field_tag 'gantt', '1' %>
<%= gantt_zoom_link(gantt, :in) %>
<%= gantt_zoom_link(gantt, :out) %>
<%= link_to_previous_month(gantt.year_from, gantt.month_from, accesskey: accesskey(:previous)) %> |
<%= link_to_next_month(gantt.year_from, gantt.month_from, accesskey: accesskey(:next)) %>
<%= number_field_tag 'months', gantt.months, min: 1, max: Setting.gantt_months_limit.to_i, autocomplete: false %>
<%= l(:label_months_from) %>
<%= select_month(gantt.month_from, prefix: 'month', discard_type: true) %>
<%= select_year(gantt.year_from, prefix: 'year', discard_type: true) %>
<%= hidden_field_tag 'zoom', gantt.zoom %>
<%= link_to_function sprite_icon('checked', l(:button_apply)), '$("#query_form").submit()',
class: 'icon icon-checked' %>
<%= link_to sprite_icon('reload', l(:button_clear)), {project_id: project, set_filter: 1},
class: 'icon icon-reload' %>
<% if query.new_record? && User.current.allowed_to?(:save_queries, project, global: true) %>
<%= link_to_function sprite_icon('save', l(:button_save_object, object_name: l(:label_query)).capitalize),
"$('#query_form').attr('action', '#{ project ? new_project_query_path(project) : new_query_path }').submit();",
class: 'icon icon-save' %>
<% end %>
<% if !query.new_record? && query.editable_by?(User.current) %>
<%= link_to sprite_icon('edit', l(:button_edit_object, object_name: l(:label_query)).capitalize),
edit_query_path(query, gantt: 1),
class: 'icon icon-edit' %>
<%= delete_link query_path(query, gantt: 1), {}, l(:button_delete_object, object_name: l(:label_query)).capitalize %>
<% end %>
<% end %>