OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/app/views/issues/_list.html.erb

76 lines
3.7 KiB

<%= form_tag({}) do -%>
<%= hidden_field_tag 'back_url', url_for(params) %>
<div class="autoscroll">
<table class="list issues">
<thead><tr>
<th class="checkbox hide-when-print"><%= link_to image_tag('check.png'), {},
:onclick => 'toggleIssuesSelection(Element.up(this, "form")); return false;',
:title => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}",
:alt => "#{l(:button_check_all)}/#{l(:button_uncheck_all)}" %>
</th>
<%= sort_header_tag('id', :caption => '#', :default_order => 'desc') %>
<% query.columns.each do |column| %>
<%= column_header(column) %>
<% end %>
</tr></thead>
<% previous_group = false %>
<tbody>
<% issue_list(issues) do |issue, level| -%>
<% if @query.grouped? && (group = @query.group_by_column.value(issue)) != previous_group %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this); return false;">&nbsp;</span>
<%= group.blank? ? 'None' : column_content(@query.group_by_column, issue) %> <span class="count">(<%= @issue_count_by_group[group] %>)</span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}", "toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
</tr>
<% previous_group = group %>
<% end %>
<tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %> <%= level > 0 ? "idnt idnt-#{level}" : nil %>">
<td class="checkbox hide-when-print">
<label for="issue<%= issue.id %>" class="hidden-for-sighted"><%= l(:description_select_issue) + '#' + issue.id.to_s %></label>
<%= check_box_tag("ids[]", issue.id, false, :id => "issue#{issue.id}") %>
</td>
<td class="id">
<% if parent_issue = issue.parent_issue_id %>
<span class='hidden-for-sighted'><%=l(:description_subissue) + ' ' + l(:label_issue) + ' #' + parent_issue.to_s %></span>
<% end -%>
<%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %>
</td>
<% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %>
</tr>
<% if display_sums? %>
<% caching_issue(issue) %>
<%# Check if we are at the end of a group or the end of a page %>
<% if @query.grouped? %>
<% if !next_in_same_group? or issue == issues.last %>
<tr class="<%= cycle('odd', 'even') + " sum grouped " + issue.css_classes %>">
<td colspan="2">
<% column_content = column_content(@query.group_by_column, issue).to_s %>
<%=raw t(:label_sum_for, :value => (column_content.empty? ? 'None' : column_content)) %>
</td>
<% @query.columns.each do |column| %>
<td><%= mapping_for(column).call(grouped_sum_of(column)) %></td>
<% end %>
</tr>
<% end %>
<% end %>
<%# Check if we are at the end of a page %>
<% if issue == issues.last %>
<tr class="<%= cycle('odd', 'even') + " sum group all " + all_issues.first.css_classes %>">
<td colspan="2"><%= t(:label_sum_for, :value => l(:label_all_issues)) %></td>
<% @query.columns.each do |column| %>
<td><%= mapping_for(column).call(total_sum_of(column)) %></td>
<% end %>
</tr>
<% end %>
<% end %>
<%= call_hook(:issue_list_group_bottom, :current_issue => issue, :issues => issues, :query => @query, :group => group) %>
<% end -%>
</tbody>
</table>
</div>
<% end -%>