User can now add a phone number
This commit is contained in:
@@ -21,7 +21,7 @@ class SupportersController < ApplicationController
|
||||
private
|
||||
|
||||
def supporter_form_params
|
||||
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :li_membership, :age_category, :city, :comments)
|
||||
params.require(:supporter).permit(:first_name, :last_name, :street, :zip, :email, :support, :li_membership, :age_category, :city, :comments, :tel)
|
||||
end
|
||||
|
||||
# We use sendy for newsletters atm
|
||||
|
||||
@@ -45,6 +45,7 @@ class Supporter
|
||||
field :comments, type: String
|
||||
field :language, type: String
|
||||
field :duplicate, type: Boolean, default: false
|
||||
field :tel, type: String
|
||||
|
||||
validates :first_name, presence: true
|
||||
validates :last_name, presence: true
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
= f.input :city, placeholder: t('.placeholders.city')
|
||||
= f.input :zip, placeholder: t('.placeholders.zip')
|
||||
= f.input :email, placeholder: t('.placeholders.email')
|
||||
= f.input :tel, placeholder: '+41 (0) xxxx'
|
||||
= f.input :support, as: :radio_buttons, collection: t('support_type').map{ |x| [x.first, raw(x.last)]}, label_method: :last, value_method: :first
|
||||
= f.input :li_membership, as: :boolean
|
||||
= f.input :age_category, as: :radio_buttons, collection: t('age_category'), label_method: :last, value_method: :first
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
dd == t("age_category.#{current_supporter.age_category}")
|
||||
dt = Supporter.human_attribute_name(:language)
|
||||
dd = t("languages.#{current_supporter.language}")
|
||||
dt = Supporter.human_attribute_name(:tel)
|
||||
dd = current_supporter.tel
|
||||
|
||||
p
|
||||
= link_to t('.edit'), edit_supporter_registration_path(), class: 'pull-right'
|
||||
|
||||
@@ -138,6 +138,7 @@ de:
|
||||
language: Sprache
|
||||
password_confirmation: Passwort bestätigen
|
||||
current_password: Aktuelles Passwort
|
||||
tel: Telefon (optional)
|
||||
publicity:
|
||||
state: Status
|
||||
organisation: Organisation
|
||||
|
||||
@@ -135,7 +135,8 @@ fr:
|
||||
language: Langue
|
||||
password_confirmation: confirmer le mot de passe
|
||||
current_password: Mot de passe actuel
|
||||
|
||||
tel: Téléphone (facultatif)
|
||||
|
||||
publicity:
|
||||
status: Statu
|
||||
organisation: Organisation
|
||||
|
||||
@@ -137,6 +137,7 @@ it:
|
||||
language: Lingua
|
||||
password_confirmation: conferma password
|
||||
current_password: Password corrente
|
||||
tel: Telefono (opzionale)
|
||||
publicity:
|
||||
status: Statu
|
||||
organisation: Organizzazione
|
||||
|
||||
@@ -10,6 +10,7 @@ feature 'Support' do
|
||||
fill_in 'Postleitzahl', with: '8704'
|
||||
fill_in 'Ort', with: 'Herrliberg'
|
||||
fill_in 'E-Mail', with: 'blocher@blocher.ch'
|
||||
fill_in 'Telefon', with: '12345'
|
||||
fill_in 'Kommentar / Feedback', with: 'Test text'
|
||||
|
||||
choose 'Ich würde eine Volksinitiative für die Legalisierung von Cannabis unterschreiben und helfe aktiv Unterschriften in meiner Umgebung zu sammeln.'
|
||||
@@ -30,6 +31,7 @@ feature 'Support' do
|
||||
expect(supporter.comments).to eq 'Test text'
|
||||
expect(supporter.language).to eq 'de'
|
||||
expect(supporter.li_membership).to eq true
|
||||
expect(supporter.tel).to eq '12345'
|
||||
end
|
||||
|
||||
scenario 'A bot tries to enter data' do
|
||||
|
||||
Reference in New Issue
Block a user