diff --git a/app/views/spree/admin/shared/_calculator_fields.html.haml b/app/views/spree/admin/shared/_calculator_fields.html.haml new file mode 100644 index 0000000000..062503c8d6 --- /dev/null +++ b/app/views/spree/admin/shared/_calculator_fields.html.haml @@ -0,0 +1,13 @@ +%fieldset#calculator_fields.no-border-bottom + %legend{align: "center"}= t(:calculator) + #preference-settings + .field + = f.label(:calculator_type, t(:calculator), for: 'calc_type') + = f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {id: 'calc_type', class: 'select2 fullwidth'}) + - if !@object.new_record? + .field + .calculator-settings + = f.fields_for :calculator do |calculator_form| + = preference_fields(@object.calculator, calculator_form) + - if @object.calculator.respond_to?(:preferences) + %span.calculator-settings-warning.info.warning= t(:calculator_settings_warning) diff --git a/config/locales/en.yml b/config/locales/en.yml index 37e65de208..611ec91409 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -2076,6 +2076,7 @@ See the %{link} to find out more about %{sitename}'s features and to start using tax_category: "Tax Category" calculator: "Calculator" calculator_values: "Calculator values" + calculator_settings_warning: "If you are changing the calculator type, you must save first before you can edit the calculator settings" flat_percent_per_item: "Flat Percent (per item)" flat_rate_per_item: "Flat Rate (per item)" flat_rate_per_order: "Flat Rate (per order)"