mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-21 08:26:10 +01:00
Move the view logic back into the helper
Staleness#days_stale only gives us the number of days that a Todo has been stale. Add the logic for choosing the CSS class to use back to the view helper.
This commit is contained in:
parent
c1c81d7653
commit
d699359648
1 changed files with 12 additions and 1 deletions
|
|
@ -173,7 +173,18 @@ module TodosHelper
|
|||
# * l3: created more than 3 x staleness_starts
|
||||
#
|
||||
def staleness_class(item)
|
||||
Staleness.days_stale(item, current_user)
|
||||
days_stale = Staleness.days_stale(item, current_user)
|
||||
start = current_user.prefs.staleness_starts
|
||||
case days_stale
|
||||
when 0...start
|
||||
""
|
||||
when start...start*2
|
||||
" stale_l1"
|
||||
when start*2...start*3
|
||||
" stale_l2"
|
||||
else
|
||||
" stale_l3"
|
||||
end
|
||||
end
|
||||
|
||||
def show_date_tag(date, the_class, text)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue