mirror of
https://github.com/TracksApp/tracks.git
synced 2026-02-28 18:10:15 +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,
|
url = {:controller => 'todos', :action => 'defer', :id => @todo.id, :days => days,
|
||||||
:_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}
|
:_source_view => (@source_view.underscore.gsub(/\s+/,'_') rescue "")}
|
||||||
url[:_tag_name] = @tag_name if @source_view == 'tag'
|
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
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue