0001-Issues-Show-improvements.patch

Patch against trunk @ r21131 - Mischa The Evil, 2021-08-03 04:31

Download (6.48 KB)

View differences:

app/helpers/issues_helper.rb
126 126
                           :project => (issue.project_id != child.project_id)),
127 127
                         :class => 'subject') +
128 128
             content_tag('td', h(child.status), :class => 'status') +
129
             content_tag('td', link_to_user(child.assigned_to), :class => 'assigned_to') +
130
             content_tag('td', format_date(child.start_date), :class => 'start_date') +
131
             content_tag('td', format_date(child.due_date), :class => 'due_date') +
129
             content_tag('td', (child.assigned_to ? link_to_user(child.assigned_to) : "-"), :class => 'assigned_to') +
130
             content_tag('td', (child.start_date ? format_date(child.start_date) : "-"), :class => 'start_date') +
131
             content_tag('td', (child.due_date ? format_date(child.due_date) : "-"), :class => 'due_date') +
132 132
             content_tag('td',
133 133
                         (if child.disabled_core_fields.include?('done_ratio')
134 134
                            ''
......
228 228
                         end.html_safe,
229 229
                         :class => 'subject') +
230 230
             content_tag('td', other_issue.status, :class => 'status') +
231
             content_tag('td', link_to_user(other_issue.assigned_to), :class => 'assigned_to') +
232
             content_tag('td', format_date(other_issue.start_date), :class => 'start_date') +
233
             content_tag('td', format_date(other_issue.due_date), :class => 'due_date') +
231
             content_tag('td', (other_issue.assigned_to ? link_to_user(other_issue.assigned_to) : "-"), :class => 'assigned_to') +
232
             content_tag('td', (other_issue.start_date ? format_date(other_issue.start_date) : "-"), :class => 'start_date') +
233
             content_tag('td', (other_issue.start_date ? format_date(other_issue.due_date) : "-"), :class => 'due_date') +
234 234
             content_tag('td',
235 235
                         (if other_issue.disabled_core_fields.include?('done_ratio')
236 236
                            ''
......
246 246
  end
247 247

  
248 248
  def issue_estimated_hours_details(issue)
249
    if issue.total_estimated_hours.present?
249
    if issue.total_estimated_hours.present? && issue.total_estimated_hours > 0
250 250
      if issue.total_estimated_hours == issue.estimated_hours
251 251
        l_hours_short(issue.estimated_hours)
252 252
      else
......
366 366
    issue_fields_rows do |rows|
367 367
      values.each_with_index do |value, i|
368 368
        m = (i < half ? :left : :right)
369
        rows.send m, custom_field_name_tag(value.custom_field), custom_field_value_tag(value), :class => value.custom_field.css_classes
369
        rows.send m, custom_field_name_tag(value.custom_field), (custom_field_value_tag(value).present? ? custom_field_value_tag(value) : "-"), :class => value.custom_field.css_classes
370 370
      end
371 371
    end
372 372
  end
......
377 377

  
378 378
    s = ''.html_safe
379 379
    values.each_with_index do |value, i|
380
      attr_value_tag = custom_field_value_tag(value)
380
      attr_value_tag = (custom_field_value_tag(value).present? ? custom_field_value_tag(value) : "-")
381 381
      next if attr_value_tag.blank?
382 382

  
383 383
      content =
app/views/issues/show.html.erb
60 60
  end
61 61

  
62 62
  unless @issue.disabled_core_fields.include?('start_date')
63
    rows.right l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
63
    rows.right l(:field_start_date), (@issue.start_date ? format_date(@issue.start_date) : "-"), :class => 'start-date'
64 64
  end
65 65
  unless @issue.disabled_core_fields.include?('due_date')
66
    rows.right l(:field_due_date), issue_due_date_details(@issue), :class => 'due-date'
66
    rows.right l(:field_due_date), (issue_due_date_details(@issue) ? issue_due_date_details(@issue) : "-"), :class => 'due-date'
67 67
  end
68 68
  unless @issue.disabled_core_fields.include?('done_ratio')
69 69
    rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :legend => "#{@issue.done_ratio}%"), :class => 'progress'
70 70
  end
71 71
  unless @issue.disabled_core_fields.include?('estimated_hours')
72
    rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), :class => 'estimated-hours'
72
    rows.right l(:field_estimated_hours), (issue_estimated_hours_details(@issue).present? ? issue_estimated_hours_details(@issue) : "-"), :class => 'estimated-hours'
73 73
  end
74
  if User.current.allowed_to?(:view_time_entries, @project) && @issue.total_spent_hours > 0
75
    rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time'
74
  if User.current.allowed_to?(:view_time_entries, @project)
75
    rows.right l(:label_spent_time), (issue_spent_hours_details(@issue).present? ? issue_spent_hours_details(@issue) : "-"), :class => 'spent-time'
76 76
  end
77 77
end %>
78 78
<%= render_half_width_custom_fields_rows(@issue) %>
79 79
<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
80 80
</div>
81 81

  
82
<% if @issue.description? %>
82
<% if @issue.description? && !@issue.disabled_core_fields.include?('description') %>
83 83
<hr />
84 84
<div class="description">
85 85
  <div class="contextual">
......
91 91
  <%= textilizable @issue, :description, :attachments => @issue.attachments %>
92 92
  </div>
93 93
</div>
94
<% elsif !@issue.description? && !@issue.disabled_core_fields.include?('description') %>
95
  <hr />
96
  <div class="description">
97
    <p><strong><%=l(:field_description)%></strong></p>
98
    <div class="wiki">-</div>
99
  </div>
100
<% else %>
94 101
<% end %>
102

  
103
<%= render_full_width_custom_fields_rows(@issue) %>
104

  
95 105
<% if @issue.attachments.any? %>
96 106
  <hr />
97 107
  <p><strong><%=l(:label_attachment_plural)%></strong></p>
98 108
  <%= link_to_attachments @issue, :thumbnails => true %>
99 109
<% end %>
100 110

  
101
<%= render_full_width_custom_fields_rows(@issue) %>
102

  
103 111
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
104 112

  
105 113
<% if !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
106
-