solidus_backend 4.3.5 → 4.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend/namespaces.js +0 -1
- data/app/assets/javascripts/spree/backend/templates/index.js +0 -3
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js +11 -8
- data/app/assets/javascripts/spree/backend/views/cart/empty_cart_button.js +1 -1
- data/app/assets/javascripts/spree/backend/views/index.js +0 -2
- data/app/assets/javascripts/spree/backend/views/order/details_adjustments.js +1 -2
- data/app/assets/javascripts/spree/backend.js +0 -2
- data/app/assets/stylesheets/spree/backend/sections/_adjustments.scss +0 -3
- data/app/assets/stylesheets/spree/backend/sections/index.scss +0 -1
- data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
- data/app/controllers/spree/admin/dashboards_controller.rb +4 -0
- data/app/controllers/spree/admin/option_types_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/resource_controller.rb +1 -1
- data/app/helpers/spree/admin/base_helper.rb +2 -2
- data/app/helpers/spree/admin/navigation_helper.rb +1 -1
- data/app/views/spree/admin/adjustments/_adjustment.html.erb +0 -1
- data/app/views/spree/admin/dashboards/home.html.erb +1 -0
- data/app/views/spree/admin/orders/_adjustments.html.erb +1 -1
- data/app/views/spree/admin/orders/_order_details.html.erb +3 -3
- data/app/views/spree/admin/orders/confirm.html.erb +3 -3
- data/app/views/spree/admin/orders/index.html.erb +4 -82
- data/app/views/spree/admin/products/index.html.erb +2 -2
- data/app/views/spree/admin/shared/_locale_selection_solidus_admin.html.erb +1 -1
- data/app/views/spree/admin/shared/search_fields/_checkbox.html.erb +8 -0
- data/app/views/spree/admin/shared/search_fields/_date_range_picker.html.erb +16 -0
- data/app/views/spree/admin/shared/search_fields/_select.html.erb +6 -0
- data/app/views/spree/admin/shared/search_fields/_text_field.html.erb +6 -0
- data/app/views/spree/admin/shared/search_fields/_variant_autocomplete.html.erb +6 -0
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/users/index.html.erb +1 -1
- data/app/views/spree/admin/users/items.html.erb +3 -3
- data/app/views/spree/admin/users/orders.html.erb +3 -3
- data/app/views/spree/admin/variants/_form.html.erb +1 -1
- data/app/views/spree/admin/zones/index.html.erb +1 -1
- data/config/routes.rb +0 -11
- data/lib/spree/backend_configuration.rb +83 -18
- data/solidus_backend.gemspec +2 -2
- metadata +13 -73
- data/app/assets/javascripts/spree/backend/promotions/activation.js +0 -26
- data/app/assets/javascripts/spree/backend/promotions.js +0 -35
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +0 -23
- data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +0 -23
- data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +0 -12
- data/app/assets/javascripts/spree/backend/views/calculators/tiered.js +0 -54
- data/app/assets/javascripts/spree/backend/views/promotions/option_values_rule.js +0 -79
- data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +0 -138
- data/app/controllers/spree/admin/promotion_actions_controller.rb +0 -51
- data/app/controllers/spree/admin/promotion_categories_controller.rb +0 -8
- data/app/controllers/spree/admin/promotion_code_batches_controller.rb +0 -30
- data/app/controllers/spree/admin/promotion_codes_controller.rb +0 -48
- data/app/controllers/spree/admin/promotion_rules_controller.rb +0 -60
- data/app/controllers/spree/admin/promotions_controller.rb +0 -67
- data/app/helpers/spree/admin/promotions_helper.rb +0 -15
- data/app/helpers/spree/promotion_rules_helper.rb +0 -12
- data/app/views/spree/admin/promotion_actions/create.js.erb +0 -10
- data/app/views/spree/admin/promotion_actions/destroy.js.erb +0 -1
- data/app/views/spree/admin/promotion_categories/_form.html.erb +0 -14
- data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -10
- data/app/views/spree/admin/promotion_categories/index.html.erb +0 -47
- data/app/views/spree/admin/promotion_categories/new.html.erb +0 -10
- data/app/views/spree/admin/promotion_code_batches/_form_fields.html.erb +0 -22
- data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +0 -8
- data/app/views/spree/admin/promotion_code_batches/index.html.erb +0 -65
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +0 -8
- data/app/views/spree/admin/promotion_codes/index.csv.ruby +0 -8
- data/app/views/spree/admin/promotion_codes/index.html.erb +0 -32
- data/app/views/spree/admin/promotion_codes/new.html.erb +0 -31
- data/app/views/spree/admin/promotion_rules/create.js.erb +0 -8
- data/app/views/spree/admin/promotion_rules/destroy.js.erb +0 -3
- data/app/views/spree/admin/promotions/_actions.html.erb +0 -37
- data/app/views/spree/admin/promotions/_activations_edit.html.erb +0 -22
- data/app/views/spree/admin/promotions/_activations_new.html.erb +0 -43
- data/app/views/spree/admin/promotions/_form.html.erb +0 -67
- data/app/views/spree/admin/promotions/_promotion_action.html.erb +0 -13
- data/app/views/spree/admin/promotions/_promotion_rule.html.erb +0 -12
- data/app/views/spree/admin/promotions/_rules.html.erb +0 -42
- data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +0 -2
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +0 -6
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +0 -10
- data/app/views/spree/admin/promotions/actions/_free_shipping.html.erb +0 -0
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +0 -29
- data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +0 -6
- data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +0 -56
- data/app/views/spree/admin/promotions/calculators/flat_rate/_fields.html.erb +0 -6
- data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +0 -30
- data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +0 -30
- data/app/views/spree/admin/promotions/edit.html.erb +0 -35
- data/app/views/spree/admin/promotions/index.html.erb +0 -124
- data/app/views/spree/admin/promotions/new.html.erb +0 -9
- data/app/views/spree/admin/promotions/rules/_first_order.html.erb +0 -0
- data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +0 -13
- data/app/views/spree/admin/promotions/rules/_item_total.html.erb +0 -14
- data/app/views/spree/admin/promotions/rules/_minimum_quantity.html.erb +0 -5
- data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +0 -12
- data/app/views/spree/admin/promotions/rules/_one_use_per_user.html.erb +0 -0
- data/app/views/spree/admin/promotions/rules/_option_value.html.erb +0 -13
- data/app/views/spree/admin/promotions/rules/_product.html.erb +0 -15
- data/app/views/spree/admin/promotions/rules/_store.html.erb +0 -6
- data/app/views/spree/admin/promotions/rules/_taxon.html.erb +0 -9
- data/app/views/spree/admin/promotions/rules/_user.html.erb +0 -4
- data/app/views/spree/admin/promotions/rules/_user_logged_in.html.erb +0 -0
- data/app/views/spree/admin/promotions/rules/_user_role.html.erb +0 -12
- data/bin/rails +0 -13
@@ -1,124 +0,0 @@
|
|
1
|
-
<% admin_breadcrumb(plural_resource_name(Spree::Promotion)) %>
|
2
|
-
|
3
|
-
<% content_for :page_actions do %>
|
4
|
-
<% if can? :create, Spree::Promotion %>
|
5
|
-
<li>
|
6
|
-
<%= link_to t('spree.new_promotion'), spree.new_admin_promotion_path, class: 'btn btn-primary' %>
|
7
|
-
</li>
|
8
|
-
<% end %>
|
9
|
-
<% end %>
|
10
|
-
|
11
|
-
<% content_for :table_filter_title do %>
|
12
|
-
<%= t('spree.search') %>
|
13
|
-
<% end %>
|
14
|
-
|
15
|
-
<% content_for :table_filter do %>
|
16
|
-
<div data-hook="admin_promotions_index_search">
|
17
|
-
<%= search_form_for [:admin, @search] do |f| %>
|
18
|
-
<div class="row">
|
19
|
-
<div class="col-4">
|
20
|
-
<div class="field">
|
21
|
-
<%= label_tag :q_name_cont, Spree::Promotion.human_attribute_name(:name) %>
|
22
|
-
<%= f.text_field :name_cont, tabindex: 1 %>
|
23
|
-
</div>
|
24
|
-
</div>
|
25
|
-
|
26
|
-
<div class="col-2">
|
27
|
-
<div class="field">
|
28
|
-
<%= label_tag :q_codes_value_cont, Spree::Promotion.human_attribute_name(:code) %>
|
29
|
-
<%= f.text_field :codes_value_cont, tabindex: 1 %>
|
30
|
-
</div>
|
31
|
-
</div>
|
32
|
-
|
33
|
-
<div class="col-2">
|
34
|
-
<div class="field">
|
35
|
-
<%= label_tag :q_path_cont, Spree::Promotion.human_attribute_name(:path) %>
|
36
|
-
<%= f.text_field :path_cont, tabindex: 1 %>
|
37
|
-
</div>
|
38
|
-
</div>
|
39
|
-
|
40
|
-
<div class="col-2">
|
41
|
-
<div class="field">
|
42
|
-
<%= label_tag :q_promotion_category_id_eq, Spree::PromotionCategory.model_name.human %><br>
|
43
|
-
<%= f.collection_select(:promotion_category_id_eq, @promotion_categories, :id, :name, { include_blank: t('spree.match_choices.all') }, { class: 'custom-select fullwidth' }) %>
|
44
|
-
</div>
|
45
|
-
</div>
|
46
|
-
|
47
|
-
<div class="col-2">
|
48
|
-
<div class="field">
|
49
|
-
<%= label_tag :active, t('spree.active') %><br>
|
50
|
-
<%= f.check_box :active, label: false, as: :boolean, checked_value: true %>
|
51
|
-
</div>
|
52
|
-
</div>
|
53
|
-
</div>
|
54
|
-
|
55
|
-
<div class="clearfix"></div>
|
56
|
-
|
57
|
-
<div class="actions filter-actions">
|
58
|
-
<div data-hook="admin_promotions_index_search_buttons">
|
59
|
-
<%= button_tag t('spree.filter_results'), class: 'btn btn-primary' %>
|
60
|
-
</div>
|
61
|
-
</div>
|
62
|
-
<% end %>
|
63
|
-
</div>
|
64
|
-
<% end %>
|
65
|
-
|
66
|
-
<%= paginate @promotions, theme: "solidus_admin" %>
|
67
|
-
|
68
|
-
<% if @promotions.length > 0 %>
|
69
|
-
<table class="index">
|
70
|
-
<thead>
|
71
|
-
<tr>
|
72
|
-
<th><%= Spree::Promotion.human_attribute_name(:name) %></th>
|
73
|
-
<th><%= Spree::Promotion.human_attribute_name(:code) %></th>
|
74
|
-
<th><%= Spree::Promotion.human_attribute_name(:status) %></th>
|
75
|
-
<th><%= Spree::Promotion.human_attribute_name(:usage_limit) %></th>
|
76
|
-
<th><%= Spree::Promotion.human_attribute_name(:uses) %></th>
|
77
|
-
<th><%= Spree::Promotion.human_attribute_name(:starts_at) %></th>
|
78
|
-
<th><%= Spree::Promotion.human_attribute_name(:expires_at) %></th>
|
79
|
-
<th class="actions"></th>
|
80
|
-
</tr>
|
81
|
-
</thead>
|
82
|
-
<tbody>
|
83
|
-
<% @promotions.each do |promotion| %>
|
84
|
-
<tr id="<%= spree_dom_id promotion %>">
|
85
|
-
<td><%= promotion.name %></td>
|
86
|
-
<td>
|
87
|
-
<%= (promotion.codes.size == 1) ? promotion.codes.pluck(:value).first : t('spree.number_of_codes', count: promotion.codes.size) %>
|
88
|
-
</td>
|
89
|
-
<td>
|
90
|
-
<span class="pill pill-<%= promotion.active? ? 'active' : 'inactive' %>">
|
91
|
-
<%= t(admin_promotion_status(promotion), scope: 'spree.admin.promotion_status') %>
|
92
|
-
</span>
|
93
|
-
</td>
|
94
|
-
<td>
|
95
|
-
<%= promotion.usage_limit.nil? ? "∞" : promotion.usage_limit %>
|
96
|
-
</td>
|
97
|
-
<td>
|
98
|
-
<%= promotion.usage_count %>
|
99
|
-
</td>
|
100
|
-
<td>
|
101
|
-
<%= promotion.starts_at.to_fs(:long) if promotion.starts_at %>
|
102
|
-
</td>
|
103
|
-
<td>
|
104
|
-
<%= promotion.expires_at.to_fs(:long) if promotion.expires_at %>
|
105
|
-
</td>
|
106
|
-
<td class="actions">
|
107
|
-
<% if can?(:edit, promotion) %>
|
108
|
-
<%= link_to_edit promotion, no_text: true %>
|
109
|
-
<% end %>
|
110
|
-
<% if can?(:destroy, promotion) %>
|
111
|
-
<%= link_to_delete promotion, no_text: true %>
|
112
|
-
<% end %>
|
113
|
-
</td>
|
114
|
-
</tr>
|
115
|
-
<% end %>
|
116
|
-
</tbody>
|
117
|
-
</table>
|
118
|
-
<% else %>
|
119
|
-
<div class="no-objects-found">
|
120
|
-
<%= render 'spree/admin/shared/no_objects_found',
|
121
|
-
resource: Spree::Promotion,
|
122
|
-
new_resource_url: new_object_url %>
|
123
|
-
</div>
|
124
|
-
<% end %>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<% admin_layout "full-width" %>
|
2
|
-
|
3
|
-
<% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path) %>
|
4
|
-
<% admin_breadcrumb(t('spree.new_promotion')) %>
|
5
|
-
|
6
|
-
<%= form_for @promotion, url: collection_url do |f| %>
|
7
|
-
<%= render partial: 'form', locals: { f: f } %>
|
8
|
-
<%= render partial: 'spree/admin/shared/new_resource_links' %>
|
9
|
-
<% end %>
|
File without changes
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
<div class="col-6">
|
3
|
-
<div class="field">
|
4
|
-
<%= Spree::Promotion::Rules::FirstRepeatPurchaseSince.human_attribute_name(:form_text) %>
|
5
|
-
</div>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<div class="col-6">
|
9
|
-
<div class="field">
|
10
|
-
<%= number_field_tag "#{param_prefix}[preferred_days_ago]", promotion_rule.preferred_days_ago, class: 'fullwidth' %>
|
11
|
-
</div>
|
12
|
-
</div>
|
13
|
-
</div>
|
@@ -1,14 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
<div class="col-6">
|
3
|
-
<div class="field">
|
4
|
-
<%= select_tag "#{param_prefix}[preferred_operator]", options_for_select(promotion_rule.class.operator_options, promotion_rule.preferred_operator), {class: 'custom-select select_item_total fullwidth'} %>
|
5
|
-
</div>
|
6
|
-
</div>
|
7
|
-
<div class="col-6">
|
8
|
-
<div class="field">
|
9
|
-
<%= fields_for param_prefix, promotion_rule do |f| %>
|
10
|
-
<%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :preferred_amount, currency_attr: :preferred_currency %>
|
11
|
-
<% end %>
|
12
|
-
</div>
|
13
|
-
</div>
|
14
|
-
</div>
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
<div class="col-6">
|
3
|
-
<div class="field">
|
4
|
-
<%= Spree::Promotion::Rules::NthOrder.human_attribute_name(:form_text) %>
|
5
|
-
</div>
|
6
|
-
</div>
|
7
|
-
<div class="col-6">
|
8
|
-
<div class="field">
|
9
|
-
<%= number_field_tag "#{param_prefix}[preferred_nth_order]", promotion_rule.preferred_nth_order, class: 'fullwidth' %>
|
10
|
-
</div>
|
11
|
-
</div>
|
12
|
-
</div>
|
File without changes
|
@@ -1,13 +0,0 @@
|
|
1
|
-
<div class="field promo-rule-option-values">
|
2
|
-
<div class="param-prefix hidden" data-param-prefix="<%= param_prefix %>"></div>
|
3
|
-
<div class="row">
|
4
|
-
<div class="col-6"><%= label_tag nil, Spree::Product.model_name.human %></div>
|
5
|
-
<div class="col-6"><%= label_tag nil, plural_resource_name(Spree::OptionValue) %></div>
|
6
|
-
</div>
|
7
|
-
|
8
|
-
<%= content_tag :div, nil, class: "js-promo-rule-option-values",
|
9
|
-
data: { :'original-option-values' => promotion_rule.preferred_eligible_values } %>
|
10
|
-
|
11
|
-
<button class="button js-add-promo-rule-option-value"><%= t('spree.actions.add') %></button>
|
12
|
-
|
13
|
-
</div>
|
@@ -1,15 +0,0 @@
|
|
1
|
-
<div class="row">
|
2
|
-
<div class="col-12">
|
3
|
-
<div class="field products_rule_products">
|
4
|
-
<%= label_tag "#{param_prefix}_product_ids_string", t('spree.product_rule.choose_products') %>
|
5
|
-
<%= hidden_field_tag "#{param_prefix}[product_ids_string]", promotion_rule.product_ids.join(","), class: "product_picker fullwidth" %>
|
6
|
-
</div>
|
7
|
-
</div>
|
8
|
-
<div class="col-12">
|
9
|
-
<div class="field">
|
10
|
-
<label>
|
11
|
-
<%= 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 %>
|
12
|
-
</label>
|
13
|
-
</div>
|
14
|
-
</div>
|
15
|
-
</div>
|
@@ -1,6 +0,0 @@
|
|
1
|
-
<div class="field">
|
2
|
-
<label><%= t("spree.store_rule.choose_stores" ) %></label>
|
3
|
-
<%= select_tag "#{param_prefix}[store_ids][]",
|
4
|
-
options_from_collection_for_select(Spree::Store.all, :id, :name, promotion_rule.store_ids),
|
5
|
-
multiple: true, class: "select2 fullwidth" %>
|
6
|
-
</div>
|
@@ -1,9 +0,0 @@
|
|
1
|
-
<div class="field taxons_rule_taxons">
|
2
|
-
<%= label_tag "#{param_prefix}_taxon_ids_string", t('spree.taxon_rule.choose_taxons') %>
|
3
|
-
<%= hidden_field_tag "#{param_prefix}[taxon_ids_string]", promotion_rule.taxon_ids.join(","), class: "taxon_picker fullwidth", id: 'product_taxon_ids' %>
|
4
|
-
</div>
|
5
|
-
<div class="field">
|
6
|
-
<label>
|
7
|
-
<%= 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 %>
|
8
|
-
</label>
|
9
|
-
</div>
|
File without changes
|
@@ -1,12 +0,0 @@
|
|
1
|
-
<div class="form-group">
|
2
|
-
<%= label_tag "#{param_prefix}_preferred_role_ids", t('spree.user_role_rule.choose_roles') %>
|
3
|
-
<%= select_tag "#{param_prefix}[preferred_role_ids]",
|
4
|
-
options_from_collection_for_select(
|
5
|
-
Spree::Role.all, :id, :name, promotion_rule.preferred_role_ids
|
6
|
-
), class: 'select2 fullwidth', multiple: true %>
|
7
|
-
</div>
|
8
|
-
<div class="form-group">
|
9
|
-
<label>
|
10
|
-
<%= 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 %>
|
11
|
-
</label>
|
12
|
-
</div>
|
data/bin/rails
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
# This command will automatically be run when you run "rails" with Rails gems
|
3
|
-
# installed from the root of your application.
|
4
|
-
|
5
|
-
ENGINE_ROOT = File.expand_path('..', __dir__)
|
6
|
-
ENGINE_PATH = File.expand_path('../lib/spree/backend/engine', __dir__)
|
7
|
-
|
8
|
-
# Set up gems listed in the Gemfile.
|
9
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __dir__)
|
10
|
-
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"])
|
11
|
-
|
12
|
-
require "rails/all"
|
13
|
-
require "rails/engine/commands"
|