spree_backend 4.6.1 → 4.7.1
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 +10 -14
- data/app/assets/javascripts/spree/backend/stock_transfer.js +1 -1
- 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/images/index.html.erb +12 -3
- 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/prototypes/show.html.erb +2 -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 +6 -4
- 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
@@ -1,7 +1,15 @@
|
|
1
1
|
<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :adjustments} %>
|
2
2
|
|
3
3
|
<% content_for :page_actions do %>
|
4
|
-
|
4
|
+
<% adjustments_actions.items.each do |action| %>
|
5
|
+
<% next unless action.available?(current_ability) %>
|
6
|
+
<%= button_link_to(
|
7
|
+
Spree.t(action.label_translation_key),
|
8
|
+
action.url(@order),
|
9
|
+
class: action.classes,
|
10
|
+
icon: action.icon_key
|
11
|
+
) %>
|
12
|
+
<% end %>
|
5
13
|
<% end %>
|
6
14
|
|
7
15
|
<% if @adjustments.present? %>
|
@@ -37,17 +37,15 @@
|
|
37
37
|
<% end %>
|
38
38
|
|
39
39
|
<div class="col-12"><hr></div>
|
40
|
-
|
41
|
-
<%= f.
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
<%= f.error_message_on :link_type_one %>
|
50
|
-
<% end %>
|
40
|
+
<%= f.field_container :link_type_one do %>
|
41
|
+
<%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
|
42
|
+
<%= f.select(:link_type_one,
|
43
|
+
spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
|
44
|
+
{ const: 'LINKED_RESOURCE_TYPE' }),
|
45
|
+
{ include_blank: false },
|
46
|
+
class: 'link_switcher',
|
47
|
+
data: { target_field: :link_one}) %>
|
48
|
+
<%= f.error_message_on :link_type_one %>
|
51
49
|
<% end %>
|
52
50
|
<%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
|
53
51
|
</div>
|
@@ -69,17 +67,15 @@
|
|
69
67
|
<% end %>
|
70
68
|
|
71
69
|
<div class="col-12"><hr></div>
|
72
|
-
|
73
|
-
<%= f.
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
<%= f.error_message_on :link_type_two %>
|
82
|
-
<% end %>
|
70
|
+
<%= f.field_container :link_type_two do %>
|
71
|
+
<%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
|
72
|
+
<%= f.select(:link_type_two,
|
73
|
+
spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
|
74
|
+
{ const: 'LINKED_RESOURCE_TYPE' }),
|
75
|
+
{ include_blank: false },
|
76
|
+
class: 'link_switcher',
|
77
|
+
data: { target_field: :link_two}) %>
|
78
|
+
<%= f.error_message_on :link_type_two %>
|
83
79
|
<% end %>
|
84
80
|
<%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
|
85
81
|
</div>
|
@@ -101,17 +97,15 @@
|
|
101
97
|
<% end %>
|
102
98
|
|
103
99
|
<div class="col-12"><hr></div>
|
104
|
-
|
105
|
-
<%= f.
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
<%= f.error_message_on :link_type_three %>
|
114
|
-
<% end %>
|
100
|
+
<%= f.field_container :link_type_three do %>
|
101
|
+
<%= f.label :link_type_three, Spree.t('admin.navigation.link_to') %>
|
102
|
+
<%= f.select(:link_type_three,
|
103
|
+
spree_humanize_dropdown_values('Spree::Cms::Sections::ImageGallery',
|
104
|
+
{ const: 'LINKED_RESOURCE_TYPE' }),
|
105
|
+
{ include_blank: false },
|
106
|
+
class: 'link_switcher',
|
107
|
+
data: { target_field: :link_three}) %>
|
108
|
+
<%= f.error_message_on :link_type_three %>
|
115
109
|
<% end %>
|
116
110
|
<%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_three, save_to: :link_three, f: f %>
|
117
111
|
</div>
|
@@ -21,17 +21,15 @@
|
|
21
21
|
<% end %>
|
22
22
|
|
23
23
|
<div class="col-12"><hr></div>
|
24
|
-
|
25
|
-
<%= f.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
<%= f.error_message_on :link_type_one %>
|
34
|
-
<% end %>
|
24
|
+
<%= f.field_container :link_type_one do %>
|
25
|
+
<%= f.label :link_type_one, Spree.t('admin.navigation.link_to') %>
|
26
|
+
<%= f.select(:link_type_one,
|
27
|
+
spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
|
28
|
+
{ const: 'LINKED_RESOURCE_TYPE' }),
|
29
|
+
{ include_blank: false },
|
30
|
+
class: 'link_switcher',
|
31
|
+
data: { target_field: :link_one}) %>
|
32
|
+
<%= f.error_message_on :link_type_one %>
|
35
33
|
<% end %>
|
36
34
|
<%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_one, save_to: :link_one, f: f %>
|
37
35
|
</div>
|
@@ -60,17 +58,15 @@
|
|
60
58
|
|
61
59
|
<div class="col-12"><hr></div>
|
62
60
|
|
63
|
-
|
64
|
-
<%= f.
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
<%= f.error_message_on :link_type_two %>
|
73
|
-
<% end %>
|
61
|
+
<%= f.field_container :link_type_two do %>
|
62
|
+
<%= f.label :link_type_two, Spree.t('admin.navigation.link_to') %>
|
63
|
+
<%= f.select(:link_type_two,
|
64
|
+
spree_humanize_dropdown_values('Spree::Cms::Sections::SideBySideImages',
|
65
|
+
{ const: 'LINKED_RESOURCE_TYPE' }),
|
66
|
+
{ include_blank: false },
|
67
|
+
class: 'link_switcher',
|
68
|
+
data: { target_field: :link_two}) %>
|
69
|
+
<%= f.error_message_on :link_type_two %>
|
74
70
|
<% end %>
|
75
71
|
<%= render "spree/admin/shared/link_fields", resource: @cms_section, linked_type: @cms_section.link_type_two, save_to: :link_two, f: f %>
|
76
72
|
</div>
|
@@ -1,9 +1,18 @@
|
|
1
1
|
<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :images } %>
|
2
2
|
|
3
3
|
<% content_for :page_actions do %>
|
4
|
-
|
5
|
-
|
6
|
-
|
4
|
+
<% images_actions.items.each do |action| %>
|
5
|
+
<% next unless action.available?(current_ability) %>
|
6
|
+
<%= button_link_to(
|
7
|
+
Spree.t(action.label_translation_key),
|
8
|
+
action.url(@product),
|
9
|
+
class: action.classes,
|
10
|
+
icon: action.icon_key,
|
11
|
+
id: action.id,
|
12
|
+
target: action.target,
|
13
|
+
data: action.data_attributes
|
14
|
+
) %>
|
15
|
+
<% end %>
|
7
16
|
<% end %>
|
8
17
|
|
9
18
|
<% has_variants = @product.has_variants? %>
|
@@ -1,18 +1,13 @@
|
|
1
1
|
<% content_for :page_actions do %>
|
2
|
-
<%
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
<% if (can? :update, @order) && @order.some_digital? %>
|
13
|
-
<%= button_link_to Spree.t('admin.digitals.reset_download_links'),
|
14
|
-
reset_digitals_admin_order_url(@order),
|
15
|
-
method: :put,
|
16
|
-
icon: 'hdd.svg' %>
|
2
|
+
<% order_actions.items.each do |action| %>
|
3
|
+
<% next unless action.available?(current_ability, order) %>
|
4
|
+
<%= button_link_to(
|
5
|
+
Spree.t(action.label_translation_key),
|
6
|
+
action.url(order),
|
7
|
+
class: action.classes,
|
8
|
+
icon: action.icon_key,
|
9
|
+
method: action.method,
|
10
|
+
data: action.data_attributes
|
11
|
+
) %>
|
17
12
|
<% end %>
|
18
13
|
<% end %>
|
@@ -3,12 +3,17 @@
|
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% content_for :page_actions do %>
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
6
|
+
<% orders_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 %>
|
12
17
|
|
13
18
|
<% content_for :page_tabs do %>
|
14
19
|
<li class="nav-item">
|
@@ -1,10 +1,15 @@
|
|
1
1
|
<%= render partial: 'spree/admin/shared/order_tabs', locals: { current: :payments } %>
|
2
2
|
|
3
3
|
<% content_for :page_actions do %>
|
4
|
-
<%
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
<% payments_actions.items.each do |action| %>
|
5
|
+
<% next unless action.available?(current_ability, @order) %>
|
6
|
+
<%= button_link_to(
|
7
|
+
Spree.t(action.label_translation_key),
|
8
|
+
action.url(@order),
|
9
|
+
class: action.classes,
|
10
|
+
icon: action.icon_key,
|
11
|
+
id: action.id
|
12
|
+
) %>
|
8
13
|
<% end %>
|
9
14
|
<% end %>
|
10
15
|
|
@@ -1,8 +1,18 @@
|
|
1
1
|
<%= render partial: 'spree/admin/shared/product_tabs', locals: { current: :prices } %>
|
2
2
|
|
3
3
|
<% content_for :page_actions do %>
|
4
|
-
|
5
|
-
|
4
|
+
<% prices_actions.items.each do |action| %>
|
5
|
+
<% next unless action.available?(current_ability) %>
|
6
|
+
<%= button_link_to(
|
7
|
+
Spree.t(action.label_translation_key),
|
8
|
+
action.url(@product),
|
9
|
+
class: action.classes,
|
10
|
+
icon: action.icon_key,
|
11
|
+
id: action.id,
|
12
|
+
target: action.target,
|
13
|
+
data: action.data_attributes
|
14
|
+
) %>
|
15
|
+
<% end if product_actions&.items %>
|
6
16
|
<% end %>
|
7
17
|
|
8
18
|
<form>
|
@@ -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">
|
@@ -13,7 +13,7 @@
|
|
13
13
|
<% ot.option_values.each do |ov| %>
|
14
14
|
<li>
|
15
15
|
<%= label_tag "option_value_#{ov.id}" do %>
|
16
|
-
<%= check_box_tag "product[option_values_hash[#{ot.id}]
|
16
|
+
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
|
17
17
|
<div class="option-value__color" style="--presentation: <%= ov.presentation %>"></div>
|
18
18
|
<% end %>
|
19
19
|
</li>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<ul class="option-type-values">
|
24
24
|
<% ot.option_values.each do |ov| %>
|
25
25
|
<li>
|
26
|
-
<%= check_box_tag "product[option_values_hash[#{ot.id}]
|
26
|
+
<%= check_box_tag "product[option_values_hash][#{ot.id}][]", ov.id, params[:product] && (params[:product][:option_values_hash] || {}).values.flatten.include?(ov.id.to_s), id: "option_value_#{ov.id}", class: "option-value" %>
|
27
27
|
<%= label_tag "option_value_#{ov.id}", ov.presentation %>
|
28
28
|
</li>
|
29
29
|
<% end %>
|
@@ -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 %>
|