subtask-details.patch

Daniel Ritz, 2013-10-18 13:46

Download (2.7 KB)

View differences:

app/helpers/issues_helper.rb
78 78
  end
79 79

  
80 80
  def render_descendants_tree(issue)
81
    show_start = !issue.disabled_core_fields.include?('start_date') && !issue.start_date.nil?
82
    show_due = !issue.disabled_core_fields.include?('due_date') && !issue.due_date.nil?
83
    show_estimated = !issue.disabled_core_fields.include?('estimated_hours') && !issue.estimated_hours.nil?
84
    show_spent = User.current.allowed_to?(:view_time_entries, @project)
81 85
    s = '<form><table class="list issues">'
82 86
    issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|
87
      start_date = ''
88
      if show_start
89
        if !child.disabled_core_fields.include?('start_date') && !child.start_date.nil?
90
          start_date = content_tag('td', format_date(child.start_date), :class => 'start-date')
91
        else
92
          start_date = content_tag('td', '', :class => 'start-date')
93
        end
94
      end
95
      due_date = ''
96
      if show_due
97
        if !child.disabled_core_fields.include?('due_date') && !child.due_date.nil?
98
          due_date = content_tag('td', format_date(child.due_date), :class => 'due-date')
99
        else
100
          due_date = content_tag('td', '', :class => 'due-date')
101
        end
102
      end
103
      estimated = ''
104
      if show_estimated
105
        if !child.disabled_core_fields.include?('estimated_hours') && !child.estimated_hours.nil?
106
          estimated = content_tag('td', "#{child.estimated_hours}h", :class => 'estimated-hours')
107
        else
108
          estimated = content_tag('td', '', :class => 'estimated-hours')
109
        end
110
      end
111
      spent = ''
112
      if show_spent
113
        if child.total_spent_hours > 0
114
          spent = content_tag('td', "#{child.total_spent_hours}h", :class => 'spent-time')
115
        else
116
          spent = content_tag('td', '', :class => 'spent-time')
117
        end
118
      end
83 119
      css = "issue issue-#{child.id} hascontextmenu"
84 120
      css << " idnt idnt-#{level}" if level > 0
85 121
      s << content_tag('tr',
......
87 123
             content_tag('td', link_to_issue(child, :truncate => 60, :project => (issue.project_id != child.project_id)), :class => 'subject') +
88 124
             content_tag('td', h(child.status)) +
89 125
             content_tag('td', link_to_user(child.assigned_to)) +
90
             content_tag('td', progress_bar(child.done_ratio, :width => '80px')),
126
             content_tag('td', progress_bar(child.done_ratio, :width => '80px')) +
127
             start_date + due_date + estimated + spent,
91 128
             :class => css)
92 129
    end
93 130
    s << '</table></form>'