estimated-hours-on-overview-page.diff

Go MAEDA, 2019-01-18 14:02

Download (1.49 KB)

View differences:

app/controllers/projects_controller.rb (working copy)
158 158

  
159 159
    if User.current.allowed_to_view_all_time_entries?(@project)
160 160
      @total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f
161
      @total_estimated_hours = Issue.visible.where(cond).sum(:estimated_hours).to_f
161 162
    end
162 163

  
163 164
    @key = User.current.rss_key
app/views/projects/show.html.erb (working copy)
83 83

  
84 84
  <% if User.current.allowed_to?(:view_time_entries, @project) %>
85 85
  <div class="spent_time box">
86
    <h3 class="icon icon-time"><%= l(:label_spent_time) %></h3>
87
    <% if @total_hours.present? %>
88
      <p><%= l_hours(@total_hours) %></p>
89
    <% end %>
86
    <h3 class="icon icon-time"><%= l(:label_time_tracking) %></h3>
87
    <ul>
88
      <% if @total_hours.present? %>
89
        <li><%= l(:label_spent_time) %>: <%= l_hours(@total_hours) %>
90
      <% end %>
91
      <% if @total_estimated_hours.present? %>
92
        <li><%= l(:field_estimated_hours) %>: <%= l_hours(@total_estimated_hours) %>
93
      <% end %>
94
    </ul>
90 95
    <p>
91 96
    <% if User.current.allowed_to?(:log_time, @project) %>
92 97
      <%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> |