solidus_backend 4.6.2 → 4.7.1
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/Rakefile +17 -17
- data/app/assets/images/spree/backend/themes/solidus_admin/remixicon.license.txt +222 -0
- data/app/assets/javascripts/spree/backend/components/tabs.js +0 -2
- data/app/assets/javascripts/spree/backend/views/tables/selectable_table/sum_return_item_amount.js +1 -1
- data/app/controllers/spree/admin/adjustments_controller.rb +1 -1
- data/app/controllers/spree/admin/base_controller.rb +9 -9
- data/app/controllers/spree/admin/cancellations_controller.rb +3 -3
- data/app/controllers/spree/admin/customer_returns_controller.rb +6 -6
- data/app/controllers/spree/admin/images_controller.rb +2 -2
- data/app/controllers/spree/admin/locale_controller.rb +4 -4
- data/app/controllers/spree/admin/option_types_controller.rb +1 -1
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
- data/app/controllers/spree/admin/orders_controller.rb +29 -29
- data/app/controllers/spree/admin/payment_methods_controller.rb +3 -3
- data/app/controllers/spree/admin/payments_controller.rb +12 -10
- data/app/controllers/spree/admin/prices_controller.rb +1 -1
- data/app/controllers/spree/admin/product_properties_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +14 -14
- data/app/controllers/spree/admin/properties_controller.rb +3 -3
- data/app/controllers/spree/admin/refunds_controller.rb +2 -2
- data/app/controllers/spree/admin/reimbursements_controller.rb +4 -8
- data/app/controllers/spree/admin/resource_controller.rb +10 -10
- data/app/controllers/spree/admin/return_authorizations_controller.rb +14 -11
- data/app/controllers/spree/admin/return_items_controller.rb +1 -1
- data/app/controllers/spree/admin/search_controller.rb +8 -8
- data/app/controllers/spree/admin/stock_items_controller.rb +5 -5
- data/app/controllers/spree/admin/stock_locations_controller.rb +1 -1
- data/app/controllers/spree/admin/stock_movements_controller.rb +5 -5
- data/app/controllers/spree/admin/store_credits_controller.rb +10 -10
- data/app/controllers/spree/admin/style_guide_controller.rb +19 -19
- data/app/controllers/spree/admin/taxons/attachment_controller.rb +2 -2
- data/app/controllers/spree/admin/taxons_controller.rb +5 -5
- data/app/controllers/spree/admin/theme_controller.rb +3 -3
- data/app/controllers/spree/admin/users/api_key_controller.rb +2 -2
- data/app/controllers/spree/admin/users_controller.rb +6 -6
- data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +1 -1
- data/app/controllers/spree/admin/variants_controller.rb +8 -8
- data/app/helpers/spree/admin/adjustments_helper.rb +7 -7
- data/app/helpers/spree/admin/base_helper.rb +10 -10
- data/app/helpers/spree/admin/navigation_helper.rb +37 -37
- data/app/helpers/spree/admin/orders_helper.rb +2 -2
- data/app/helpers/spree/admin/reimbursement_type_helper.rb +1 -1
- data/app/helpers/spree/admin/stock_locations_helper.rb +1 -1
- data/app/helpers/spree/admin/store_credit_events_helper.rb +9 -9
- data/app/views/spree/admin/orders/_shipment.html.erb +1 -0
- data/app/views/spree/admin/search/users.json.jbuilder +2 -2
- data/config/initializers/assets.rb +1 -1
- data/config/initializers/form_builder.rb +1 -1
- data/config/routes.rb +9 -9
- data/lib/solidus_backend.rb +1 -1
- data/lib/spree/backend/callbacks.rb +2 -2
- data/lib/spree/backend/config.rb +1 -1
- data/lib/spree/backend/engine.rb +3 -3
- data/lib/spree/backend.rb +12 -12
- data/lib/spree/backend_configuration/deprecated_tab_constants.rb +2 -0
- data/lib/spree/backend_configuration.rb +46 -46
- data/lib/spree_backend.rb +1 -1
- data/solidus_backend.gemspec +22 -21
- data/vendor/assets/fonts/inter/inter.license.txt +97 -0
- data/vendor/assets/javascripts/solidus_admin/backbone-nested-models.license.txt +29 -0
- data/vendor/assets/javascripts/solidus_admin/bind-polyfill.license.txt +9 -0
- data/vendor/assets/javascripts/solidus_admin/flatpickr/flatpickr.license.txt +244 -0
- data/vendor/assets/javascripts/solidus_admin/select2.license.txt +226 -0
- metadata +32 -12
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
module Spree
|
|
4
4
|
module Admin
|
|
5
5
|
class StoreCreditsController < ResourceController
|
|
6
|
-
belongs_to
|
|
6
|
+
belongs_to "spree/user", model_class: Spree.user_class
|
|
7
7
|
before_action :load_categories, only: [:new]
|
|
8
8
|
before_action :load_reasons, only: [:edit_amount, :edit_validity]
|
|
9
9
|
before_action :ensure_store_credit_reason, only: [:update_amount, :invalidate]
|
|
@@ -27,7 +27,7 @@ module Spree
|
|
|
27
27
|
redirect_to admin_user_store_credits_path(@user)
|
|
28
28
|
else
|
|
29
29
|
load_categories
|
|
30
|
-
flash[:error] = "#{t(
|
|
30
|
+
flash[:error] = "#{t("spree.admin.store_credits.unable_to_create")} #{@store_credit.errors.full_messages}"
|
|
31
31
|
render :new
|
|
32
32
|
end
|
|
33
33
|
end
|
|
@@ -38,11 +38,11 @@ module Spree
|
|
|
38
38
|
|
|
39
39
|
if @store_credit.save
|
|
40
40
|
respond_to do |format|
|
|
41
|
-
format.json { render json: {
|
|
41
|
+
format.json { render json: {message: flash_message_for(@store_credit, :successfully_updated)}, status: :ok }
|
|
42
42
|
end
|
|
43
43
|
else
|
|
44
44
|
respond_to do |format|
|
|
45
|
-
format.json { render json: {
|
|
45
|
+
format.json { render json: {message: "#{t("spree.admin.store_credits.unable_to_update")} #{@store_credit.errors.full_messages}"}, status: :bad_request }
|
|
46
46
|
end
|
|
47
47
|
end
|
|
48
48
|
end
|
|
@@ -70,8 +70,8 @@ module Spree
|
|
|
70
70
|
private
|
|
71
71
|
|
|
72
72
|
def permitted_resource_params
|
|
73
|
-
params.require(:store_credit).permit([:amount, :currency, :category_id, :memo])
|
|
74
|
-
merge(created_by: spree_current_user)
|
|
73
|
+
params.require(:store_credit).permit([:amount, :currency, :category_id, :memo])
|
|
74
|
+
.merge(created_by: spree_current_user)
|
|
75
75
|
end
|
|
76
76
|
|
|
77
77
|
def collection
|
|
@@ -89,7 +89,7 @@ module Spree
|
|
|
89
89
|
def ensure_store_credit_reason
|
|
90
90
|
@store_credit_reason = Spree::StoreCreditReason.find_by(id: params[:store_credit_reason_id])
|
|
91
91
|
unless @store_credit_reason
|
|
92
|
-
@store_credit.errors.add(:base, t(
|
|
92
|
+
@store_credit.errors.add(:base, t("spree.admin.store_credits.errors.store_credit_reason_required"))
|
|
93
93
|
render_edit_page
|
|
94
94
|
end
|
|
95
95
|
end
|
|
@@ -97,14 +97,14 @@ module Spree
|
|
|
97
97
|
def render_edit_page
|
|
98
98
|
if action == :update_amount
|
|
99
99
|
template = :edit_amount
|
|
100
|
-
translation_key =
|
|
100
|
+
translation_key = "update"
|
|
101
101
|
else
|
|
102
102
|
template = :edit_validity
|
|
103
|
-
translation_key =
|
|
103
|
+
translation_key = "invalidate"
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
load_reasons
|
|
107
|
-
flash[:error] = "#{t("spree.admin.store_credits.unable_to_#{translation_key}")}: #{@store_credit.errors.full_messages.join(
|
|
107
|
+
flash[:error] = "#{t("spree.admin.store_credits.unable_to_#{translation_key}")}: #{@store_credit.errors.full_messages.join(", ")}"
|
|
108
108
|
render(template) && return
|
|
109
109
|
end
|
|
110
110
|
|
|
@@ -4,37 +4,37 @@ module Spree
|
|
|
4
4
|
module Admin
|
|
5
5
|
class StyleGuideController < Spree::Admin::BaseController
|
|
6
6
|
respond_to :html
|
|
7
|
-
layout
|
|
7
|
+
layout "spree/layouts/admin_style_guide"
|
|
8
8
|
|
|
9
9
|
def index
|
|
10
10
|
@topics = {
|
|
11
11
|
typography: [
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
"fonts",
|
|
13
|
+
"colors",
|
|
14
|
+
"lists",
|
|
15
|
+
"icons"
|
|
16
16
|
],
|
|
17
17
|
forms: [
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
"building_forms",
|
|
19
|
+
"buttons",
|
|
20
|
+
"helper_text",
|
|
21
|
+
"inputs",
|
|
22
|
+
"labels",
|
|
23
|
+
"validation"
|
|
24
24
|
],
|
|
25
25
|
components: [
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
"pills",
|
|
27
|
+
"modals",
|
|
28
|
+
"tabs"
|
|
29
29
|
],
|
|
30
30
|
messaging: [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
"loading",
|
|
32
|
+
"flashes",
|
|
33
|
+
"tooltips"
|
|
34
34
|
],
|
|
35
35
|
tables: [
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
"building_tables",
|
|
37
|
+
"pagination"
|
|
38
38
|
]
|
|
39
39
|
}
|
|
40
40
|
end
|
|
@@ -8,9 +8,9 @@ module Spree
|
|
|
8
8
|
taxonomy = Spree::Taxonomy.find(params[:taxonomy_id])
|
|
9
9
|
taxon = taxonomy.taxons.find(params[:taxon_id])
|
|
10
10
|
if taxon.destroy_attachment(params[:attachment_definition])
|
|
11
|
-
flash[:success] = t(
|
|
11
|
+
flash[:success] = t("spree.successfully_removed", resource: params[:attachment_definition].titleize)
|
|
12
12
|
else
|
|
13
|
-
flash[:error] = t(
|
|
13
|
+
flash[:error] = t("spree.taxon_attachment_removal_error")
|
|
14
14
|
end
|
|
15
15
|
redirect_to edit_admin_taxonomy_taxon_path(taxonomy, taxon.id)
|
|
16
16
|
end
|
|
@@ -10,10 +10,10 @@ module Spree
|
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
def search
|
|
13
|
-
if params[:ids]
|
|
14
|
-
|
|
13
|
+
@taxons = if params[:ids]
|
|
14
|
+
Spree::Taxon.where(id: params[:ids].split(","))
|
|
15
15
|
else
|
|
16
|
-
|
|
16
|
+
Spree::Taxon.limit(20).ransack(name_cont: params[:q]).result
|
|
17
17
|
end
|
|
18
18
|
end
|
|
19
19
|
|
|
@@ -25,7 +25,7 @@ module Spree
|
|
|
25
25
|
format.json { render json: @taxon.to_json }
|
|
26
26
|
end
|
|
27
27
|
else
|
|
28
|
-
flash[:error] = t(
|
|
28
|
+
flash[:error] = t("spree.errors.messages.could_not_create_taxon")
|
|
29
29
|
respond_with(@taxon) do |format|
|
|
30
30
|
format.html { redirect_to @taxonomy ? edit_admin_taxonomy_url(@taxonomy) : admin_taxonomies_url }
|
|
31
31
|
end
|
|
@@ -76,7 +76,7 @@ module Spree
|
|
|
76
76
|
def destroy
|
|
77
77
|
@taxon = Spree::Taxon.find(params[:id])
|
|
78
78
|
@taxon.destroy
|
|
79
|
-
respond_with(@taxon) { |format| format.json { render json:
|
|
79
|
+
respond_with(@taxon) { |format| format.json { render json: "" } }
|
|
80
80
|
end
|
|
81
81
|
|
|
82
82
|
private
|
|
@@ -9,14 +9,14 @@ module Spree
|
|
|
9
9
|
requested_theme = params[:switch_to_theme].presence
|
|
10
10
|
|
|
11
11
|
# Avoid interpolating user content into the session key
|
|
12
|
-
system_theme = params[:system_theme].presence == "dark" ? "dark" : "light"
|
|
12
|
+
system_theme = (params[:system_theme].presence == "dark") ? "dark" : "light"
|
|
13
13
|
session_key = :"admin_#{system_theme}_theme"
|
|
14
14
|
|
|
15
15
|
if theme_is_available?(requested_theme)
|
|
16
16
|
session[session_key] = requested_theme
|
|
17
|
-
redirect_back_or_to spree.admin_url, notice: t(
|
|
17
|
+
redirect_back_or_to spree.admin_url, notice: t("spree.theme_changed")
|
|
18
18
|
else
|
|
19
|
-
redirect_back_or_to spree.admin_url, error: t(
|
|
19
|
+
redirect_back_or_to spree.admin_url, error: t("spree.error")
|
|
20
20
|
end
|
|
21
21
|
end
|
|
22
22
|
|
|
@@ -6,14 +6,14 @@ module Spree
|
|
|
6
6
|
class ApiKeyController < Spree::Admin::BaseController
|
|
7
7
|
def create
|
|
8
8
|
if user.generate_spree_api_key!
|
|
9
|
-
flash[:success] = t(
|
|
9
|
+
flash[:success] = t("spree.admin.api.key_generated")
|
|
10
10
|
end
|
|
11
11
|
redirect_to edit_admin_user_path(user)
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def destroy
|
|
15
15
|
if user.clear_spree_api_key!
|
|
16
|
-
flash[:success] = t(
|
|
16
|
+
flash[:success] = t("spree.admin.api.key_cleared")
|
|
17
17
|
end
|
|
18
18
|
redirect_to edit_admin_user_path(user)
|
|
19
19
|
end
|
|
@@ -26,7 +26,7 @@ module Spree
|
|
|
26
26
|
set_roles
|
|
27
27
|
set_stock_locations
|
|
28
28
|
|
|
29
|
-
flash[:success] = t(
|
|
29
|
+
flash[:success] = t("spree.created_successfully")
|
|
30
30
|
redirect_to edit_admin_user_url(@user)
|
|
31
31
|
else
|
|
32
32
|
load_roles
|
|
@@ -42,7 +42,7 @@ module Spree
|
|
|
42
42
|
set_roles
|
|
43
43
|
set_stock_locations
|
|
44
44
|
|
|
45
|
-
flash[:success] = t(
|
|
45
|
+
flash[:success] = t("spree.account_updated")
|
|
46
46
|
redirect_to edit_admin_user_url(@user)
|
|
47
47
|
else
|
|
48
48
|
load_roles
|
|
@@ -56,7 +56,7 @@ module Spree
|
|
|
56
56
|
def addresses
|
|
57
57
|
if request.put?
|
|
58
58
|
if @user.update(user_params)
|
|
59
|
-
flash.now[:success] = t(
|
|
59
|
+
flash.now[:success] = t("spree.account_updated")
|
|
60
60
|
end
|
|
61
61
|
|
|
62
62
|
render :addresses
|
|
@@ -74,9 +74,9 @@ module Spree
|
|
|
74
74
|
|
|
75
75
|
@search = Spree::Order.includes(
|
|
76
76
|
line_items: {
|
|
77
|
-
variant: [:product, {
|
|
77
|
+
variant: [:product, {option_values: :option_type}]
|
|
78
78
|
}
|
|
79
|
-
).ransack(params[:q].merge(user_id_eq: @user.id))
|
|
79
|
+
).ransack(params[:q].merge(user_id_eq: @user.id))
|
|
80
80
|
|
|
81
81
|
@orders = @search.result.page(params[:page]).per(Spree::Config[:admin_products_per_page])
|
|
82
82
|
end
|
|
@@ -104,7 +104,7 @@ module Spree
|
|
|
104
104
|
end
|
|
105
105
|
|
|
106
106
|
if can? :manage, Spree::StockLocation
|
|
107
|
-
attributes += [{
|
|
107
|
+
attributes += [{stock_location_ids: []}]
|
|
108
108
|
end
|
|
109
109
|
|
|
110
110
|
unless can? :update_password, @user
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
module Spree
|
|
4
4
|
module Admin
|
|
5
5
|
class VariantsController < ResourceController
|
|
6
|
-
helper
|
|
6
|
+
helper "spree/admin/products"
|
|
7
7
|
|
|
8
|
-
belongs_to
|
|
8
|
+
belongs_to "spree/product", find_by: :slug
|
|
9
9
|
new_action.before :new_before
|
|
10
10
|
before_action :redirect_on_empty_option_values, only: [:new]
|
|
11
11
|
before_action :load_data, only: [:new, :create, :edit, :update]
|
|
@@ -13,17 +13,17 @@ module Spree
|
|
|
13
13
|
private
|
|
14
14
|
|
|
15
15
|
def new_before
|
|
16
|
-
@object.attributes = @object.product.master.attributes.except(
|
|
17
|
-
|
|
16
|
+
@object.attributes = @object.product.master.attributes.except("id", "created_at", "deleted_at",
|
|
17
|
+
"sku", "is_master")
|
|
18
18
|
# Shallow Clone of the default price to populate the price field.
|
|
19
19
|
@object.prices.build(@object.product.master.default_price.attributes.except("id", "created_at", "updated_at", "deleted_at"))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def collection
|
|
23
|
-
if params[:deleted] == "on"
|
|
24
|
-
|
|
23
|
+
base_variant_scope ||= if params[:deleted] == "on"
|
|
24
|
+
super.with_discarded
|
|
25
25
|
else
|
|
26
|
-
|
|
26
|
+
super
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
search = Spree::Config.variant_search_class.new(params[:variant_search_term], scope: base_variant_scope)
|
|
@@ -36,7 +36,7 @@ module Spree
|
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
def variant_includes
|
|
39
|
-
[{
|
|
39
|
+
[{option_values: :option_type}, :prices]
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def redirect_on_empty_option_values
|
|
@@ -4,18 +4,18 @@ module Spree
|
|
|
4
4
|
module Admin
|
|
5
5
|
module AdjustmentsHelper
|
|
6
6
|
def adjustment_state(adjustment)
|
|
7
|
-
icon = adjustment.finalized? ?
|
|
8
|
-
content_tag(:span,
|
|
7
|
+
icon = adjustment.finalized? ? "lock" : "unlock"
|
|
8
|
+
content_tag(:span, "", class: "fa fa-#{icon}")
|
|
9
9
|
end
|
|
10
10
|
|
|
11
11
|
def display_adjustable(adjustable)
|
|
12
12
|
case adjustable
|
|
13
13
|
when Spree::LineItem
|
|
14
|
-
|
|
14
|
+
display_line_item(adjustable)
|
|
15
15
|
when Spree::Shipment
|
|
16
|
-
|
|
16
|
+
display_shipment(adjustable)
|
|
17
17
|
when Spree::Order
|
|
18
|
-
|
|
18
|
+
display_order(adjustable)
|
|
19
19
|
end
|
|
20
20
|
end
|
|
21
21
|
|
|
@@ -32,14 +32,14 @@ module Spree
|
|
|
32
32
|
|
|
33
33
|
def display_shipment(shipment)
|
|
34
34
|
parts = [
|
|
35
|
-
"#{t(
|
|
35
|
+
"#{t("spree.shipment")} ##{shipment.number}",
|
|
36
36
|
shipment.display_cost
|
|
37
37
|
]
|
|
38
38
|
safe_join(parts, "<br>".html_safe)
|
|
39
39
|
end
|
|
40
40
|
|
|
41
41
|
def display_order(_order)
|
|
42
|
-
t(
|
|
42
|
+
t("spree.order")
|
|
43
43
|
end
|
|
44
44
|
end
|
|
45
45
|
end
|
|
@@ -5,11 +5,11 @@ module Spree
|
|
|
5
5
|
module BaseHelper
|
|
6
6
|
def field_container(model, method, options = {}, &block)
|
|
7
7
|
css_classes = options[:class].to_a
|
|
8
|
-
css_classes <<
|
|
8
|
+
css_classes << "field"
|
|
9
9
|
if error_message_on(model, method).present?
|
|
10
|
-
css_classes <<
|
|
10
|
+
css_classes << "withError"
|
|
11
11
|
end
|
|
12
|
-
content_tag(:div, capture(&block), class: css_classes.join(
|
|
12
|
+
content_tag(:div, capture(&block), class: css_classes.join(" "), id: "#{model}_#{method}_field")
|
|
13
13
|
end
|
|
14
14
|
|
|
15
15
|
def error_message_on(object, method, _options = {})
|
|
@@ -18,15 +18,15 @@ module Spree
|
|
|
18
18
|
|
|
19
19
|
if obj && obj.errors[method].present?
|
|
20
20
|
errors = safe_join(obj.errors[method], "<br>".html_safe)
|
|
21
|
-
content_tag(:span, errors, class:
|
|
21
|
+
content_tag(:span, errors, class: "formError")
|
|
22
22
|
else
|
|
23
|
-
|
|
23
|
+
""
|
|
24
24
|
end
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
def admin_hint(title, text)
|
|
28
|
-
content_tag(:span, class:
|
|
29
|
-
content_tag(:i,
|
|
28
|
+
content_tag(:span, class: "hint-tooltip", title:, data: {content: text}) do
|
|
29
|
+
content_tag(:i, "", class: "fa fa-info-circle")
|
|
30
30
|
end
|
|
31
31
|
end
|
|
32
32
|
|
|
@@ -34,16 +34,16 @@ module Spree
|
|
|
34
34
|
return if date.blank?
|
|
35
35
|
|
|
36
36
|
format = if with_time
|
|
37
|
-
t(
|
|
37
|
+
t("spree.date_picker.format_with_time", default: "%Y/%m/%d %H:%M")
|
|
38
38
|
else
|
|
39
|
-
t(
|
|
39
|
+
t("spree.date_picker.format", default: "%Y/%m/%d")
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
l(date, format:)
|
|
43
43
|
end
|
|
44
44
|
|
|
45
45
|
def spree_dom_id(record)
|
|
46
|
-
dom_id(record,
|
|
46
|
+
dom_id(record, "spree")
|
|
47
47
|
end
|
|
48
48
|
|
|
49
49
|
def admin_layout(layout = nil)
|
|
@@ -19,9 +19,9 @@ module Spree
|
|
|
19
19
|
admin_breadcrumb(content_for(:page_title))
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
content_tag :ol, class:
|
|
22
|
+
content_tag :ol, class: "breadcrumb" do
|
|
23
23
|
segments = admin_breadcrumbs.map do |level|
|
|
24
|
-
content_tag(:li, level, class: "breadcrumb-item #{level == admin_breadcrumbs.last
|
|
24
|
+
content_tag(:li, level, class: "breadcrumb-item #{"active" if level == admin_breadcrumbs.last}")
|
|
25
25
|
end
|
|
26
26
|
safe_join(segments)
|
|
27
27
|
end
|
|
@@ -33,9 +33,9 @@ module Spree
|
|
|
33
33
|
elsif content_for?(:page_title)
|
|
34
34
|
content_for(:page_title)
|
|
35
35
|
elsif admin_breadcrumbs.any?
|
|
36
|
-
admin_breadcrumbs.map { |breadcrumb| strip_tags(breadcrumb) }.reverse.join(
|
|
36
|
+
admin_breadcrumbs.map { |breadcrumb| strip_tags(breadcrumb) }.reverse.join(" - ")
|
|
37
37
|
else
|
|
38
|
-
t(controller.controller_name, default: controller.controller_name.titleize, scope:
|
|
38
|
+
t(controller.controller_name, default: controller.controller_name.titleize, scope: "spree")
|
|
39
39
|
end
|
|
40
40
|
end
|
|
41
41
|
|
|
@@ -75,76 +75,76 @@ module Spree
|
|
|
75
75
|
request.fullpath.starts_with?(options[:url])
|
|
76
76
|
end
|
|
77
77
|
|
|
78
|
-
css_classes <<
|
|
78
|
+
css_classes << "selected" if options[:selected]
|
|
79
79
|
|
|
80
80
|
if options[:icon]
|
|
81
81
|
link = link_to_with_icon(options[:icon], label, options[:url])
|
|
82
|
-
css_classes <<
|
|
82
|
+
css_classes << "tab-with-icon"
|
|
83
83
|
else
|
|
84
84
|
link = link_to(label, options[:url])
|
|
85
85
|
end
|
|
86
86
|
block_content = capture(&block) if block_given?
|
|
87
|
-
content_tag(
|
|
87
|
+
content_tag("li", link + block_content.to_s, class: css_classes.join(" "))
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
def link_to_clone(resource, options = {})
|
|
91
|
-
options[:data] = {
|
|
91
|
+
options[:data] = {action: "clone"}
|
|
92
92
|
options[:method] = :post
|
|
93
|
-
link_to_with_icon(
|
|
93
|
+
link_to_with_icon("copy", t("spree.clone"), clone_object_url(resource), options)
|
|
94
94
|
end
|
|
95
95
|
|
|
96
96
|
def link_to_new(resource)
|
|
97
|
-
options[:data] = {
|
|
98
|
-
link_to_with_icon(
|
|
97
|
+
options[:data] = {action: "new"}
|
|
98
|
+
link_to_with_icon("plus", t("spree.new"), edit_object_url(resource))
|
|
99
99
|
end
|
|
100
100
|
|
|
101
101
|
def link_to_edit(resource, options = {})
|
|
102
102
|
url = options[:url] || edit_object_url(resource)
|
|
103
|
-
options[:data] = {
|
|
104
|
-
link_to_with_icon(
|
|
103
|
+
options[:data] = {action: "edit"}
|
|
104
|
+
link_to_with_icon("edit", t("spree.actions.edit"), url, options)
|
|
105
105
|
end
|
|
106
106
|
|
|
107
107
|
def link_to_edit_url(url, options = {})
|
|
108
|
-
options[:data] = {
|
|
109
|
-
link_to_with_icon(
|
|
108
|
+
options[:data] = {action: "edit"}
|
|
109
|
+
link_to_with_icon("edit", t("spree.actions.edit"), url, options)
|
|
110
110
|
end
|
|
111
111
|
|
|
112
112
|
def link_to_delete(resource, options = {})
|
|
113
113
|
url = options[:url] || object_url(resource)
|
|
114
|
-
name = options[:name] || t(
|
|
115
|
-
confirm = options[:confirm] || t(
|
|
114
|
+
name = options[:name] || t("spree.actions.delete")
|
|
115
|
+
confirm = options[:confirm] || t("spree.are_you_sure")
|
|
116
116
|
options[:class] = "#{options[:class]} delete-resource".strip
|
|
117
|
-
options[:data] = {
|
|
118
|
-
link_to_with_icon
|
|
117
|
+
options[:data] = {confirm:, action: "remove"}
|
|
118
|
+
link_to_with_icon "trash", name, url, options
|
|
119
119
|
end
|
|
120
120
|
|
|
121
121
|
def link_to_with_icon(icon_name, text, url, options = {})
|
|
122
122
|
options[:class] = "#{options[:class]} icon_link with-tip".strip
|
|
123
123
|
|
|
124
|
-
if icon_name.starts_with?(
|
|
125
|
-
svg_map = image_path(
|
|
124
|
+
if icon_name.starts_with?("ri-")
|
|
125
|
+
svg_map = image_path("spree/backend/themes/solidus_admin/remixicon.symbol.svg")
|
|
126
126
|
icon_tag = tag.svg(
|
|
127
|
-
tag.use(
|
|
128
|
-
|
|
129
|
-
style: "fill: currentColor;"
|
|
127
|
+
tag.use("xlink:href": "#{svg_map}##{icon_name}"),
|
|
128
|
+
"aria-hidden": true,
|
|
129
|
+
style: "fill: currentColor;"
|
|
130
130
|
)
|
|
131
131
|
else
|
|
132
132
|
options[:class] << " fa fa-#{icon_name}"
|
|
133
|
-
icon_tag =
|
|
133
|
+
icon_tag = "".html_safe
|
|
134
134
|
end
|
|
135
135
|
|
|
136
|
-
options[:class] +=
|
|
136
|
+
options[:class] += " no-text" if options[:no_text]
|
|
137
137
|
options[:title] = text if options[:no_text]
|
|
138
|
-
text = options[:no_text] ?
|
|
138
|
+
text = options[:no_text] ? "" : content_tag(:span, text, class: "text")
|
|
139
139
|
options.delete(:no_text)
|
|
140
140
|
link_to(icon_tag + text, url, options)
|
|
141
141
|
end
|
|
142
142
|
|
|
143
143
|
def solidus_icon(icon_name)
|
|
144
|
-
icon_name ? content_tag(:i,
|
|
144
|
+
icon_name ? content_tag(:i, "", class: icon_name) : ""
|
|
145
145
|
end
|
|
146
146
|
|
|
147
|
-
def configurations_menu_item(link_text, url, description =
|
|
147
|
+
def configurations_menu_item(link_text, url, description = "")
|
|
148
148
|
%(<tr>
|
|
149
149
|
<td>#{link_to(link_text, url)}</td>
|
|
150
150
|
<td>#{description}</td>
|
|
@@ -154,9 +154,9 @@ module Spree
|
|
|
154
154
|
|
|
155
155
|
def configurations_sidebar_menu_item(link_text, url, options = {})
|
|
156
156
|
is_active = url.ends_with?(controller.controller_name) ||
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
options[:class] = is_active ?
|
|
157
|
+
url.ends_with?("#{controller.controller_name}/edit") ||
|
|
158
|
+
url.ends_with?("#{controller.controller_name.singularize}/edit")
|
|
159
|
+
options[:class] = is_active ? "active" : nil
|
|
160
160
|
content_tag(:li, options) do
|
|
161
161
|
link_to(link_text, url)
|
|
162
162
|
end
|
|
@@ -164,12 +164,12 @@ module Spree
|
|
|
164
164
|
|
|
165
165
|
def settings_tab_item(link_text, url, options = {})
|
|
166
166
|
is_active = url.ends_with?(controller.controller_name) ||
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
options[:class] =
|
|
170
|
-
options[:class] +=
|
|
167
|
+
url.ends_with?("#{controller.controller_name}/edit") ||
|
|
168
|
+
url.ends_with?("#{controller.controller_name.singularize}/edit")
|
|
169
|
+
options[:class] = "fa"
|
|
170
|
+
options[:class] += " active" if is_active
|
|
171
171
|
options[:data] ||= {}
|
|
172
|
-
options[:data][:hook] = "admin_settings_#{link_text.downcase.tr(
|
|
172
|
+
options[:data][:hook] = "admin_settings_#{link_text.downcase.tr(" ", "_")}"
|
|
173
173
|
content_tag(:li, options) do
|
|
174
174
|
link_to(link_text, url)
|
|
175
175
|
end
|
|
@@ -16,7 +16,7 @@ module Spree
|
|
|
16
16
|
translated_event,
|
|
17
17
|
[event.to_sym, :admin, @order],
|
|
18
18
|
method: :put,
|
|
19
|
-
data: {
|
|
19
|
+
data: {confirm: t(:order_sure_want_to, event: translated_event, scope: :spree)}
|
|
20
20
|
)
|
|
21
21
|
end
|
|
22
22
|
safe_join(links, " ".html_safe)
|
|
@@ -72,7 +72,7 @@ module Spree
|
|
|
72
72
|
"P" => "Not Processed",
|
|
73
73
|
"S" => "Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card",
|
|
74
74
|
"U" => "Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys",
|
|
75
|
-
""
|
|
75
|
+
"" => "Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered"
|
|
76
76
|
}
|
|
77
77
|
end
|
|
78
78
|
end
|
|
@@ -4,7 +4,7 @@ module Spree
|
|
|
4
4
|
module Admin
|
|
5
5
|
module ReimbursementTypeHelper
|
|
6
6
|
def reimbursement_type_name(reimbursement_type)
|
|
7
|
-
reimbursement_type.present? ? reimbursement_type.name.humanize :
|
|
7
|
+
reimbursement_type.present? ? reimbursement_type.name.humanize : ""
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|
|
@@ -4,7 +4,7 @@ module Spree
|
|
|
4
4
|
module Admin
|
|
5
5
|
module StockLocationsHelper
|
|
6
6
|
def admin_stock_location_display_name(stock_location)
|
|
7
|
-
[stock_location.admin_name, stock_location.name].reject(&:blank?).join(
|
|
7
|
+
[stock_location.admin_name, stock_location.name].reject(&:blank?).join(" / ")
|
|
8
8
|
end
|
|
9
9
|
end
|
|
10
10
|
end
|