mirror of
https://github.com/TracksApp/tracks.git
synced 2026-03-16 01:06:32 +01:00
first version of review view
This commit is contained in:
parent
5f0bcebca9
commit
ac98737176
8 changed files with 82 additions and 5 deletions
|
|
@ -108,7 +108,28 @@ class Project < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def needs_review?(current_user)
|
||||
return (last_reviewed < current_user.time ) # - current_user.prefs.review_period.days)
|
||||
return false unless !nil?
|
||||
return true if last_reviewed.nil?
|
||||
return (active? && (last_reviewed < current_user.time - current_user.prefs.review_period.days))
|
||||
end
|
||||
|
||||
def blocked?
|
||||
## mutually exclusive for stalled and blocked
|
||||
return false if stalled?
|
||||
is_blocked = true
|
||||
todos.each do |t|
|
||||
is_blocked = false if (!t.completed? && !t.deferred? && !t.pending?)
|
||||
end
|
||||
return is_blocked
|
||||
end
|
||||
|
||||
def stalled?
|
||||
return true if todos.count == 0
|
||||
is_stalled = true
|
||||
todos.each do |t|
|
||||
is_stalled = false if (!t.completed?)
|
||||
end
|
||||
return is_stalled
|
||||
end
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue