solidus_backend 4.7.1 → 4.8.0
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/LICENSE +29 -0
- data/app/assets/images/spree/backend/themes/solidus_admin/remixicon.symbol.svg +4 -4
- data/app/controllers/spree/admin/base_controller.rb +3 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +8 -4
- data/app/controllers/spree/admin/orders_controller.rb +3 -3
- data/app/controllers/spree/admin/payments_controller.rb +15 -2
- data/app/controllers/spree/admin/products_controller.rb +1 -1
- data/app/controllers/spree/admin/properties_controller.rb +1 -1
- data/app/controllers/spree/admin/refunds_controller.rb +8 -0
- data/app/controllers/spree/admin/stock_items_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_locations_controller.rb +1 -1
- data/app/controllers/spree/admin/store_credits_controller.rb +1 -1
- data/app/controllers/spree/admin/stores_controller.rb +7 -0
- data/app/controllers/spree/admin/tax_rates_controller.rb +1 -1
- data/app/controllers/spree/admin/users_controller.rb +7 -3
- data/app/controllers/spree/admin/variants_controller.rb +1 -1
- data/app/helpers/spree/admin/products_helper.rb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +2 -2
- data/app/views/spree/admin/payment_methods/_form.html.erb +1 -1
- data/app/views/spree/admin/payments/_log_entries.html.erb +7 -2
- data/app/views/spree/admin/payments/show.html.erb +2 -2
- data/app/views/spree/admin/shared/_address_form.html.erb +19 -13
- data/app/views/spree/admin/shared/_head.html.erb +1 -1
- data/app/views/spree/admin/shared/_locale_selection.html.erb +1 -1
- data/app/views/spree/admin/shared/_locale_selection_solidus_admin.html.erb +1 -1
- data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
- data/app/views/spree/admin/shared/_navigation_header.html.erb +1 -1
- data/app/views/spree/admin/shared/_navigation_solidus_admin.html.erb +3 -2
- data/app/views/spree/admin/shared/_timezone_selection.html.erb +10 -0
- data/app/views/spree/admin/shared/_timezone_selection_solidus_admin.html.erb +13 -0
- data/app/views/spree/admin/stores/_form.html.erb +7 -0
- data/app/views/spree/admin/users/_form.html.erb +8 -1
- metadata +10 -7
- /data/app/assets/images/{favicon.ico → spree/backend/favicon.ico} +0 -0
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
module Spree
|
|
4
4
|
module Admin
|
|
5
5
|
class BaseController < Spree::BaseController
|
|
6
|
+
include Spree::Core::ControllerHelpers::Timezone
|
|
7
|
+
|
|
6
8
|
helper "spree/admin/navigation"
|
|
7
9
|
layout "spree/layouts/admin"
|
|
8
10
|
|
|
@@ -49,7 +51,7 @@ module Spree
|
|
|
49
51
|
end
|
|
50
52
|
|
|
51
53
|
def config_locale
|
|
52
|
-
Spree::Backend::Config
|
|
54
|
+
Spree::Backend::Config.locale
|
|
53
55
|
end
|
|
54
56
|
|
|
55
57
|
def lock_order
|
|
@@ -23,12 +23,16 @@ module Spree
|
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
def update
|
|
26
|
-
if
|
|
26
|
+
if should_associate_user?
|
|
27
|
+
requested_user = Spree.user_class.accessible_by(current_ability, :show).find_by(id: params[:user_id])
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
@order.associate_user!(requested_user, @order.email.blank?)
|
|
29
|
+
unless requested_user
|
|
30
|
+
return resource_not_found(flash_class: Spree.user_class, redirect_url: edit_admin_order_customer_url(@order))
|
|
31
31
|
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
if @order.contents.update_cart(order_params)
|
|
35
|
+
@order.associate_user!(requested_user, @order.email.blank?) if requested_user
|
|
32
36
|
|
|
33
37
|
unless @order.completed?
|
|
34
38
|
@order.contents.advance
|
|
@@ -16,7 +16,7 @@ module Spree
|
|
|
16
16
|
|
|
17
17
|
def index
|
|
18
18
|
params[:q] ||= {}
|
|
19
|
-
params[:q][:completed_at_not_null] ||= "1" if Spree::Config
|
|
19
|
+
params[:q][:completed_at_not_null] ||= "1" if Spree::Config.show_only_complete_orders_by_default
|
|
20
20
|
@show_only_completed = params[:q][:completed_at_not_null] == "1"
|
|
21
21
|
params[:q][:s] ||= @show_only_completed ? "completed_at desc" : "created_at desc"
|
|
22
22
|
params[:q][:completed_at_not_null] = "" unless @show_only_completed
|
|
@@ -53,7 +53,7 @@ module Spree
|
|
|
53
53
|
@search = Spree::Order.accessible_by(current_ability, :index).ransack(params[:q])
|
|
54
54
|
@orders = @search.result.includes([:user])
|
|
55
55
|
.page(params[:page])
|
|
56
|
-
.per(params[:per_page] || Spree::Config
|
|
56
|
+
.per(params[:per_page] || Spree::Config.orders_per_page)
|
|
57
57
|
|
|
58
58
|
# Restore dates
|
|
59
59
|
params[:q][:created_at_gt] = created_at_gt
|
|
@@ -61,7 +61,7 @@ module Spree
|
|
|
61
61
|
end
|
|
62
62
|
|
|
63
63
|
def new
|
|
64
|
-
user = Spree.user_class.find_by(id: params[:user_id]) if params[:user_id]
|
|
64
|
+
user = Spree.user_class.accessible_by(current_ability, :show).find_by(id: params[:user_id]) if params[:user_id]
|
|
65
65
|
order_importer_params = order_params
|
|
66
66
|
order_importer_params[:bill_address] = user&.bill_address
|
|
67
67
|
order_importer_params[:ship_address] = user&.ship_address
|
|
@@ -9,6 +9,7 @@ module Spree
|
|
|
9
9
|
before_action :load_payment, except: [:create, :new, :index, :fire]
|
|
10
10
|
before_action :load_payment_for_fire, only: :fire
|
|
11
11
|
before_action :load_data
|
|
12
|
+
before_action :load_log_entries, only: [:show]
|
|
12
13
|
before_action :require_bill_address, only: [:index]
|
|
13
14
|
|
|
14
15
|
helper ::Spree::Admin::OrdersHelper
|
|
@@ -16,7 +17,7 @@ module Spree
|
|
|
16
17
|
respond_to :html
|
|
17
18
|
|
|
18
19
|
def index
|
|
19
|
-
@payments = @order.payments.includes(refunds: :reason)
|
|
20
|
+
@payments = @order.payments.includes(:payment_method, refunds: :reason)
|
|
20
21
|
@refunds = @payments.flat_map(&:refunds)
|
|
21
22
|
redirect_to new_admin_order_payment_url(@order) if @payments.empty?
|
|
22
23
|
end
|
|
@@ -57,6 +58,11 @@ module Spree
|
|
|
57
58
|
def fire
|
|
58
59
|
return unless (event = params[:e]) && @payment.payment_source
|
|
59
60
|
|
|
61
|
+
unless @payment.actions.include?(event)
|
|
62
|
+
flash[:error] = t("spree.cannot_perform_operation")
|
|
63
|
+
return
|
|
64
|
+
end
|
|
65
|
+
|
|
60
66
|
# Because we have a transition method also called void, we do this to avoid conflicts.
|
|
61
67
|
event = "void_transaction" if event == "void"
|
|
62
68
|
if @payment.send("#{event}!")
|
|
@@ -104,6 +110,13 @@ module Spree
|
|
|
104
110
|
@payment = Spree::Payment.find(params[:id])
|
|
105
111
|
end
|
|
106
112
|
|
|
113
|
+
def load_log_entries
|
|
114
|
+
@all_log_entries = Spree::LogEntry
|
|
115
|
+
.where(source: @payment)
|
|
116
|
+
.or(Spree::LogEntry.where(source: @payment.refunds))
|
|
117
|
+
.order(:created_at)
|
|
118
|
+
end
|
|
119
|
+
|
|
107
120
|
def load_payment_for_fire
|
|
108
121
|
load_payment
|
|
109
122
|
authorize! params[:e].to_sym, @payment
|
|
@@ -114,7 +127,7 @@ module Spree
|
|
|
114
127
|
end
|
|
115
128
|
|
|
116
129
|
def require_bill_address
|
|
117
|
-
if Spree::Config
|
|
130
|
+
if Spree::Config.order_bill_address_used && @order.bill_address.nil?
|
|
118
131
|
flash[:notice] = t("spree.fill_in_customer_info")
|
|
119
132
|
redirect_to edit_admin_order_customer_url(@order)
|
|
120
133
|
end
|
|
@@ -5,6 +5,7 @@ module Spree
|
|
|
5
5
|
class RefundsController < ResourceController
|
|
6
6
|
belongs_to "spree/payment"
|
|
7
7
|
before_action :load_order
|
|
8
|
+
before_action :ensure_refundable_payment, only: [:new, :create]
|
|
8
9
|
|
|
9
10
|
helper_method :refund_reasons
|
|
10
11
|
|
|
@@ -37,6 +38,13 @@ module Spree
|
|
|
37
38
|
@order = @payment.order if @payment
|
|
38
39
|
end
|
|
39
40
|
|
|
41
|
+
def ensure_refundable_payment
|
|
42
|
+
return if Spree::Config.refundable_payment_states.include?(@payment.state)
|
|
43
|
+
|
|
44
|
+
flash[:error] = t("spree.payment_is_not_refundable")
|
|
45
|
+
redirect_to admin_order_payments_path(@order)
|
|
46
|
+
end
|
|
47
|
+
|
|
40
48
|
def refund_reasons
|
|
41
49
|
@refund_reasons ||= Spree::RefundReason.active.all
|
|
42
50
|
end
|
|
@@ -50,7 +50,7 @@ module Spree
|
|
|
50
50
|
)
|
|
51
51
|
@variant_display_attributes = self.class.variant_display_attributes
|
|
52
52
|
@variants = Spree::Config.variant_search_class.new(params[:variant_search_term], scope: variant_scope).results
|
|
53
|
-
.order(id: :desc).page(params[:page]).per(params[:per_page] || Spree::Config
|
|
53
|
+
.order(id: :desc).page(params[:page]).per(params[:per_page] || Spree::Config.orders_per_page)
|
|
54
54
|
end
|
|
55
55
|
|
|
56
56
|
def variant_scope
|
|
@@ -13,6 +13,13 @@ module Spree
|
|
|
13
13
|
|
|
14
14
|
private
|
|
15
15
|
|
|
16
|
+
def permitted_resource_params
|
|
17
|
+
super.tap do |store_params|
|
|
18
|
+
without_address_parameters = store_params[:address_attributes]&.except(:country_id, :state_id, :reverse_charge_status)&.compact_blank&.empty?
|
|
19
|
+
store_params.delete(:address_attributes) if without_address_parameters
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
16
23
|
def store_params
|
|
17
24
|
params.require(:store).permit(permitted_params)
|
|
18
25
|
end
|
|
@@ -42,6 +42,10 @@ module Spree
|
|
|
42
42
|
set_roles
|
|
43
43
|
set_stock_locations
|
|
44
44
|
|
|
45
|
+
if @user.respond_to?(:timezone) && @user.saved_change_to_timezone? && @user == spree_current_user
|
|
46
|
+
session[:solidus_timezone] = nil
|
|
47
|
+
end
|
|
48
|
+
|
|
45
49
|
flash[:success] = t("spree.account_updated")
|
|
46
50
|
redirect_to edit_admin_user_url(@user)
|
|
47
51
|
else
|
|
@@ -66,7 +70,7 @@ module Spree
|
|
|
66
70
|
def orders
|
|
67
71
|
params[:q] ||= {}
|
|
68
72
|
@search = Spree::Order.reverse_chronological.ransack(params[:q].merge(user_id_eq: @user.id))
|
|
69
|
-
@orders = @search.result.page(params[:page]).per(Spree::Config
|
|
73
|
+
@orders = @search.result.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
70
74
|
end
|
|
71
75
|
|
|
72
76
|
def items
|
|
@@ -78,7 +82,7 @@ module Spree
|
|
|
78
82
|
}
|
|
79
83
|
).ransack(params[:q].merge(user_id_eq: @user.id))
|
|
80
84
|
|
|
81
|
-
@orders = @search.result.page(params[:page]).per(Spree::Config
|
|
85
|
+
@orders = @search.result.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
82
86
|
end
|
|
83
87
|
|
|
84
88
|
def model_class
|
|
@@ -93,7 +97,7 @@ module Spree
|
|
|
93
97
|
@search = super.ransack(params[:q])
|
|
94
98
|
@collection = @search.result.includes(:spree_roles)
|
|
95
99
|
@collection = @collection.includes(:orders)
|
|
96
|
-
@collection = @collection.page(params[:page]).per(Spree::Config
|
|
100
|
+
@collection = @collection.page(params[:page]).per(Spree::Config.admin_products_per_page)
|
|
97
101
|
end
|
|
98
102
|
|
|
99
103
|
def user_params
|
|
@@ -27,7 +27,7 @@ module Spree
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
search = Spree::Config.variant_search_class.new(params[:variant_search_term], scope: base_variant_scope)
|
|
30
|
-
@collection = search.results.includes(variant_includes).page(params[:page]).per(Spree::Config
|
|
30
|
+
@collection = search.results.includes(variant_includes).page(params[:page]).per(Spree::Config.admin_variants_per_page)
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def load_data
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
</fieldset>
|
|
42
42
|
|
|
43
43
|
<div class="row">
|
|
44
|
-
<% if Spree::Config
|
|
44
|
+
<% if Spree::Config.order_bill_address_used %>
|
|
45
45
|
<div class="col-6" data-hook="bill_address_wrapper">
|
|
46
46
|
<fieldset class="no-border-bottom">
|
|
47
47
|
<legend align="center"><%= t('spree.billing_address') %></legend>
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
<div class="col-6" data-hook="ship_address_wrapper">
|
|
58
58
|
<fieldset class="no-border-bottom">
|
|
59
59
|
<legend align="center"><%= t('spree.shipping_address') %></legend>
|
|
60
|
-
<% if Spree::Config
|
|
60
|
+
<% if Spree::Config.order_bill_address_used %>
|
|
61
61
|
<div class="field">
|
|
62
62
|
<span data-hook="use_billing">
|
|
63
63
|
<label>
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
<div data-hook="auto_capture" class="field">
|
|
33
33
|
<%= f.label :auto_capture %>
|
|
34
34
|
<%= f.select :auto_capture,
|
|
35
|
-
[["#{t('spree.use_app_default')} (#{Spree::Config
|
|
35
|
+
[["#{t('spree.use_app_default')} (#{Spree::Config.auto_capture ? t('spree.say_yes') : t('spree.say_no')})", ''],
|
|
36
36
|
[t('spree.say_yes'), true],
|
|
37
37
|
[t('spree.say_no'), false]],
|
|
38
38
|
{},
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<table class='index' id='listing_log_entries'>
|
|
2
2
|
<colgroup>
|
|
3
|
-
<col style="width:
|
|
4
|
-
<col style="width:
|
|
3
|
+
<col style="width: 25%">
|
|
4
|
+
<col style="width: 15%">
|
|
5
|
+
<col style="width: 50%">
|
|
5
6
|
<col style="width: 10%">
|
|
6
7
|
</colgroup>
|
|
7
8
|
<thead>
|
|
8
9
|
<tr>
|
|
9
10
|
<th><%= Spree::LogEntry.human_attribute_name(:created_at) %></th>
|
|
11
|
+
<th><%= Spree::LogEntry.human_attribute_name(:source) %></th>
|
|
10
12
|
<th><%= Spree::LogEntry.human_attribute_name(:details) %></th>
|
|
11
13
|
<th></th>
|
|
12
14
|
</tr>
|
|
@@ -17,6 +19,9 @@
|
|
|
17
19
|
<td>
|
|
18
20
|
<%= pretty_time(entry.created_at) %>
|
|
19
21
|
</td>
|
|
22
|
+
<td>
|
|
23
|
+
<%= entry.source_type.constantize.model_name.human %>
|
|
24
|
+
</td>
|
|
20
25
|
<td>
|
|
21
26
|
<pre><%= entry.parsed_details.message %></pre>
|
|
22
27
|
</td>
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
</fieldset>
|
|
22
22
|
<% end %>
|
|
23
23
|
|
|
24
|
-
<% if @
|
|
24
|
+
<% if @all_log_entries.any? %>
|
|
25
25
|
<fieldset class="no-border-bottom">
|
|
26
26
|
<legend><%= plural_resource_name(Spree::LogEntry) %></legend>
|
|
27
|
-
<%= render 'spree/admin/payments/log_entries', log_entries: @
|
|
27
|
+
<%= render 'spree/admin/payments/log_entries', log_entries: @all_log_entries %>
|
|
28
28
|
</fieldset>
|
|
29
29
|
<% end %>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<%= f.text_field :name, class: 'fullwidth' %>
|
|
7
7
|
</div>
|
|
8
8
|
|
|
9
|
-
<% if Spree::Config
|
|
9
|
+
<% if Spree::Config.company %>
|
|
10
10
|
<div class="field <%= "#{type}-row" %>">
|
|
11
11
|
<%= f.label :company %>
|
|
12
12
|
<%= f.text_field :company, class: 'fullwidth' %>
|
|
@@ -18,10 +18,12 @@
|
|
|
18
18
|
<%= f.text_field :address1, class: 'fullwidth' %>
|
|
19
19
|
</div>
|
|
20
20
|
|
|
21
|
-
|
|
22
|
-
<%=
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
<% unless local_assigns.fetch(:excludes, []).include?(:address2) %>
|
|
22
|
+
<div class="field <%= "#{type}-row" %>">
|
|
23
|
+
<%= f.label :address2 %>
|
|
24
|
+
<%= f.text_field :address2, class: 'fullwidth' %>
|
|
25
|
+
</div>
|
|
26
|
+
<% end %>
|
|
25
27
|
|
|
26
28
|
<div class="field <%= "#{type}-row" %>">
|
|
27
29
|
<%= f.label :city %>
|
|
@@ -59,15 +61,19 @@
|
|
|
59
61
|
</span>
|
|
60
62
|
</div>
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
<%=
|
|
64
|
-
|
|
65
|
-
|
|
64
|
+
<% unless local_assigns.fetch(:excludes, []).include?(:phone) %>
|
|
65
|
+
<div class="field <%= "#{type}-row" %>">
|
|
66
|
+
<%= f.label :phone %>
|
|
67
|
+
<%= f.phone_field :phone, class: 'fullwidth' %>
|
|
68
|
+
</div>
|
|
69
|
+
<% end %>
|
|
66
70
|
|
|
67
|
-
|
|
68
|
-
<%=
|
|
69
|
-
|
|
70
|
-
|
|
71
|
+
<% unless local_assigns.fetch(:excludes, []).include?(:email) %>
|
|
72
|
+
<div class="field <%= "#{type}-row" %>">
|
|
73
|
+
<%= f.label :email %>
|
|
74
|
+
<%= f.email_field :email, class: 'fullwidth' %>
|
|
75
|
+
</div>
|
|
76
|
+
<% end %>
|
|
71
77
|
|
|
72
78
|
<% if Spree::Backend::Config.show_reverse_charge_fields %>
|
|
73
79
|
<div class="field <%= "#{type}-row" %>">
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
<title><%= admin_page_title %></title>
|
|
7
7
|
|
|
8
|
-
<%= favicon_link_tag 'favicon.ico' %>
|
|
8
|
+
<%= favicon_link_tag 'spree/backend/favicon.ico' %>
|
|
9
9
|
<%= stylesheet_link_tag Spree::Backend::Config.theme_path(session[:admin_light_theme]), media: '(prefers-color-scheme: light)', data: {turbolinks_track: 'reload'} %>
|
|
10
10
|
<%= stylesheet_link_tag Spree::Backend::Config.theme_path(session[:admin_dark_theme]), media: '(prefers-color-scheme: dark)', data: {turbolinks_track: 'reload'} %>
|
|
11
11
|
<%= javascript_include_tag 'spree/backend/all', data: {turbolinks_track: 'reload'} %>
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<% if available_locale_options_for_select.size > 1 %>
|
|
6
6
|
<%= form_tag(spree.admin_set_locale_path(format: :html), method: :put, style: "width: 100%;") do %>
|
|
7
7
|
<label class="admin-navbar-selection admin-locale-selection">
|
|
8
|
-
<i class="fa fa-
|
|
8
|
+
<i class="fa fa-language fa-fw" title="<%= I18n.t('spree.choose_dashboard_locale') %>"></i>
|
|
9
9
|
<select class="custom-select fullwidth" onchange="this.form.requestSubmit()">
|
|
10
10
|
<%= options_for_select(available_locale_options_for_select, I18n.locale) %>
|
|
11
11
|
</select>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<li>
|
|
7
7
|
<%= form_tag(spree.admin_set_locale_path(format: :html), method: :put, style: "width: 100%;") do %>
|
|
8
8
|
<label>
|
|
9
|
-
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-
|
|
9
|
+
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-translate-2"></use></svg>
|
|
10
10
|
<select name="switch_to_locale" onchange="this.form.requestSubmit()">
|
|
11
11
|
<%= options_for_select(available_locale_options_for_select, selected: I18n.locale) %>
|
|
12
12
|
</select>
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
<%= button_tag class: 'btn fa fa-chevron-circle-left', id: 'admin-nav-toggle', type: :button do %>
|
|
7
7
|
<span class="text"><%= t('spree.minimize_menu') %></span>
|
|
8
8
|
<% end %>
|
|
9
|
+
<%= render partial: 'spree/admin/shared/timezone_selection' %>
|
|
9
10
|
<%= render partial: 'spree/admin/shared/locale_selection' %>
|
|
10
11
|
<%= render partial: 'spree/admin/shared/theme_selection' %>
|
|
11
12
|
<% if lookup_context.exists?('spree/admin/shared/_navigation_footer') %>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<aside class="solidus-admin--nav">
|
|
5
5
|
<header class="solidus-admin--nav--section">
|
|
6
6
|
<%= link_to spree.admin_path, class: 'solidus-admin--nav--logo' do %>
|
|
7
|
-
<%= image_tag(Spree::Config
|
|
7
|
+
<%= image_tag(Spree::Config.admin_interface_logo) %>
|
|
8
8
|
<%- end %>
|
|
9
9
|
|
|
10
10
|
<%= link_to "//#{default_store.url}", target: '_blank', class: 'solidus-admin--nav--store-link' do %>
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
data-legacy-label="<%= 'spree.navigation.switch_to_legacy'.then { t(_1, default: t(_1, locale: :en)) } %>"
|
|
34
34
|
data-admin-label="<%= 'spree.navigation.switch_to_solidus_admin'.then { t(_1, default: t(_1, locale: :en)) } %>"
|
|
35
35
|
></span>
|
|
36
|
-
<span><input type="checkbox" id="solidus-admin-switch" class="solidus-admin--nav--switch"
|
|
36
|
+
<span><input type="checkbox" id="solidus-admin-switch" class="solidus-admin--nav--switch"></span>
|
|
37
37
|
</label>
|
|
38
38
|
</li>
|
|
39
39
|
</ul>
|
|
@@ -49,6 +49,7 @@
|
|
|
49
49
|
</summary>
|
|
50
50
|
|
|
51
51
|
<ul>
|
|
52
|
+
<%= render 'spree/admin/shared/timezone_selection_solidus_admin' %>
|
|
52
53
|
<%= render 'spree/admin/shared/locale_selection_solidus_admin' %>
|
|
53
54
|
<%= render 'spree/admin/shared/theme_selection_solidus_admin' %>
|
|
54
55
|
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
<% available_timezones_for_select = ActiveSupport::TimeZone.all.map(&:name) %>
|
|
2
|
+
|
|
3
|
+
<%= form_tag(url_for, method: :get, style: "width: 100%;") do %>
|
|
4
|
+
<label class="admin-navbar-selection admin-timezone-selection">
|
|
5
|
+
<i class="fa fa-globe fa-fw" title="<%= I18n.t('spree.choose_dashboard_timezone') %>"></i>
|
|
6
|
+
<select name="solidus_timezone" class="custom-select fullwidth" onchange="this.form.requestSubmit()">
|
|
7
|
+
<%= options_for_select(available_timezones_for_select, selected: Time.zone.name) %>
|
|
8
|
+
</select>
|
|
9
|
+
</label>
|
|
10
|
+
<% end %>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<% available_timezones_for_select = ActiveSupport::TimeZone.all.map(&:name) %>
|
|
2
|
+
|
|
3
|
+
<li>
|
|
4
|
+
<%= form_tag(url_for, method: :get, style: "width: 100%;") do %>
|
|
5
|
+
<label>
|
|
6
|
+
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-time-zone-line"></use></svg>
|
|
7
|
+
<select name="solidus_timezone" onchange="this.form.requestSubmit()">
|
|
8
|
+
<%= options_for_select(available_timezones_for_select, selected: Time.zone.name) %>
|
|
9
|
+
</select>
|
|
10
|
+
<svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-expand-up-down-line"></use></svg>
|
|
11
|
+
</label>
|
|
12
|
+
<% end %>
|
|
13
|
+
</li>
|
|
@@ -41,6 +41,13 @@
|
|
|
41
41
|
<%= f.error_message_on :reverse_charge_status %>
|
|
42
42
|
<% end %>
|
|
43
43
|
<% end %>
|
|
44
|
+
|
|
45
|
+
<fieldset class="no-border-bottom js-addresses-form" data-hook="store_address_wrapper">
|
|
46
|
+
<legend align="center"><%= Spree::Address.model_name.human %></legend>
|
|
47
|
+
<%= f.fields_for :address, f.object.address || Spree::Address.new(country: Spree::Country.find_by(iso: Spree::Config.default_country_iso)) do |address_form| %>
|
|
48
|
+
<%= render partial: 'spree/admin/shared/address_form', locals: { f: address_form, type: "store", excludes: Spree::Config.address_requires_phone ? [:address2, :email] : [:address2, :email, :phone] } %>
|
|
49
|
+
<% end %>
|
|
50
|
+
</fieldset>
|
|
44
51
|
</div>
|
|
45
52
|
<div class="col-12 col-md-6">
|
|
46
53
|
<%= f.field_container :url do %>
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
</div>
|
|
36
36
|
<% end %>
|
|
37
37
|
|
|
38
|
-
<% if Spree::Config
|
|
38
|
+
<% if Spree::Config.can_restrict_stock_management && can?(:show, Spree::StockLocation) %>
|
|
39
39
|
<div data-hook="admin_user_form_stock_locations" class="field">
|
|
40
40
|
<%= label_tag nil, plural_resource_name(Spree::StockLocation) %>
|
|
41
41
|
<ul>
|
|
@@ -76,5 +76,12 @@
|
|
|
76
76
|
<% end %>
|
|
77
77
|
<% end %>
|
|
78
78
|
<% end %>
|
|
79
|
+
|
|
80
|
+
<% if can?(:update, @user) && @user.respond_to?(:timezone) %>
|
|
81
|
+
<%= f.field_container :timezone do %>
|
|
82
|
+
<%= f.label :timezone %>
|
|
83
|
+
<%= f.time_zone_select :timezone, nil, {include_blank: t("spree.none")}, class: "select2 fullwidth" %>
|
|
84
|
+
<% end %>
|
|
85
|
+
<% end %>
|
|
79
86
|
</div>
|
|
80
87
|
</div>
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: solidus_backend
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 4.
|
|
4
|
+
version: 4.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Solidus Team
|
|
@@ -15,28 +15,28 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - '='
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 4.
|
|
18
|
+
version: 4.8.0
|
|
19
19
|
type: :runtime
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - '='
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 4.
|
|
25
|
+
version: 4.8.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: solidus_core
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
29
29
|
requirements:
|
|
30
30
|
- - '='
|
|
31
31
|
- !ruby/object:Gem::Version
|
|
32
|
-
version: 4.
|
|
32
|
+
version: 4.8.0
|
|
33
33
|
type: :runtime
|
|
34
34
|
prerelease: false
|
|
35
35
|
version_requirements: !ruby/object:Gem::Requirement
|
|
36
36
|
requirements:
|
|
37
37
|
- - '='
|
|
38
38
|
- !ruby/object:Gem::Version
|
|
39
|
-
version: 4.
|
|
39
|
+
version: 4.8.0
|
|
40
40
|
- !ruby/object:Gem::Dependency
|
|
41
41
|
name: font-awesome-rails
|
|
42
42
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -155,11 +155,12 @@ executables: []
|
|
|
155
155
|
extensions: []
|
|
156
156
|
extra_rdoc_files: []
|
|
157
157
|
files:
|
|
158
|
+
- LICENSE
|
|
158
159
|
- README.md
|
|
159
160
|
- Rakefile
|
|
160
161
|
- app/assets/config/solidus_backend_manifest.js
|
|
161
|
-
- app/assets/images/favicon.ico
|
|
162
162
|
- app/assets/images/solidus-style-guide-logo.png
|
|
163
|
+
- app/assets/images/spree/backend/favicon.ico
|
|
163
164
|
- app/assets/images/spree/backend/themes/solidus_admin/remixicon.license.txt
|
|
164
165
|
- app/assets/images/spree/backend/themes/solidus_admin/remixicon.symbol.svg
|
|
165
166
|
- app/assets/javascripts/spree/backend.js
|
|
@@ -563,6 +564,8 @@ files:
|
|
|
563
564
|
- app/views/spree/admin/shared/_taxes_tabs.html.erb
|
|
564
565
|
- app/views/spree/admin/shared/_theme_selection.html.erb
|
|
565
566
|
- app/views/spree/admin/shared/_theme_selection_solidus_admin.html.erb
|
|
567
|
+
- app/views/spree/admin/shared/_timezone_selection.html.erb
|
|
568
|
+
- app/views/spree/admin/shared/_timezone_selection_solidus_admin.html.erb
|
|
566
569
|
- app/views/spree/admin/shared/_variant_search.html.erb
|
|
567
570
|
- app/views/spree/admin/shared/named_types/_edit.html.erb
|
|
568
571
|
- app/views/spree/admin/shared/named_types/_form.html.erb
|
|
@@ -877,7 +880,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
877
880
|
- !ruby/object:Gem::Version
|
|
878
881
|
version: 1.8.23
|
|
879
882
|
requirements: []
|
|
880
|
-
rubygems_version: 4.0.
|
|
883
|
+
rubygems_version: 4.0.20
|
|
881
884
|
specification_version: 4
|
|
882
885
|
summary: Admin interface for the Solidus e-commerce framework.
|
|
883
886
|
test_files: []
|
|
File without changes
|