mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-16 20:28:09 +01:00
Applied lolindrath's patch to a) mark overdue actions only with a red badge reading 'Overdue by X days' and b) label the due dates using relative descriptions ('Due today', 'Due tomorrow', 'Due in X days').
Fixes #102 git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@145 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
a8c7c73428
commit
157d882483
3 changed files with 17 additions and 4 deletions
|
|
@ -43,16 +43,21 @@ module ApplicationHelper
|
|||
|
||||
@now = Date.today
|
||||
@days = due-@now
|
||||
|
||||
case @days
|
||||
# overdue or due very soon! sound the alarm!
|
||||
when -365..1
|
||||
"<span class=\"red\">" + format_date(due) + "</span> "
|
||||
when -365..-1
|
||||
"<a title='" + format_date(due) + "'><span class=\"red\">Overdue by " + (@days * -1).to_s + " days</span></a> "
|
||||
when 0
|
||||
"<a title='" + format_date(due) + "'><span class=\"amber\">Due Today</span></a> "
|
||||
when 1
|
||||
"<a title='" + format_date(due) + "'><span class=\"amber\">Due Tommorrow</span></a> "
|
||||
# due 2-7 days away
|
||||
when 2..7
|
||||
"<span class=\"amber\">" + format_date(due) + "</span> "
|
||||
"<a title='" + format_date(due) + "'><span class=\"orange\">Due in " + @days.to_s + " days</span></a> "
|
||||
# more than a week away - relax
|
||||
else
|
||||
"<span class=\"green\">" + format_date(due) + "</span> "
|
||||
"<a title='" + format_date(due) + "'><span class=\"green\">Due in " + @days.to_s + " days</span></a> "
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ Wiki (deprecated - please use Trac): http://www.rousette.org.uk/projects/wiki/
|
|||
12. Changed the shebang lines to <tt>#!/usr/bin/env ruby</tt>. This should work for all *nix based setups (Linux or Mac OS X), but Windows users will probably have to change it. Try this command at the command line, run inside the Tracks directory:
|
||||
ruby -i.bak -pe 'gsub!("#!/usr/bin/env ruby", "#!c:/ruby/bin/ruby")' public/dispatch.* script/*
|
||||
13. The TXT view is now sorted by position, just as the home page is.
|
||||
14. <b>Contributed by lolindrath</b>: Items that are overdue are coloured red, and have the text 'Overdue by X days' in the badge. Other due dates are given as days from now (up to a week away in orange, more than a week away in green), and the tool tip shows the actual date.
|
||||
|
||||
== Version 1.03
|
||||
|
||||
|
|
|
|||
|
|
@ -291,6 +291,13 @@ a.footer_link:hover {color: #fff; background-color: #cc3334 !important;}
|
|||
padding: 1px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.orange {
|
||||
color: #fff;
|
||||
background: #FFA500;
|
||||
padding: 1px;
|
||||
font-size: 10px;
|
||||
}
|
||||
|
||||
.green {
|
||||
color: #fff;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue