Index: app/helpers/queries_helper.rb
===================================================================
--- app/helpers/queries_helper.rb (revision 19691)
+++ app/helpers/queries_helper.rb (revision 19692)
@@ -42,8 +42,11 @@
when 'Date'
format_date(value)
when 'Fixnum', 'Float'
- if column.name == :done_ratio
- progress_bar(value, :width => '80px')
+ case column.name
+ when :done_ratio
+ progress_bar(value, :width => '80px')
+ when :estimated_hours
+ l_hours(value)
else
value.to_s
end
Index: app/views/my/blocks/_timelog.rhtml
===================================================================
--- app/views/my/blocks/_timelog.rhtml (revision 19691)
+++ app/views/my/blocks/_timelog.rhtml (revision 19692)
@@ -8,7 +8,7 @@
%>
-
<%= l(:label_total) %>: <%= html_hours("%.2f" % entries.sum(&:hours).to_f) %>
+
<%= l(:label_total) %>: <%= l_hours(entries.sum(&:hours)) %>
<% if entries.any? %>
@@ -25,7 +25,7 @@
<%= day == Date.today ? l(:label_today).titleize : format_date(day) %> |
|
- <%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %> |
+ <%= l_hours(entries_by_day[day].sum(&:hours)) %> |
|
<% entries_by_day[day].each do |entry| -%>
@@ -33,7 +33,7 @@
<%=h entry.activity %> |
<%=h entry.project %> <%= ' - ' + link_to_issue(entry.issue, :truncate => 50) if entry.issue %> |
- <%= html_hours("%.2f" % entry.hours) %> |
+ <%= l_hours(entry.hours) %> |
<% if entry.editable_by?(@user) -%>
<%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry},
Index: app/views/timelog/_list.rhtml
===================================================================
--- app/views/timelog/_list.rhtml (revision 19691)
+++ app/views/timelog/_list.rhtml (revision 19692)
@@ -24,7 +24,7 @@
<% end -%>
|
-<%= html_hours("%.2f" % entry.hours) %> |
+<%= l_hours(entry.hours) %> |
<% if entry.editable_by?(User.current) -%>
<%= link_to image_tag('edit.png'), {:controller => 'timelog', :action => 'edit', :id => entry, :project_id => nil},
Index: lib/redmine/i18n.rb
===================================================================
--- lib/redmine/i18n.rb (revision 19691)
+++ lib/redmine/i18n.rb (revision 19692)
@@ -1,5 +1,5 @@
module Redmine
- module I18n
+ module I18n
def self.included(base)
base.extend Redmine::I18n
end
@@ -28,7 +28,9 @@
def l_hours(hours)
hours = hours.to_f
- l((hours < 2.0 ? :label_f_hour : :label_f_hour_plural), :value => ("%.2f" % hours.to_f))
+ hours_part = hours.truncate
+ minutes_part = ((hours - hours_part) * 60).round
+ "#{hours_part}h #{minutes_part}m"
end
def ll(lang, str, value=nil)
|