spree_backend 4.6.0 → 4.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +20 -101
- data/.codeclimate.yml +1 -1
- data/.rubocop.yml +5 -2
- data/Gemfile +9 -13
- data/app/assets/javascripts/spree/backend/stock_transfer.js +1 -1
- data/app/controllers/concerns/spree/admin/translatable.rb +10 -7
- data/app/controllers/spree/admin/products_controller.rb +22 -0
- data/app/helpers/spree/admin/navigation_helper.rb +77 -11
- data/app/helpers/spree/admin/orders_helper.rb +0 -18
- data/app/models/spree/admin/actions/action.rb +48 -0
- data/app/models/spree/admin/actions/action_builder.rb +79 -0
- data/app/models/spree/admin/actions/action_style.rb +11 -0
- data/app/models/spree/admin/actions/adjustments_default_actions_builder.rb +28 -0
- data/app/models/spree/admin/actions/images_default_actions_builder.rb +29 -0
- data/app/models/spree/admin/actions/order_default_actions_builder.rb +92 -0
- data/app/models/spree/admin/actions/orders_default_actions_builder.rb +29 -0
- data/app/models/spree/admin/actions/payments_default_actions_builder.rb +33 -0
- data/app/models/spree/admin/actions/product_properties_default_actions_builder.rb +42 -0
- data/app/models/spree/admin/actions/products_default_actions_builder.rb +29 -0
- data/app/models/spree/admin/actions/root.rb +15 -0
- data/app/models/spree/admin/actions/store_credits_default_actions_builder.rb +28 -0
- data/app/models/spree/admin/actions/user_default_actions_builder.rb +29 -0
- data/app/models/spree/admin/actions/users_default_actions_builder.rb +29 -0
- data/app/models/spree/admin/actions/variants_default_actions_builder.rb +30 -0
- data/app/models/spree/admin/item_manager.rb +50 -0
- data/app/models/spree/admin/main_menu/default_configuration_builder.rb +263 -0
- data/app/models/spree/admin/main_menu/item.rb +30 -0
- data/app/models/spree/admin/main_menu/item_builder.rb +37 -0
- data/app/models/spree/admin/main_menu/root.rb +17 -0
- data/app/models/spree/admin/main_menu/section.rb +31 -0
- data/app/models/spree/admin/main_menu/section_builder.rb +36 -0
- data/app/models/spree/admin/permission_checks.rb +50 -0
- data/app/models/spree/admin/tabs/order_default_tabs_builder.rb +147 -0
- data/app/models/spree/admin/tabs/product_default_tabs_builder.rb +144 -0
- data/app/models/spree/admin/tabs/root.rb +15 -0
- data/app/models/spree/admin/tabs/tab.rb +38 -0
- data/app/models/spree/admin/tabs/tab_builder.rb +63 -0
- data/app/models/spree/admin/tabs/user_default_tabs_builder.rb +77 -0
- data/app/views/spree/admin/adjustments/index.html.erb +9 -1
- data/app/views/spree/admin/cms_sections/types/_image_gallery.html.erb +27 -33
- data/app/views/spree/admin/cms_sections/types/_side_by_side_images.html.erb +18 -22
- data/app/views/spree/admin/dashboard/_getting_started.html.erb +1 -0
- data/app/views/spree/admin/images/index.html.erb +12 -3
- data/app/views/spree/admin/oauth_applications/index.html.erb +7 -0
- data/app/views/spree/admin/orders/_order_actions.html.erb +10 -15
- data/app/views/spree/admin/orders/index.html.erb +11 -6
- data/app/views/spree/admin/payments/index.html.erb +9 -4
- data/app/views/spree/admin/prices/index.html.erb +12 -2
- data/app/views/spree/admin/product_properties/index.html.erb +13 -13
- data/app/views/spree/admin/products/_add_stock_form.html.erb +12 -1
- data/app/views/spree/admin/products/edit.html.erb +12 -1
- data/app/views/spree/admin/products/index.html.erb +11 -2
- data/app/views/spree/admin/shared/_main_menu.html.erb +19 -77
- data/app/views/spree/admin/shared/_order_tabs.html.erb +10 -83
- data/app/views/spree/admin/shared/_product_tabs.html.erb +12 -64
- data/app/views/spree/admin/store_credits/index.html.erb +9 -1
- data/app/views/spree/admin/users/_tabs.html.erb +11 -30
- data/app/views/spree/admin/users/_user_page_actions.html.erb +9 -1
- data/app/views/spree/admin/users/index.html.erb +11 -2
- data/app/views/spree/admin/variants/index.html.erb +12 -2
- data/config/locales/en.yml +10 -5
- data/lib/spree/backend/configuration.rb +0 -17
- data/lib/spree/backend/engine.rb +28 -1
- data/lib/spree/backend/version.rb +1 -1
- data/spree_backend.gemspec +2 -2
- data/yarn.lock +58 -22
- metadata +36 -17
- data/app/views/spree/admin/shared/sub_menu/_apps.html.erb +0 -3
- data/app/views/spree/admin/shared/sub_menu/_configuration.html.erb +0 -19
- data/app/views/spree/admin/shared/sub_menu/_content.html.erb +0 -4
- data/app/views/spree/admin/shared/sub_menu/_integrations.html.erb +0 -5
- data/app/views/spree/admin/shared/sub_menu/_orders.html.erb +0 -5
- data/app/views/spree/admin/shared/sub_menu/_organizations.html.erb +0 -3
- data/app/views/spree/admin/shared/sub_menu/_product.html.erb +0 -8
- data/app/views/spree/admin/shared/sub_menu/_promotion.html.erb +0 -4
- data/app/views/spree/admin/shared/sub_menu/_returns.html.erb +0 -4
- data/app/views/spree/admin/shared/sub_menu/_stock.html.erb +0 -4
@@ -2,19 +2,19 @@
|
|
2
2
|
<%= render 'spree/admin/shared/error_messages', target: @product %>
|
3
3
|
|
4
4
|
<% content_for :page_actions do %>
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<% end
|
5
|
+
<% product_properties_actions.items.each do |action| %>
|
6
|
+
<% next unless action.available?(current_ability) %>
|
7
|
+
<%= button_link_to(
|
8
|
+
Spree.t(action.label_translation_key),
|
9
|
+
action.url(@product),
|
10
|
+
class: action.classes,
|
11
|
+
icon: action.icon_key,
|
12
|
+
id: action.id,
|
13
|
+
target: action.target,
|
14
|
+
data: action.data_attributes
|
15
|
+
) %>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
18
|
|
19
19
|
<%= form_for @product, url: spree.admin_product_url(@product), method: :put do |f| %>
|
20
20
|
<fieldset>
|
@@ -4,7 +4,18 @@
|
|
4
4
|
</h5>
|
5
5
|
</div>
|
6
6
|
<% content_for :page_actions do %>
|
7
|
-
|
7
|
+
<% stock_actions.items.each do |action| %>
|
8
|
+
<% next unless action.available?(current_ability) %>
|
9
|
+
<%= button_link_to(
|
10
|
+
Spree.t(action.label_translation_key),
|
11
|
+
action.url(@product),
|
12
|
+
class: action.classes,
|
13
|
+
icon: action.icon_key,
|
14
|
+
id: action.id,
|
15
|
+
target: action.target,
|
16
|
+
data: action.data_attributes
|
17
|
+
) %>
|
18
|
+
<% end if product_actions&.items %>
|
8
19
|
<% end %>
|
9
20
|
<div class="card-body">
|
10
21
|
<%= form_for [:admin, Spree::StockMovement.new], url: admin_stock_items_path do |f| %>
|
@@ -1,5 +1,16 @@
|
|
1
1
|
<% content_for :page_actions do %>
|
2
|
-
|
2
|
+
<% product_actions.items.each do |action| %>
|
3
|
+
<% next unless action.available?(current_ability) %>
|
4
|
+
<%= button_link_to(
|
5
|
+
Spree.t(action.label_translation_key),
|
6
|
+
action.url(@product),
|
7
|
+
class: action.classes,
|
8
|
+
icon: action.icon_key,
|
9
|
+
id: action.id,
|
10
|
+
target: action.target,
|
11
|
+
data: action.data_attributes
|
12
|
+
) %>
|
13
|
+
<% end if product_actions&.items %>
|
3
14
|
<% end %>
|
4
15
|
|
5
16
|
<%= render partial: 'spree/admin/shared/product_tabs', locals: {current: :details} %>
|
@@ -3,8 +3,17 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
|
-
|
7
|
-
<%
|
6
|
+
<% products_actions.items.each do |action| %>
|
7
|
+
<% next unless action.available?(current_ability) %>
|
8
|
+
<%= button_link_to(
|
9
|
+
Spree.t(action.label_translation_key),
|
10
|
+
action.url,
|
11
|
+
class: action.classes,
|
12
|
+
icon: action.icon_key,
|
13
|
+
id: action.id
|
14
|
+
) %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
8
17
|
|
9
18
|
<% content_for :page_tabs do %>
|
10
19
|
<li class="nav-item">
|
@@ -11,83 +11,25 @@
|
|
11
11
|
</button>
|
12
12
|
</div>
|
13
13
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
</ul>
|
34
|
-
<% end %>
|
35
|
-
|
36
|
-
<% if can?(:admin, Spree::StockLocation) || can?(:admin, Spree::StockTransfer) %>
|
37
|
-
<ul class="nav nav-sidebar" id="sidebarStock">
|
38
|
-
<%= main_menu_tree Spree.t(:stock), icon: "box-seam.svg", sub_menu: "stock", url: "#sidebar-stock" %>
|
39
|
-
</ul>
|
40
|
-
<% end %>
|
41
|
-
|
42
|
-
<% if can? :admin, Spree::Admin::ReportsController %>
|
43
|
-
<ul class="nav nav-sidebar" id="sidebarReport">
|
44
|
-
<%= tab *Spree::Backend::Configuration::REPORT_TABS, icon: 'pie-chart-fill.svg' %>
|
45
|
-
</ul>
|
46
|
-
<% end %>
|
47
|
-
|
48
|
-
<% if can? :admin, Spree::Promotion %>
|
49
|
-
<ul class="nav nav-sidebar" id="sidebarPromotion">
|
50
|
-
<%= main_menu_tree Spree.t(:promotions), icon: "percent.svg", sub_menu: "promotion", url: "#sidebar-promotions" %>
|
51
|
-
</ul>
|
52
|
-
<% end %>
|
53
|
-
|
54
|
-
<% if defined?(Spree::Vendor) && can?(:manage, Spree::Vendor) && can?(:index, Spree::Vendor) %>
|
55
|
-
<ul class="nav nav-sidebar" id="sidebarOrganizations">
|
56
|
-
<%= main_menu_tree Spree.t(:organizations), icon: "building.svg", sub_menu: "organizations", url: "#sidebar-organizations" %>
|
57
|
-
</ul>
|
58
|
-
<% end %>
|
59
|
-
|
60
|
-
<% if Spree.user_class && can?(:admin, Spree.user_class) %>
|
61
|
-
<ul class="nav nav-sidebar" id="sidebarUser">
|
62
|
-
<%= tab *Spree::Backend::Configuration::USER_TABS, url: spree.admin_users_path, icon: 'people-fill.svg' %>
|
63
|
-
</ul>
|
64
|
-
<% end %>
|
65
|
-
|
66
|
-
<% if can? :admin, Spree::Menu %>
|
67
|
-
<ul class="nav nav-sidebar" id="sidebarMenu">
|
68
|
-
<%= main_menu_tree Spree.t('admin.tab.content'), icon: "card-heading.svg", sub_menu: "content", url: "#sidebar-content" %>
|
69
|
-
</ul>
|
70
|
-
<% end %>
|
71
|
-
|
72
|
-
<% if can?(:admin, Spree::Webhooks::Subscriber) || can?(:admin, Spree::PaymentMethod) %>
|
73
|
-
<ul class="nav nav-sidebar" id="sidebarIntegrations">
|
74
|
-
<%= main_menu_tree Spree.t('admin.tab.integrations'), icon: "stack.svg", sub_menu: "integrations", url: "#sidebar-integrations" %>
|
75
|
-
</ul>
|
76
|
-
<% end %>
|
77
|
-
|
78
|
-
<% if can? :admin, Spree::OauthApplication %>
|
79
|
-
<ul class="nav nav-sidebar" id="sidebarApps">
|
80
|
-
<%= main_menu_tree Spree.t('admin.tab.apps'), icon: "terminal-fill.svg", sub_menu: "apps", url: "#sidebar-apps" %>
|
81
|
-
</ul>
|
82
|
-
<% end %>
|
83
|
-
|
84
|
-
<% if can? :admin, current_store %>
|
85
|
-
<ul class="nav nav-sidebar" id="sidebarConfiguration">
|
86
|
-
<%= main_menu_tree Spree.t('admin.settings'), icon: "gear-fill.svg", sub_menu: "configuration", url: "#sidebar-configuration" %>
|
87
|
-
</ul>
|
88
|
-
<% elsif defined?(current_spree_vendor) && current_spree_vendor.present? %>
|
89
|
-
<ul class="nav nav-sidebar" id="sidebarConfiguration">
|
90
|
-
<%= main_menu_tree Spree.t('admin.settings'), icon: "gear-fill.svg", sub_menu: "vendor_configuration", url: "#sidebar-configuration" %>
|
14
|
+
<% main_menu.items.each do |item| %>
|
15
|
+
<% next unless item.available?(current_ability, current_store) %>
|
16
|
+
|
17
|
+
<ul class="nav nav-sidebar" id="sidebar<%= item.key.upcase %>>">
|
18
|
+
<% if item.children? %>
|
19
|
+
<li class="sidebar-menu-item d-block w-100 text-muted">
|
20
|
+
<%= main_menu_item(Spree.t(item.label_translation_key), url: "#sidebar-#{item.key}", icon: item.icon_key) %>
|
21
|
+
|
22
|
+
<ul id="sidebar-<%= item.key %>" class="collapse nav nav-pills nav-stacked pb-2" data-hook="admin_orders">
|
23
|
+
<% item.items.each do |section_item| %>
|
24
|
+
<% next unless section_item.available?(current_ability, current_store) %>
|
25
|
+
|
26
|
+
<%= tab(Spree.t(section_item.label_translation_key), url: section_item.url.is_a?(Proc) ? section_item.url.call(current_store) : section_item.url, match_path: section_item.match_path, icon: section_item.icon_key) %>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
|
+
</li>
|
30
|
+
<% else %>
|
31
|
+
<%= tab(Spree.t(item.label_translation_key), url: item.url.is_a?(Proc) ? item.url.call(current_store) : item.url, match_path: item.match_path, icon: item.icon_key) %>
|
32
|
+
<% end %>
|
91
33
|
</ul>
|
92
34
|
<% end %>
|
93
35
|
</nav>
|
@@ -4,88 +4,15 @@
|
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<% content_for :page_tabs do %>
|
7
|
-
<%
|
8
|
-
|
9
|
-
<%=
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
<li class="nav-item" data-hook='admin_order_tabs_channel_details'>
|
18
|
-
<%= link_to_with_icon 'funnel.svg',
|
19
|
-
Spree.t(:channel),
|
20
|
-
channel_admin_order_url(@order),
|
21
|
-
class: "#{'active' if current == :channel} nav-link" %>
|
22
|
-
</li>
|
23
|
-
<% end %>
|
24
|
-
|
25
|
-
<% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
|
26
|
-
<li class="nav-item" data-hook='admin_order_tabs_customer_details'>
|
27
|
-
<%= link_to_with_icon 'person-lines-fill.svg',
|
28
|
-
Spree.t(:customer),
|
29
|
-
spree.admin_order_customer_url(@order),
|
30
|
-
class: "#{'active' if current == :customer_details} nav-link" %>
|
31
|
-
</li>
|
32
|
-
<% end %>
|
33
|
-
|
34
|
-
<% if can? :update, @order %>
|
35
|
-
<li class="nav-item" data-hook='admin_order_tabs_shipment_details'>
|
36
|
-
<%= link_to_with_icon 'truck.svg',
|
37
|
-
Spree.t(:shipments),
|
38
|
-
edit_admin_order_url(@order),
|
39
|
-
class: "#{'active' if current == :shipments} nav-link" %>
|
40
|
-
</li>
|
41
|
-
<% end %>
|
42
|
-
|
43
|
-
<% if can? :index, Spree::Adjustment %>
|
44
|
-
<li class="nav-item" data-hook='admin_order_tabs_adjustments'>
|
45
|
-
<%= link_to_with_icon 'adjust.svg',
|
46
|
-
Spree.t(:adjustments),
|
47
|
-
spree.admin_order_adjustments_url(@order),
|
48
|
-
class: "#{'active' if current == :adjustments} nav-link" %>
|
49
|
-
</li>
|
50
|
-
<% end %>
|
51
|
-
|
52
|
-
<% if can?(:index, Spree::Payment) %>
|
53
|
-
<li class="nav-item" data-hook='admin_order_tabs_payments'>
|
54
|
-
<%= link_to_with_icon 'credit-card.svg',
|
55
|
-
Spree.t(:payments),
|
56
|
-
spree.admin_order_payments_url(@order),
|
57
|
-
class: "#{'active' if current == :payments} nav-link" %>
|
58
|
-
</li>
|
59
|
-
<% end %>
|
60
|
-
|
61
|
-
<% if can? :index, Spree::ReturnAuthorization %>
|
62
|
-
<% if @order.completed? %>
|
63
|
-
<li class="nav-item" data-hook='admin_order_tabs_return_authorizations'>
|
64
|
-
<%= link_to_with_icon 'enter.svg',
|
65
|
-
Spree.t(:return_authorizations),
|
66
|
-
spree.admin_order_return_authorizations_url(@order),
|
67
|
-
class: "#{'active' if current == :return_authorizations} nav-link" %>
|
68
|
-
</li>
|
69
|
-
<% end %>
|
70
|
-
<% end %>
|
71
|
-
|
72
|
-
<% if can? :index, Spree::CustomerReturn %>
|
73
|
-
<% if @order.completed? %>
|
74
|
-
<li class="nav-item">
|
75
|
-
<%= link_to_with_icon 'returns.svg',
|
76
|
-
Spree.t(:customer_returns),
|
77
|
-
spree.admin_order_customer_returns_url(@order),
|
78
|
-
class: "#{'active' if current == :customer_returns} nav-link" %>
|
79
|
-
</li>
|
80
|
-
<% end %>
|
81
|
-
<% end %>
|
82
|
-
|
83
|
-
<% if can? :update, @order %>
|
84
|
-
<li class="nav-item" data-hook='admin_order_tabs_state_changes'>
|
85
|
-
<%= link_to_with_icon 'calendar3.svg',
|
86
|
-
Spree::StateChange.human_attribute_name(:state_changes),
|
87
|
-
spree.admin_order_state_changes_url(@order),
|
88
|
-
class: "#{'active' if current == :state_changes} nav-link" %>
|
89
|
-
</li>
|
7
|
+
<% order_tabs.items.each do |tab| %>
|
8
|
+
<% next unless tab.available?(current_ability, @order) %>
|
9
|
+
<%= content_tag :li, class: 'nav-item', data: { hook: tab.data_hook } do %>
|
10
|
+
<%= link_to_with_icon(
|
11
|
+
tab.icon_key,
|
12
|
+
Spree.t(tab.label_translation_key),
|
13
|
+
tab.url(@order),
|
14
|
+
class: tab.active?(current) ? 'active nav-link' : 'nav-link'
|
15
|
+
) %>
|
16
|
+
<% end %>
|
90
17
|
<% end %>
|
91
18
|
<% end %>
|
@@ -3,68 +3,16 @@
|
|
3
3
|
<%= @product.name %>
|
4
4
|
<% end %>
|
5
5
|
|
6
|
-
<% content_for
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
spree.admin_product_images_url(@product),
|
19
|
-
class: "nav-link #{'active' if current == :images}" %>
|
20
|
-
|
21
|
-
<% end if can?(:admin, Spree::Image) && !@product.deleted? %>
|
22
|
-
|
23
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
24
|
-
<%= link_to_with_icon 'adjust.svg',
|
25
|
-
Spree.t(:variants),
|
26
|
-
spree.admin_product_variants_url(@product),
|
27
|
-
class: "nav-link #{'active' if current == :variants}" %>
|
28
|
-
|
29
|
-
<% end if can?(:admin, Spree::Variant) && !@product.deleted? %>
|
30
|
-
|
31
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
32
|
-
<%= link_to_with_icon 'list.svg',
|
33
|
-
Spree.t(:properties),
|
34
|
-
spree.admin_product_product_properties_url(@product),
|
35
|
-
class: "nav-link #{'active' if current == :properties}" %>
|
36
|
-
|
37
|
-
<% end if can?(:admin, Spree::ProductProperty) && !@product.deleted? %>
|
38
|
-
|
39
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
40
|
-
<%= link_to_with_icon 'box-seam.svg',
|
41
|
-
Spree.t(:stock),
|
42
|
-
stock_admin_product_url(@product),
|
43
|
-
class: "nav-link #{'active' if current == :stock}" %>
|
44
|
-
|
45
|
-
<% end if can?(:admin, Spree::StockItem) && !@product.deleted? %>
|
46
|
-
|
47
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
48
|
-
<%= link_to_with_icon 'currency-exchange.svg',
|
49
|
-
Spree.t(:prices),
|
50
|
-
admin_product_prices_path(@product),
|
51
|
-
class: "nav-link #{'active' if current == :prices}" %>
|
52
|
-
|
53
|
-
<% end if can?(:admin, Spree::Price) && !@product.deleted? %>
|
54
|
-
|
55
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
56
|
-
<%= link_to_with_icon 'download.svg',
|
57
|
-
Spree.t('admin.digitals.digital_assets'),
|
58
|
-
admin_product_digitals_path(@product),
|
59
|
-
class: "nav-link #{'active' if current == :digitals} #{current}" %>
|
60
|
-
|
61
|
-
<% end if can?(:admin, Spree::Digital) && !@product.deleted? %>
|
62
|
-
|
63
|
-
<%= content_tag :li, class: 'nav-item' do %>
|
64
|
-
<%= link_to_with_icon 'translate.svg',
|
65
|
-
Spree.t(:translations),
|
66
|
-
translations_admin_product_path(@product),
|
67
|
-
class: "nav-link #{'active' if current == :translations}" %>
|
68
|
-
|
69
|
-
<% end if can?(:admin, Spree::Product) && !@product.deleted? %>
|
6
|
+
<% content_for :page_tabs do %>
|
7
|
+
<% product_tabs.items.each do |tab| %>
|
8
|
+
<% next unless tab.available?(current_ability, @product) %>
|
9
|
+
<li class="nav-item">
|
10
|
+
<%= link_to_with_icon(
|
11
|
+
tab.icon_key,
|
12
|
+
Spree.t(tab.label_translation_key),
|
13
|
+
tab.url(@product),
|
14
|
+
class: tab.active?(current) ? 'active nav-link' : 'nav-link'
|
15
|
+
) %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
70
18
|
<% end %>
|
@@ -5,7 +5,15 @@
|
|
5
5
|
<% end %>
|
6
6
|
|
7
7
|
<% content_for :page_actions do %>
|
8
|
-
|
8
|
+
<% store_credits_actions.items.each do |action| %>
|
9
|
+
<% next unless action.available?(current_ability) %>
|
10
|
+
<%= button_link_to(
|
11
|
+
Spree.t(action.label_translation_key),
|
12
|
+
action.url(@user),
|
13
|
+
class: action.classes,
|
14
|
+
icon: action.icon_key
|
15
|
+
) %>
|
16
|
+
<% end %>
|
9
17
|
<% end %>
|
10
18
|
|
11
19
|
<% if @store_credits.any? %>
|
@@ -4,34 +4,15 @@
|
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<% content_for :page_tabs do %>
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
</li>
|
19
|
-
<li class="nav-item">
|
20
|
-
<%= link_to_with_icon 'inbox.svg',
|
21
|
-
Spree.t(:"admin.user.orders"),
|
22
|
-
spree.orders_admin_user_path(@user),
|
23
|
-
class: "nav-link #{'active' if current == :orders}" %>
|
24
|
-
</li>
|
25
|
-
<li class="nav-item">
|
26
|
-
<%= link_to_with_icon 'tag.svg',
|
27
|
-
Spree.t(:"admin.user.items"),
|
28
|
-
spree.items_admin_user_path(@user),
|
29
|
-
class: "nav-link #{'active' if current == :items}" %>
|
30
|
-
</li>
|
31
|
-
<li class="nav-item">
|
32
|
-
<%= link_to_with_icon 'gift.svg',
|
33
|
-
Spree.t(:"admin.user.store_credits"),
|
34
|
-
spree.admin_user_store_credits_path(@user),
|
35
|
-
class: "nav-link #{'active' if current == :store_credits}" %>
|
36
|
-
</li>
|
7
|
+
<% user_tabs.items.each do |tab| %>
|
8
|
+
<% next unless tab.available?(current_ability, @user) %>
|
9
|
+
<li class="nav-item">
|
10
|
+
<%= link_to_with_icon(
|
11
|
+
tab.icon_key,
|
12
|
+
Spree.t(tab.label_translation_key),
|
13
|
+
tab.url(@user),
|
14
|
+
class: tab.active?(current) ? 'active nav-link' : 'nav-link'
|
15
|
+
) %>
|
16
|
+
</li>
|
17
|
+
<% end %>
|
37
18
|
<% end %>
|
@@ -1,3 +1,11 @@
|
|
1
1
|
<% content_for :page_actions do %>
|
2
|
-
|
2
|
+
<% user_actions.items.each do |action| %>
|
3
|
+
<% next unless action.available?(current_ability) %>
|
4
|
+
<%= button_link_to(
|
5
|
+
Spree.t(action.label_translation_key),
|
6
|
+
action.url(@user),
|
7
|
+
class: action.classes,
|
8
|
+
icon: action.icon_key
|
9
|
+
) %>
|
10
|
+
<% end %>
|
3
11
|
<% end %>
|
@@ -3,8 +3,17 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
|
-
|
7
|
-
<%
|
6
|
+
<% users_actions.items.each do |action| %>
|
7
|
+
<% next unless action.available?(current_ability) %>
|
8
|
+
<%= button_link_to(
|
9
|
+
Spree.t(action.label_translation_key),
|
10
|
+
action.url,
|
11
|
+
class: action.classes,
|
12
|
+
icon: action.icon_key,
|
13
|
+
id: action.id
|
14
|
+
) %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
8
17
|
|
9
18
|
<% content_for :table_filter_title do %>
|
10
19
|
<%= Spree.t(:search) %>
|
@@ -64,8 +64,18 @@
|
|
64
64
|
<% end %>
|
65
65
|
<% else %>
|
66
66
|
<% content_for :page_actions do %>
|
67
|
-
|
68
|
-
|
67
|
+
<% variants_actions.items.each do |action| %>
|
68
|
+
<% next unless action.available?(current_ability) %>
|
69
|
+
<%= button_link_to(
|
70
|
+
Spree.t(action.label_translation_key),
|
71
|
+
action.url(@product),
|
72
|
+
class: action.classes,
|
73
|
+
icon: action.icon_key,
|
74
|
+
id: action.id,
|
75
|
+
target: action.target,
|
76
|
+
data: action.data_attributes
|
77
|
+
) %>
|
78
|
+
<% end %>
|
69
79
|
<%= button_link_to (@deleted == '1' ? Spree.t(:show_active) : Spree.t(:show_deleted)), spree.admin_product_variants_url(@product, { q: { deleted_at_null: @deleted == '1' ? "0" : "1" } }), { class: 'btn-light', icon: 'filter.svg' } %>
|
70
80
|
<% end %>
|
71
81
|
<% end %>
|
data/config/locales/en.yml
CHANGED
@@ -133,10 +133,12 @@ en:
|
|
133
133
|
taxons: Taxons
|
134
134
|
users: Users
|
135
135
|
return_authorizations: Return Authorizations
|
136
|
+
stock: Stock
|
136
137
|
customer_returns: Customer Returns
|
137
138
|
apps: Apps
|
138
139
|
applications: Applications
|
139
140
|
integrations: Integrations
|
141
|
+
webhook_subscribers: Webhook Subscribers
|
140
142
|
taxon:
|
141
143
|
nested_under_info: Nest this Taxon within the Taxonomy tree.
|
142
144
|
taxonomies:
|
@@ -150,9 +152,9 @@ en:
|
|
150
152
|
changing_store_warning: If you change the store this order belongs to, the order will be reset.
|
151
153
|
once_an_order_is_complete_you_can_not_change_store: 'Sorry, once an order is complete, you can no longer change the store that the order belongs to.'
|
152
154
|
events:
|
153
|
-
approve:
|
154
|
-
cancel:
|
155
|
-
resume:
|
155
|
+
approve: Approve
|
156
|
+
cancel: Cancel
|
157
|
+
resume: Resume
|
156
158
|
resend: Resend
|
157
159
|
orders:
|
158
160
|
all: All
|
@@ -167,6 +169,8 @@ en:
|
|
167
169
|
new: New oAuth application
|
168
170
|
uid: UID
|
169
171
|
scopes: Scopes
|
172
|
+
documentation_message: 'To learn how to authenticate requests to the Platform API, '
|
173
|
+
documentation_cta: see the documentation
|
170
174
|
reports:
|
171
175
|
for: For %{store_name}
|
172
176
|
return_authorization:
|
@@ -250,7 +254,7 @@ en:
|
|
250
254
|
this_link_takes_you_to_your_stores_home_page: This link takes you to your stores home page.
|
251
255
|
settings: Settings
|
252
256
|
utilities:
|
253
|
-
preview: Preview
|
257
|
+
preview: Preview
|
254
258
|
webhooks_subscribers:
|
255
259
|
webhooks_subscribers: Webhooks Subscribers
|
256
260
|
new_webhooks_subscriber: New Webhooks Subscriber
|
@@ -324,7 +328,8 @@ en:
|
|
324
328
|
setup_taxes_calculation: Setup tax calculation
|
325
329
|
products_section:
|
326
330
|
message_with_products_html: You have added <strong> %{count} products</strong> so far - good job!</p>
|
327
|
-
message_without_products: You can add products manually
|
331
|
+
message_without_products: You can add products manually or
|
332
|
+
import_message: import them via the API.
|
328
333
|
shipping_section:
|
329
334
|
message_with_shipping: You have setup shipping for
|
330
335
|
message_without_shipping: You can add multiple shipping methods, different for each country, continent or region.
|
@@ -15,23 +15,6 @@ module Spree
|
|
15
15
|
preference :product_wysiwyg_editor_enabled, :boolean, default: true
|
16
16
|
preference :taxon_wysiwyg_editor_enabled, :boolean, default: true
|
17
17
|
preference :show_only_complete_orders_by_default, :boolean, default: true
|
18
|
-
|
19
|
-
ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
|
20
|
-
:shipments, :credit_cards, :return_authorizations,
|
21
|
-
:customer_returns, :adjustments, :customer_details]
|
22
|
-
PRODUCT_TABS ||= [:products, :option_types, :properties, :prototypes,
|
23
|
-
:variants, :product_properties, :taxonomies,
|
24
|
-
:taxons]
|
25
|
-
REPORT_TABS ||= [:reports]
|
26
|
-
CONFIGURATION_TABS ||= [:configurations, :general_settings, :tax_categories,
|
27
|
-
:tax_rates, :zones, :countries, :states,
|
28
|
-
:payment_methods, :shipping_methods,
|
29
|
-
:shipping_categories, :stock_transfers,
|
30
|
-
:stock_locations, :trackers, :refund_reasons,
|
31
|
-
:reimbursement_types, :return_authorization_reasons,
|
32
|
-
:stores]
|
33
|
-
PROMOTION_TABS ||= [:promotions, :promotion_categories]
|
34
|
-
USER_TABS ||= [:users]
|
35
18
|
end
|
36
19
|
end
|
37
20
|
end
|
data/lib/spree/backend/engine.rb
CHANGED
@@ -3,10 +3,13 @@ require_relative 'configuration'
|
|
3
3
|
module Spree
|
4
4
|
module Backend
|
5
5
|
class Engine < ::Rails::Engine
|
6
|
+
Environment = Struct.new(:main_menu, :tabs, :actions)
|
7
|
+
|
6
8
|
config.middleware.use 'Spree::Backend::Middleware::SeoAssist'
|
7
9
|
|
8
|
-
initializer 'spree.backend.environment', before: :load_config_initializers do |
|
10
|
+
initializer 'spree.backend.environment', before: :load_config_initializers do |app|
|
9
11
|
Spree::Backend::Config = Spree::Backend::Configuration.new
|
12
|
+
app.config.spree_backend = Environment.new
|
10
13
|
end
|
11
14
|
|
12
15
|
# filter sensitive information during logging
|
@@ -20,6 +23,30 @@ module Spree
|
|
20
23
|
# warn "[DEPRECATION] Spree::Backend::Config[:#{pref[:name]}] is deprecated. #{pref[:message]}"
|
21
24
|
end
|
22
25
|
end
|
26
|
+
|
27
|
+
config.after_initialize do
|
28
|
+
Rails.application.reload_routes!
|
29
|
+
Rails.application.config.spree_backend.main_menu = Spree::Admin::MainMenu::DefaultConfigurationBuilder.new.build
|
30
|
+
Rails.application.config.spree_backend.tabs = {}
|
31
|
+
Rails.application.config.spree_backend.tabs[:order] = Spree::Admin::Tabs::OrderDefaultTabsBuilder.new.build
|
32
|
+
Rails.application.config.spree_backend.tabs[:user] = Spree::Admin::Tabs::UserDefaultTabsBuilder.new.build
|
33
|
+
Rails.application.config.spree_backend.tabs[:product] = Spree::Admin::Tabs::ProductDefaultTabsBuilder.new.build
|
34
|
+
Rails.application.config.spree_backend.actions = {}
|
35
|
+
Rails.application.config.spree_backend.actions[:orders] = Spree::Admin::Actions::OrdersDefaultActionsBuilder.new.build
|
36
|
+
Rails.application.config.spree_backend.actions[:order] = Spree::Admin::Actions::OrderDefaultActionsBuilder.new.build
|
37
|
+
Rails.application.config.spree_backend.actions[:users] = Spree::Admin::Actions::UsersDefaultActionsBuilder.new.build
|
38
|
+
Rails.application.config.spree_backend.actions[:user] = Spree::Admin::Actions::UserDefaultActionsBuilder.new.build
|
39
|
+
Rails.application.config.spree_backend.actions[:products] = Spree::Admin::Actions::ProductsDefaultActionsBuilder.new.build
|
40
|
+
Rails.application.config.spree_backend.actions[:product] = Spree::Admin::Actions::Root.new
|
41
|
+
Rails.application.config.spree_backend.actions[:stock] = Spree::Admin::Actions::Root.new
|
42
|
+
Rails.application.config.spree_backend.actions[:prices] = Spree::Admin::Actions::Root.new
|
43
|
+
Rails.application.config.spree_backend.actions[:images] = Spree::Admin::Actions::ImagesDefaultActionsBuilder.new.build
|
44
|
+
Rails.application.config.spree_backend.actions[:store_credits] = Spree::Admin::Actions::StoreCreditsDefaultActionsBuilder.new.build
|
45
|
+
Rails.application.config.spree_backend.actions[:adjustments] = Spree::Admin::Actions::AdjustmentsDefaultActionsBuilder.new.build
|
46
|
+
Rails.application.config.spree_backend.actions[:payments] = Spree::Admin::Actions::PaymentsDefaultActionsBuilder.new.build
|
47
|
+
Rails.application.config.spree_backend.actions[:variants] = Spree::Admin::Actions::VariantsDefaultActionsBuilder.new.build
|
48
|
+
Rails.application.config.spree_backend.actions[:product_properties] = Spree::Admin::Actions::ProductPropertiesDefaultActionsBuilder.new.build
|
49
|
+
end
|
23
50
|
end
|
24
51
|
end
|
25
52
|
end
|
data/spree_backend.gemspec
CHANGED
@@ -19,13 +19,13 @@ Gem::Specification.new do |s|
|
|
19
19
|
"source_code_uri" => "https://github.com/spree/spree_backend/tree/v#{s.version}",
|
20
20
|
}
|
21
21
|
|
22
|
-
s.required_ruby_version = '>=
|
22
|
+
s.required_ruby_version = '>= 3.0'
|
23
23
|
|
24
24
|
s.files = `git ls-files`.split("\n").reject { |f| f.match(/^spec/) && !f.match(/^spec\/fixtures/) }
|
25
25
|
s.require_path = 'lib'
|
26
26
|
s.requirements << 'none'
|
27
27
|
|
28
|
-
s.add_dependency 'spree', ">= 4.
|
28
|
+
s.add_dependency 'spree', ">= 4.7.0"
|
29
29
|
|
30
30
|
s.add_dependency 'babel-transpiler', '~> 0.7'
|
31
31
|
s.add_dependency 'bootstrap', '~> 4.0'
|