Ask volunteers to agree to our ToS
This commit is contained in:
parent
ef5935bd85
commit
9ec0294a75
|
@ -41,7 +41,7 @@ module Management
|
||||||
params.require(:volunteer).permit(:name, :picture, :email, :phone,
|
params.require(:volunteer).permit(:name, :picture, :email, :phone,
|
||||||
:tshirt_size, :tshirt_cut,
|
:tshirt_size, :tshirt_cut,
|
||||||
:food_preferences, :previous_experience,
|
:food_preferences, :previous_experience,
|
||||||
:notes, :language,
|
:notes, :language, :terms_accepted,
|
||||||
:volunteer_team_id,
|
:volunteer_team_id,
|
||||||
additional_volunteer_team_ids: [])
|
additional_volunteer_team_ids: [])
|
||||||
end
|
end
|
||||||
|
|
|
@ -39,7 +39,7 @@ module Public
|
||||||
params.require(:volunteer).permit(
|
params.require(:volunteer).permit(
|
||||||
:name, :picture, :email, :phone, :tshirt_size, :tshirt_cut,
|
:name, :picture, :email, :phone, :tshirt_size, :tshirt_cut,
|
||||||
:food_preferences, :previous_experience, :notes, :language,
|
:food_preferences, :previous_experience, :notes, :language,
|
||||||
:volunteer_team_id
|
:terms_accepted, :volunteer_team_id,
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,6 +12,7 @@ class Volunteer < ActiveRecord::Base
|
||||||
validates :email, format: {with: /\A[^@]+@[^@]+\z/}, presence: true, uniqueness: {scope: :conference_id}
|
validates :email, format: {with: /\A[^@]+@[^@]+\z/}, presence: true, uniqueness: {scope: :conference_id}
|
||||||
validates :phone, presence: true, format: {with: /\A[+\- \(\)0-9]+\z/}
|
validates :phone, presence: true, format: {with: /\A[+\- \(\)0-9]+\z/}
|
||||||
validates :volunteer_team, presence: true
|
validates :volunteer_team, presence: true
|
||||||
|
validates :terms_accepted, acceptance: true
|
||||||
validate :volunteer_teams_belong_to_conference
|
validate :volunteer_teams_belong_to_conference
|
||||||
|
|
||||||
phony_normalize :phone, default_country_code: "BG"
|
phony_normalize :phone, default_country_code: "BG"
|
||||||
|
@ -24,7 +25,7 @@ class Volunteer < ActiveRecord::Base
|
||||||
before_create :assign_unique_id
|
before_create :assign_unique_id
|
||||||
before_create :assign_confirmation_token
|
before_create :assign_confirmation_token
|
||||||
after_commit :send_email_confirmation_to_volunteer, on: [:create]
|
after_commit :send_email_confirmation_to_volunteer, on: [:create]
|
||||||
after_commit :send_email_to_organisers, on: [:create] # technically the email is not confirmed yet
|
after_commit :send_email_to_organisers, on: [:create] # technically the volunteer's email is not confirmed yet
|
||||||
|
|
||||||
def send_notification_to_volunteer
|
def send_notification_to_volunteer
|
||||||
VolunteerMailer.volunteer_notification(self).deliver_later
|
VolunteerMailer.volunteer_notification(self).deliver_later
|
||||||
|
|
|
@ -20,5 +20,6 @@
|
||||||
= f.input :food_preferences, collection: Volunteer::FOOD_PREFERENCES, wrapper: :horizontal_radio_and_checkboxes, as: :radio_buttons, checked: (@volunteer.food_preferences.presence || :none)
|
= f.input :food_preferences, collection: Volunteer::FOOD_PREFERENCES, wrapper: :horizontal_radio_and_checkboxes, as: :radio_buttons, checked: (@volunteer.food_preferences.presence || :none)
|
||||||
= f.input :previous_experience
|
= f.input :previous_experience
|
||||||
= f.input :notes
|
= f.input :notes
|
||||||
|
= f.input :terms_accepted
|
||||||
.panel-footer.text-right
|
.panel-footer.text-right
|
||||||
= f.submit class: 'btn btn-primary'
|
= f.submit class: 'btn btn-primary'
|
||||||
|
|
|
@ -118,6 +118,7 @@ bg:
|
||||||
food_preferences: Предпочитана храна
|
food_preferences: Предпочитана храна
|
||||||
previous_experience: Предишен опит
|
previous_experience: Предишен опит
|
||||||
notes: Бележки
|
notes: Бележки
|
||||||
|
terms_accepted: Съгласен съм екипът да се свързва с мен
|
||||||
language: Език
|
language: Език
|
||||||
volunteer_team: Екип доброволци
|
volunteer_team: Екип доброволци
|
||||||
additional_volunteer_teams: Допълнителни екипи доброволци
|
additional_volunteer_teams: Допълнителни екипи доброволци
|
||||||
|
@ -373,6 +374,7 @@ bg:
|
||||||
phone: "Мобилният ви телефон, който ще бъде видим само за организаторите"
|
phone: "Мобилният ви телефон, който ще бъде видим само за организаторите"
|
||||||
picture: "Ваша снимка в jpeg, png или gif формат"
|
picture: "Ваша снимка в jpeg, png или gif формат"
|
||||||
volunteer_team: "Доброволческият екип, от които искате да бъдете част. Подробни описания на екипите можете да намерите <a href=\"/volunteer_teams\" target=\"_blank\">тук</a>. Ако желаете да участвате в повече от един екип, споменете това в полето бележка."
|
volunteer_team: "Доброволческият екип, от които искате да бъдете част. Подробни описания на екипите можете да намерите <a href=\"/volunteer_teams\" target=\"_blank\">тук</a>. Ако желаете да участвате в повече от един екип, споменете това в полето бележка."
|
||||||
|
terms_accepted: "Съгласен съм екипът да се свързва с мен, както и с <a href=\"https://openfest.org/2024/bg/terms-of-service\" target=\"_blank\">политиката за данни и общите условия</a>."
|
||||||
user:
|
user:
|
||||||
email: e-mail адресът ви. Ще бъде видим само от организаторите
|
email: e-mail адресът ви. Ще бъде видим само от организаторите
|
||||||
password: "Парола с дължина между 8 и 128 символа"
|
password: "Парола с дължина между 8 и 128 символа"
|
||||||
|
|
|
@ -118,6 +118,7 @@ en:
|
||||||
food_preferences: Food preference
|
food_preferences: Food preference
|
||||||
previous_experience: Previous experience
|
previous_experience: Previous experience
|
||||||
notes: Notes
|
notes: Notes
|
||||||
|
terms_accepted: I agree to be contacted by the team
|
||||||
language: Language
|
language: Language
|
||||||
volunteer_team: Volunteer team
|
volunteer_team: Volunteer team
|
||||||
additional_volunteer_teams: Additional volunteer teams
|
additional_volunteer_teams: Additional volunteer teams
|
||||||
|
@ -373,6 +374,7 @@ en:
|
||||||
phone: "Your mobile phone. It will be visible only to the organizers"
|
phone: "Your mobile phone. It will be visible only to the organizers"
|
||||||
picture: "A picture of you in jpeg, png or gif format"
|
picture: "A picture of you in jpeg, png or gif format"
|
||||||
volunteer_team: "The volunteer team you'd like to be a part of. You can find a description of each team <a href=\"/volunteer_teams?locale=en\" target=\"_blank\">here</a>. Leave a note in the Notes field if you wish to be a part of any additional teams."
|
volunteer_team: "The volunteer team you'd like to be a part of. You can find a description of each team <a href=\"/volunteer_teams?locale=en\" target=\"_blank\">here</a>. Leave a note in the Notes field if you wish to be a part of any additional teams."
|
||||||
|
terms_accepted: "I agree to be contacted by the team, and with <a href=\"https://openfest.org/2024/en/terms-of-service\" target=\"_blank\">the terms of service and the privacy policy</a>."
|
||||||
user:
|
user:
|
||||||
email: Your e-mail address. Will be visible to the organizers only.
|
email: Your e-mail address. Will be visible to the organizers only.
|
||||||
password: "Password with length between 8 and 128 symbols"
|
password: "Password with length between 8 and 128 symbols"
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddTermsAcceptedToVolunteer < ActiveRecord::Migration[7.1]
|
||||||
|
def change
|
||||||
|
add_column :volunteers, :terms_accepted, :boolean, default: false
|
||||||
|
end
|
||||||
|
end
|
|
@ -22,5 +22,6 @@
|
||||||
= f.input :food_preferences, collection: Volunteer::FOOD_PREFERENCES, as: :radio_buttons, wrapper: :default, checked: (@volunteer.food_preferences.presence || :none)
|
= f.input :food_preferences, collection: Volunteer::FOOD_PREFERENCES, as: :radio_buttons, wrapper: :default, checked: (@volunteer.food_preferences.presence || :none)
|
||||||
= f.input :previous_experience
|
= f.input :previous_experience
|
||||||
= f.input :notes
|
= f.input :notes
|
||||||
|
= f.input :terms_accepted
|
||||||
.form-actions
|
.form-actions
|
||||||
= f.button :submit
|
= f.button :submit
|
||||||
|
|
Loading…
Reference in New Issue