Show time specification of projects/task the invoice_form

They are inserted in the titles of the time entry links so they are
shown when hovering over them.

Also fixed "None" not being displayed when there was no time entry
comment.
This commit is contained in:
Paul van Tilburg 2014-10-25 18:31:48 +02:00
parent 6cfdd4c7e1
commit 423916232f
1 changed files with 6 additions and 2 deletions

View File

@ -2131,11 +2131,15 @@ module StopTime::Views
task.time_entries.each do |entry|
tr do
td.indent do
time_spec = "from #{entry.start.to_formatted_s(:time_only)} " +
"until #{entry.end.to_formatted_s(:time_only)} " +
"on #{entry.date.to_date}"
if entry.comment.present?
a "#{entry.comment}", :href => R(TimelineN, entry.id),
:title => entry.comment
:title => "#{entry.comment} (#{time_spec})"
else
a :href => R(TimelineN, entry.id) { i "• None" }
a(:href => R(TimelineN, entry.id),
:title => time_spec) { i "• None" }
end
end
td.text_right { "%.2fh" % entry.hours_total }