Skip to content

Commit

Permalink
Change references to legacy promotion system in views
Browse files Browse the repository at this point in the history
There were many references to the promotion system in solidus core in
our views folder still. This commit changes them.
  • Loading branch information
mamhoff committed Oct 6, 2023
1 parent 4707c9b commit 20923b0
Show file tree
Hide file tree
Showing 15 changed files with 33 additions and 33 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(Spree::PromotionCategory), solidus_friendly_promotions.admin_promotion_categories_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::PromotionCategory), solidus_friendly_promotions.admin_promotion_categories_path) %>
<% admin_breadcrumb(@promotion_category.name) %>

<%= form_for @promotion_category, url: object_url, method: :put do |f| %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(Spree::PromotionCategory), solidus_friendly_promotions.admin_promotion_categories_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::PromotionCategory), solidus_friendly_promotions.admin_promotion_categories_path) %>
<% admin_breadcrumb(t('spree.new_promotion_category')) %>

<%= form_for :promotion_category, url: collection_url do |f| %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<% admin_breadcrumb link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path %>
<% admin_breadcrumb link_to(@promotion.name, spree.edit_admin_promotion_path(@promotion)) %>
<% admin_breadcrumb plural_resource_name(Spree::PromotionCode) %>
<% admin_breadcrumb link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path %>
<% admin_breadcrumb link_to(@promotion.name, solidus_friendly_promotions.edit_admin_promotion_path(@promotion)) %>
<% admin_breadcrumb plural_resource_name(SolidusFriendlyPromotions::PromotionCode) %>

<% content_for :page_actions do %>
<li>
<% if can?(:create, Spree::PromotionCode) && !@promotion.apply_automatically? %>
<%= link_to t('spree.create_promotion_code'), new_admin_promotion_promotion_code_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
<% if can?(:create, SolidusFriendlyPromotions::PromotionCode) && !@promotion.apply_automatically? %>
<%= link_to t('spree.create_promotion_code'), solidus_friendly_promotions.new_admin_promotion_promotion_code_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
<% end %>

<%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
<%= link_to t('spree.download_promotion_codes_list'), solidus_friendly_promotions.admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
</li>
<% end %>

Expand All @@ -18,7 +18,7 @@

<table>
<thead>
<th><%= Spree::PromotionCode.human_attribute_name :value %></th>
<th><%= SolidusFriendlyPromotions::PromotionCode.human_attribute_name :value %></th>
</thead>
<tbody>
<% @promotion_codes.each do |promotion_code| %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% admin_breadcrumb link_to plural_resource_name(Spree::Promotion), solidus_friendly_promotions.admin_promotions_path %>
<% admin_breadcrumb link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path %>
<% admin_breadcrumb link_to(@promotion.name, solidus_friendly_promotions.edit_admin_promotion_path(@promotion)) %>
<% admin_breadcrumb plural_resource_name(Spree::PromotionCode) %>
<% admin_breadcrumb plural_resource_name(SolidusFriendlyPromotions::PromotionCode) %>

