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