diff options
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/exports_helper.rb | 7 | ||||
| -rw-r--r-- | app/helpers/imports_helper.rb | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/app/helpers/exports_helper.rb b/app/helpers/exports_helper.rb index 3a32e4761..25a808c2d 100644 --- a/app/helpers/exports_helper.rb +++ b/app/helpers/exports_helper.rb @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- module ExportsHelper - def export_option_input form, export, attr, option_def - opts = { required: option_def[:required], input_html: {value: @export.try(attr) || option_def[:default_value]}, as: option_def[:type]} + def export_option_input form, export, attr, option_def, type + opts = { required: option_def[:required], input_html: {value: export.try(attr) || option_def[:default_value]}, as: option_def[:type], selected: export.try(attr) || option_def[:default_value]} opts[:collection] = option_def[:collection] if option_def.has_key?(:collection) - opts[:collection] = @export.instance_exec(&option_def[:collection]) if option_def[:collection].is_a?(Proc) + opts[:collection] = export.instance_exec(&option_def[:collection]) if option_def[:collection].is_a?(Proc) + opts[:label] = t "activerecord.attributes.export.#{type.name.demodulize.underscore}.#{attr}" form.input attr, opts end diff --git a/app/helpers/imports_helper.rb b/app/helpers/imports_helper.rb index 140660153..5d05117c9 100644 --- a/app/helpers/imports_helper.rb +++ b/app/helpers/imports_helper.rb @@ -15,6 +15,10 @@ module ImportsHelper end end + def export_status status + import_status status + end + # Compliance check set messages def bootstrap_class_for_message_criticity message_criticity case message_criticity |
