summaryrefslogtreecommitdiffstats
path: root/app/views/issues/index.html.erb
blob: 3377fd68192ab8817c12bea0b6894a3bfefe0edc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<div class="contextual">
  <% if User.current.allowed_to?(:add_issues, @project, :global => true) && (@project.nil? || Issue.allowed_target_trackers(@project).any?) %>
    <%= link_to l(:label_issue_new), _new_project_issue_path(@project), :class => 'icon icon-add new-issue' %>
  <% end %>
  <%= actions_dropdown do %>
    <% if @project %>
      <%= link_to l(:field_summary), project_issues_report_path(@project) %>
    <% end %>

    <% if User.current.allowed_to?(:import_issues, @project, :global => true) %>
      <%= link_to l(:button_import), new_issues_import_path(:project_id => @project) %>
    <% end %>

    <%= link_to_if_authorized l(:label_settings),
              {:controller => 'projects', :action => 'settings', :id => @project, :tab => 'issues'},
              :class => 'icon icon-settings' if User.current.allowed_to?(:manage_categories, @project) %>
  <% end %>
</div>

<h2><%= @query.new_record? ? l(:label_issue_plural) : @query.name %></h2>
<% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %>

<%= form_tag(_project_issues_path(@project), :method => :get, :id => 'query_form') do %>
  <%= render :partial => 'queries/query_form' %>
<% end %>

<% if @query.valid? %>
<% if @issues.empty? %>
<p class="nodata"><%= l(:label_no_data) %></p>
<% else %>
<%= render_query_totals(@query) %>
<%= render :partial => 'issues/list', :locals => {:issues => @issues, :query => @query} %>
<span class="pagination"><%= pagination_links_full @issue_pages, @issue_count %></span>
<% end %>

<% other_formats_links do |f| %>
  <%= f.link_to_with_query_parameters 'Atom', :key => User.current.rss_key %>
  <%= f.link_to_with_query_parameters 'CSV', {}, :onclick => "showModal('csv-export-options', '350px'); return false;" %>
  <%= f.link_to_with_query_parameters 'PDF' %>
<% end %>

<div id="csv-export-options" style="display:none;">
  <h3 class="title"><%= l(:label_export_options, :export_format => 'CSV') %></h3>
  <%= form_tag(_project_issues_path(@project, :format => 'csv'), :method => :get, :id => 'csv-export-form') do %>
  <%= query_as_hidden_field_tags(@query) %>
  <p>
    <label><%= radio_button_tag 'c[]', '', true %> <%= l(:description_selected_columns) %></label><br />
    <label><%= radio_button_tag 'c[]', 'all_inline' %> <%= l(:description_all_columns) %></label>
  </p>
  <p>
    <label><%= check_box_tag 'c[]', 'description', @query.has_column?(:description) %> <%= l(:field_description) %></label>
    <label><%= check_box_tag 'c[]', 'last_notes', @query.has_column?(:last_notes) %> <%= l(:label_last_notes) %></label>
  </p>
  <%= export_csv_encoding_select_tag %>
  <% 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 %>
  <p class="buttons">
    <%= submit_tag l(:button_export), :name => nil, :onclick => "hideModal(this);", :data => { :disable_with => false } %>
    <%= link_to_function l(:button_cancel), "hideModal(this);" %>
  </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 %>