|
@ -217,7 +217,7 @@ class WorkshopsController < ApplicationController |
|
|
# create the request by making the user a facilitator but making their role 'requested' |
|
|
# create the request by making the user a facilitator but making their role 'requested' |
|
|
WorkshopFacilitator.create(user_id: current_user.id, workshop_id: workshop.id, role: :requested) |
|
|
WorkshopFacilitator.create(user_id: current_user.id, workshop_id: workshop.id, role: :requested) |
|
|
|
|
|
|
|
|
UserMailer.send_mail(:workshop_facilitator_request, workshop.id, current_user.id, params[:message]) |
|
|
send_mail(:workshop_facilitator_request, workshop.id, current_user.id, params[:message]) |
|
|
|
|
|
|
|
|
redirect_to sent_facilitate_workshop_url(@this_conference.slug, workshop.id) |
|
|
redirect_to sent_facilitate_workshop_url(@this_conference.slug, workshop.id) |
|
|
end |
|
|
end |
|
@ -251,7 +251,7 @@ class WorkshopsController < ApplicationController |
|
|
f.role = :collaborator |
|
|
f.role = :collaborator |
|
|
f.save |
|
|
f.save |
|
|
LinguaFranca.with_locale(user.locale) do |
|
|
LinguaFranca.with_locale(user.locale) do |
|
|
UserMailer.send_mail(:workshop_facilitator_request_approved, workshop.id, user.id) |
|
|
send_mail(:workshop_facilitator_request_approved, workshop.id, user.id) |
|
|
end |
|
|
end |
|
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
|
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
|
|
end |
|
|
end |
|
@ -261,7 +261,7 @@ class WorkshopsController < ApplicationController |
|
|
:workshop_id => workshop.id, |
|
|
:workshop_id => workshop.id, |
|
|
:user_id => user_id) |
|
|
:user_id => user_id) |
|
|
LinguaFranca.with_locale user.locale do |
|
|
LinguaFranca.with_locale user.locale do |
|
|
UserMailer.send_mail(:workshop_facilitator_request_denied, workshop.id, user.id) |
|
|
send_mail(:workshop_facilitator_request_denied, workshop.id, user.id) |
|
|
end |
|
|
end |
|
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
|
|
return redirect_to view_workshop_url(@this_conference.slug, workshop.id) |
|
|
end |
|
|
end |
|
@ -309,7 +309,7 @@ class WorkshopsController < ApplicationController |
|
|
WorkshopFacilitator.create(user_id: user.id, workshop_id: workshop.id, role: :collaborator) |
|
|
WorkshopFacilitator.create(user_id: user.id, workshop_id: workshop.id, role: :collaborator) |
|
|
|
|
|
|
|
|
LinguaFranca.with_locale user.locale do |
|
|
LinguaFranca.with_locale user.locale do |
|
|
UserMailer.send_mail(:workshop_facilitator_request_approved, workshop.id, user.id) |
|
|
send_mail(:workshop_facilitator_request_approved, workshop.id, user.id) |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
|
|
|
|
|
@ -329,7 +329,7 @@ class WorkshopsController < ApplicationController |
|
|
|
|
|
|
|
|
unless comment.user.id == current_user.id |
|
|
unless comment.user.id == current_user.id |
|
|
LinguaFranca.with_locale comment.user.locale do |
|
|
LinguaFranca.with_locale comment.user.locale do |
|
|
UserMailer.send_mail(:workshop_comment, workshop.id, new_comment.id, comment.user.id) |
|
|
send_mail(:workshop_comment, workshop.id, new_comment.id, comment.user.id) |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
elsif params[:button] = 'add_comment' |
|
|
elsif params[:button] = 'add_comment' |
|
@ -338,7 +338,7 @@ class WorkshopsController < ApplicationController |
|
|
workshop.active_facilitators.each do | u | |
|
|
workshop.active_facilitators.each do | u | |
|
|
unless u.id == current_user.id |
|
|
unless u.id == current_user.id |
|
|
LinguaFranca.with_locale u.locale do |
|
|
LinguaFranca.with_locale u.locale do |
|
|
UserMailer.send_mail(:workshop_comment, workshop.id, new_comment.id, u.id) |
|
|
send_mail(:workshop_comment, workshop.id, new_comment.id, u.id) |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|
end |
|
|