Sha256: 74f6f30404a7b3892de7d054f266221c171c351b7f184159e3302a593dd916c9

Contents?: true

Size: 1.5 KB

Versions: 3

Compression:

Stored size: 1.5 KB

Contents

<%= render "spree/admin/shared/preference_fields/#{calculator.preference_type(:base_amount)}",
  name: "#{prefix}[calculator_attributes][preferred_base_amount]",
  value: calculator.preferred_base_amount,
  label: calculator.class.human_attribute_name(:preferred_base_amount) %>

<div class="field">
  <%= label_tag(
    "#{prefix}[calculator_attributes][preferred_currency]",
    t('spree.currency')
  ) %>
  <%= select_tag(
    "#{prefix}[calculator_attributes][preferred_currency]",
    options_for_select(
      Spree::Config.available_currencies,
      calculator.preferred_currency || Spree::Config[:currency]
    ),
    { class: 'custom-select fullwidth' }
  ) %>
</div>

<div class="field">
  <%= label_tag nil, calculator.class.human_attribute_name(:tiers) %>
  <div data-controller="calculator-tiers">
    <template data-calculator-tiers-target="template">
      <%= render "solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/tier_fields", tier: [nil, nil], form: form %>
    </template>
    <% form.object.calculator.preferred_tiers.each do |tier| %>
      <%= render "solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/tier_fields", tier: tier, form: form %>
    <% end %>
    <div class="mb-3" data-calculator-tiers-target="links">
      <%= link_to t(:add_tier, scope: [:solidus_friendly_promotions, :admin, :promotions, :calculator]), "#", class: "btn btn-outline-primary", data: { action: "click->calculator-tiers#add_association" } %>
    </div>
  </div>
</div>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.0.0 app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/_fields.html.erb
solidus_friendly_promotions-1.0.0.rc.3 app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/_fields.html.erb
solidus_friendly_promotions-1.0.0.rc.2 app/views/solidus_friendly_promotions/admin/promotion_actions/calculators/tiered_flat_rate/_fields.html.erb