Sha256: c492e51ff58cc9577832ba9071c5eb733dbce4039bf90e3fdb085748cf759c42

Contents?: true

Size: 1.31 KB

Versions: 89

Compression:

Stored size: 1.31 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) %>

      <% if local_assigns.has_key? :hint %>
        <%= admin_hint t("spree.#{hint}"), t(hint, scope: [:spree, :hints, "spree/calculator"]) %>
      <% end %>

      <%= 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.admin_form_preference_names.each do |name| %>
            <%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(name)}",
              form: calculator_form, attribute: "preferred_#{name}",
              label: t(name, scope: 'spree', default: name.to_s.humanize) %>
          <% end %>
        <% end %>
      </div>
    <% end %>
  </div>
</fieldset>

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
solidus_backend-4.4.1 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.4.0 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.3.4 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.2.4 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.1.5 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.3.3 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.3.2 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.1.4 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.3.1 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.3.0 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.2.3 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.1.3 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.0.4 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-3.4.6 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.0.3 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.1.2 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.2.2 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-3.4.5 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.2.1 app/views/spree/admin/shared/_calculator_fields.html.erb
solidus_backend-4.2.0 app/views/spree/admin/shared/_calculator_fields.html.erb