forked from solidusio/solidus
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Only show fields for promotion action calculators that we have prefer…
…ence form fields for We do not ship preference form fields for Array and Hash preference types. Some promotion actions might use them to store very specific settings. As arrays and hashes won't represent well in a form field, we should not render them.
- Loading branch information
Showing
2 changed files
with
48 additions
and
4 deletions.
There are no files selected for viewing
9 changes: 5 additions & 4 deletions
9
backend/app/views/spree/admin/promotions/calculators/_default_fields.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<% calculator.preferences.keys.map do |key| %> | ||
<%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(key)}", | ||
name: "#{prefix}[calculator_attributes][preferred_#{key}]", | ||
value: calculator.get_preference(key), label: t(key.to_s, scope: 'spree') %> | ||
<% calculator.admin_form_preference_names.map do |name| %> | ||
<%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(name)}", | ||
name: "#{prefix}[calculator_attributes][preferred_#{name}]", | ||
value: calculator.get_preference(name), | ||
label: t(name.to_s, scope: 'spree', default: name.to_s.humanize) %> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters