Ask volunteers to agree to our ToS
This commit is contained in:
parent
ef5935bd85
commit
9067df61b1
|
@ -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'
|
||||||
|
|
|
@ -1,35 +1,40 @@
|
||||||
# PostgreSQL. Versions 9.3 and up are supported.
|
# PostgreSQL. Versions 9.1 and up are supported.
|
||||||
#
|
#
|
||||||
# Install the pg driver:
|
# Install the pg driver:
|
||||||
# gem install pg
|
# gem install pg
|
||||||
# On macOS with Homebrew:
|
# On OS X with Homebrew:
|
||||||
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
# gem install pg -- --with-pg-config=/usr/local/bin/pg_config
|
||||||
|
# On OS X with MacPorts:
|
||||||
|
# gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config
|
||||||
# On Windows:
|
# On Windows:
|
||||||
# gem install pg
|
# gem install pg
|
||||||
# Choose the win32 build.
|
# Choose the win32 build.
|
||||||
# Install PostgreSQL and put its /bin directory on your path.
|
# Install PostgreSQL and put its /bin directory on your path.
|
||||||
#
|
#
|
||||||
# Configure Using Gemfile
|
# Configure Using Gemfile
|
||||||
# gem "pg"
|
# gem 'pg'
|
||||||
#
|
#
|
||||||
default: &default
|
default: &default
|
||||||
adapter: postgresql
|
adapter: postgresql
|
||||||
encoding: unicode
|
encoding: unicode
|
||||||
# For details on connection pooling, see Rails configuration guide
|
# For details on connection pooling, see Rails configuration guide
|
||||||
# https://guides.rubyonrails.org/configuring.html#database-pooling
|
# http://guides.rubyonrails.org/configuring.html#database-pooling
|
||||||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
|
||||||
|
|
||||||
development:
|
development:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: clarion_development
|
database: clarion
|
||||||
|
username: clarion
|
||||||
|
password: not-a-real-db-password-tiliez4phei9oZoo1Shoyitee2zoon8O
|
||||||
|
host: 127.0.0.1
|
||||||
|
|
||||||
# The specified database role being used to connect to PostgreSQL.
|
# The specified database role being used to connect to postgres.
|
||||||
# To create additional roles in PostgreSQL see `$ createuser --help`.
|
# To create additional roles in postgres see `$ createuser --help`.
|
||||||
# When left blank, PostgreSQL will use the default role. This is
|
# When left blank, postgres will use the default role. This is
|
||||||
# the same name as the operating system user running Rails.
|
# the same name as the operating system user that initialized the database.
|
||||||
#username: clarion
|
#username: clarion
|
||||||
|
|
||||||
# The password associated with the PostgreSQL role (username).
|
# The password associated with the postgres role (username).
|
||||||
#password:
|
#password:
|
||||||
|
|
||||||
# Connect on a TCP socket. Omitted by default since the client uses a
|
# Connect on a TCP socket. Omitted by default since the client uses a
|
||||||
|
@ -54,32 +59,32 @@ development:
|
||||||
# re-generated from your development database when you run "rake".
|
# re-generated from your development database when you run "rake".
|
||||||
# Do not set this db to the same as development or production.
|
# Do not set this db to the same as development or production.
|
||||||
test:
|
test:
|
||||||
<<: *default
|
adapter: sqlite3
|
||||||
database: clarion_test
|
pool: 5
|
||||||
|
timeout: 5000
|
||||||
|
database: db/test.sqlite3
|
||||||
|
|
||||||
# As with config/credentials.yml, you never want to store sensitive information,
|
# As with config/secrets.yml, you never want to store sensitive information,
|
||||||
# like your database password, in your source code. If your source code is
|
# like your database password, in your source code. If your source code is
|
||||||
# ever seen by anyone, they now have access to your database.
|
# ever seen by anyone, they now have access to your database.
|
||||||
#
|
#
|
||||||
# Instead, provide the password or a full connection URL as an environment
|
# Instead, provide the password as a unix environment variable when you boot
|
||||||
# variable when you boot the app. For example:
|
# the app. Read http://guides.rubyonrails.org/configuring.html#configuring-a-database
|
||||||
|
# for a full rundown on how to provide these environment variables in a
|
||||||
|
# production deployment.
|
||||||
|
#
|
||||||
|
# On Heroku and other platform providers, you may have a full connection URL
|
||||||
|
# available as an environment variable. For example:
|
||||||
#
|
#
|
||||||
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
# DATABASE_URL="postgres://myuser:mypass@localhost/somedatabase"
|
||||||
#
|
#
|
||||||
# If the connection URL is provided in the special DATABASE_URL environment
|
# You can use this database configuration with:
|
||||||
# variable, Rails will automatically merge its configuration values on top of
|
|
||||||
# the values provided in this file. Alternatively, you can specify a connection
|
|
||||||
# URL environment variable explicitly:
|
|
||||||
#
|
#
|
||||||
# production:
|
# production:
|
||||||
# url: <%= ENV["MY_APP_DATABASE_URL"] %>
|
# url: <%= ENV['DATABASE_URL'] %>
|
||||||
#
|
|
||||||
# Read https://guides.rubyonrails.org/configuring.html#configuring-a-database
|
|
||||||
# for a full overview on how database connection configuration can be specified.
|
|
||||||
#
|
#
|
||||||
production:
|
production:
|
||||||
<<: *default
|
<<: *default
|
||||||
host: <%= ENV.fetch("CLARION_DATABASE_HOST") { "host.containers.internal" } %>
|
database: clarion_production
|
||||||
database: clarion
|
|
||||||
username: clarion
|
username: clarion
|
||||||
password: <%= ENV["CLARION_DATABASE_PASSWORD"] %>
|
password: <%= ENV['CLARION_DATABASE_PASSWORD'] %>
|
||||||
|
|
|
@ -24,6 +24,9 @@ default: &default
|
||||||
development:
|
development:
|
||||||
<<: *default
|
<<: *default
|
||||||
database: clarion_development
|
database: clarion_development
|
||||||
|
username: clarion
|
||||||
|
password: not-a-real-db-password-tiliez4phei9oZoo1Shoyitee2zoon8O
|
||||||
|
host: 127.0.0.1
|
||||||
|
|
||||||
# The specified database role being used to connect to postgres.
|
# The specified database role being used to connect to postgres.
|
||||||
# To create additional roles in postgres see `$ createuser --help`.
|
# To create additional roles in postgres see `$ createuser --help`.
|
||||||
|
@ -56,8 +59,10 @@ development:
|
||||||
# re-generated from your development database when you run "rake".
|
# re-generated from your development database when you run "rake".
|
||||||
# Do not set this db to the same as development or production.
|
# Do not set this db to the same as development or production.
|
||||||
test:
|
test:
|
||||||
<<: *default
|
adapter: sqlite3
|
||||||
database: clarion_test
|
pool: 5
|
||||||
|
timeout: 5000
|
||||||
|
database: db/test.sqlite3
|
||||||
|
|
||||||
# As with config/secrets.yml, you never want to store sensitive information,
|
# As with config/secrets.yml, you never want to store sensitive information,
|
||||||
# like your database password, in your source code. If your source code is
|
# like your database password, in your source code. If your source code is
|
||||||
|
|
|
@ -12,7 +12,7 @@ Rails.application.configure do
|
||||||
config.eager_load = false
|
config.eager_load = false
|
||||||
|
|
||||||
# Show full error reports.
|
# Show full error reports.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = false
|
||||||
|
|
||||||
# Enable server timing
|
# Enable server timing
|
||||||
config.server_timing = true
|
config.server_timing = true
|
||||||
|
|
|
@ -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
|
|
@ -26,15 +26,21 @@ services:
|
||||||
POSTGRES_DB: clarion
|
POSTGRES_DB: clarion
|
||||||
volumes:
|
volumes:
|
||||||
- pgdata:/var/lib/postgresql/data
|
- pgdata:/var/lib/postgresql/data
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:5432:5432
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: redis:7
|
image: redis:7
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:6379:6379
|
||||||
|
|
||||||
mail-dummy:
|
mail-dummy:
|
||||||
image: python:3.11-slim
|
image: python:3.11-slim
|
||||||
command: python3 -m smtpd --debug --class DebuggingServer 0.0.0.0:25
|
command: python3 -m smtpd --debug --class DebuggingServer 0.0.0.0:25
|
||||||
expose:
|
expose:
|
||||||
- 25
|
- 25
|
||||||
|
ports:
|
||||||
|
- 127.0.0.1:2525:25
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
pgdata:
|
pgdata:
|
||||||
|
|
|
@ -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