osem-fcy/app/views/devise/registrations/_form_fields.html.haml
Henne Vogelsang 7babc5d08a
Fix registration form
- Admins should be able to change admin status
- Username should not be changeable
- always require password confirmation
2022-03-02 17:59:30 +01:00

50 lines
1.8 KiB
Text

- unless @user.persisted?
.form-group
= f.label :username
%abbr{title: 'This field is required'} *
= f.text_field :username, required: true, autocomplete: 'off', class: 'form-control', placeholder: 'Username'
.form-group
= f.label :email
%abbr{title: 'This field is required'} *
= f.email_field :email, required: true, autocomplete: 'off', class: 'form-control', placeholder: 'Email'
- if local_assigns[:full]
.checkbox
%label
= f.check_box :email_public
Do you want your email address to appear publicly
%span.help-block
For instance on sessions pages or registration lists.
.form-group
= f.label :password, 'Password'
- if !@user.persisted?
%abbr{title: 'This field is required'} *
= f.password_field :password, required: !@user.persisted?, class: 'form-control', placeholder: 'Password'
.form-group
= f.label :password_confirmation, 'Password Confirmation'
= f.password_field :password_confirmation, required: !@user.persisted?, class: 'form-control', placeholder: 'Password Confirmation'
- if @user.persisted?
%p.text-muted
Leave blank if you don't want to change your password
= render partial: 'form_fields_openid', locals: { f: f }
- if current_user.try(:is_admin?)
.checkbox
%label
= f.check_box :is_admin
is Admin?
%span.help-block
An admin can create a new conference, manage users and make other users admins.
- if @user.persisted?
%h4
Confirmation
%hr
.form-group
= f.label :password, "Current Password"
%abbr{title: 'This field is required'} *
= f.password_field :current_password, required: true, autocomplete: 'off', class: 'form-control', placeholder: 'Password'
%p.text-muted
We need your current password to confirm changes
- Feature.with(:recaptcha) do
.form-group
= recaptcha_tags
%p.text-right
= f.submit nil, class: 'btn btn-success'