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 %>
|
2011-04-01 18:34:44 +04:00
|
|
|
<%= hidden_field_tag 'set_filter', '1' %>
|
2011-09-17 15:15:28 +04:00
|
|
|
<div id="query_form_content" class="hide-when-print">
|
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>
|
|
|
|
<td><%= render :partial => 'queries/columns', :locals => {:query => @query} %></td>
|
|
|
|
</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>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</fieldset>
|
|
|
|
</div>
|
2010-06-20 01:53:58 +04:00
|
|
|
<p class="buttons hide-when-print">
|
2009-04-26 17:09:14 +04:00
|
|
|
|
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-02-17 01:01:48 +04:00
|
|
|
"$('query_form').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>
|
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) %>
|
2011-11-20 17:23:20 +04:00
|
|
|
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); 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;">
|
|
|
|
<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>
|
|
|
|
<label><%= check_box_tag 'description', '1' %> <%= l(:field_description) %></label>
|
|
|
|
</p>
|
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 %>
|