spree_admin 5.4.0.beta → 5.4.0.beta3
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/controllers/spree/admin/api_keys_controller.rb +21 -0
- data/app/controllers/spree/admin/exports_controller.rb +2 -1
- data/app/controllers/spree/admin/markets_controller.rb +14 -0
- data/app/controllers/spree/admin/products_controller.rb +0 -12
- data/app/helpers/spree/admin/api_keys_helper.rb +6 -2
- data/app/helpers/spree/admin/navigation_helper.rb +2 -4
- data/app/helpers/spree/admin/products_helper.rb +2 -5
- data/app/helpers/spree/admin/tags_helper.rb +0 -11
- data/app/javascript/spree/admin/controllers/search_clear_controller.js +1 -1
- data/app/models/action_text/video_embed.rb +13 -0
- data/app/presenters/spree/admin/order_summary_presenter.rb +12 -0
- data/app/subscribers/spree/admin/import_row_subscriber.rb +1 -1
- data/app/subscribers/spree/admin/import_subscriber.rb +1 -1
- data/app/views/action_text/video_embeds/_thumbnail.html.erb +1 -0
- data/app/views/action_text/video_embeds/_video_embed.html.erb +3 -0
- data/app/views/layouts/action_text/contents/_content.html.erb +3 -0
- data/app/views/spree/admin/api_keys/_token_card.html.erb +36 -9
- data/app/views/spree/admin/api_keys/_usage_info.html.erb +3 -2
- data/app/views/spree/admin/exports/create.turbo_stream.erb +1 -1
- data/app/views/spree/admin/exports/new.html.erb +3 -3
- data/app/views/spree/admin/payment_methods/descriptions/_gateway.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +12 -11
- data/app/views/spree/admin/products/_form.html.erb +0 -2
- data/app/views/spree/admin/products/_table_filter_dropdown.html.erb +6 -6
- data/app/views/spree/admin/shared/sidebar/_store_nav.html.erb +3 -125
- data/config/initializers/oembed.rb +1 -0
- data/config/initializers/spree_admin_navigation.rb +0 -15
- data/config/initializers/spree_admin_tables.rb +1 -100
- data/config/locales/en.yml +4 -1
- data/config/routes.rb +0 -12
- data/db/migrate/20250217171018_create_action_text_video_embeds.rb +11 -0
- data/lib/spree/admin/engine.rb +8 -0
- data/lib/spree/admin.rb +1 -0
- metadata +26 -42
- data/app/controllers/spree/admin/post_categories_controller.rb +0 -21
- data/app/controllers/spree/admin/posts_controller.rb +0 -37
- data/app/controllers/spree/admin/properties_controller.rb +0 -26
- data/app/helpers/spree/admin/posts_helper.rb +0 -9
- data/app/views/spree/admin/post_categories/_form.html.erb +0 -6
- data/app/views/spree/admin/post_categories/_table_header.html.erb +0 -5
- data/app/views/spree/admin/post_categories/_table_row.html.erb +0 -9
- data/app/views/spree/admin/post_categories/edit.html.erb +0 -1
- data/app/views/spree/admin/post_categories/index.html.erb +0 -10
- data/app/views/spree/admin/post_categories/new.html.erb +0 -1
- data/app/views/spree/admin/posts/_extra_actions.html.erb +0 -0
- data/app/views/spree/admin/posts/_form.html.erb +0 -54
- data/app/views/spree/admin/posts/_table_header.html.erb +0 -7
- data/app/views/spree/admin/posts/_table_row.html.erb +0 -22
- data/app/views/spree/admin/posts/edit.html.erb +0 -5
- data/app/views/spree/admin/posts/filters.html.erb +0 -39
- data/app/views/spree/admin/posts/index.html.erb +0 -10
- data/app/views/spree/admin/posts/new.html.erb +0 -1
- data/app/views/spree/admin/products/form/_properties.html.erb +0 -46
- data/app/views/spree/admin/properties/_filters.html.erb +0 -5
- data/app/views/spree/admin/properties/_form.html.erb +0 -8
- data/app/views/spree/admin/properties/_table_header.html.erb +0 -9
- data/app/views/spree/admin/properties/_table_row.html.erb +0 -25
- data/app/views/spree/admin/properties/edit.html.erb +0 -2
- data/app/views/spree/admin/properties/index.html.erb +0 -22
- data/app/views/spree/admin/properties/new.html.erb +0 -1
- data/app/views/spree/admin/properties/update.turbo_stream.erb +0 -1
- data/app/views/spree/admin/shared/_posts_tabs.html.erb +0 -8
- data/app/views/spree/admin/shared/sidebar/_customers_nav.html.erb +0 -15
- data/app/views/spree/admin/shared/sidebar/_integrations_nav.html.erb +0 -3
- data/app/views/spree/admin/shared/sidebar/_orders_nav.html.erb +0 -45
- data/app/views/spree/admin/shared/sidebar/_products_nav.html.erb +0 -42
- data/app/views/spree/admin/shared/sidebar/_promotions_nav.html.erb +0 -15
- data/app/views/spree/admin/shared/sidebar/_returns_nav.html.erb +0 -26
- data/app/views/spree/admin/shared/sidebar/_storefront_nav.html.erb +0 -46
- data/app/views/spree/admin/shared/sidebar/_vendors_nav.html.erb +0 -17
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6e25435ab28276f0ca9a78db5d61f4b5485be27fb668ee9c1c381db48812445e
|
|
4
|
+
data.tar.gz: cc103dc8524c6a0575e367a427e88037647cc22caa9dd5117a0091715df480d6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1b5b4a0bd4ee889940ca9826c9f6e2db5337bf1215588e543343be9fab77454ad3e9254f5b903eefcc485f6ef30673d38171fec315f3b3d5a16b463d68a42559
|
|
7
|
+
data.tar.gz: 5f67328def69057604315c1c79a3bcaae424ce369d98741b7521b1fe98f91f552aff41883534b5df81914d73d6a3d5985430551c8a6392e8caa537411778b44e
|
|
@@ -8,6 +8,27 @@ module Spree
|
|
|
8
8
|
|
|
9
9
|
helper 'spree/admin/api_keys'
|
|
10
10
|
|
|
11
|
+
def create
|
|
12
|
+
invoke_callbacks(:create, :before)
|
|
13
|
+
set_created_by
|
|
14
|
+
@object.attributes = permitted_resource_params
|
|
15
|
+
if @object.save
|
|
16
|
+
invoke_callbacks(:create, :after)
|
|
17
|
+
if @object.secret?
|
|
18
|
+
# Pass plaintext token via flash so the show page can display it once.
|
|
19
|
+
# Flash is stored in the encrypted session cookie and auto-cleared after one request.
|
|
20
|
+
# Skip the success flash — the token warning banner is sufficient feedback.
|
|
21
|
+
flash[:plaintext_token] = @object.plaintext_token
|
|
22
|
+
else
|
|
23
|
+
flash[:success] = message_after_create
|
|
24
|
+
end
|
|
25
|
+
redirect_to location_after_create, status: :see_other
|
|
26
|
+
else
|
|
27
|
+
invoke_callbacks(:create, :fails)
|
|
28
|
+
render action: :new, status: :unprocessable_content
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
11
32
|
def revoke
|
|
12
33
|
@object = scope.find_by_prefix_id!(params[:id])
|
|
13
34
|
@object.revoke!(try_spree_current_user)
|
|
@@ -35,7 +35,8 @@ module Spree
|
|
|
35
35
|
end
|
|
36
36
|
|
|
37
37
|
def assign_params
|
|
38
|
-
|
|
38
|
+
available_type = available_types.map(&:to_s).find { |t| t == permitted_resource_params[:type] }
|
|
39
|
+
@object = @object.becomes!(available_type.constantize) if available_type.present?
|
|
39
40
|
@object.search_params = permitted_resource_params[:search_params]
|
|
40
41
|
end
|
|
41
42
|
|
|
@@ -10,6 +10,20 @@ module Spree
|
|
|
10
10
|
|
|
11
11
|
def load_data
|
|
12
12
|
@countries = current_store.countries_with_shipping_coverage
|
|
13
|
+
|
|
14
|
+
# Exclude countries already assigned to other markets in the store
|
|
15
|
+
if @object&.persisted?
|
|
16
|
+
taken_country_ids = Spree::MarketCountry.joins(:market)
|
|
17
|
+
.where(spree_markets: { store_id: current_store.id, deleted_at: nil })
|
|
18
|
+
.where.not(market_id: @object.id)
|
|
19
|
+
.pluck(:country_id)
|
|
20
|
+
else
|
|
21
|
+
taken_country_ids = Spree::MarketCountry.joins(:market)
|
|
22
|
+
.where(spree_markets: { store_id: current_store.id, deleted_at: nil })
|
|
23
|
+
.pluck(:country_id)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
@countries = @countries.where.not(id: taken_country_ids) if taken_country_ids.any?
|
|
13
27
|
end
|
|
14
28
|
|
|
15
29
|
def permitted_resource_params
|
|
@@ -19,10 +19,8 @@ module Spree
|
|
|
19
19
|
|
|
20
20
|
new_action.before :build_master_prices
|
|
21
21
|
new_action.before :build_master_stock_items
|
|
22
|
-
new_action.before :build_product_properties
|
|
23
22
|
edit_action.before :build_master_prices
|
|
24
23
|
edit_action.before :build_master_stock_items
|
|
25
|
-
edit_action.before :build_product_properties
|
|
26
24
|
create.after :assign_master_images
|
|
27
25
|
update.before :skip_updating_status
|
|
28
26
|
update.before :update_status
|
|
@@ -271,16 +269,6 @@ module Spree
|
|
|
271
269
|
{}
|
|
272
270
|
end
|
|
273
271
|
|
|
274
|
-
def build_product_properties
|
|
275
|
-
return unless Spree::Config[:product_properties_enabled]
|
|
276
|
-
|
|
277
|
-
Spree::Property.all.each do |property|
|
|
278
|
-
@product.product_properties.build(property: property) unless @product.product_properties.find do |product_property|
|
|
279
|
-
product_property.property_id == property.id
|
|
280
|
-
end
|
|
281
|
-
end
|
|
282
|
-
end
|
|
283
|
-
|
|
284
272
|
def assign_master_images
|
|
285
273
|
return unless @product.master.persisted?
|
|
286
274
|
|
|
@@ -24,8 +24,12 @@ module Spree
|
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def masked_api_key(api_key)
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
if api_key.secret?
|
|
28
|
+
"#{api_key.token_prefix}#{'*' * 15}"
|
|
29
|
+
else
|
|
30
|
+
token = api_key.token
|
|
31
|
+
"#{token[0..6]}#{'*' * 16}#{token[-4..]}"
|
|
32
|
+
end
|
|
29
33
|
end
|
|
30
34
|
end
|
|
31
35
|
end
|
|
@@ -273,13 +273,13 @@ module Spree
|
|
|
273
273
|
end
|
|
274
274
|
|
|
275
275
|
# renders a link to preview a resource on the storefront using the spree_storefront_resource_url helper
|
|
276
|
-
# @param resource [Spree::Product
|
|
276
|
+
# @param resource [Spree::Product] the resource to preview
|
|
277
277
|
# @param options [Hash] the options for the link
|
|
278
278
|
# @return [String] the link to preview the resource
|
|
279
279
|
def external_page_preview_link(resource, options = {})
|
|
280
280
|
resource_name = options[:name] || resource.class.name.demodulize
|
|
281
281
|
|
|
282
|
-
url = if
|
|
282
|
+
url = if resource.instance_of?(Spree::Product)
|
|
283
283
|
spree_storefront_resource_url(resource, preview_id: resource.id)
|
|
284
284
|
else
|
|
285
285
|
spree_storefront_resource_url(resource)
|
|
@@ -318,8 +318,6 @@ module Spree
|
|
|
318
318
|
# @param options [Hash] additional options for rendering
|
|
319
319
|
# @return [String] the rendered navigation HTML
|
|
320
320
|
def render_navigation(context = :sidebar, **options)
|
|
321
|
-
return '' if Spree::Admin::RuntimeConfig.legacy_sidebar_navigation
|
|
322
|
-
|
|
323
321
|
items = navigation_items(context)
|
|
324
322
|
return '' if items.empty?
|
|
325
323
|
|
|
@@ -90,9 +90,9 @@ module Spree
|
|
|
90
90
|
end
|
|
91
91
|
|
|
92
92
|
def product_filter_stock_dropdown_value
|
|
93
|
-
if params.dig(:q, :
|
|
93
|
+
if params.dig(:q, :in_stock) == '1'
|
|
94
94
|
Spree.t('admin.products.in_stock')
|
|
95
|
-
elsif params.dig(:q, :
|
|
95
|
+
elsif params.dig(:q, :out_of_stock) == '1'
|
|
96
96
|
Spree.t('admin.products.out_of_stock')
|
|
97
97
|
else
|
|
98
98
|
Spree.t('admin.products.any_stock')
|
|
@@ -111,9 +111,6 @@ module Spree
|
|
|
111
111
|
[:admin, @search]
|
|
112
112
|
end
|
|
113
113
|
|
|
114
|
-
def sorted_product_properties(product)
|
|
115
|
-
product.product_properties.sort_by { |product_property| product_property.property.position }
|
|
116
|
-
end
|
|
117
114
|
end
|
|
118
115
|
end
|
|
119
116
|
end
|
|
@@ -9,17 +9,6 @@ module Spree
|
|
|
9
9
|
@tags_json_array ||= tags_scope.pluck(:id, :name).map { |id, name| { id: id, name: name } }.as_json
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
def post_tags_scope
|
|
13
|
-
@post_tags_scope ||= ActsAsTaggableOn::Tag.
|
|
14
|
-
joins(:taggings).
|
|
15
|
-
where(ActsAsTaggableOn.taggings_table => { taggable_type: 'Spree::Post' }).
|
|
16
|
-
for_context(:tags).for_tenant(current_store.id)
|
|
17
|
-
end
|
|
18
|
-
|
|
19
|
-
def post_tags_json_array
|
|
20
|
-
@post_tags_json_array ||= post_tags_scope.pluck(:id, :name).map { |id, name| { id: id, name: name } }.as_json
|
|
21
|
-
end
|
|
22
|
-
|
|
23
12
|
def user_tags_scope
|
|
24
13
|
@user_tags_scope ||= ActsAsTaggableOn::Tag.
|
|
25
14
|
joins(:taggings).
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
module ActionText
|
|
2
|
+
class VideoEmbed < ApplicationRecord
|
|
3
|
+
include ActionText::Attachable
|
|
4
|
+
|
|
5
|
+
validates :url, :raw_html, :thumbnail_url, presence: true
|
|
6
|
+
|
|
7
|
+
# `to_partial_path` for the storefront render is by default "action_text/video_embeds/video_embed"
|
|
8
|
+
|
|
9
|
+
def to_trix_content_attachment_partial_path
|
|
10
|
+
'action_text/video_embeds/thumbnail'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -13,6 +13,7 @@ module Spree
|
|
|
13
13
|
[
|
|
14
14
|
*metadata_rows,
|
|
15
15
|
:separator,
|
|
16
|
+
locale_row,
|
|
16
17
|
currency_row,
|
|
17
18
|
subtotal_row,
|
|
18
19
|
shipping_row,
|
|
@@ -71,6 +72,17 @@ module Spree
|
|
|
71
72
|
rows
|
|
72
73
|
end
|
|
73
74
|
|
|
75
|
+
def locale_row
|
|
76
|
+
return nil if order.locale.blank?
|
|
77
|
+
|
|
78
|
+
{
|
|
79
|
+
label: Spree.t(:locale),
|
|
80
|
+
value: order.locale,
|
|
81
|
+
id: 'locale',
|
|
82
|
+
type: :code
|
|
83
|
+
}
|
|
84
|
+
end
|
|
85
|
+
|
|
74
86
|
def currency_row
|
|
75
87
|
{
|
|
76
88
|
label: Spree.t(:currency),
|
|
@@ -21,7 +21,7 @@ module Spree
|
|
|
21
21
|
import_row_id = event.payload['id']
|
|
22
22
|
return unless import_row_id
|
|
23
23
|
|
|
24
|
-
import_row = Spree::ImportRow.
|
|
24
|
+
import_row = Spree::ImportRow.find_by_prefix_id(import_row_id)
|
|
25
25
|
return unless import_row
|
|
26
26
|
|
|
27
27
|
add_row_to_import_view(import_row)
|
|
@@ -19,7 +19,7 @@ module Spree
|
|
|
19
19
|
import_id = event.payload['id']
|
|
20
20
|
return unless import_id
|
|
21
21
|
|
|
22
|
-
import = Spree::Import.
|
|
22
|
+
import = Spree::Import.find_by_prefix_id(import_id)
|
|
23
23
|
return unless import
|
|
24
24
|
return unless import.respond_to?(:broadcast_update_to)
|
|
25
25
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
<%= image_tag video_embed.thumbnail_url %>
|
|
@@ -3,25 +3,52 @@
|
|
|
3
3
|
<h5 class="card-title"><%= Spree.t(:api_key) %></h5>
|
|
4
4
|
</div>
|
|
5
5
|
<div class="card-body">
|
|
6
|
-
<% if
|
|
6
|
+
<% if !@api_key.active? %>
|
|
7
|
+
<div class="bg-red-50 border border-red-200 rounded-md p-4">
|
|
8
|
+
<div class="flex items-center">
|
|
9
|
+
<%= icon 'alert-triangle', class: 'text-red-500 mr-2' %>
|
|
10
|
+
<span class="text-red-700"><%= Spree.t('admin.api_keys.key_revoked_message') %></span>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
<% elsif @api_key.secret? && flash[:plaintext_token].present? %>
|
|
14
|
+
<div class="bg-yellow-50 border border-yellow-200 rounded-md p-4 mb-4">
|
|
15
|
+
<div class="flex items-center">
|
|
16
|
+
<%= icon 'alert-triangle', class: 'text-yellow-600 mr-2' %>
|
|
17
|
+
<span class="text-yellow-800 text-sm font-medium"><%= Spree.t('admin.api_keys.token_warning') %></span>
|
|
18
|
+
</div>
|
|
19
|
+
</div>
|
|
7
20
|
<div data-controller="password-visibility" class="input-group gap-0 pr-1">
|
|
8
|
-
<input type="password" class="grow text-truncate" data-password-visibility-target="input" spellcheck="false" value="<%=
|
|
21
|
+
<input type="password" class="grow text-truncate" data-password-visibility-target="input" spellcheck="false" value="<%= flash[:plaintext_token] %>" readonly>
|
|
9
22
|
|
|
10
23
|
<button type="button" class="btn hover:bg-gray-100 p-1 mr-1 rounded" data-action="password-visibility#toggle">
|
|
11
24
|
<span data-password-visibility-target="icon"><%= icon 'eye', class: 'mr-0' %></span>
|
|
12
25
|
<span data-password-visibility-target="icon" class="hidden"><%= icon 'eye-off', class: 'mr-0' %></span>
|
|
13
26
|
</button>
|
|
14
27
|
|
|
15
|
-
<%= clipboard_component(
|
|
16
|
-
button_class: 'btn hover:bg-gray-100 p-1 rounded',
|
|
28
|
+
<%= clipboard_component(flash[:plaintext_token],
|
|
29
|
+
button_class: 'btn hover:bg-gray-100 p-1 rounded',
|
|
17
30
|
icon_class: 'mr-0') %>
|
|
18
31
|
</div>
|
|
19
|
-
<%
|
|
20
|
-
<div class="bg-
|
|
21
|
-
<div class="flex items-center">
|
|
22
|
-
<%= icon '
|
|
23
|
-
<span class="text-
|
|
32
|
+
<% elsif @api_key.secret? %>
|
|
33
|
+
<div class="bg-gray-50 border border-gray-200 rounded-md p-4">
|
|
34
|
+
<div class="flex items-center mb-2">
|
|
35
|
+
<%= icon 'lock', class: 'text-gray-500 mr-2' %>
|
|
36
|
+
<span class="text-gray-700 text-sm font-medium"><%= Spree.t('admin.api_keys.secret_key_hidden') %></span>
|
|
24
37
|
</div>
|
|
38
|
+
<code class="text-sm text-gray-500"><%= @api_key.token_prefix %><%= '***************' %></code>
|
|
39
|
+
</div>
|
|
40
|
+
<% else %>
|
|
41
|
+
<div data-controller="password-visibility" class="input-group gap-0 pr-1">
|
|
42
|
+
<input type="password" class="grow text-truncate" data-password-visibility-target="input" spellcheck="false" value="<%= @api_key.token %>" readonly>
|
|
43
|
+
|
|
44
|
+
<button type="button" class="btn hover:bg-gray-100 p-1 mr-1 rounded" data-action="password-visibility#toggle">
|
|
45
|
+
<span data-password-visibility-target="icon"><%= icon 'eye', class: 'mr-0' %></span>
|
|
46
|
+
<span data-password-visibility-target="icon" class="hidden"><%= icon 'eye-off', class: 'mr-0' %></span>
|
|
47
|
+
</button>
|
|
48
|
+
|
|
49
|
+
<%= clipboard_component(@api_key.token,
|
|
50
|
+
button_class: 'btn hover:bg-gray-100 p-1 rounded',
|
|
51
|
+
icon_class: 'mr-0') %>
|
|
25
52
|
</div>
|
|
26
53
|
<% end %>
|
|
27
54
|
</div>
|
|
@@ -8,9 +8,10 @@
|
|
|
8
8
|
</p>
|
|
9
9
|
|
|
10
10
|
<h6 class="font-medium text-sm mb-2"><%= Spree.t('admin.api_keys.example_request') %></h6>
|
|
11
|
+
<% example_token = flash[:plaintext_token] || @api_key.token || "#{@api_key.token_prefix}..." %>
|
|
11
12
|
<div class="bg-gray-900 rounded-md p-4 overflow-x-auto">
|
|
12
|
-
<pre class="text-green-400 text-sm font-mono
|
|
13
|
-
-H "
|
|
13
|
+
<pre class="text-green-400 text-sm font-mono"><code class="bg-transparent text-green-500">curl -X GET "<%= spree.api_v3_store_products_url(host: current_store.url_or_custom_domain) %>" \
|
|
14
|
+
-H "x-spree-api-key: <strong class="text-white"><%= example_token %></strong>"</code></pre>
|
|
14
15
|
</div>
|
|
15
16
|
</div>
|
|
16
17
|
</div>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
<%= turbo_frame_tag :export_dialog do %>
|
|
2
|
-
<%= form_for @
|
|
2
|
+
<%= form_for @object, url: spree.admin_exports_path, as: :export do |f| %>
|
|
3
3
|
<%= f.hidden_field :type %>
|
|
4
4
|
<%= f.hidden_field :search_params %>
|
|
5
5
|
<div class="dialog-header">
|
|
6
6
|
<h5 class="dialog-title">
|
|
7
|
-
<%= Spree.t(:export) + ' ' + plural_resource_name(@
|
|
7
|
+
<%= Spree.t(:export) + ' ' + plural_resource_name(@object.model_class) %>
|
|
8
8
|
</h5>
|
|
9
9
|
<button type="button" class="btn-close" data-action="click->export-dialog#close" aria-label="Close"></button>
|
|
10
10
|
</div>
|
|
11
11
|
<div class="dialog-body">
|
|
12
|
-
<%= render 'spree/admin/shared/error_messages', target: @
|
|
12
|
+
<%= render 'spree/admin/shared/error_messages', target: @object %>
|
|
13
13
|
<div class="custom-control custom-radio hover:bg-gray-50 rounded-lg p-3">
|
|
14
14
|
<%= f.radio_button :record_selection, 'filtered', class: 'custom-control-input' %>
|
|
15
15
|
<%= f.label :record_selection, for: :export_record_selection_filtered, class: 'custom-control-label flex-col items-start' do %>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
Classic
|
|
1
|
+
Classic payment gateway provided by community.
|
|
@@ -31,19 +31,20 @@
|
|
|
31
31
|
<div class="table-responsive">
|
|
32
32
|
<table class="table">
|
|
33
33
|
<thead>
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
<tr>
|
|
35
|
+
<th scope="col"><%= Spree.t(:name) %></th>
|
|
36
|
+
<th scope="col"><%= Spree.t(:description) %></th>
|
|
37
|
+
<th scope="col"></th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
<%= render partial: 'spree/admin/payment_methods/available_payment_method', collection: available_payment_methods, as: :payment_method %>
|
|
42
|
+
</tbody>
|
|
43
|
+
</table>
|
|
44
|
+
</div>
|
|
44
45
|
</div>
|
|
45
46
|
<% end %>
|
|
46
47
|
|
|
47
48
|
<p class="text-gray-600 text-center my-12">
|
|
48
49
|
Find more payment methods in <%= external_link_to 'Integrations Directory', 'https://spreecommerce.org/docs/integrations/integrations', target: '_blank' %>
|
|
49
|
-
</p>
|
|
50
|
+
</p>
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
<% end unless @product.has_variants? %>
|
|
8
8
|
<%= render 'spree/admin/products/form/variants', f: f %>
|
|
9
9
|
<%= render 'spree/admin/products/form/inventory', f: f unless @product.has_variants? %>
|
|
10
|
-
<%= render 'spree/admin/products/form/properties', f: f if Spree::Config[:product_properties_enabled] %>
|
|
11
|
-
|
|
12
10
|
<%= render_admin_partials(:product_form_partials, f: f, product: @product) %>
|
|
13
11
|
</div>
|
|
14
12
|
<div class="col-span-12 md:col-span-4">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
<%= dropdown_menu do %>
|
|
17
17
|
<h6 class="dropdown-header"><%= Spree.t('admin.products.by_status') %>:</h6>
|
|
18
18
|
|
|
19
|
-
<%= active_link_to Spree.t('admin.products.all_statuses'), params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq
|
|
19
|
+
<%= active_link_to Spree.t('admin.products.all_statuses'), params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq in_stock out_of_stock] ).all?(&:blank?) %>
|
|
20
20
|
<%= link_to Spree.t('admin.products.active'),
|
|
21
21
|
params.to_unsafe_h.deep_merge({page: nil, q: {status_eq: :active}}),
|
|
22
22
|
class: "dropdown-item #{'active' if params[:q][:status_eq] == 'active'}" %>
|
|
@@ -31,12 +31,12 @@
|
|
|
31
31
|
|
|
32
32
|
<h6 class="dropdown-header"><%= Spree.t('admin.products.by_stock') %>:</h6>
|
|
33
33
|
|
|
34
|
-
<%= active_link_to Spree.t('admin.products.any_stock'), params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
34
|
+
<%= active_link_to Spree.t('admin.products.any_stock'), params.to_unsafe_h.deep_merge({page: nil, q: {in_stock: nil, out_of_stock: nil}}), class: 'dropdown-item', active: (params[:q] || {}).values_at(*%w[status_eq in_stock out_of_stock] ).all?(&:blank?) %>
|
|
35
35
|
<%= link_to Spree.t('admin.products.in_stock'),
|
|
36
|
-
params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
37
|
-
class: "dropdown-item #{'active' if params[:q][:
|
|
36
|
+
params.to_unsafe_h.deep_merge({page: nil, q: {in_stock: '1', out_of_stock: nil}}),
|
|
37
|
+
class: "dropdown-item #{'active' if params[:q][:in_stock] == '1'}" %>
|
|
38
38
|
<%= link_to Spree.t('admin.products.out_of_stock'),
|
|
39
|
-
params.to_unsafe_h.deep_merge({page: nil, q: {
|
|
40
|
-
class: "dropdown-item #{'active' if params[:q][:
|
|
39
|
+
params.to_unsafe_h.deep_merge({page: nil, q: {out_of_stock: '1', in_stock: nil}}),
|
|
40
|
+
class: "dropdown-item #{'active' if params[:q][:out_of_stock] == '1'}" %>
|
|
41
41
|
<% end %>
|
|
42
42
|
<% end %>
|
|
@@ -1,131 +1,9 @@
|
|
|
1
|
-
<% if
|
|
2
|
-
|
|
3
|
-
<% if settings_area? %>
|
|
4
|
-
<ul class="nav flex-col">
|
|
5
|
-
<% if can?(:manage, current_store) %>
|
|
6
|
-
<%= nav_item(Spree.t(:store_details), spree.edit_admin_store_path(section: 'general-settings'), icon: 'building-store', active: params[:section] == 'general-settings') %>
|
|
7
|
-
<% end %>
|
|
8
|
-
|
|
9
|
-
<% if can?(:manage, Spree.admin_user_class) %>
|
|
10
|
-
<%= nav_item(Spree.t(:users), spree.admin_admin_users_path, icon: 'users', active: %w[admin_users invitations roles].include?(controller_name)) %>
|
|
11
|
-
<% end %>
|
|
12
|
-
|
|
13
|
-
<%= nav_item(Spree.t(:emails), spree.edit_admin_store_path(section: 'emails'), icon: 'send', active: params[:section] == 'emails') if can?(:manage, current_store) %>
|
|
14
|
-
<%= nav_item(Spree.t(:policies), spree.admin_policies_path, icon: 'list-check') if can?(:manage, Spree::Policy) %>
|
|
15
|
-
<%= nav_item(Spree.t(:checkout), spree.edit_admin_store_path(section: 'checkout'), icon: 'shopping-cart', active: params[:section] == 'checkout') if can?(:manage, current_store) %>
|
|
16
|
-
<%= render_admin_partials(:store_settings_nav_partials) %>
|
|
17
|
-
|
|
18
|
-
<% if defined?(Spree::CustomDomain) && can?(:manage, Spree::CustomDomain) %>
|
|
19
|
-
<%= nav_item(Spree.t(:domains), spree.admin_custom_domains_path, icon: 'world-www') %>
|
|
20
|
-
<% end %>
|
|
21
|
-
|
|
22
|
-
<% if can?(:manage, Spree::PaymentMethod) %>
|
|
23
|
-
<%= nav_item(Spree.t(:payments), spree.admin_payment_methods_path, icon: 'credit-card') %>
|
|
24
|
-
<% end %>
|
|
25
|
-
|
|
26
|
-
<% if can?(:manage, Spree::Zone) %>
|
|
27
|
-
<%= nav_item(Spree.t(:zones), spree.admin_zones_path, icon: 'world', active: %w[zones countries states].include?(controller_name)) %>
|
|
28
|
-
<% end %>
|
|
29
|
-
|
|
30
|
-
<% if can?(:manage, Spree::ShippingMethod) %>
|
|
31
|
-
<%= nav_item(Spree.t(:shipping), spree.admin_shipping_methods_path, icon: 'truck', active: %w[shipping_methods shipping_categories].include?(controller_name)) %>
|
|
32
|
-
<% end %>
|
|
33
|
-
|
|
34
|
-
<% if can?(:manage, Spree::TaxRate) %>
|
|
35
|
-
<%= nav_item(Spree.t(:tax), spree.admin_tax_rates_path, icon: 'receipt-tax', active: %w[tax_rates tax_categories stripe_tax_registrations].include?(controller_name)) %>
|
|
36
|
-
<% end %>
|
|
37
|
-
|
|
38
|
-
<% if can?(:manage, Spree::ReturnAuthorizationReason) %>
|
|
39
|
-
<%= nav_item(Spree.t(:returns), spree.admin_return_authorization_reasons_path, icon: 'receipt-refund', active: %w[refund_reasons reimbursement_types return_authorization_reasons].include?(controller_name)) %>
|
|
40
|
-
<% end %>
|
|
41
|
-
|
|
42
|
-
<% if can?(:manage, Spree::StockLocation) %>
|
|
43
|
-
<%= nav_item(Spree.t(:stock_locations), spree.admin_stock_locations_path, icon: 'map-pin') %>
|
|
44
|
-
<% end %>
|
|
45
|
-
|
|
46
|
-
<% if can?(:manage, Spree::MetafieldDefinition) %>
|
|
47
|
-
<%= nav_item(Spree.t(:metafield_definitions), spree.admin_metafield_definitions_path, icon: 'list-details') %>
|
|
48
|
-
<% end %>
|
|
49
|
-
|
|
50
|
-
<% if can?(:manage, Spree::Store) %>
|
|
51
|
-
<% if spree.respond_to?(:admin_audits_path) %>
|
|
52
|
-
<%= nav_item(Spree.t('admin.audit_log'), spree.admin_audits_path, icon: 'history', active: %w[audits exports imports].include?(controller_name)) %>
|
|
53
|
-
<% else %>
|
|
54
|
-
<li class="nav-item">
|
|
55
|
-
<%= external_link_to nil, 'https://spreecommerce.org/pricing', class: 'nav-link flex items-center w-full' do %>
|
|
56
|
-
<%= icon 'history' %>
|
|
57
|
-
<%= Spree.t('admin.audit_log') %>
|
|
58
|
-
|
|
59
|
-
<span class="badge ml-auto rounded-full" data-controller="tooltip">
|
|
60
|
-
Enterprise
|
|
61
|
-
<%= tooltip("This feature is part of the Enterprise Edition.") %>
|
|
62
|
-
</span>
|
|
63
|
-
<% end %>
|
|
64
|
-
</li>
|
|
65
|
-
<% end %>
|
|
66
|
-
<% end %>
|
|
67
|
-
|
|
68
|
-
<% if defined?(Spree::OauthApplication) && can?(:manage, Spree::OauthApplication) %>
|
|
69
|
-
<%= nav_item(Spree.t(:developers), spree.admin_oauth_applications_path, icon: 'terminal', active: %w[oauth_applications webhooks_subscribers].include?(controller_name)) %>
|
|
70
|
-
<% end %>
|
|
71
|
-
|
|
72
|
-
<%= nav_item(Spree.t('admin.edit_profile'), spree.edit_admin_profile_path, icon: 'user-scan') %>
|
|
73
|
-
|
|
74
|
-
<%= render_admin_partials(:settings_nav_partials) %>
|
|
75
|
-
</ul>
|
|
1
|
+
<% if settings_area? %>
|
|
2
|
+
<%= render_navigation(:settings) %>
|
|
76
3
|
<% else %>
|
|
77
|
-
|
|
78
|
-
<% if can?(:manage, current_store) %>
|
|
79
|
-
<% unless current_store.setup_completed? %>
|
|
80
|
-
<%= nav_item(nil, spree.admin_getting_started_path, icon: 'map') do %>
|
|
81
|
-
<%= icon 'map' %>
|
|
82
|
-
<%= Spree.t('admin.getting_started') %>
|
|
83
|
-
<span class="badge ml-auto badge-info">
|
|
84
|
-
<%= current_store.setup_tasks_done %><span class="opacity-50">/<%= current_store.setup_tasks_total %></span>
|
|
85
|
-
</span>
|
|
86
|
-
<% end %>
|
|
87
|
-
<% end %>
|
|
88
|
-
<% end %>
|
|
89
|
-
|
|
90
|
-
<%= nav_item(Spree.t(:home), spree.admin_path, icon: 'home', active: controller_name == 'dashboard' && action_name == 'show') %>
|
|
91
|
-
|
|
92
|
-
<%= render 'spree/admin/shared/sidebar/orders_nav' %>
|
|
93
|
-
<%= render 'spree/admin/shared/sidebar/returns_nav' %>
|
|
94
|
-
<%= render 'spree/admin/shared/sidebar/products_nav' %>
|
|
95
|
-
<%= render 'spree/admin/shared/sidebar/vendors_nav' %>
|
|
96
|
-
<%= render 'spree/admin/shared/sidebar/customers_nav' %>
|
|
97
|
-
<%= render 'spree/admin/shared/sidebar/promotions_nav' %>
|
|
98
|
-
|
|
99
|
-
<% if can?(:manage, Spree::Report) %>
|
|
100
|
-
<%= nav_item(Spree.t(:reports), spree.admin_reports_path, icon: 'chart-bar') %>
|
|
101
|
-
<% end %>
|
|
102
|
-
|
|
103
|
-
<%= render_admin_partials(:store_nav_partials) %>
|
|
104
|
-
|
|
105
|
-
<%= render 'spree/admin/shared/sidebar/storefront_nav' %>
|
|
106
|
-
<%= render 'spree/admin/shared/sidebar/integrations_nav' %>
|
|
107
|
-
</ul>
|
|
4
|
+
<%= render_navigation(:sidebar) %>
|
|
108
5
|
|
|
109
6
|
<div class="mt-auto flex flex-col">
|
|
110
7
|
<%= render 'spree/admin/shared/sidebar/enterprise_edition_notice' %>
|
|
111
|
-
|
|
112
|
-
<ul class="nav flex-col mb-2">
|
|
113
|
-
<% if can?(:manage, current_store) %>
|
|
114
|
-
<%= nav_item(Spree.t(:settings), spree.edit_admin_store_path(section: 'general-settings'), icon: 'settings', active: params[:section] == 'general-settings') %>
|
|
115
|
-
<%= nav_item(Spree.t(:users), spree.admin_admin_users_path, icon: 'users') %>
|
|
116
|
-
<% end %>
|
|
117
|
-
</ul>
|
|
118
8
|
</div>
|
|
119
|
-
<% end %>
|
|
120
|
-
<% else %>
|
|
121
|
-
<%# New navigation system %>
|
|
122
|
-
<% if settings_area? %>
|
|
123
|
-
<%= render_navigation(:settings) %>
|
|
124
|
-
<% else %>
|
|
125
|
-
<%= render_navigation(:sidebar) %>
|
|
126
|
-
|
|
127
|
-
<div class="mt-auto flex flex-col">
|
|
128
|
-
<%= render 'spree/admin/shared/sidebar/enterprise_edition_notice' %>
|
|
129
|
-
</div>
|
|
130
|
-
<% end %>
|
|
131
9
|
<% end %>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
OEmbed::Providers.register_all
|
|
@@ -126,12 +126,6 @@ Rails.application.config.after_initialize do
|
|
|
126
126
|
active: -> { %w[option_types option_values].include?(controller_name) },
|
|
127
127
|
if: -> { can?(:manage, Spree::OptionType) }
|
|
128
128
|
|
|
129
|
-
# Properties
|
|
130
|
-
products.add :properties,
|
|
131
|
-
label: :properties,
|
|
132
|
-
url: :admin_properties_path,
|
|
133
|
-
position: 50,
|
|
134
|
-
if: -> { can?(:manage, Spree::Property) && Spree::Config.product_properties_enabled }
|
|
135
129
|
end
|
|
136
130
|
|
|
137
131
|
# Customers with submenu
|
|
@@ -179,15 +173,6 @@ Rails.application.config.after_initialize do
|
|
|
179
173
|
position: 60,
|
|
180
174
|
if: -> { can?(:manage, Spree::Report) }
|
|
181
175
|
|
|
182
|
-
# Posts (Blog)
|
|
183
|
-
sidebar_nav.add :posts,
|
|
184
|
-
label: :posts,
|
|
185
|
-
url: :admin_posts_path,
|
|
186
|
-
icon: 'article',
|
|
187
|
-
position: 70,
|
|
188
|
-
active: -> { %w[posts post_categories].include?(controller_name) },
|
|
189
|
-
if: -> { can?(:manage, Spree::Post) }
|
|
190
|
-
|
|
191
176
|
# Integrations
|
|
192
177
|
sidebar_nav.add :integrations,
|
|
193
178
|
label: :integrations,
|