summaryrefslogtreecommitdiffstats
path: root/app/views
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-18 12:42:20 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-11-18 12:42:20 +0000
commit5495e6f3424f44faa16b4d03dfe1e76a30e50469 (patch)
treef37543a819979725a0a916af660e49095ff303e3 /app/views
parent9c3e3a4276612f60552379518ab8c9a11319e73b (diff)
downloadredmine-5495e6f3424f44faa16b4d03dfe1e76a30e50469.tar.gz
redmine-5495e6f3424f44faa16b4d03dfe1e76a30e50469.zip
Introduce a setting to change the display format of timespans to h:mm (#23996).
Patch by Jens Kraemer. git-svn-id: http://svn.redmine.org/redmine/trunk@15965 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app/views')
-rw-r--r--app/views/issues/_attributes.html.erb2
-rw-r--r--app/views/issues/_edit.html.erb2
-rw-r--r--app/views/my/blocks/_timelog.html.erb4
-rw-r--r--app/views/settings/_display.html.erb2
-rw-r--r--app/views/timelog/_form.html.erb2
-rw-r--r--app/views/timelog/_report_criteria.html.erb4
-rw-r--r--app/views/timelog/report.html.erb4
7 files changed, 11 insertions, 9 deletions
diff --git a/app/views/issues/_attributes.html.erb b/app/views/issues/_attributes.html.erb
index 960256e44..f8acef58b 100644
--- a/app/views/issues/_attributes.html.erb
+++ b/app/views/issues/_attributes.html.erb
@@ -65,7 +65,7 @@
<% end %>
<% if @issue.safe_attribute? 'estimated_hours' %>
-<p><%= f.text_field :estimated_hours, :size => 3, :required => @issue.required_attribute?('estimated_hours') %> <%= l(:field_hours) %></p>
+<p><%= f.text_field :estimated_hours, :size => 3, :required => @issue.required_attribute?('estimated_hours'), :value => format_hours(@issue.estimated_hours) %> <%= l(:field_hours) %></p>
<% end %>
<% if @issue.safe_attribute?('done_ratio') && Issue.use_field_for_done_ratio? %>
diff --git a/app/views/issues/_edit.html.erb b/app/views/issues/_edit.html.erb
index 3291ba737..0a642f22c 100644
--- a/app/views/issues/_edit.html.erb
+++ b/app/views/issues/_edit.html.erb
@@ -14,7 +14,7 @@
<%= labelled_fields_for :time_entry, @time_entry do |time_entry| %>
<div class="splitcontent">
<div class="splitcontentleft">
- <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time %> <%= l(:field_hours) %></p>
+ <p><%= time_entry.text_field :hours, :size => 6, :label => :label_spent_time, :value => format_hours(@time_entry.hours) %> <%= l(:field_hours) %></p>
</div>
<div class="splitcontentright">
<p><%= time_entry.select :activity_id, activity_collection_for_select_options %></p>
diff --git a/app/views/my/blocks/_timelog.html.erb b/app/views/my/blocks/_timelog.html.erb
index 566831132..5b8820c19 100644
--- a/app/views/my/blocks/_timelog.html.erb
+++ b/app/views/my/blocks/_timelog.html.erb
@@ -46,7 +46,7 @@ entries_by_day = entries.group_by(&:spent_on)
<tr class="odd">
<td><strong><%= day == User.current.today ? l(:label_today).titleize : format_date(day) %></strong></td>
<td colspan="2"></td>
- <td class="hours"><em><%= html_hours("%.2f" % entries_by_day[day].sum(&:hours).to_f) %></em></td>
+ <td class="hours"><em><%= html_hours(l_hours_short(entries_by_day[day].sum(&:hours))) %></em></td>
</tr>
<% entries_by_day[day].each do |entry| -%>
<tr class="time-entry hascontextmenu">
@@ -56,7 +56,7 @@ entries_by_day = entries.group_by(&:spent_on)
</td>
<td class="subject"><%= entry.project %> <%= h(' - ') + link_to_issue(entry.issue, :truncate => 50) if entry.issue %></td>
<td class="comments"><%= entry.comments %></td>
- <td class="hours"><%= html_hours("%.2f" % entry.hours) %></td>
+ <td class="hours"><%= html_hours(l_hours_short(entry.hours)) %></td>
</tr>
<% end -%>
<% end -%>
diff --git a/app/views/settings/_display.html.erb b/app/views/settings/_display.html.erb
index be3e70e34..93eaa6ef4 100644
--- a/app/views/settings/_display.html.erb
+++ b/app/views/settings/_display.html.erb
@@ -15,6 +15,8 @@
<p><%= setting_select :time_format, Setting::TIME_FORMATS.collect {|f| [::I18n.l(Time.now, :locale => locale, :format => f), f]}, :blank => :label_language_based %></p>
+<p><%= setting_select :timespan_format, [["%.2f" % 0.75, 'decimal'], ['0:45 h', 'minutes']], :blank => false %></p>
+
<p><%= setting_select :user_format, @options[:user_format] %></p>
<p><%= setting_check_box :gravatar_enabled %></p>
diff --git a/app/views/timelog/_form.html.erb b/app/views/timelog/_form.html.erb
index 5b0ec6aac..59198d0fb 100644
--- a/app/views/timelog/_form.html.erb
+++ b/app/views/timelog/_form.html.erb
@@ -18,7 +18,7 @@
</span>
</p>
<p><%= f.date_field :spent_on, :size => 10, :required => true %><%= calendar_for('time_entry_spent_on') %></p>
- <p><%= f.text_field :hours, :size => 6, :required => true %></p>
+ <p><%= f.text_field :hours, :size => 6, :required => true, :value => format_hours(@time_entry.hours) %></p>
<p><%= f.text_field :comments, :size => 100, :maxlength => 1024 %></p>
<p><%= f.select :activity_id, activity_collection_for_select_options(@time_entry), :required => true %></p>
<% @time_entry.custom_field_values.each do |value| %>
diff --git a/app/views/timelog/_report_criteria.html.erb b/app/views/timelog/_report_criteria.html.erb
index c86b219d1..a74cdbfec 100644
--- a/app/views/timelog/_report_criteria.html.erb
+++ b/app/views/timelog/_report_criteria.html.erb
@@ -8,9 +8,9 @@
<% total = 0 -%>
<% @report.periods.each do |period| -%>
<% sum = sum_hours(select_hours(hours_for_value, @report.columns, period.to_s)); total += sum -%>
- <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
+ <td class="hours"><%= html_hours(l_hours_short(sum)) if sum > 0 %></td>
<% end -%>
- <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
+ <td class="hours"><%= html_hours(l_hours_short(total)) if total > 0 %></td>
</tr>
<% if criterias.length > level+1 -%>
<%= render(:partial => 'report_criteria', :locals => {:criterias => criterias, :hours => hours_for_value, :level => (level + 1)}) %>
diff --git a/app/views/timelog/report.html.erb b/app/views/timelog/report.html.erb
index 05ad08b93..ecab7dea4 100644
--- a/app/views/timelog/report.html.erb
+++ b/app/views/timelog/report.html.erb
@@ -52,9 +52,9 @@
<% total = 0 -%>
<% @report.periods.each do |period| -%>
<% sum = sum_hours(select_hours(@report.hours, @report.columns, period.to_s)); total += sum -%>
- <td class="hours"><%= html_hours("%.2f" % sum) if sum > 0 %></td>
+ <td class="hours"><%= html_hours(l_hours_short(sum)) if sum > 0 %></td>
<% end -%>
- <td class="hours"><%= html_hours("%.2f" % total) if total > 0 %></td>
+ <td class="hours"><%= html_hours(l_hours_short(total)) if total > 0 %></td>
</tr>
</tbody>
</table>