Sha256: ea4d34917a97c0683b81ed62c541cd43731b0f111d9b91ea24d3f43173782182

Contents?: true

Size: 1.45 KB

Versions: 5

Compression:

Stored size: 1.45 KB

Contents

<div class="col-12">
  <div class="calculator-fields js-calculator-fields row">

    <div class="col-6">
      <div class="field">
        <% field_name = "#{param_prefix}[calculator_type]" %>
        <%= label_tag field_name, Spree::Calculator.model_name.human %>
        <%= select_tag field_name,
                      options_from_collection_for_select(calculators, :to_s, :description, promotion_action.calculator.type),
                      class: 'type-select js-calculator-type select2 fullwidth' %>
      </div>
    </div>

    <div class="col-6">
      <div class="settings field">
        <% calculators.each do |calculator_class| %>
          <% calculator = promotion_action.calculator.class == calculator_class ? promotion_action.calculator : calculator_class.new %>
          <div class="js-calculator-preferences" data-calculator-type="<%= calculator_class %>">
            <% type_name = calculator.type.demodulize.underscore %>
            <% if lookup_context.exists?("fields",
                ["spree/admin/promotions/calculators/#{type_name}"], true) %>
              <%= render "spree/admin/promotions/calculators/#{type_name}/fields",
                calculator: calculator, prefix: param_prefix %>
            <% else %>
              <%= render "spree/admin/promotions/calculators/default_fields",
                calculator: calculator, prefix: param_prefix %>
            <% end %>
          </div>
        <% end %>
      </div>
    </div>
  </div>
</div>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_backend-2.2.2 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.2.1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.2.0 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.2.0.rc1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.2.0.beta1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb