Add custom fields to invoice, odergroup, supplier and user
This commit is contained in:
parent
72b5a5ca82
commit
75deec9f06
13 changed files with 48 additions and 7 deletions
7
app/views/shared/_custom_form_fields.html.haml
Normal file
7
app/views/shared/_custom_form_fields.html.haml
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
- if FoodsoftConfig[:custom_fields] && FoodsoftConfig[:custom_fields][type]
|
||||
= f.simple_fields_for :custom_fields, defaults: { required: false } do |s|
|
||||
- FoodsoftConfig[:custom_fields][type].each do |options|
|
||||
- options = options.deep_symbolize_keys
|
||||
- name = options.delete(:name)
|
||||
- value = f.object.settings.custom_fields[name]
|
||||
= s.input name, options.deep_merge(input_html: {value:value})
|
||||
|
|
@ -19,10 +19,11 @@
|
|||
= ogf.input :contact_address, label: t('activerecord.attributes.ordergroup.contact_address'), required: false,
|
||||
input_html: { title: address_hint, data: {toggle: 'tooltip', placement: 'right'} }
|
||||
|
||||
= render 'shared/custom_form_fields', f: f, type: :user
|
||||
= 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|
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue