mirror of
https://github.com/TracksApp/tracks.git
synced 2025-12-26 12:08:47 +01:00
Use the newly extracted method object for getting todo staleness
This commit is contained in:
parent
8ffe3cacca
commit
8dfbac0fe8
1 changed files with 1 additions and 11 deletions
|
|
@ -173,17 +173,7 @@ module TodosHelper
|
|||
# * l3: created more than 3 x staleness_starts
|
||||
#
|
||||
def staleness_class(item)
|
||||
if item.due || item.completed?
|
||||
return ""
|
||||
elsif item.created_at < current_user.time - (prefs.staleness_starts * 3).days
|
||||
return " stale_l3"
|
||||
elsif item.created_at < current_user.time - (prefs.staleness_starts * 2).days
|
||||
return " stale_l2"
|
||||
elsif item.created_at < current_user.time - (prefs.staleness_starts).days
|
||||
return " stale_l1"
|
||||
else
|
||||
return ""
|
||||
end
|
||||
Staleness.days_stale(item, current_user)
|
||||
end
|
||||
|
||||
def show_date_tag(date, the_class, text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue