2009-09-20 11:39:53 +04:00
|
|
|
<div class="contextual">
|
|
|
|
<% if !@query.new_record? && @query.editable_by?(User.current) %>
|
|
|
|
<%= link_to l(:button_edit), {:controller => 'queries', :action => 'edit', :id => @query}, :class => 'icon icon-edit' %>
|
|
|
|
<%= link_to l(:button_delete), {:controller => 'queries', :action => 'destroy', :id => @query}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<h2><%= @query.new_record? ? l(:label_issue_plural) : h(@query.name) %></h2>
|
|
|
|
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
|
|
|
|
|
|
|
|
<% form_tag({ :controller => 'queries', :action => 'new' }, :id => 'query_form') do %>
|
2009-02-13 01:01:20 +03:00
|
|
|
<%= hidden_field_tag('project_id', @project.to_param) if @project %>
|
2010-06-20 01:53:58 +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" %>">
|
2009-09-20 11:24:16 +04:00
|
|
|
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
2010-03-03 23:09:39 +03:00
|
|
|
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
|
2009-09-20 11:24:16 +04:00
|
|
|
<%= 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">
|
2009-10-22 21:46:54 +04:00
|
|
|
<legend onclick="toggleFieldset(this);"><%= l(:label_options) %></legend>
|
2009-09-20 11:24:16 +04:00
|
|
|
<div style="display: none;">
|
2009-11-28 14:34:12 +03:00
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td><%= l(:field_column_names) %></td>
|
|
|
|
<td><%= render :partial => 'queries/columns', :locals => {:query => @query} %></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td><%= l(:field_group_by) %></td>
|
|
|
|
<td><%= select_tag('group_by', options_for_select([[]] + @query.groupable_columns.collect {|c| [c.caption, c.name.to_s]}, @query.group_by)) %></td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2009-09-20 11:24:16 +04:00
|
|
|
</div>
|
|
|
|
</fieldset>
|
2009-04-26 17:09:14 +04:00
|
|
|
</div>
|
2010-06-20 01:53:58 +04:00
|
|
|
<p class="buttons hide-when-print">
|
2009-04-26 17:09:14 +04:00
|
|
|
|
2007-11-05 21:38:42 +03:00
|
|
|
<%= link_to_remote l(:button_apply),
|
|
|
|
{ :url => { :set_filter => 1 },
|
2009-11-28 14:34:12 +03:00
|
|
|
:before => 'selectAllOptions("selected_columns");',
|
2007-11-05 21:38:42 +03:00
|
|
|
:update => "content",
|
2010-09-17 01:33:49 +04:00
|
|
|
:complete => "apply_filters_observer()",
|
2007-11-05 21:38:42 +03:00
|
|
|
:with => "Form.serialize('query_form')"
|
2007-11-17 20:45:21 +03:00
|
|
|
}, :class => 'icon icon-checked' %>
|
2007-11-05 21:38:42 +03:00
|
|
|
|
|
|
|
<%= link_to_remote l(:button_clear),
|
2009-02-13 01:01:20 +03:00
|
|
|
{ :url => { :set_filter => 1, :project_id => @project },
|
2009-01-27 23:59:02 +03:00
|
|
|
:method => :get,
|
2007-11-05 21:38:42 +03:00
|
|
|
:update => "content",
|
|
|
|
}, :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) %>
|
2009-11-28 14:34:12 +03:00
|
|
|
<%= link_to l(:button_save), {}, :onclick => "selectAllOptions('selected_columns'); $('query_form').submit(); return false;", :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| %>
|
2009-03-07 01:46:49 +03:00
|
|
|
<%= f.link_to 'Atom', :url => { :project_id => @project, :query_id => (@query.new_record? ? nil : @query), :key => User.current.rss_key } %>
|
|
|
|
<%= f.link_to 'CSV', :url => { :project_id => @project } %>
|
|
|
|
<%= f.link_to 'PDF', :url => { :project_id => @project } %>
|
2009-01-29 16:53:17 +03:00
|
|
|
<% end %>
|
|
|
|
|
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 %>
|
2007-11-05 21:38:42 +03:00
|
|
|
<%= auto_discovery_link_tag(:atom, {:query_id => @query, :format => 'atom', :page => nil, :key => User.current.rss_key}, :title => l(:label_issue_plural)) %>
|
2010-08-23 19:04:36 +04:00
|
|
|
<%= 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 %>
|