<% content_for :page_actions do %>
<li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= form_with model: promotion_rule, scope: :promotion_rule, url: solidus_friendly_promotions.admin_promotion_promotion_rule_path(@promotion, promotion_rule), method: :patch do |form| %>
<h6 class='promotion-title'><%= promotion_rule.class.model_name.human %></h6>
<% if can?(:destroy, promotion_rule) %>
<%= link_to_with_icon 'trash', '', spree.admin_promotion_promotion_rule_path(@promotion, promotion_rule), method: :delete, class: 'delete' %>
<%= link_to_with_icon 'trash', '', solidus_friendly_promotions.admin_promotion_promotion_rule_path(@promotion, promotion_rule), method: :delete, class: 'delete' %>
<% end %>
<p>
<%= promotion_rule.class.human_attribute_name(:description) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%= turbo_frame_tag @promotion, "new_#{@level}_promotion_rule" do %>
<div class="promotion_rule promotion-block">
<h6 class='promotion-title'> <%= t(:add_rule, scope: :solidus_friendly_promotions) %></h6>
<%= link_to_with_icon 'trash', '', spree.edit_admin_promotion_path(@promotion), class: 'delete' %>
<%= link_to_with_icon 'trash', '', solidus_friendly_promotions.edit_admin_promotion_path(@promotion), class: 'delete' %>
<%= render 'type_select', level: @level %>
<% flash.each do |severity, message| %>
<%= content_tag(:div, "", data: { controller: :flash, severity: severity, message: message }) %>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-6">
<div class="field">
<%= Spree::Promotion::Rules::FirstRepeatPurchaseSince.human_attribute_name(:form_text) %>
<%= SolidusFriendlyPromotions::Rules::FirstRepeatPurchaseSince.human_attribute_name(:form_text) %>
</div>
</div>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="row">
<div class="col-6">
<div class="field">
<%= Spree::Promotion::Rules::NthOrder.human_attribute_name(:form_text) %>
<%= SolidusFriendlyPromotions::Rules::NthOrder.human_attribute_name(:form_text) %>
</div>
</div>
<div class="col-6">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<div class="col-12">
<div class="field">
<label>
<%= t('spree.product_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(Spree::Promotion::Rules::Product::MATCH_POLICIES.map{|s| [t("spree.product_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_product custom-select'})).html_safe %>
<%= t('spree.product_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(SolidusFriendlyPromotions::Rules::Product::MATCH_POLICIES.map{|s| [t("spree.product_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_product custom-select'})).html_safe %>
</label>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
</div>
<div class="field">
<label>
<%= t('spree.taxon_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(Spree::Promotion::Rules::Taxon::MATCH_POLICIES.map{|s| [t("spree.taxon_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_taxon custom-select'})).html_safe %>
<%= t('spree.taxon_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(SolidusFriendlyPromotions::Rules::Taxon::MATCH_POLICIES.map{|s| [t("spree.taxon_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), {class: 'select_taxon custom-select'})).html_safe %>
</label>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
</div>
<div class="form-group">
<label>
<%= t('spree.user_role_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(Spree::Promotion::Rules::UserRole::MATCH_POLICIES.map{ |s| [t("spree.user_role_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), { class: 'custom-select'})).html_safe %>
<%= t('spree.user_role_rule.label', select: select_tag("#{param_prefix}[preferred_match_policy]", options_for_select(SolidusFriendlyPromotions::Rules::UserRole::MATCH_POLICIES.map{ |s| [t("spree.user_role_rule.match_#{s}"),s] }, promotion_rule.preferred_match_policy), { class: 'custom-select'})).html_safe %>
</label>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<div data-activation-type="single_code">
<div class="field">
<%= label_tag :single_code, Spree::PromotionCode.model_name.human, class: "required" %>
<%= label_tag :single_code, SolidusFriendlyPromotions::PromotionCode.model_name.human, class: "required" %>
<%= text_field_tag :single_code, @promotion.codes.first.try!(:value), class: "fullwidth", required: true %>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% admin_layout "full-width" %>

<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(@promotion.name) %>

<%= content_for :head do %>
Expand All @@ -9,14 +9,14 @@

<% content_for :page_actions do %>
<li>
<% if can?(:show, Spree::PromotionCode) %>
<% if can?(:show, SolidusFriendlyPromotions::PromotionCode) %>
<%= link_to t('solidus_friendly_promotions.view_promotion_codes_list'), solidus_friendly_promotions.admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>

<%= link_to t('solidus_friendly_promotions.download_promotion_codes_list'), solidus_friendly_promotions.admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
<% end %>

<% if can?(:show, Spree::PromotionCodeBatch) %>
<%= link_to plural_resource_name(Spree::PromotionCodeBatch), solidus_friendly_promotions.admin_promotion_promotion_code_batches_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
<% if can?(:show, SolidusFriendlyPromotions::PromotionCodeBatch) %>
<%= link_to plural_resource_name(SolidusFriendlyPromotions::PromotionCodeBatch), solidus_friendly_promotions.admin_promotion_promotion_code_batches_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
<% end %>
</li>
<% end %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,13 @@
<table class="index">
<thead>
<tr>
<th><%= Spree::Promotion.human_attribute_name(:name) %></th>
<th><%= Spree::Promotion.human_attribute_name(:code) %></th>
<th><%= Spree::Promotion.human_attribute_name(:status) %></th>
<th><%= Spree::Promotion.human_attribute_name(:usage_limit) %></th>
<th><%= Spree::Promotion.human_attribute_name(:uses) %></th>
<th><%= Spree::Promotion.human_attribute_name(:starts_at) %></th>
<th><%= Spree::Promotion.human_attribute_name(:expires_at) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:name) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:code) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:status) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:usage_limit) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:uses) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:starts_at) %></th>
<th><%= SolidusFriendlyPromotions::Promotion.human_attribute_name(:expires_at) %></th>
<th class="actions"></th>
</tr>
</thead>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<% admin_layout "full-width" %>

<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(link_to plural_resource_name(SolidusFriendlyPromotions::Promotion), solidus_friendly_promotions.admin_promotions_path) %>
<% admin_breadcrumb(t('solidus_friendly_promotions.new_promotion')) %>

<%= form_for @promotion, url: collection_url do |f| %>
Expand Down

0 comments on commit 20923b0

Please sign in to comment.