Use the newly extracted method object for getting todo staleness

This commit is contained in:
Matt Rogers 2013-03-09 22:29:13 -06:00
parent 8ffe3cacca
commit 8dfbac0fe8

View file

@ -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)