end
end
+ def grouped_issue_list(issues, query, issue_count_by_group, &block)
+ previous_group, first = false, true
+ issue_list(issues) do |issue, level|
+ group_name = group_count = nil
+ if query.grouped? && ((group = query.group_by_column.value(issue)) != previous_group || first)
+ if group.blank? && group != false
+ group_name = l(:label_none)
+ else
+ group_name = column_content(query.group_by_column, issue)
+ end
+ group_name ||= ""
+ group_count = issue_count_by_group[group]
+ end
+ yield issue, level, group_name, group_count
+ previous_group, first = group, false
+ end
+ end
+
# Renders a HTML/CSS tooltip
#
# To use, a trigger div is needed. This is a div with the class of "tooltip"
<% end %>
</tr>
</thead>
- <% previous_group, first = false, true %>
<tbody>
- <% issue_list(issues) do |issue, level| -%>
- <% if @query.grouped? && ((group = @query.group_by_column.value(issue)) != previous_group || first) %>
+ <% grouped_issue_list(issues, @query, @issue_count_by_group) do |issue, level, group_name, group_count| -%>
+ <% if group_name %>
<% reset_cycle %>
<tr class="group open">
<td colspan="<%= query.inline_columns.size + 2 %>">
<span class="expander" onclick="toggleRowGroup(this);"> </span>
- <%= (group.blank? && group != false) ? l(:label_none) : column_content(@query.group_by_column, issue) %> <span class="count"><%= @issue_count_by_group[group] %></span>
+ <%= group_name %> <span class="count"><%= group_count %></span>
<%= link_to_function("#{l(:button_collapse_all)}/#{l(:button_expand_all)}",
"toggleAllRowGroups(this)", :class => 'toggle-all') %>
</td>
</tr>
- <% previous_group, first = group, false %>
<% 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"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td>