2011-06-09 22:03:27 +02:00
|
|
|
= f.input :first_name
|
|
|
|
= f.input :last_name
|
|
|
|
= f.input :email
|
2013-12-22 13:28:33 +01:00
|
|
|
-# need :required because :use_nil option on user model validators break the required mark
|
|
|
|
= f.input :nick, required: true if FoodsoftConfig[:use_nick]
|
2013-12-22 23:21:14 +01:00
|
|
|
-# You can control password autocompletion by passing `password_autocomplete` to this partial.
|
|
|
|
-# Possible values: undefined/nil, true, false, 'store-only'
|
2013-12-22 13:28:33 +01:00
|
|
|
-# see also https://github.com/foodcoops/foodsoft/wiki/Form-autocompletion
|
2014-12-10 21:27:53 +01:00
|
|
|
- password_html = autocomplete_flag_to_password_html(local_assigns[:password_autocomplete])
|
2013-12-22 23:21:14 +01:00
|
|
|
= 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
|
2011-06-09 22:03:27 +02:00
|
|
|
= f.input :phone
|
2013-06-06 03:40:15 +02:00
|
|
|
|
2014-12-10 21:27:53 +01:00
|
|
|
- if local_assigns[:with_address] && (f.object.ordergroup || f.object.new_record?)
|
|
|
|
= f.fields_for [:ordergroup, f.object.ordergroup || Ordergroup.new] do |ogf|
|
2014-12-16 20:48:40 +01:00
|
|
|
- address_hint = f.object.ordergroup.users.count > 1 ? t('.contact_address_hint') : nil
|
|
|
|
= ogf.input :contact_address, label: t('activerecord.attributes.ordergroup.contact_address'), required: false,
|
|
|
|
input_html: { title: address_hint, data: {toggle: 'tooltip', placement: 'right'} }
|
2014-12-10 21:27:53 +01:00
|
|
|
|
2013-06-18 12:20:26 +02:00
|
|
|
= 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']
|
|
|
|
|
|
|
|
.settings
|
|
|
|
.settings-group
|
|
|
|
= s.simple_fields_for :profile, defaults: { inline_label: true } do |profile|
|
|
|
|
|
2013-06-14 22:38:07 +02:00
|
|
|
%div{class: 'control-group h_wrapper'}
|
2013-06-18 12:20:26 +02:00
|
|
|
%h5{class: 'controls'}
|
|
|
|
= t 'simple_form.labels.settings.settings_group.privacy'
|
|
|
|
= profile.input 'phone_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['phone_is_public'] }
|
|
|
|
= profile.input 'email_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['email_is_public'] }
|
2013-09-20 22:40:13 +02:00
|
|
|
- if FoodsoftConfig[:use_nick]
|
|
|
|
= profile.input 'name_is_public', as: :boolean, label: false, input_html: { checked: f.object.settings.profile['name_is_public'] }
|
2013-06-18 12:20:26 +02:00
|
|
|
|
|
|
|
.settings-group
|
|
|
|
%div{class: 'control-group'}
|
|
|
|
%h5{class: 'controls'}
|
|
|
|
= t 'simple_form.labels.settings.settings_group.messages'
|
|
|
|
|
|
|
|
= s.simple_fields_for :notify, defaults: { inline_label: true, label: false } do |notify|
|
|
|
|
= notify.input 'order_finished', as: :boolean, input_html: { checked: f.object.settings.notify['order_finished'] }
|
|
|
|
= notify.input 'negative_balance', as: :boolean, input_html: { checked: f.object.settings.notify['negative_balance'] }
|
|
|
|
= notify.input 'upcoming_tasks', as: :boolean, input_html: { checked: f.object.settings.notify['upcoming_tasks'] }
|
|
|
|
|