fix user form field order and autocompletion
This commit is contained in:
parent
df9cff0eee
commit
3e1d561a5e
3 changed files with 10 additions and 7 deletions
|
|
@ -1,12 +1,15 @@
|
|||
- if FoodsoftConfig[:use_nick]
|
||||
-# use_nil option to user model validators break required mark
|
||||
= f.input :nick, required: true
|
||||
= f.input :first_name
|
||||
= f.input :last_name
|
||||
= f.input :email
|
||||
-# need :required because :use_nil option on user model validators break the required mark
|
||||
= f.input :nick, required: true if FoodsoftConfig[:use_nick]
|
||||
-# you can disable password autocompletion by passing `password_autocomplete: false` to this partial
|
||||
-# see also https://github.com/foodcoops/foodsoft/wiki/Form-autocompletion
|
||||
- password_autocomplete = nil unless defined?(:password_autocomplete)
|
||||
- passwd_opts = (password_autocomplete.nil? ? {} : {autocomplete: password_autocomplete ? 'on' : 'off'})
|
||||
= f.input :password, :required => f.object.new_record?, input_html: passwd_opts
|
||||
= f.input :password_confirmation, :required => f.object.new_record?, input_html: passwd_opts
|
||||
= f.input :phone
|
||||
= f.input :password, :required => f.object.new_record?
|
||||
= f.input :password_confirmation
|
||||
|
||||
= f.simple_fields_for :settings_attributes do |s|
|
||||
= s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue