Sha256: d2ed3c770dc335dea31fc7f722505d838178ea6c1fb6e30b99bab42f4fd71a32

Contents?: true

Size: 1.09 KB

Versions: 5

Compression:

Stored size: 1.09 KB

Contents

<fieldset id="calculator_fields" class="js-calculator-fields no-border-bottom">
  <legend align="center"><%= Spree::Calculator.model_name.human %></legend>

  <div id="preference-settings">
    <div class="field">
      <%= f.label(:calculator_type, Spree::Calculator.model_name.human) %>
      <%= f.select(:calculator_type, @calculators.map { |c| [c.description, c.name] }, {}, {class: 'custom-select fullwidth js-calculator-type'}) %>
    </div>

    <% @calculators.each do |calculator_class| %>
      <% calculator = f.object.calculator.class == calculator_class ? f.object.calculator : calculator_class.new %>
      <div class="js-calculator-preferences" data-calculator-type="<%= calculator_class %>">
        <%= f.fields_for :calculator, calculator do |calculator_form| %>
          <% calculator.preferences.keys.each do |key| %>
            <%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(key)}",
               form: calculator_form, attribute: "preferred_#{key}", label: Spree.t(key) %>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
</fieldset>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_backend-2.4.2 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-2.4.1 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-2.4.0 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-2.4.0.rc1 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-2.4.0.beta1 app/views/spree/admin/shared/_calculator_fields.html.erb