Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bring spree_backend calculator fields partial to OFN #4585

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions app/views/spree/admin/shared/_calculator_fields.html.haml
Original file line number Diff line number Diff line change
@@ -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 [email protected]_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)
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2081,6 +2081,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)"
Expand Down