Sha256: 1e5ef5e9433f2e2518866c67c457486c84dde3054dd2eff50d3b6b9eea41d4df

Contents?: true

Size: 1.49 KB

Versions: 4

Compression:

Stored size: 1.49 KB

Contents

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

    <div class="col-xs-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 select2 fullwidth' %>
        <% if promotion_action.calculator.respond_to?(:preferences) %>
          <span class="warning info"><%= Spree.t(:calculator_settings_warning) %></span>
        <% end %>
      </div>
    </div>

    <% unless promotion_action.new_record? %>
      <div class="col-xs-6">
        <div class="settings field">
          <% type_name = promotion_action.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: promotion_action.calculator, prefix: param_prefix %>
          <% else %>
            <%= render "spree/admin/promotions/calculators/default_fields",
              calculator: promotion_action.calculator, prefix: param_prefix %>
          <% end %>
          <%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
        </div>
      </div>
    <% end %>
  </div>
</div>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
solidus_backend-2.1.1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.1.0 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.1.0.rc1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb
solidus_backend-2.1.0.beta1 app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb