mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Merge pull request #4585 from luisramos0/backend_partial_calc_fields
Bring spree_backend calculator fields partial to OFN
This commit is contained in:
13
app/views/spree/admin/shared/_calculator_fields.html.haml
Normal file
13
app/views/spree/admin/shared/_calculator_fields.html.haml
Normal file
@@ -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)
|
||||
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user