hide message preferences when messages are disabled

This commit is contained in:
wvengen 2014-11-20 23:11:04 +01:00
parent d83ce60516
commit 6188567931
2 changed files with 4 additions and 2 deletions

View file

@ -33,8 +33,6 @@
%h5{class: 'controls'} %h5{class: 'controls'}
= t 'simple_form.labels.settings.settings_group.messages' = t 'simple_form.labels.settings.settings_group.messages'
= s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
= messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }
= s.simple_fields_for :notify, defaults: { inline_label: true, label: false } do |notify| = 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 '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 'negative_balance', as: :boolean, input_html: { checked: f.object.settings.notify['negative_balance'] }

View file

@ -0,0 +1,4 @@
/ insert_before 'erb:contains("simple_fields_for :notify")'
- if FoodsoftMessages.enabled?
= s.simple_fields_for :messages, defaults: { inline_label: true, label: false } do |messages|
= messages.input 'send_as_email', as: :boolean, input_html: { checked: f.object.settings.messages['send_as_email'] }