|
|
|
@ -100,13 +100,12 @@ module WatchersHelper
|
|
|
|
|
return '' if user.id == course.tea_id
|
|
|
|
|
joined = user.member_of_course?(course)
|
|
|
|
|
text = joined ? l(:label_exit_course) : l(:label_new_join)
|
|
|
|
|
url_t = join_path(:object_id => course.id)
|
|
|
|
|
url_f = try_join_path(:object_id => course.id)
|
|
|
|
|
url = joined ? join_path(:object_id => course.id) : try_join_path(:object_id => course.id)
|
|
|
|
|
method = joined ? 'delete' : 'post'
|
|
|
|
|
if joined
|
|
|
|
|
link_to text, url_t, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
|
|
|
|
|
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :confirm => l(:text_are_you_sure_out), :class => []+options
|
|
|
|
|
else
|
|
|
|
|
link_to text, url_f, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
|
|
|
|
|
link_to text, url, :remote => true, :method => method, :id => "#{course.id}", :class => []+options
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|