mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-03 15:58:50 +01:00
parent
52ed21d0c3
commit
6bccd2a6ce
1 changed files with 11 additions and 2 deletions
|
|
@ -284,7 +284,16 @@ module TodosHelper
|
|||
url = {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => days,
|
||||
:_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}
|
||||
url[:_tag_name] = @tag_name if @source_view == 'tag'
|
||||
link_to_remote image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"), :url => url
|
||||
|
||||
futuredate = (@todo.show_from || @todo.user.date) + days.days
|
||||
if @todo.due && futuredate > @todo.due
|
||||
return link_to_function(
|
||||
image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"),
|
||||
"alert('Defer date is after due date. Please edit and adjust due date before deferring.')")
|
||||
else
|
||||
return link_to_remote(
|
||||
image_tag("defer_#{days}.png", :alt => "Defer #{pluralize(days, 'day')}"),
|
||||
:url => url)
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue