2009-09-20 11:39:53 +04:00
|
|
|
<div class="contextual">
|
|
|
|
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
2011-10-26 22:00:56 +04:00
|
|
|
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
|
2012-07-07 18:36:49 +04:00
|
|
|
<%= delete_link query_path(@query) %>
|
2009-09-20 11:39:53 +04:00
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2>
|
2011-10-02 22:45:17 +04:00
|
|
|
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
2009-09-20 11:39:53 +04:00
|
|
|
|
2012-04-25 21:17:49 +04:00
|
|
|
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project },
|
2012-01-05 12:02:19 +04:00
|
|
|
:method => :get, :id => 'query_form') do %>
|
2014-01-11 15:12:03 +04:00
|
|
|
<div id="query_form_with_buttons" class="hide-when-print">
|
2011-04-01 18:34:44 +04:00
|
|
|
<%= hidden_field_tag 'set_filter', '1' %>
|
2014-01-11 15:12:03 +04:00
|
|
|
<div id="query_form_content">
|
2010-03-03 23:09:39 +03:00
|
|
|
<fieldset id="filters" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
|
2011-09-17 15:15:28 +04:00
|
|
|
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
|
|
|
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
|
|
|
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
|
|
|
|
</div>
|
2009-04-26 17:09:14 +04:00
|
|
|
</fieldset>
|
2009-09-20 11:24:16 +04:00
|
|
|
<fieldset class="collapsible collapsed">
|
2011-09-17 15:15:28 +04:00
|
|
|
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
|
|
|
<div style="display: none;">
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td><%= l(:field_column_names) %></td>
|
2013-02-23 16:14:22 +04:00
|
|
|
<td><%= render_query_columns_selection(@query) %></td>
|
2011-09-17 15:15:28 +04:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2011-10-29 05:14:47 +04:00
|
|
|
<td><label for='group_by'><%= l(:field_group_by) %></label></td>
|
2012-01-05 12:02:19 +04:00
|
|
|
<td><%= select_tag('group_by',
|
|
|
|
options_for_select(
|
|
|
|
[[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]},
|
|
|
|
@query.group_by)
|
|
|
|
) %></td>
|
2011-09-17 15:15:28 +04:00
|
|
|
</tr>
|
2012-12-06 21:48:19 +04:00
|
|
|
<tr>
|
|
|
|
<td><%= l(:button_show) %></td>
|
|
|
|
<td><%= available_block_columns_tags(@query) %></td>
|
|
|
|
</tr>
|
2011-09-17 15:15:28 +04:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
2014-01-11 15:12:03 +04:00
|
|
|
<p class="buttons">
|
2011-04-01 18:34:44 +04:00
|
|
|
<%= link_to_function l(:button_apply), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
|
|
|
|
<%= link_to l(:button_clear), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %>
|
2009-09-20 11:39:53 +04:00
|
|
|
<% if @query.new_record? && User.current.allowed_to?(:save_queries, @project, :global => true) %>
|
2012-01-05 12:02:19 +04:00
|
|
|
<%= link_to_function l(:button_save),
|
2012-07-22 17:29:26 +04:00
|
|
|
"$('#query_form').attr('action', '#{ @project ? new_project_query_path(@project) : new_query_path }'); submit_query_form('query_form')",
|
2012-01-05 12:02:19 +04:00
|
|
|
:class => 'icon icon-save' %>
|
2007-11-05 21:38:42 +03:00
|
|
|
<% end %>
|
2008-03-22 00:08:00 +03:00
|
|
|
</p>
|
2014-01-11 15:12:03 +04:00
|
|
|
</div>
|
2007-08-31 21:02:44 +04:00
|
|
|
<% end %>
|
2009-04-26 17:09:14 +04:00
|
|
|
|
2007-08-31 21:02:44 +04:00
|
|
|
<%= error_messages_for 'query' %>
|
|
|
|
<% if @query.valid? %>
|
|
|
|
<% if @issues.empty? %>
|
2007-11-05 21:38:42 +03:00
|
|
|
<p class="nodata"><%= l(:label_no_data) %></p>
|
2007-08-31 21:02:44 +04:00
|
|
|
<% else %>
|
2007-10-01 12:44:17 +04:00
|
|
|
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
|
2007-12-29 14:36:30 +03:00
|
|
|
<p class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></p>
|
2009-02-21 01:45:16 +03:00
|
|
|
<% end %>
|
2008-03-05 11:25:22 +03:00
|
|
|
|
2009-01-29 16:53:17 +03:00
|
|
|
<% other_formats_links do |f| %>
|
2011-09-17 15:15:28 +04:00
|
|
|
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
|
2014-01-12 14:39:42 +04:00
|
|
|
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '350px'); return false;" %>
|
2011-09-17 15:15:28 +04:00
|
|
|
<%= f.link_to 'PDF', :url => params %>
|
2009-01-29 16:53:17 +03:00
|
|
|
<% end %>
|
|
|
|
|
2011-11-20 17:23:20 +04:00
|
|
|
<div id="csv-export-options" style="display:none;">
|
2014-01-12 14:39:42 +04:00
|
|
|
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
|
2012-04-25 21:17:49 +04:00
|
|
|
<%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %>
|
2011-11-20 17:23:20 +04:00
|
|
|
<p>
|
|
|
|
<label><%= radio_button_tag 'columns', '', true %> <%= l(:description_selected_columns) %></label><br />
|
|
|
|
<label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label>
|
|
|
|
</p>
|
|
|
|
<p>
|
2012-12-06 21:48:19 +04:00
|
|
|
<label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
|
2011-11-20 17:23:20 +04:00
|
|
|
</p>
|
2014-01-12 14:39:42 +04:00
|
|
|
<% if @issue_count > Setting.issues_export_limit.to_i %>
|
|
|
|
<p class="icon icon-warning">
|
|
|
|
<%= l(:setting_issues_export_limit) %>: <%= Setting.issues_export_limit.to_i %>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
2011-11-26 17:33:19 +04:00
|
|
|
<p class="buttons">
|
2011-11-20 17:23:20 +04:00
|
|
|
<%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);" %>
|
|
|
|
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
|
|
|
|
</p>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
2007-08-31 21:02:44 +04:00
|
|
|
<% end %>
|
2010-07-16 07:16:29 +04:00
|
|
|
<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %>
|
2007-11-05 21:38:42 +03:00
|
|
|
|
|
|
|
<% content_for :sidebar do %>
|
|
|
|
<%= render :partial => 'issues/sidebar' %>
|
2008-03-30 16:29:07 +04:00
|
|
|
<% end %>
|
2007-09-01 00:22:36 +04:00
|
|
|
|
|
|
|
<% content_for :header_tags do %>
|
2012-01-05 12:02:19 +04:00
|
|
|
<%= auto_discovery_link_tag(:atom,
|
|
|
|
{:query_id => @query, :format => 'atom',
|
|
|
|
:page => nil, :key => User.current.rss_key},
|
|
|
|
:title => l(:label_issue_plural)) %>
|
|
|
|
<%= auto_discovery_link_tag(:atom,
|
|
|
|
{:controller => 'journals', :action => 'index',
|
|
|
|
:query_id => @query, :format => 'atom',
|
|
|
|
:page => nil, :key => User.current.rss_key},
|
|
|
|
:title => l(:label_changes_details)) %>
|
2007-09-01 00:22:36 +04:00
|
|
|
<% end %>
|
2008-02-11 20:59:41 +03:00
|
|
|
|
2010-08-19 22:16:54 +04:00
|
|
|
<%= context_menu issues_context_menu_path %>
|