Feature #30464 » estimated-hours-on-overview-page.diff
| app/controllers/projects_controller.rb (working copy) | ||
|---|---|---|
|
if User.current.allowed_to_view_all_time_entries?(@project)
|
||
|
@total_hours = TimeEntry.visible.where(cond).sum(:hours).to_f
|
||
|
@total_estimated_hours = Issue.visible.where(cond).sum(:estimated_hours).to_f
|
||
|
end
|
||
|
@key = User.current.rss_key
|
||
| app/views/projects/show.html.erb (working copy) | ||
|---|---|---|
|
<% if User.current.allowed_to?(:view_time_entries, @project) %>
|
||
|
<div class="spent_time box">
|
||
|
<h3 class="icon icon-time"><%= l(:label_spent_time) %></h3>
|
||
|
<% if @total_hours.present? %>
|
||
|
<p><%= l_hours(@total_hours) %></p>
|
||
|
<% end %>
|
||
|
<h3 class="icon icon-time"><%= l(:label_time_tracking) %></h3>
|
||
|
<ul>
|
||
|
<% if @total_hours.present? %>
|
||
|
<li><%= l(:label_spent_time) %>: <%= l_hours(@total_hours) %>
|
||
|
<% end %>
|
||
|
<% if @total_estimated_hours.present? %>
|
||
|
<li><%= l(:field_estimated_hours) %>: <%= l_hours(@total_estimated_hours) %>
|
||
|
<% end %>
|
||
|
</ul>
|
||
|
<p>
|
||
|
<% if User.current.allowed_to?(:log_time, @project) %>
|
||
|
<%= link_to l(:button_log_time), new_project_time_entry_path(@project) %> |
|
||