Sha256: 09af941bd94eae67dd1e0a45a29887e84f714638dc3346f33dbe884448e0803f

Contents?: true

Size: 1.66 KB

Versions: 5

Compression:

Stored size: 1.66 KB

Contents

<% context = local_assigns[:context] || :order %>

<% if context == :order %>
  <p>
    <%= promotion_rule.class.human_attribute_name(:description) %>
  </p>
  <%= fields_for param_prefix, promotion_rule do |form| %>
    <div class="field taxons_rule_taxons">
      <%= form.label :taxon_ids_string, t('solidus_friendly_promotions.taxon_rule.choose_taxons') %>
      <%= form.hidden_field :taxon_ids_string, value: promotion_rule.taxon_ids.join(","), class: "taxon_picker fullwidth" %>
    </div>

    <div class="field">
      <%
        match_policy_options = options_for_select(
          SolidusFriendlyPromotions::Rules::Taxon::MATCH_POLICIES.map { |s| [t("solidus_friendly_promotions.taxon_rule.match_#{s}"),s] },
          promotion_rule.preferred_match_policy
        )
      %>
      <% select = form.select :preferred_match_policy, match_policy_options %>
      <%= form.label :preferred_match_policy, t('solidus_friendly_promotions.taxon_rule.label', select: select).html_safe %>
      </label>
    </div>

    <div class="field">
      <%= form.label :preferred_line_item_applicable do %>
        <%= form.check_box :preferred_line_item_applicable %>
        <%= promotion_rule.class.human_attribute_name(:preferred_line_item_applicable) %>
      <% end %>
    </div>
  <% end %>
<% else %>
  <p>
    <% match_policy_translation_key = promotion_rule.preferred_match_policy == "none" ? :exclude : :include %>
    <%= t(match_policy_translation_key, scope: [:solidus_friendly_promotions, :promotion_rules, :line_item_taxon, :match_policies]) %>
  </p>
  <ul>
    <% promotion_rule.taxons.each do |taxon| %>
      <li>
        <%= taxon.name %>
      </li>
    <% end %>
  </ul>
<% end %>

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_friendly_promotions-1.0.0 app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb
solidus_friendly_promotions-1.0.0.rc.3 app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb
solidus_friendly_promotions-1.0.0.rc.2 app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb
solidus_friendly_promotions-1.0.0.rc.1 app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb
solidus_friendly_promotions-1.0.0.pre app/views/solidus_friendly_promotions/admin/promotion_rules/rules/_taxon.html.erb