Compare commits

..

No commits in common. "8cd4a4856d6bea4cf1fa6d9687d1b0fa9504f9f7" and "6af2d098960b7dc79e0a25fa26a4d4cab393b1de" have entirely different histories.

8 changed files with 3 additions and 13 deletions

View File

@ -41,7 +41,7 @@ module Management
params.require(:volunteer).permit(:name, :picture, :email, :phone,
:tshirt_size, :tshirt_cut,
:food_preferences, :previous_experience,
:notes, :language, :terms_accepted,
:notes, :language,
:volunteer_team_id,
additional_volunteer_team_ids: [])
end

View File

@ -39,7 +39,7 @@ module Public
params.require(:volunteer).permit(
:name, :picture, :email, :phone, :tshirt_size, :tshirt_cut,
:food_preferences, :previous_experience, :notes, :language,
:terms_accepted, :volunteer_team_id,
:volunteer_team_id
)
end
end

View File

@ -12,7 +12,6 @@ class Volunteer < ActiveRecord::Base
validates :email, format: {with: /\A[^@]+@[^@]+\z/}, presence: true, uniqueness: {scope: :conference_id}
validates :phone, presence: true, format: {with: /\A[+\- \(\)0-9]+\z/}
validates :volunteer_team, presence: true
validates :terms_accepted, acceptance: true
validate :volunteer_teams_belong_to_conference
phony_normalize :phone, default_country_code: "BG"
@ -25,7 +24,7 @@ class Volunteer < ActiveRecord::Base
before_create :assign_unique_id
before_create :assign_confirmation_token
after_commit :send_email_confirmation_to_volunteer, on: [:create]
after_commit :send_email_to_organisers, on: [:create] # technically the volunteer's email is not confirmed yet
after_commit :send_email_to_organisers, on: [:create] # technically the email is not confirmed yet
def send_notification_to_volunteer
VolunteerMailer.volunteer_notification(self).deliver_later

View File

@ -20,6 +20,5 @@
= 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 :notes
= f.input :terms_accepted
.panel-footer.text-right
= f.submit class: 'btn btn-primary'

View File

@ -118,7 +118,6 @@ bg:
food_preferences: Предпочитана храна
previous_experience: Предишен опит
notes: Бележки
terms_accepted: Съгласен съм екипът да се свързва с мен
language: Език
volunteer_team: Екип доброволци
additional_volunteer_teams: Допълнителни екипи доброволци

View File

@ -118,7 +118,6 @@ en:
food_preferences: Food preference
previous_experience: Previous experience
notes: Notes
terms_accepted: I agree to be contacted by the team
language: Language
volunteer_team: Volunteer team
additional_volunteer_teams: Additional volunteer teams

View File

@ -1,5 +0,0 @@
class AddTermsAcceptedToVolunteer < ActiveRecord::Migration[7.1]
def change
add_column :volunteers, :terms_accepted, :boolean, default: false
end
end

View File

@ -22,6 +22,5 @@
= 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 :notes
= f.input :terms_accepted
.form-actions
= f.button :submit