solidus_backend 2.9.5 → 2.10.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/spree/backend.js +1 -0
- data/app/assets/javascripts/spree/backend/components/admin_nav.js +24 -0
- data/app/assets/javascripts/spree/backend/components/tabs.js +1 -1
- data/app/assets/javascripts/spree/backend/models/order.js +9 -0
- data/app/assets/javascripts/spree/backend/orders/cart.js +6 -0
- data/app/assets/javascripts/spree/backend/shipments.js +0 -62
- data/app/assets/javascripts/spree/backend/templates/index.js +0 -1
- data/app/assets/javascripts/spree/backend/views/cart/empty_cart_button.js +29 -0
- data/app/assets/javascripts/spree/backend/views/cart/line_item_table.js +5 -0
- data/app/assets/javascripts/spree/backend/views/index.js +1 -0
- data/app/assets/javascripts/spree/backend/views/order/address.js +7 -5
- data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +2 -0
- data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +3 -3
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +4 -0
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +182 -49
- data/app/assets/stylesheets/spree/backend/globals/{_mixins.css → _mixins.scss} +0 -0
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +2 -0
- data/app/assets/stylesheets/spree/backend/shared/_header.scss +5 -1
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +0 -9
- data/app/controllers/spree/admin/adjustments_controller.rb +1 -1
- data/app/controllers/spree/admin/base_controller.rb +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +2 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +4 -4
- data/app/controllers/spree/admin/payments_controller.rb +2 -2
- data/app/controllers/spree/admin/product_properties_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +2 -2
- data/app/controllers/spree/admin/resource_controller.rb +13 -4
- data/app/controllers/spree/admin/style_guide_controller.rb +1 -1
- data/app/controllers/spree/admin/taxons/attachment_controller.rb +20 -0
- data/app/controllers/spree/admin/users_controller.rb +6 -2
- data/app/helpers/spree/admin/navigation_helper.rb +3 -2
- data/app/helpers/spree/promotion_rules_helper.rb +1 -1
- data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
- data/app/views/spree/admin/option_types/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -0
- data/app/views/spree/admin/orders/edit.html.erb +3 -4
- data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
- data/app/views/spree/admin/prices/_master_variant_table.html.erb +41 -41
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +1 -1
- data/app/views/spree/admin/promotion_codes/new.html.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +1 -0
- data/app/views/spree/admin/promotions/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/new.html.erb +1 -1
- data/app/views/spree/admin/shared/_calculator_fields.html.erb +5 -0
- data/app/views/spree/admin/shared/_navigation.html.erb +3 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_submenu.html.erb +2 -2
- data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
- data/app/views/spree/admin/store_credit_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/store_credits/index.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/_form.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
- data/app/views/spree/admin/taxons/_form.html.erb +1 -5
- data/app/views/spree/admin/taxons/attachment_forms/_paperclip.html.erb +16 -0
- data/app/views/spree/admin/users/_form.html.erb +12 -10
- data/app/views/spree/admin/users/_tabs.html.erb +1 -1
- data/app/views/spree/admin/users/edit.html.erb +1 -2
- data/app/views/spree/layouts/admin.html.erb +1 -2
- data/config/routes.rb +4 -6
- data/lib/spree/backend.rb +1 -0
- data/lib/spree/backend/config.rb +9 -0
- data/lib/spree/backend/engine.rb +5 -3
- data/{app/models → lib}/spree/backend_configuration.rb +5 -2
- data/solidus_backend.gemspec +2 -1
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/resource_controller_spec.rb +12 -1
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/users_controller_spec.rb +23 -0
- data/spec/features/admin/configuration/payment_methods_spec.rb +11 -2
- data/spec/features/admin/configuration/shipping_methods_spec.rb +13 -1
- data/spec/features/admin/configuration/taxonomies_spec.rb +7 -0
- data/spec/features/admin/orders/customer_details_spec.rb +1 -2
- data/spec/features/admin/orders/customer_returns_spec.rb +20 -7
- data/spec/features/admin/orders/new_order_spec.rb +53 -5
- data/spec/features/admin/orders/new_refund_spec.rb +1 -1
- data/spec/features/admin/orders/order_details_spec.rb +14 -4
- data/spec/features/admin/orders/return_authorizations_spec.rb +38 -9
- data/spec/features/admin/products/edit/images_spec.rb +1 -1
- data/spec/features/admin/products/edit/taxons_spec.rb +8 -2
- data/spec/features/admin/products/products_spec.rb +12 -0
- data/spec/features/admin/promotion_adjustments_spec.rb +9 -0
- data/spec/features/admin/promotions/promotion_code_batches_spec.rb +37 -0
- data/spec/features/admin/promotions/promotion_code_spec.rb +31 -0
- data/spec/features/admin/taxons_spec.rb +12 -0
- data/spec/features/admin/users_spec.rb +18 -8
- data/spec/{support → fixtures/files}/ror_ringer.jpeg +0 -0
- data/spec/{models → lib}/spree/backend_configuration/menu_item_spec.rb +0 -0
- data/spec/{models → lib}/spree/backend_configuration_spec.rb +0 -0
- data/spec/spec_helper.rb +1 -0
- data/spec/support/feature/base_feature_helper.rb +6 -1
- data/spec/teaspoon_env.rb +8 -23
- data/vendor/assets/stylesheets/solidus_admin/bootstrap/_variables.scss +1 -1
- metadata +33 -14
- data/app/assets/javascripts/spree/backend/templates/variants/autocomplete_stock.hbs +0 -56
- data/app/views/spree/admin/orders/_add_product.html.erb +0 -12
|
File without changes
|
|
@@ -169,6 +169,8 @@ $actions-brd-colors: $color-action-edit-brd, $color-action-clone-brd, $color-act
|
|
|
169
169
|
//--------------------------------------------------------------
|
|
170
170
|
$width-sidebar: 200px !default;
|
|
171
171
|
$width-sidebar-flyout: 225px !default;
|
|
172
|
+
$width-sidebar-collapsed: 52px !default;
|
|
173
|
+
$sidebar-transition: 250ms ease-in !default;
|
|
172
174
|
$border-sidebar: 1px solid $color-sidebar-border !default;
|
|
173
175
|
|
|
174
176
|
// Main
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
.main-header {
|
|
2
2
|
display: flex;
|
|
3
3
|
align-items: center;
|
|
4
|
-
padding: 15px $grid-gutter-width;
|
|
5
4
|
background-color: $color-header-bg;
|
|
5
|
+
padding: ($grid-gutter-width / 2) $grid-gutter-width;
|
|
6
6
|
border-bottom: 1px solid $color-border;
|
|
7
7
|
height: $main-header-height;
|
|
8
8
|
|
|
9
|
+
.admin-nav-hidden & {
|
|
10
|
+
margin-left: ($width-sidebar - $width-sidebar-collapsed);
|
|
11
|
+
}
|
|
12
|
+
|
|
9
13
|
@media print { display: none }
|
|
10
14
|
}
|
|
11
15
|
|
|
@@ -12,15 +12,6 @@ body {
|
|
|
12
12
|
background-color: $admin-body-bg;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.admin-nav {
|
|
16
|
-
position: absolute;
|
|
17
|
-
top: 0;
|
|
18
|
-
bottom: 0;
|
|
19
|
-
left: 0;
|
|
20
|
-
width: $width-sidebar;
|
|
21
|
-
@media print { display: none }
|
|
22
|
-
}
|
|
23
|
-
|
|
24
15
|
.content-wrapper {
|
|
25
16
|
background-color: $content-wrapper-bg;
|
|
26
17
|
padding-top: 1rem;
|
|
@@ -105,8 +105,8 @@ module Spree
|
|
|
105
105
|
@order.complete!
|
|
106
106
|
flash[:success] = t('spree.order_completed')
|
|
107
107
|
redirect_to edit_admin_order_url(@order)
|
|
108
|
-
rescue StateMachines::InvalidTransition =>
|
|
109
|
-
flash[:error] =
|
|
108
|
+
rescue StateMachines::InvalidTransition => error
|
|
109
|
+
flash[:error] = error.message
|
|
110
110
|
redirect_to confirm_admin_order_url(@order)
|
|
111
111
|
end
|
|
112
112
|
|
|
@@ -28,13 +28,13 @@ module Spree
|
|
|
28
28
|
invoke_callbacks(:update, :before)
|
|
29
29
|
|
|
30
30
|
attributes = payment_method_params
|
|
31
|
-
attributes.each do |
|
|
32
|
-
if
|
|
33
|
-
attributes.delete(
|
|
31
|
+
attributes.each do |key, _value|
|
|
32
|
+
if key.include?("password") && attributes[key].blank?
|
|
33
|
+
attributes.delete(key)
|
|
34
34
|
end
|
|
35
35
|
end
|
|
36
36
|
|
|
37
|
-
if @payment_method.
|
|
37
|
+
if @payment_method.update(attributes)
|
|
38
38
|
invoke_callbacks(:update, :after)
|
|
39
39
|
flash[:success] = t('spree.successfully_updated', resource: t('spree.payment_method'))
|
|
40
40
|
redirect_to edit_admin_payment_method_path(@payment_method)
|
|
@@ -46,8 +46,8 @@ module Spree
|
|
|
46
46
|
flash[:error] = t('spree.payment_could_not_be_created')
|
|
47
47
|
render :new
|
|
48
48
|
end
|
|
49
|
-
rescue Spree::Core::GatewayError =>
|
|
50
|
-
flash[:error] =
|
|
49
|
+
rescue Spree::Core::GatewayError => error
|
|
50
|
+
flash[:error] = error.message.to_s
|
|
51
51
|
redirect_to new_admin_order_payment_path(@order)
|
|
52
52
|
end
|
|
53
53
|
end
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Spree
|
|
4
4
|
module Admin
|
|
5
5
|
class ProductPropertiesController < ResourceController
|
|
6
|
-
belongs_to 'spree/product', find_by: :slug
|
|
6
|
+
belongs_to 'spree/product', find_by: :slug, includes: { product_properties: :property }
|
|
7
7
|
before_action :find_properties
|
|
8
8
|
before_action :setup_property, only: :index, if: -> { can?(:create, model_class) }
|
|
9
9
|
before_action :setup_variant_property_rules, only: :index
|
|
@@ -26,7 +26,7 @@ module Spree
|
|
|
26
26
|
end
|
|
27
27
|
end
|
|
28
28
|
invoke_callbacks(:update, :before)
|
|
29
|
-
if @object.
|
|
29
|
+
if @object.update(permitted_resource_params)
|
|
30
30
|
invoke_callbacks(:update, :after)
|
|
31
31
|
flash[:success] = flash_message_for(@object, :successfully_updated)
|
|
32
32
|
respond_with(@object) do |format|
|
|
@@ -120,7 +120,7 @@ module Spree
|
|
|
120
120
|
end
|
|
121
121
|
|
|
122
122
|
def product_includes
|
|
123
|
-
[{ variants: [:images], master: [:images, :default_price] }]
|
|
123
|
+
[:variant_images, { variants: [:images], master: [:images, :default_price] }]
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
def clone_object_url(resource)
|
|
@@ -30,7 +30,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
30
30
|
|
|
31
31
|
def update
|
|
32
32
|
invoke_callbacks(:update, :before)
|
|
33
|
-
if @object.
|
|
33
|
+
if @object.update(permitted_resource_params)
|
|
34
34
|
invoke_callbacks(:update, :after)
|
|
35
35
|
respond_with(@object) do |format|
|
|
36
36
|
format.html do
|
|
@@ -107,8 +107,14 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
107
107
|
else
|
|
108
108
|
invoke_callbacks(:destroy, :fails)
|
|
109
109
|
respond_with(@object) do |format|
|
|
110
|
-
|
|
111
|
-
format.
|
|
110
|
+
message = @object.errors.full_messages.to_sentence
|
|
111
|
+
format.html do
|
|
112
|
+
flash[:error] = message
|
|
113
|
+
redirect_to location_after_destroy
|
|
114
|
+
end
|
|
115
|
+
format.js do
|
|
116
|
+
render status: :unprocessable_entity, plain: message
|
|
117
|
+
end
|
|
112
118
|
end
|
|
113
119
|
end
|
|
114
120
|
end
|
|
@@ -123,6 +129,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
123
129
|
@parent_data[:model_name] = model_name
|
|
124
130
|
@parent_data[:model_class] = (options[:model_class] || model_name.to_s.classify.constantize)
|
|
125
131
|
@parent_data[:find_by] = options[:find_by] || :id
|
|
132
|
+
@parent_data[:includes] = options[:includes]
|
|
126
133
|
end
|
|
127
134
|
end
|
|
128
135
|
|
|
@@ -183,7 +190,9 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
|
|
|
183
190
|
|
|
184
191
|
def parent
|
|
185
192
|
if parent?
|
|
186
|
-
@parent ||= self.class.parent_data[:model_class]
|
|
193
|
+
@parent ||= self.class.parent_data[:model_class]
|
|
194
|
+
.includes(self.class.parent_data[:includes])
|
|
195
|
+
.find_by(self.class.parent_data[:find_by] => params["#{parent_model_name}_id"])
|
|
187
196
|
instance_variable_set("@#{parent_model_name}", @parent)
|
|
188
197
|
else
|
|
189
198
|
Spree::Deprecation.warn "Calling #parent is deprecated on a ResourceController which has not defined a belongs_to"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Spree
|
|
4
|
+
module Admin
|
|
5
|
+
module Taxons
|
|
6
|
+
class AttachmentController < Spree::Admin::BaseController
|
|
7
|
+
def destroy
|
|
8
|
+
taxonomy = Spree::Taxonomy.find(params[:taxonomy_id])
|
|
9
|
+
taxon = taxonomy.taxons.find(params[:taxon_id])
|
|
10
|
+
if taxon.destroy_attachment(params[:attachment_definition])
|
|
11
|
+
flash[:success] = t('spree.successfully_removed', resource: params[:attachment_definition].titleize)
|
|
12
|
+
else
|
|
13
|
+
flash[:error] = t('spree.taxon_attachment_removal_error')
|
|
14
|
+
end
|
|
15
|
+
redirect_to edit_admin_taxonomy_taxon_path(taxonomy, taxon.id)
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -38,7 +38,7 @@ module Spree
|
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
def update
|
|
41
|
-
if @user.
|
|
41
|
+
if @user.update(user_params)
|
|
42
42
|
set_roles
|
|
43
43
|
set_stock_locations
|
|
44
44
|
|
|
@@ -55,7 +55,7 @@ module Spree
|
|
|
55
55
|
|
|
56
56
|
def addresses
|
|
57
57
|
if request.put?
|
|
58
|
-
if @user.
|
|
58
|
+
if @user.update(user_params)
|
|
59
59
|
flash.now[:success] = t('spree.account_updated')
|
|
60
60
|
end
|
|
61
61
|
|
|
@@ -131,6 +131,10 @@ module Spree
|
|
|
131
131
|
attributes += [{ spree_role_ids: [] }]
|
|
132
132
|
end
|
|
133
133
|
|
|
134
|
+
unless can? :update_password, @user
|
|
135
|
+
attributes -= [:password, :password_confirmation]
|
|
136
|
+
end
|
|
137
|
+
|
|
134
138
|
params.require(:user).permit(attributes)
|
|
135
139
|
end
|
|
136
140
|
|
|
@@ -33,7 +33,7 @@ module Spree
|
|
|
33
33
|
elsif content_for?(:page_title)
|
|
34
34
|
content_for(:page_title)
|
|
35
35
|
elsif admin_breadcrumbs.any?
|
|
36
|
-
admin_breadcrumbs.map{ |
|
|
36
|
+
admin_breadcrumbs.map { |breadcrumb| strip_tags(breadcrumb) }.reverse.join(' - ')
|
|
37
37
|
else
|
|
38
38
|
t(controller.controller_name, default: controller.controller_name.titleize, scope: 'spree')
|
|
39
39
|
end
|
|
@@ -181,7 +181,8 @@ module Spree
|
|
|
181
181
|
url.ends_with?("#{controller.controller_name.singularize}/edit")
|
|
182
182
|
options[:class] = 'fa'
|
|
183
183
|
options[:class] += ' active' if is_active
|
|
184
|
-
options[:
|
|
184
|
+
options[:data] ||= {}
|
|
185
|
+
options[:data][:hook] = "admin_settings_#{link_text.downcase.tr(' ', '_')}"
|
|
185
186
|
content_tag(:li, options) do
|
|
186
187
|
link_to(link_text, url)
|
|
187
188
|
end
|
|
@@ -4,7 +4,7 @@ module Spree
|
|
|
4
4
|
module PromotionRulesHelper
|
|
5
5
|
def options_for_promotion_rule_types(promotion)
|
|
6
6
|
existing = promotion.rules.map { |rule| rule.class.name }
|
|
7
|
-
rules = Rails.application.config.spree.promotions.rules.reject { |
|
|
7
|
+
rules = Rails.application.config.spree.promotions.rules.reject { |rule| existing.include? rule.name }
|
|
8
8
|
options = rules.map { |rule| [rule.model_name.human, rule.name] }
|
|
9
9
|
options_for_select(options)
|
|
10
10
|
end
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
</div>
|
|
41
41
|
|
|
42
42
|
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
|
43
|
-
<%=
|
|
43
|
+
<%= f.submit t('spree.actions.create'), class: 'btn btn-primary' %>
|
|
44
44
|
<%= link_to t('spree.actions.cancel'), admin_order_customer_returns_url(@order), class: 'btn btn-primary' %>
|
|
45
45
|
</div>
|
|
46
46
|
</fieldset>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
<% if can?(:update, @order) && can?(:create, Spree::LineItem) %>
|
|
9
9
|
<button class="js-add-line-item btn btn-primary" disabled><%= t('spree.add_line_item') %></button>
|
|
10
|
+
<button class="js-empty-cart btn btn-primary" disabled><%= t('spree.empty_cart') %></button>
|
|
10
11
|
<% end %>
|
|
11
12
|
|
|
12
13
|
<%= render "spree/admin/orders/order_details", { order: order } %>
|
|
@@ -18,13 +18,12 @@
|
|
|
18
18
|
<%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.reorder("created_at DESC").first %>
|
|
19
19
|
<% end %>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
<%= render partial: 'add_product' %>
|
|
23
|
-
<% end %>
|
|
21
|
+
<div data-hook="admin_order_edit_sub_header"></div>
|
|
24
22
|
|
|
25
23
|
<% if @order.line_items.empty? %>
|
|
26
24
|
<div class="no-objects-found">
|
|
27
|
-
|
|
25
|
+
<p><%= t('spree.your_order_is_empty_add_product') %></p>
|
|
26
|
+
<%= link_to t('spree.cart'), spree.cart_admin_order_url(@order), class: 'btn btn-primary' %>
|
|
28
27
|
</div>
|
|
29
28
|
<% end %>
|
|
30
29
|
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<fieldset class="no-border-top">
|
|
16
16
|
<%= render partial: 'form', locals: { f: f } %>
|
|
17
17
|
<div data-hook="buttons" class="filter-actions actions">
|
|
18
|
-
<%=
|
|
18
|
+
<%= f.submit t('spree.actions.create'), class: 'btn btn-primary' %>
|
|
19
19
|
</div>
|
|
20
20
|
</fieldset>
|
|
21
21
|
<% end %>
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
<%= paginate master_prices, theme: "solidus_admin" %>
|
|
2
|
+
|
|
3
|
+
<fieldset class="no-border-bottom <%= "no-border-top" if !variants %>">
|
|
4
|
+
<% if variants %>
|
|
5
|
+
<legend align="center"><%= I18n.t(:master_variant, scope: :spree) %> <%= admin_hint I18n.t(:master_variant, scope: :spree), I18n.t(:master_variant, scope: [:spree, :hints, "spree/price"]) %></legend>
|
|
6
|
+
<% end %>
|
|
7
|
+
<table class="index master_prices">
|
|
8
|
+
<colgroup>
|
|
9
|
+
<col style="width: 30%">
|
|
10
|
+
<col style="width: 30%">
|
|
11
|
+
<col style="width: 20%">
|
|
12
|
+
<col style="width: 20%">
|
|
13
|
+
</colgroup>
|
|
14
|
+
<thead data-hook="master_prices_header">
|
|
15
|
+
<tr>
|
|
16
|
+
<th><%= Spree::Price.human_attribute_name(:country) %></th>
|
|
17
|
+
<th><%= Spree::Price.human_attribute_name(:currency) %></th>
|
|
18
|
+
<th><%= Spree::Price.human_attribute_name(:amount) %></th>
|
|
19
|
+
<th class="actions"></th>
|
|
20
|
+
</tr>
|
|
21
|
+
</thead>
|
|
22
|
+
<% master_prices.each do |price| %>
|
|
23
|
+
<tr id="<%= spree_dom_id price %>" data-hook="prices_row" class="<%= "deleted" if price.deleted? %>">
|
|
24
|
+
<td><%= price.display_country %></td>
|
|
25
|
+
<td><%= price.currency %></td>
|
|
26
|
+
<td><%= price.money.to_html %></td>
|
|
27
|
+
<td class="actions">
|
|
28
|
+
<% if can?(:update, price) %>
|
|
29
|
+
<%= link_to_edit(price, no_text: true) unless price.deleted? %>
|
|
30
|
+
<% end %>
|
|
31
|
+
<% if can?(:destroy, price) %>
|
|
32
|
+
|
|
33
|
+
<%= link_to_delete(price, no_text: true) unless price.deleted? %>
|
|
34
|
+
<% end %>
|
|
35
|
+
</td>
|
|
36
|
+
</tr>
|
|
37
|
+
<% end %>
|
|
38
|
+
</table>
|
|
39
|
+
</fieldset>
|
|
40
|
+
|
|
41
|
+
<%= paginate master_prices, theme: "solidus_admin" %>
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
<%= f.label :email %>
|
|
25
25
|
<%= f.text_field :email, class: "fullwidth", value: spree_current_user.email %>
|
|
26
26
|
<% end %>
|
|
27
|
-
<%=
|
|
27
|
+
<%= f.submit t('spree.actions.create'), class: 'btn btn-primary' %>
|
|
28
28
|
<% end %>
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
</div>
|
|
25
25
|
|
|
26
26
|
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
|
27
|
-
<%=
|
|
27
|
+
<%= f.submit t('spree.actions.create'), class: 'btn btn-primary' %>
|
|
28
28
|
<%= link_to t('spree.actions.cancel'), admin_promotion_promotion_codes_url(@promotion), class: 'button' %>
|
|
29
29
|
</div>
|
|
30
30
|
</fieldset>
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
<% if can?(:update, @promotion) %>
|
|
8
8
|
<div class="field">
|
|
9
9
|
<%= label_tag :action_type, t('spree.adjustment_type')%>
|
|
10
|
+
<%= admin_hint t('spree.adjustment_type'), t(:promotions, scope: [:spree, :hints, "spree/calculator"]) %>
|
|
10
11
|
<%= select_tag 'action_type', options, include_blank: t(:choose_promotion_action, scope: 'spree'), class: 'custom-select fullwidth' %>
|
|
11
12
|
</div>
|
|
12
13
|
<div class="filter-actions actions">
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
<tr id="<%= spree_dom_id promotion %>">
|
|
79
79
|
<td><%= promotion.name %></td>
|
|
80
80
|
<td>
|
|
81
|
-
<%= (promotion.codes.size == 1) ? promotion.codes.
|
|
81
|
+
<%= (promotion.codes.size == 1) ? promotion.codes.pluck(:value).first : t('spree.number_of_codes', count: promotion.codes.size) %>
|
|
82
82
|
</td>
|
|
83
83
|
<td>
|
|
84
84
|
<span class="pill pill-<%= promotion.active? ? 'active' : 'inactive' %>">
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<%= render partial: 'form', locals: { f: f } %>
|
|
14
14
|
|
|
15
15
|
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
|
16
|
-
<%=
|
|
16
|
+
<%= f.submit t('spree.actions.create'), class: 'btn btn-primary' %>
|
|
17
17
|
<%= link_to t('spree.actions.cancel'), admin_order_return_authorizations_url(@order), class: 'btn btn-primary' %>
|
|
18
18
|
</div>
|
|
19
19
|
</fieldset>
|