socialforge/app/views/issues/index.html.erb

118 lines
4.6 KiB
Plaintext

<div class="content-title-top">
<% flag = false %>
<div style="">
<%= link_to l(:label_issue_new), { :controller => 'issues', :action => 'new', :copy_from => nil }, :param => :project_id, :caption => :label_issue_new,
:html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %>
<%= link_to l(:label_query), '#', :class => 'icon icon-help',
:onclick => '$("#custom_query").toggle(); ' if (User.current.logged? && flag) %>
</div>
</div>
</h3>
<div class="contextual">
<% if !@query.new_record? && @query.editable_by?(User.current) %>
<%= link_to l(:button_edit), edit_query_path(@query), :class => 'icon icon-edit' %>
<%= delete_link query_path(@query) %>
<% end %>
</div>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form') do %>
<%= hidden_field_tag 'set_filter', '1' %>
<div id="custom_query" style="display: <%= !flag ? 'block' : 'none' %>;">
<div id="query_form_content" class="hide-when-print">
<fieldset id="filters" style="width:650px;" class="collapsible <%= @query.new_record? ? "" : "collapsed" %>">
<legend onclick="toggleFieldset(this);">
<%= l(:label_issue_query_condition) %>
</legend>
<div style="<%= @query.new_record? ? "" : "display: none;" %>">
<%= render :partial => 'queries/filters', :locals => {:query => @query} %>
</div>
</fieldset>
<fieldset class="collapsible collapsed" style="width:650px;">
<legend onclick="toggleFieldset(this);">
<%= l(:label_options) %>
</legend>
<div style="display: none;">
<table>
<tr>
<td><%= l(:field_column_names) %></td>
<td><%= render_query_columns_selection(@query) %></td>
</tr>
<tr>
<td><label for='group_by'><%= l(:field_group_by) %></label></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>
<tr>
<td><%= l(:button_show) %></td>
<td><%= available_block_columns_tags(@query) %></td>
</tr>
</table>
</div>
</fieldset>
</div>
<div class="buttons hide-when-print">
<%= link_to_function l(:label_issue_query), 'submit_query_form("query_form")', :class => 'icon icon-checked' %>
<%= link_to l(:label_issue_cancel_query), { :set_filter => 1, :project_id => @project }, :class => 'icon icon-reload' %>
</div>
</div>
<% end %>
<%= error_messages_for 'query' %>
<% if @query.valid? %>
<% if @issues.empty? %>
<p class="nodata">
<%= l(:label_no_data) %>
</p>
<% else %>
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
<div class="pagination"><ul><%= pagination_links_full @issue_pages, @issue_count %></ul></div>
<% end %>
<div style="float: right; padding-top: 30px">
<% other_formats_links do |f| %>
<%= f.link_to 'Atom', :url => params.merge(:key => User.current.rss_key) %>
<%= f.link_to 'CSV', :url => params, :onclick => "showModal('csv-export-options', '330px'); return false;" %>
<%= f.link_to 'PDF', :url => params %>
<% end %>
</div>
<div id="csv-export-options" style="display:none;">
<h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
<%= form_tag(params.merge({:format => 'csv',:page=>nil}), :method => :get, :id => 'csv-export-form') do %>
<p>
<label><%= radio_button_tag 'columns', 'all' %> <%= l(:description_all_columns) %></label>
</p>
<p>
<label><%= check_box_tag 'description', '1', @query.has_column?(:description) %> <%= l(:field_description) %></label>
</p>
<p class="buttons">
<%= 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>
<% end %>
<%= call_hook(:view_issues_index_bottom, { :issues => @issues, :project => @project, :query => @query }) %>
<% content_for :sidebar do %>
<%= render :partial => 'issues/sidebar' %>
<% end %>
<% content_for :header_tags do %>
<%= 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)) %>
<% end %>
<%= context_menu issues_context_menu_path %>