Issue list improvements for subtasking (#5196):

* makes the parent task column available
* display the issue hierarchy when list is sorted by parent

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3618 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang committed 2010-03-27 16:55:20 +00:00
1 parent 06d2c3fd4e
commit 4524bc04e9
6 files changed
+42 -10

No files matched your search

+14 -6
View File
@@ -18,6 +18,17 @@
module IssuesHelper
include ApplicationHelper
def issue_list(issues, &block)
ancestors = []
issues.each do |issue|
while (ancestors.any? && !issue.is_descendant_of?(ancestors.last))
ancestors.pop
end
yield issue, ancestors.size
ancestors << issue
end
end
def render_issue_tooltip(issue)
@cached_label_start_date ||= l(:field_start_date)
@cached_label_due_date ||= l(:field_due_date)
@@ -43,17 +54,14 @@ module IssuesHelper
def render_descendants_tree(issue)
s = '<form><table class="list issues">'
ancestors = []
issue.descendants.sort_by(&:lft).each do |child|
level = child.level - issue.level - 1
issue_list(issue.descendants.sort_by(&:lft)) do |child, level|
s << content_tag('tr',
content_tag('td', check_box_tag("ids[]", child.id, false, :id => nil), :class => 'checkbox') +
content_tag('td', link_to_issue(child, :truncate => 60), :class => 'subject',
:style => "padding-left: #{level * 20}px") +
content_tag('td', link_to_issue(child, :truncate => 60), :class => 'subject') +
content_tag('td', h(child.status)) +
content_tag('td', link_to_user(child.assigned_to)) +
content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
:class => "issue-#{child.id} hascontextmenu")
:class => "issue issue-#{child.id} hascontextmenu #{level > 0 ? "idnt idnt-#{level}" : nil}")
end
s << '</form></table>'
s