Skip to content

Commit

Permalink
Adds phone_number to the regular user registration / account views
Browse files Browse the repository at this point in the history
  • Loading branch information
kikito committed Aug 16, 2015
1 parent e84873d commit 543f718
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/controllers/account_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def set_account
end

def account_params
params.require(:account).permit(:first_name, :last_name, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
params.require(:account).permit(:first_name, :last_name, :phone_number, :nickname, :use_nickname, :email_on_debate_comment, :email_on_comment_reply)
end

end
2 changes: 1 addition & 1 deletion app/controllers/users/registrations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def create
private

def sign_up_params
params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :use_nickname, :nickname)
params.require(:user).permit(:first_name, :last_name, :email, :phone_number, :password, :password_confirmation, :use_nickname, :nickname)
end

end
5 changes: 5 additions & 0 deletions app/views/account/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@
<% end %>
</div>

<div class="small-12 medium-6 column">
<%= f.label :last_name, t("account.show.phone_number_label") %>
<%= f.text_field :phone_number, placeholder: t("account.show.phone_number_label") %>
</div>

<div class="small-12 column">
<%= f.label :email_on_debate_comment do %>
<%= f.check_box :email_on_debate_comment %>
Expand Down
7 changes: 7 additions & 0 deletions app/views/users/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@
</div>
</div>

<div class="row">
<div class="small-12 columns">
<%= f.label :phone_number, t("devise_views.users.registrations.new.phone_number_label") %>
<%= f.text_field :phone_number, placeholder: t("devise_views.users.registrations.new.phone_number_label") %>
</div>
</div>

<div class="row">
<div class="small-12 columns">
<%= f.label :password, t("devise_views.users.registrations.new.password_label"), class: "inline-block" %>
Expand Down
1 change: 1 addition & 0 deletions config/locales/devise_views.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ en:
nickname_label: "Nickname"
use_nickname_label: "Use nickname"
email_label: "Email"
phone_number_label: "Phone number"
password_label: "Password"
min_length: "(%{min} characters minimum)"
password_confirmation_label: "Confirm password"
Expand Down
1 change: 1 addition & 0 deletions config/locales/devise_views.es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ es:
nickname_label: "Pseudónimo"
use_nickname_label: "Usar pseudónimo"
email_label: "Email"
phone_number_label: "Teléfono"
password_label: "Contraseña"
min_length: "(mínimo %{min} caracteres)"
password_confirmation_label: "Confirmar contraseña"
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ en:
change_credentials_link: "Change my credentials"
first_name_label: "First Name"
last_name_label: "Last Name"
phone_number_label: "Phone number"
use_nickname_label: "Use nickname"
nickname_label: "Nickname"
recaptcha:
Expand Down
1 change: 1 addition & 0 deletions config/locales/es.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ es:
email_on_comment_reply_label: "Recibir un email cuando alguien contesta a mis comentarios"
first_name_label: "Nombre"
last_name_label: "Apellidos"
phone_number_label: "Teléfono"
use_nickname_label: "Usar pseudónimo"
nickname_label: "Pseudónimo"
recaptcha:
Expand Down

0 comments on commit 543f718

Please sign in to comment.