Allow to edit address from user profile

This commit is contained in:
wvengen 2014-12-10 21:27:53 +01:00
parent 7ac3f54709
commit 56f6efa590
3 changed files with 24 additions and 4 deletions

View file

@ -6,12 +6,15 @@
-# You can control password autocompletion by passing `password_autocomplete` to this partial.
-# Possible values: undefined/nil, true, false, 'store-only'
-# see also https://github.com/foodcoops/foodsoft/wiki/Form-autocompletion
- password_autocomplete = nil unless defined?(:password_autocomplete)
- password_html = autocomplete_flag_to_password_html(password_autocomplete)
- password_html = autocomplete_flag_to_password_html(local_assigns[:password_autocomplete])
= f.input :password, :required => f.object.new_record?, input_html: password_html
= f.input :password_confirmation, :required => f.object.new_record?, input_html: password_html
= f.input :phone
- if local_assigns[:with_address] && (f.object.ordergroup || f.object.new_record?)
= f.fields_for [:ordergroup, f.object.ordergroup || Ordergroup.new] do |ogf|
= ogf.input :contact_address, label: t('activerecord.attributes.ordergroup.contact_address'), required: false
= f.simple_fields_for :settings_attributes do |s|
= s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
= profile.input 'language', as: :select, collection: available_locales, required: false, selected: f.object.settings.profile['language']