]> source.dussan.org Git - redmine.git/commitdiff
use only one if with two conditions in issue show instead of two ifs (if in if) ...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 30 May 2017 12:04:53 +0000 (12:04 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Tue, 30 May 2017 12:04:53 +0000 (12:04 +0000)
Contributed by Marius BALTEANU.

git-svn-id: http://svn.redmine.org/redmine/trunk@16581 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/show.html.erb

index 08028d270ed6958c08461d26fc9dc00597695c59..26600559a7e364c8236f1caff2a583c44b400090 100644 (file)
   unless @issue.disabled_core_fields.include?('estimated_hours')
     rows.right l(:field_estimated_hours), issue_estimated_hours_details(@issue), :class => 'estimated-hours'
   end
-  if User.current.allowed_to?(:view_time_entries, @project)
-    if @issue.total_spent_hours > 0
-      rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time'
-    end
+  if User.current.allowed_to?(:view_time_entries, @project) && @issue.total_spent_hours > 0
+    rows.right l(:label_spent_time), issue_spent_hours_details(@issue), :class => 'spent-time'
   end
 end %>
 <%= render_half_width_custom_fields_rows(@issue) %>