Merge pull request #132 from mbreit/feature/733-issue-due-today

[#733] Add Issue#due_today? and add due-today css class
This commit is contained in:
Eric Davis 2011-12-10 13:29:27 -08:00
commit b2998c3972
1 changed files with 6 additions and 0 deletions

View File

@ -401,6 +401,11 @@ class Issue < ActiveRecord::Base
!due_date.nil? && (due_date < Date.today) && !status.is_closed?
end
# Returns true if the issue is due today and not closed
def due_today?
!due_date.nil? && (due_date == Date.today) && !status.is_closed?
end
# Is the amount of work done less than it should for the due date
def behind_schedule?
return false if start_date.nil? || due_date.nil?
@ -556,6 +561,7 @@ class Issue < ActiveRecord::Base
s = "issue status-#{status.position} priority-#{priority.position}"
s << ' closed' if closed?
s << ' overdue' if overdue?
s << ' due-today' if due_today?
s << ' child' if child?
s << ' parent' unless leaf?
s << ' created-by-me' if User.current.logged? && author_id == User.current.id