Fixed email issues
This commit is contained in:
parent
a16a8ed082
commit
8e90f4545b
@ -3,7 +3,7 @@ class ApplicationController < BaseController
|
|||||||
|
|
||||||
before_filter :capture_page_info
|
before_filter :capture_page_info
|
||||||
|
|
||||||
helper_method :protect
|
helper_method :protect, :policies
|
||||||
|
|
||||||
# @@test_host
|
# @@test_host
|
||||||
# @@test_location
|
# @@test_location
|
||||||
@ -14,22 +14,22 @@ class ApplicationController < BaseController
|
|||||||
|
|
||||||
def capture_page_info
|
def capture_page_info
|
||||||
# capture request info in case an error occurs
|
# capture request info in case an error occurs
|
||||||
if request.method == "GET" && (params[:controller] != 'application' || params[:action] != 'contact')
|
# if request.method == "GET" && (params[:controller] != 'application' || params[:action] != 'contact')
|
||||||
session[:last_request]
|
# session[:last_request]
|
||||||
request_info = {
|
# request_info = {
|
||||||
'params' => params,
|
# 'params' => params,
|
||||||
'request' => {
|
# 'request' => {
|
||||||
'remote_ip' => request.remote_ip,
|
# 'remote_ip' => request.remote_ip,
|
||||||
'uuid' => request.uuid,
|
# 'uuid' => request.uuid,
|
||||||
'original_url' => request.original_url,
|
# 'original_url' => request.original_url,
|
||||||
'env' => Hash.new
|
# 'env' => Hash.new
|
||||||
}
|
# }
|
||||||
}
|
# }
|
||||||
request.env.each do |key, value|
|
# request.env.each do |key, value|
|
||||||
request_info['request']['env'][key.to_s] = value.to_s
|
# request_info['request']['env'][key.to_s] = value.to_s
|
||||||
end
|
# end
|
||||||
session['request_info'] = request_info
|
# # session['request_info'] = request_info
|
||||||
end
|
# end
|
||||||
|
|
||||||
# get the current conferences and set them globally
|
# get the current conferences and set them globally
|
||||||
status_hierarchy = {
|
status_hierarchy = {
|
||||||
@ -57,7 +57,7 @@ class ApplicationController < BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
@alt_lang_urls = {}
|
@alt_lang_urls = {}
|
||||||
I18n.backend.enabled_locales.each do |locale|
|
I18n.backend.enabled_locales.sort.each do |locale|
|
||||||
locale = locale.to_s
|
locale = locale.to_s
|
||||||
@alt_lang_urls[locale] = view_context.url_for_locale(locale) # don't show the current locale
|
@alt_lang_urls[locale] = view_context.url_for_locale(locale) # don't show the current locale
|
||||||
end
|
end
|
||||||
@ -82,18 +82,6 @@ class ApplicationController < BaseController
|
|||||||
@is_policy_page = true
|
@is_policy_page = true
|
||||||
end
|
end
|
||||||
|
|
||||||
# def self.set_host(host)
|
|
||||||
# @@test_host = host
|
|
||||||
# end
|
|
||||||
|
|
||||||
# def self.set_location(location)
|
|
||||||
# @@test_location = location
|
|
||||||
# end
|
|
||||||
|
|
||||||
# def self.get_location()
|
|
||||||
# @@test_location
|
|
||||||
# end
|
|
||||||
|
|
||||||
def js_error
|
def js_error
|
||||||
# send and email if this is production
|
# send and email if this is production
|
||||||
report = "A JavaScript error has occurred on <code>#{params[:location]}</code>"
|
report = "A JavaScript error has occurred on <code>#{params[:location]}</code>"
|
||||||
@ -108,14 +96,14 @@ class ApplicationController < BaseController
|
|||||||
logger.info "A JavaScript error has occurred on #{params[:location]}:#{params[:lineNumber]}: #{params[:message]}"
|
logger.info "A JavaScript error has occurred on #{params[:location]}:#{params[:lineNumber]}: #{params[:message]}"
|
||||||
|
|
||||||
if Rails.env.preview? || Rails.env.production?
|
if Rails.env.preview? || Rails.env.production?
|
||||||
requestHash = {
|
request_info = {
|
||||||
'remote_ip' => arg.remote_ip,
|
'remote_ip' => request.remote_ip,
|
||||||
'uuid' => arg.uuid,
|
'uuid' => request.uuid,
|
||||||
'original_url' => arg.original_url,
|
'original_url' => request.original_url,
|
||||||
'env' => Hash.new
|
'env' => Hash.new
|
||||||
}
|
}
|
||||||
request.env.each do | key, value |
|
request.env.each do |key, value|
|
||||||
requestHash['env'][key.to_s] = value.to_s
|
request_info['env'][key.to_s] = value.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
send_mail(:error_report,
|
send_mail(:error_report,
|
||||||
@ -123,7 +111,7 @@ class ApplicationController < BaseController
|
|||||||
report,
|
report,
|
||||||
params[:message],
|
params[:message],
|
||||||
nil,
|
nil,
|
||||||
requestHash,
|
request_info,
|
||||||
params,
|
params,
|
||||||
current_user,
|
current_user,
|
||||||
Time.now.strftime("%d/%m/%Y %H:%M")
|
Time.now.strftime("%d/%m/%Y %H:%M")
|
||||||
@ -164,6 +152,15 @@ class ApplicationController < BaseController
|
|||||||
@page_title = 'page_titles.404.Locale_Not_Available'
|
@page_title = 'page_titles.404.Locale_Not_Available'
|
||||||
@main_title_vars = { vars: { language: view_context.language_name(locale) } }
|
@main_title_vars = { vars: { language: view_context.language_name(locale) } }
|
||||||
@main_title = 'error.locale_not_available.title'
|
@main_title = 'error.locale_not_available.title'
|
||||||
|
|
||||||
|
unless @alt_lang_urls.present?
|
||||||
|
@alt_lang_urls = {}
|
||||||
|
I18n.backend.enabled_locales.sort.each do |locale|
|
||||||
|
locale = locale.to_s
|
||||||
|
@alt_lang_urls[locale] = view_context.url_for_locale(locale) # don't show the current locale
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
render 'application/locale_not_available', status: 404
|
render 'application/locale_not_available', status: 404
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -184,21 +181,21 @@ class ApplicationController < BaseController
|
|||||||
# send and email if this is production
|
# send and email if this is production
|
||||||
if Rails.env.preview? || Rails.env.production?
|
if Rails.env.preview? || Rails.env.production?
|
||||||
suppress(Exception) do
|
suppress(Exception) do
|
||||||
requestHash = {
|
request_info = {
|
||||||
'remote_ip' => arg.remote_ip,
|
'remote_ip' => request.remote_ip,
|
||||||
'uuid' => arg.uuid,
|
'uuid' => request.uuid,
|
||||||
'original_url' => arg.original_url,
|
'original_url' => request.original_url,
|
||||||
'env' => Hash.new
|
'env' => Hash.new
|
||||||
}
|
}
|
||||||
request.env.each do | key, value |
|
request.env.each do |key, value|
|
||||||
requestHash['env'][key.to_s] = value.to_s
|
request_info['env'][key.to_s] = value.to_s
|
||||||
end
|
end
|
||||||
send_mail(:error_report,
|
send_mail(:error_report,
|
||||||
"An error has occurred in #{Rails.env}",
|
"An error has occurred in #{Rails.env}",
|
||||||
nil,
|
nil,
|
||||||
exception.to_s,
|
exception.to_s,
|
||||||
exception.backtrace.join("\n"),
|
exception.backtrace.join("\n"),
|
||||||
requestHash,
|
request_info,
|
||||||
params,
|
params,
|
||||||
current_user,
|
current_user,
|
||||||
Time.now.strftime("%d/%m/%Y %H:%M")
|
Time.now.strftime("%d/%m/%Y %H:%M")
|
||||||
@ -234,6 +231,16 @@ class ApplicationController < BaseController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
request_info = {
|
||||||
|
'remote_ip' => request.remote_ip,
|
||||||
|
'uuid' => request.uuid,
|
||||||
|
'original_url' => request.original_url,
|
||||||
|
'env' => Hash.new
|
||||||
|
}
|
||||||
|
request.env.each do |key, value|
|
||||||
|
request_info['env'][key.to_s] = value.to_s
|
||||||
|
end
|
||||||
|
|
||||||
send_mail(:contact,
|
send_mail(:contact,
|
||||||
current_user || params[:email],
|
current_user || params[:email],
|
||||||
params[:subject],
|
params[:subject],
|
||||||
@ -241,13 +248,12 @@ class ApplicationController < BaseController
|
|||||||
email_list
|
email_list
|
||||||
)
|
)
|
||||||
|
|
||||||
request_info = session['request_info'] || { 'request' => request, 'params' => params }
|
|
||||||
send_mail(:contact_details,
|
send_mail(:contact_details,
|
||||||
current_user || params[:email],
|
current_user || params[:email],
|
||||||
params[:subject],
|
params[:subject],
|
||||||
params[:message],
|
params[:message],
|
||||||
request_info['request'],
|
request_info,
|
||||||
request_info['params']
|
params
|
||||||
)
|
)
|
||||||
|
|
||||||
redirect_to contact_sent_path
|
redirect_to contact_sent_path
|
||||||
@ -351,21 +357,21 @@ class ApplicationController < BaseController
|
|||||||
# send an email if this is production
|
# send an email if this is production
|
||||||
if Rails.env.preview? || Rails.env.production?
|
if Rails.env.preview? || Rails.env.production?
|
||||||
begin
|
begin
|
||||||
requestHash = {
|
request_info = {
|
||||||
'remote_ip' => arg.remote_ip,
|
'remote_ip' => request.remote_ip,
|
||||||
'uuid' => arg.uuid,
|
'uuid' => request.uuid,
|
||||||
'original_url' => arg.original_url,
|
'original_url' => request.original_url,
|
||||||
'env' => Hash.new
|
'env' => Hash.new
|
||||||
}
|
}
|
||||||
request.env.each do | key, value |
|
request.env.each do |key, value|
|
||||||
requestHash['env'][key.to_s] = value.to_s
|
request_info['env'][key.to_s] = value.to_s
|
||||||
end
|
end
|
||||||
send_mail(:error_report,
|
send_mail(:error_report,
|
||||||
"A missing translation found in #{Rails.env}",
|
"A missing translation found in #{Rails.env}",
|
||||||
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str || 'nil'}</blockquote>",
|
"<p>A translation for <code>#{key}</code> in <code>#{locale.to_s}</code> was found. The text that was rendered to the user was:</p><blockquote>#{str || 'nil'}</blockquote>",
|
||||||
exception.to_s,
|
exception.to_s,
|
||||||
nil,
|
nil,
|
||||||
requestHash,
|
request_info,
|
||||||
params,
|
params,
|
||||||
current_user.id,
|
current_user.id,
|
||||||
Time.now.strftime("%d/%m/%Y %H:%M")
|
Time.now.strftime("%d/%m/%Y %H:%M")
|
||||||
@ -646,4 +652,19 @@ class ApplicationController < BaseController
|
|||||||
UserMailer.send(*args).deliver_now
|
UserMailer.send(*args).deliver_now
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def policies
|
||||||
|
[
|
||||||
|
:commitment,
|
||||||
|
:respect,
|
||||||
|
:empowerment,
|
||||||
|
:accessible,
|
||||||
|
:peaceful,
|
||||||
|
:spaces,
|
||||||
|
:hearing,
|
||||||
|
:intent,
|
||||||
|
:open_minds,
|
||||||
|
:learning
|
||||||
|
]
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
@ -70,6 +70,17 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def previous_stats
|
||||||
|
set_conference
|
||||||
|
conference = Conference.find_by_slug(params[:conference_slug])
|
||||||
|
return do_403 unless conference.is_public
|
||||||
|
get_stats(false, nil, conference)
|
||||||
|
logger.info "Generating #{conference.slug}.xls"
|
||||||
|
return respond_to do |format|
|
||||||
|
format.xlsx { render xlsx: '../conferences/stats', filename: "stats-#{conference.slug}" }
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
rescue_from ActiveRecord::PremissionDenied do |exception|
|
rescue_from ActiveRecord::PremissionDenied do |exception|
|
||||||
do_403
|
do_403
|
||||||
end
|
end
|
||||||
@ -99,6 +110,9 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
def administrate_description
|
def administrate_description
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def administrate_group_ride
|
||||||
|
end
|
||||||
|
|
||||||
def administrate_poster
|
def administrate_poster
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -119,6 +133,30 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
def administrate_payment_message
|
def administrate_payment_message
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def administrate_housing_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_workshop_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_schedule_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_travel_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_city_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_what_to_bring
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_volunteering_info
|
||||||
|
end
|
||||||
|
|
||||||
|
def administrate_additional_details
|
||||||
|
end
|
||||||
|
|
||||||
def administrate_suggested_amounts
|
def administrate_suggested_amounts
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -168,7 +206,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
return respond_to do |format|
|
return respond_to do |format|
|
||||||
format.xlsx { render xlsx: :stats, filename: "organizations" }
|
format.xlsx { render xlsx: '../conferences/stats', filename: "organizations" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -184,7 +222,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
if request.format.xlsx?
|
if request.format.xlsx?
|
||||||
logger.info "Generating stats.xls"
|
logger.info "Generating stats.xls"
|
||||||
return respond_to do |format|
|
return respond_to do |format|
|
||||||
format.xlsx { render xlsx: :stats, filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" }
|
format.xlsx { render xlsx: '../conferences/stats', filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -224,7 +262,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
if request.format.xlsx?
|
if request.format.xlsx?
|
||||||
logger.info "Generating stats.xls"
|
logger.info "Generating stats.xls"
|
||||||
return respond_to do |format|
|
return respond_to do |format|
|
||||||
format.xlsx { render xlsx: :stats, filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" }
|
format.xlsx { render xlsx: '../conferences/stats', filename: "stats-#{DateTime.now.strftime('%Y-%m-%d')}" }
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@registration_count = @registrations.size
|
@registration_count = @registrations.size
|
||||||
@ -250,6 +288,11 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@past_conferences = []
|
||||||
|
Conference.all.order("start_date DESC").each do |conference|
|
||||||
|
@past_conferences << conference if conference.is_public && @this_conference.id != conference.id
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -327,7 +370,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
@excel_data[:data] << host_data
|
@excel_data[:data] << host_data
|
||||||
end
|
end
|
||||||
return respond_to do |format|
|
return respond_to do |format|
|
||||||
format.xlsx { render xlsx: :stats, filename: "housing" }
|
format.xlsx { render xlsx: '../conferences/stats', filename: "housing" }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -379,8 +422,8 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
def administrate_publish_schedule
|
def administrate_publish_schedule
|
||||||
end
|
end
|
||||||
|
|
||||||
def get_stats(html_format = false, id = nil)
|
def get_stats(html_format = false, id = nil, conference = @this_conference)
|
||||||
@registrations = ConferenceRegistration.where(:conference_id => @this_conference.id).sort { |a,b| (a.user.present? ? (a.user.firstname || '') : '').downcase <=> (b.user.present? ? (b.user.firstname || '') : '').downcase }
|
@registrations = ConferenceRegistration.where(conference_id: conference.id).sort { |a,b| (a.user.present? ? (a.user.firstname || '') : '').downcase <=> (b.user.present? ? (b.user.firstname || '') : '').downcase }
|
||||||
@excel_data = {
|
@excel_data = {
|
||||||
columns: [
|
columns: [
|
||||||
:name,
|
:name,
|
||||||
@ -402,7 +445,6 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
:food,
|
:food,
|
||||||
:companion,
|
:companion,
|
||||||
:companion_email,
|
:companion_email,
|
||||||
:allergies,
|
|
||||||
:other,
|
:other,
|
||||||
:can_provide_housing,
|
:can_provide_housing,
|
||||||
:first_day,
|
:first_day,
|
||||||
@ -421,7 +463,6 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
arrival: [:date, :day],
|
arrival: [:date, :day],
|
||||||
departure: [:date, :day],
|
departure: [:date, :day],
|
||||||
registration_fees_paid: :money,
|
registration_fees_paid: :money,
|
||||||
allergies: :text,
|
|
||||||
other: :text,
|
other: :text,
|
||||||
first_day: [:date, :day],
|
first_day: [:date, :day],
|
||||||
last_day: [:date, :day],
|
last_day: [:date, :day],
|
||||||
@ -443,7 +484,6 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
food: 'forms.labels.generic.food',
|
food: 'forms.labels.generic.food',
|
||||||
companion: 'articles.conference_registration.terms.companion',
|
companion: 'articles.conference_registration.terms.companion',
|
||||||
companion_email: 'articles.conference_registration.terms.companion_email',
|
companion_email: 'articles.conference_registration.terms.companion_email',
|
||||||
allergies: 'forms.labels.generic.allergies',
|
|
||||||
registration_fees_paid: 'articles.conference_registration.headings.fees_paid',
|
registration_fees_paid: 'articles.conference_registration.headings.fees_paid',
|
||||||
other: 'forms.labels.generic.other_notes',
|
other: 'forms.labels.generic.other_notes',
|
||||||
can_provide_housing: 'articles.conference_registration.can_provide_housing',
|
can_provide_housing: 'articles.conference_registration.can_provide_housing',
|
||||||
@ -458,6 +498,11 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
},
|
},
|
||||||
data: []
|
data: []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if conference.id != @this_conference.id
|
||||||
|
@excel_data[:columns] -= [:name, :email]
|
||||||
|
end
|
||||||
|
|
||||||
User.AVAILABLE_LANGUAGES.each do |l|
|
User.AVAILABLE_LANGUAGES.each do |l|
|
||||||
@excel_data[:keys]["language_#{l}".to_sym] = "languages.#{l.to_s}"
|
@excel_data[:keys]["language_#{l}".to_sym] = "languages.#{l.to_s}"
|
||||||
end
|
end
|
||||||
@ -497,10 +542,9 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
bike: r.bike.present? ? (view_context._"articles.conference_registration.questions.bike.#{r.bike}") : '',
|
bike: r.bike.present? ? (view_context._"articles.conference_registration.questions.bike.#{r.bike}") : '',
|
||||||
food: r.food.present? ? (view_context._"articles.conference_registration.questions.food.#{r.food}") : '',
|
food: r.food.present? ? (view_context._"articles.conference_registration.questions.food.#{r.food}") : '',
|
||||||
companion: companion,
|
companion: companion,
|
||||||
companion_email: (housing_data['companions'] || ['']).first,
|
companion_email: (housing_data['companion'] || { 'email' => ''})['email'],
|
||||||
allergies: r.allergies,
|
|
||||||
registration_fees_paid: r.registration_fees_paid,
|
registration_fees_paid: r.registration_fees_paid,
|
||||||
other: r.other,
|
other: r.allergies.present? ? "#{r.allergies}\n\n#{r.other}" : r.other,
|
||||||
can_provide_housing: r.can_provide_housing ? (view_context._'articles.conference_registration.questions.bike.yes') : '',
|
can_provide_housing: r.can_provide_housing ? (view_context._'articles.conference_registration.questions.bike.yes') : '',
|
||||||
first_day: availability[0].present? ? availability[0].strftime("%F %T") : '',
|
first_day: availability[0].present? ? availability[0].strftime("%F %T") : '',
|
||||||
last_day: availability[1].present? ? availability[1].strftime("%F %T") : '',
|
last_day: availability[1].present? ? availability[1].strftime("%F %T") : '',
|
||||||
@ -650,12 +694,16 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
@housing_data[host_id][:guest_data][guest_id][:warnings][:space] = { actual: (view_context._"forms.labels.generic.#{space.to_s}"), expected: (view_context._"articles.conference_registration.questions.housing.#{guest.housing}")}
|
@housing_data[host_id][:guest_data][guest_id][:warnings][:space] = { actual: (view_context._"forms.labels.generic.#{space.to_s}"), expected: (view_context._"articles.conference_registration.questions.housing.#{guest.housing}")}
|
||||||
end
|
end
|
||||||
|
|
||||||
companions = data['companions'] || []
|
if data['companion'].present?
|
||||||
companions.each do |companion|
|
companion = if data['companion']['id'].present?
|
||||||
user = User.find_user(companion)
|
User.find(data['companion']['id'])
|
||||||
if user.present?
|
else
|
||||||
|
User.find_user(data['companion']['email'])
|
||||||
|
end
|
||||||
|
|
||||||
|
if companion.present?
|
||||||
reg = ConferenceRegistration.find_by(
|
reg = ConferenceRegistration.find_by(
|
||||||
user_id: user.id,
|
user_id: companion.id,
|
||||||
conference_id: @this_conference.id
|
conference_id: @this_conference.id
|
||||||
)
|
)
|
||||||
if reg.present? && @guests[reg.id].present?
|
if reg.present? && @guests[reg.id].present?
|
||||||
@ -798,6 +846,87 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def admin_update_group_ride
|
||||||
|
params[:group_ride_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:group_ride_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_housing_info
|
||||||
|
params[:housing_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:housing_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_workshop_info
|
||||||
|
params[:workshop_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:workshop_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_schedule_info
|
||||||
|
params[:schedule_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:schedule_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_travel_info
|
||||||
|
params[:travel_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:travel_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_city_info
|
||||||
|
params[:city_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:city_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_what_to_bring
|
||||||
|
params[:what_to_bring].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:what_to_bring, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_volunteering_info
|
||||||
|
params[:volunteering_info].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:volunteering_info, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
def admin_update_additional_details
|
||||||
|
params[:additional_details].each do |locale, value|
|
||||||
|
@this_conference.set_column_for_locale(:additional_details, locale, html_value(value))
|
||||||
|
end
|
||||||
|
@this_conference.save
|
||||||
|
set_success_message @admin_step
|
||||||
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
def admin_update_poster
|
def admin_update_poster
|
||||||
begin
|
begin
|
||||||
@this_conference.poster = params[:poster]
|
@this_conference.poster = params[:poster]
|
||||||
@ -902,7 +1031,9 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
registration.send("#{key.to_s}=", value.present? ? Date.parse(value) : nil)
|
registration.send("#{key.to_s}=", value.present? ? Date.parse(value) : nil)
|
||||||
when :companion_email
|
when :companion_email
|
||||||
registration.housing_data ||= {}
|
registration.housing_data ||= {}
|
||||||
registration.housing_data['companions'] = [value]
|
registration.housing_data['companion'] ||= {}
|
||||||
|
registration.housing_data['companion']['email'] = value
|
||||||
|
registration.housing_data['companion']['id'] = User.find_user(value)
|
||||||
when :preferred_language
|
when :preferred_language
|
||||||
registration.user.locale = value
|
registration.user.locale = value
|
||||||
user_changed = true
|
user_changed = true
|
||||||
@ -1004,7 +1135,7 @@ class ConferenceAdministrationController < ApplicationController
|
|||||||
do_404
|
do_404
|
||||||
end
|
end
|
||||||
|
|
||||||
return true
|
return nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def admin_update_broadcast
|
def admin_update_broadcast
|
||||||
|
@ -217,11 +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 do
|
UserMailer.workshop_facilitator_request(workshop.id, current_user.id, params[:message]).deliver_later
|
||||||
{
|
|
||||||
:args => [ workshop, current_user, params[:message] ]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
redirect_to sent_facilitate_workshop_url(@this_conference.slug, workshop.id)
|
redirect_to sent_facilitate_workshop_url(@this_conference.slug, workshop.id)
|
||||||
end
|
end
|
||||||
@ -254,18 +250,18 @@ class WorkshopsController < ApplicationController
|
|||||||
workshop.id, user_id)
|
workshop.id, user_id)
|
||||||
f.role = :collaborator
|
f.role = :collaborator
|
||||||
f.save
|
f.save
|
||||||
UserMailer.send_mail :workshop_facilitator_request_approved, user.locale do
|
LinguaFranca.with_locale(user.locale) do
|
||||||
[ workshop, user ]
|
UserMailer.workshop_facilitator_request_approved(workshop.id, user.id).deliver_later
|
||||||
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
|
||||||
when :deny
|
when :deny
|
||||||
if workshop.active_facilitator?(current_user) && workshop.requested_collaborator?(User.find(user_id))
|
if workshop.active_facilitator?(current_user) && workshop.requested_collaborator?(User.find(user_id))
|
||||||
WorkshopFacilitator.delete_all(
|
WorkshopFacilitator.delete_all(
|
||||||
:workshop_id => workshop.id,
|
:workshop_id => workshop.id,
|
||||||
:user_id => user_id)
|
:user_id => user_id)
|
||||||
UserMailer.send_mail :workshop_facilitator_request_denied, user.locale do
|
LinguaFranca.with_locale user.locale do
|
||||||
[ workshop, user ]
|
UserMailer.workshop_facilitator_request_denied(workshop.id, user.id).deliver_later
|
||||||
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
|
||||||
@ -312,8 +308,8 @@ class WorkshopsController < ApplicationController
|
|||||||
unless workshop.facilitator?(user)
|
unless workshop.facilitator?(user)
|
||||||
WorkshopFacilitator.create(user_id: user.id, workshop_id: workshop.id, role: :collaborator)
|
WorkshopFacilitator.create(user_id: user.id, workshop_id: workshop.id, role: :collaborator)
|
||||||
|
|
||||||
UserMailer.send_mail :workshop_facilitator_request_approved, user.locale do
|
LinguaFranca.with_locale user.locale do
|
||||||
[ workshop, user ]
|
UserMailer.workshop_facilitator_request_approved(workshop.id, user.id).deliver_later
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -332,8 +328,8 @@ class WorkshopsController < ApplicationController
|
|||||||
new_comment = comment.add_comment(current_user, params[:reply])
|
new_comment = comment.add_comment(current_user, params[:reply])
|
||||||
|
|
||||||
unless comment.user.id == current_user.id
|
unless comment.user.id == current_user.id
|
||||||
UserMailer.send_mail :workshop_comment, comment.user.locale do
|
LinguaFranca.with_locale comment.user.locale do
|
||||||
[ workshop, new_comment, comment.user ]
|
UserMailer.workshop_comment(workshop.id, new_comment.id, comment.user.id).deliver_later
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
elsif params[:button] = 'add_comment'
|
elsif params[:button] = 'add_comment'
|
||||||
@ -341,8 +337,8 @@ 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
|
||||||
UserMailer.send_mail :workshop_comment, u.locale do
|
LinguaFranca.with_locale u.locale do
|
||||||
[ workshop, new_comment, u ]
|
UserMailer.workshop_comment(workshop.id, new_comment.id, u.id).deliver_later
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -251,6 +251,54 @@ Portland OR: !ruby/object:Geocoder::Result::Google
|
|||||||
- locality
|
- locality
|
||||||
- political
|
- political
|
||||||
cache_hit:
|
cache_hit:
|
||||||
|
Prince Rupert BC: !ruby/object:Geocoder::Result::Google
|
||||||
|
data:
|
||||||
|
address_components:
|
||||||
|
- long_name: Prince Rupert
|
||||||
|
short_name: Prince Rupert
|
||||||
|
types:
|
||||||
|
- locality
|
||||||
|
- political
|
||||||
|
- long_name: Skeena-Queen Charlotte
|
||||||
|
short_name: Skeena-Queen Charlotte
|
||||||
|
types:
|
||||||
|
- administrative_area_level_2
|
||||||
|
- political
|
||||||
|
- long_name: British Columbia
|
||||||
|
short_name: BC
|
||||||
|
types:
|
||||||
|
- administrative_area_level_1
|
||||||
|
- political
|
||||||
|
- long_name: Canada
|
||||||
|
short_name: CA
|
||||||
|
types:
|
||||||
|
- country
|
||||||
|
- political
|
||||||
|
formatted_address: Prince Rupert, BC, Canada
|
||||||
|
geometry:
|
||||||
|
bounds:
|
||||||
|
northeast:
|
||||||
|
lat: 54.338083
|
||||||
|
lng: -130.2437961
|
||||||
|
southwest:
|
||||||
|
lat: 54.19392
|
||||||
|
lng: -130.3634291
|
||||||
|
location:
|
||||||
|
lat: 54.3150367
|
||||||
|
lng: -130.3208187
|
||||||
|
location_type: APPROXIMATE
|
||||||
|
viewport:
|
||||||
|
northeast:
|
||||||
|
lat: 54.3343706
|
||||||
|
lng: -130.2478032
|
||||||
|
southwest:
|
||||||
|
lat: 54.202669
|
||||||
|
lng: -130.3608029
|
||||||
|
place_id: ChIJaUV_axPVclQRElbZTQ_jB3E
|
||||||
|
types:
|
||||||
|
- locality
|
||||||
|
- political
|
||||||
|
cache_hit:
|
||||||
Regina, SK: !ruby/object:Geocoder::Result::Google
|
Regina, SK: !ruby/object:Geocoder::Result::Google
|
||||||
data:
|
data:
|
||||||
address_components:
|
address_components:
|
||||||
@ -453,51 +501,3 @@ Eldorado, MX: !ruby/object:Geocoder::Result::Google
|
|||||||
- locality
|
- locality
|
||||||
- political
|
- political
|
||||||
cache_hit:
|
cache_hit:
|
||||||
Prince Rupert BC: !ruby/object:Geocoder::Result::Google
|
|
||||||
data:
|
|
||||||
address_components:
|
|
||||||
- long_name: Prince Rupert
|
|
||||||
short_name: Prince Rupert
|
|
||||||
types:
|
|
||||||
- locality
|
|
||||||
- political
|
|
||||||
- long_name: Skeena-Queen Charlotte
|
|
||||||
short_name: Skeena-Queen Charlotte
|
|
||||||
types:
|
|
||||||
- administrative_area_level_2
|
|
||||||
- political
|
|
||||||
- long_name: British Columbia
|
|
||||||
short_name: BC
|
|
||||||
types:
|
|
||||||
- administrative_area_level_1
|
|
||||||
- political
|
|
||||||
- long_name: Canada
|
|
||||||
short_name: CA
|
|
||||||
types:
|
|
||||||
- country
|
|
||||||
- political
|
|
||||||
formatted_address: Prince Rupert, BC, Canada
|
|
||||||
geometry:
|
|
||||||
bounds:
|
|
||||||
northeast:
|
|
||||||
lat: 54.338083
|
|
||||||
lng: -130.2437961
|
|
||||||
southwest:
|
|
||||||
lat: 54.19392
|
|
||||||
lng: -130.3634291
|
|
||||||
location:
|
|
||||||
lat: 54.3150367
|
|
||||||
lng: -130.3208187
|
|
||||||
location_type: APPROXIMATE
|
|
||||||
viewport:
|
|
||||||
northeast:
|
|
||||||
lat: 54.3343706
|
|
||||||
lng: -130.2478032
|
|
||||||
southwest:
|
|
||||||
lat: 54.202669
|
|
||||||
lng: -130.3608029
|
|
||||||
place_id: ChIJaUV_axPVclQRElbZTQ_jB3E
|
|
||||||
types:
|
|
||||||
- locality
|
|
||||||
- political
|
|
||||||
cache_hit:
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user