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:
commit
b2998c3972
@ -401,6 +401,11 @@ class Issue < ActiveRecord::Base
|
|||||||
!due_date.nil? && (due_date < Date.today) && !status.is_closed?
|
!due_date.nil? && (due_date < Date.today) && !status.is_closed?
|
||||||
end
|
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
|
# Is the amount of work done less than it should for the due date
|
||||||
def behind_schedule?
|
def behind_schedule?
|
||||||
return false if start_date.nil? || due_date.nil?
|
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 = "issue status-#{status.position} priority-#{priority.position}"
|
||||||
s << ' closed' if closed?
|
s << ' closed' if closed?
|
||||||
s << ' overdue' if overdue?
|
s << ' overdue' if overdue?
|
||||||
|
s << ' due-today' if due_today?
|
||||||
s << ' child' if child?
|
s << ' child' if child?
|
||||||
s << ' parent' unless leaf?
|
s << ' parent' unless leaf?
|
||||||
s << ' created-by-me' if User.current.logged? && author_id == User.current.id
|
s << ' created-by-me' if User.current.logged? && author_id == User.current.id
|
||||||
|
Loading…
x
Reference in New Issue
Block a user