solidus_backend 1.1.4 → 1.2.0.beta1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_backend might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/assets/images/solidus-style-guide-logo.png +0 -0
- data/app/assets/javascripts/spree/backend/admin.js.erb +1 -7
- data/app/assets/javascripts/spree/backend/checkouts/edit.js +2 -2
- data/app/assets/javascripts/spree/backend/navigation.coffee +10 -0
- data/app/assets/javascripts/spree/backend/option_type_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/option_value_picker.js +6 -6
- data/app/assets/javascripts/spree/backend/product_picker.js +6 -6
- data/app/assets/javascripts/spree/backend/shipments.js.erb +17 -3
- data/app/assets/javascripts/spree/backend/stock_movement.js.coffee +2 -2
- data/app/assets/javascripts/spree/backend/style_guide.coffee +2 -0
- data/app/assets/javascripts/spree/backend/taxon_autocomplete.js.erb +6 -6
- data/app/assets/javascripts/spree/backend/taxonomy.js.coffee +82 -109
- data/app/assets/javascripts/spree/backend/taxons.js.coffee +4 -5
- data/app/assets/javascripts/spree/backend/user_picker.js +8 -8
- data/app/assets/javascripts/spree/backend/variant_autocomplete.js.coffee.erb +3 -3
- data/app/assets/javascripts/spree/backend.js +3 -6
- data/app/assets/stylesheets/spree/backend/components/_messages.scss +1 -4
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +99 -115
- data/app/assets/stylesheets/spree/backend/components/_progress.scss +1 -1
- data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +6 -0
- data/app/assets/stylesheets/spree/backend/globals/_variables.scss +18 -0
- data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +35 -0
- data/app/assets/stylesheets/spree/backend/plugins/_powertip.scss +1 -0
- data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +132 -0
- data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +60 -0
- data/app/assets/stylesheets/spree/backend/shared/_forms.scss +2 -0
- data/app/assets/stylesheets/spree/backend/shared/_layout.scss +36 -4
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -6
- data/app/assets/stylesheets/spree/backend/spree_admin.scss +4 -1
- data/app/assets/stylesheets/spree/backend.css +1 -1
- data/app/controllers/spree/admin/orders_controller.rb +6 -6
- data/app/controllers/spree/admin/payment_methods_controller.rb +1 -1
- data/app/controllers/spree/admin/payments_controller.rb +1 -1
- data/app/controllers/spree/admin/products_controller.rb +0 -1
- data/app/controllers/spree/admin/reports_controller.rb +2 -2
- data/app/controllers/spree/admin/search_controller.rb +9 -7
- data/app/controllers/spree/admin/stock_transfers_controller.rb +6 -14
- data/app/controllers/spree/admin/style_guide_controller.rb +33 -0
- data/app/helpers/spree/admin/adjustments_helper.rb +2 -6
- data/app/helpers/spree/admin/base_helper.rb +7 -6
- data/app/helpers/spree/admin/navigation_helper.rb +12 -5
- data/app/helpers/spree/admin/orders_helper.rb +1 -1
- data/app/helpers/spree/admin/products_helper.rb +2 -4
- data/app/helpers/spree/admin/stock_movements_helper.rb +3 -3
- data/app/views/spree/admin/adjustments/_adjustments_table.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/_reimbursements_table.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/edit.html.erb +1 -1
- data/app/views/spree/admin/images/edit.html.erb +1 -3
- data/app/views/spree/admin/images/index.html.erb +0 -2
- data/app/views/spree/admin/option_types/edit.html.erb +2 -4
- data/app/views/spree/admin/option_types/index.html.erb +0 -2
- data/app/views/spree/admin/option_types/new.html.erb +0 -2
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +1 -1
- data/app/views/spree/admin/product_properties/index.html.erb +0 -1
- data/app/views/spree/admin/products/edit.html.erb +0 -2
- data/app/views/spree/admin/products/index.html.erb +2 -4
- data/app/views/spree/admin/products/new.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/index.html.erb +0 -2
- data/app/views/spree/admin/promotion_categories/new.html.erb +0 -2
- data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +2 -28
- data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +2 -26
- data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +28 -0
- data/app/views/spree/admin/promotions/edit.html.erb +0 -2
- data/app/views/spree/admin/promotions/index.html.erb +0 -2
- data/app/views/spree/admin/promotions/new.html.erb +0 -2
- data/app/views/spree/admin/properties/edit.html.erb +0 -2
- data/app/views/spree/admin/properties/index.html.erb +2 -4
- data/app/views/spree/admin/properties/new.html.erb +0 -2
- data/app/views/spree/admin/properties/new.js.erb +1 -1
- data/app/views/spree/admin/prototypes/edit.html.erb +0 -2
- data/app/views/spree/admin/prototypes/index.html.erb +0 -2
- data/app/views/spree/admin/prototypes/new.html.erb +0 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/show.html.erb +9 -9
- data/app/views/spree/admin/return_authorizations/_form.html.erb +16 -16
- data/app/views/spree/admin/search/users.rabl +1 -1
- data/app/views/spree/admin/shared/_head.html.erb +11 -0
- data/app/views/spree/admin/shared/_header.html.erb +4 -8
- data/app/views/spree/admin/shared/_menu.html.erb +4 -8
- data/app/views/spree/admin/shared/_navigation.html.erb +9 -0
- data/app/views/spree/admin/shared/_navigation_footer.html.erb +3 -0
- data/app/views/spree/admin/shared/_product_sub_menu.html.erb +20 -22
- data/app/views/spree/admin/shared/_promotion_sub_menu.html.erb +8 -10
- data/app/views/spree/admin/shared/_stock_sub_menu.html.erb +8 -10
- data/app/views/spree/admin/shared/_tabs.html.erb +9 -3
- data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
- data/app/views/spree/admin/stock_items/index.html.erb +1 -2
- data/app/views/spree/admin/stock_transfers/edit.html.erb +0 -1
- data/app/views/spree/admin/stock_transfers/index.html.erb +0 -3
- data/app/views/spree/admin/stock_transfers/new.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/receive.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/show.html.erb +0 -2
- data/app/views/spree/admin/stock_transfers/tracking_info.html.erb +0 -2
- data/app/views/spree/admin/style_guide/index.html.erb +5 -0
- data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +79 -0
- data/app/views/spree/admin/style_guide/topics/forms/_validation.html.erb +14 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +20 -0
- data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +16 -0
- data/app/views/spree/admin/style_guide/topics/tables/_building_tables.html.erb +44 -0
- data/app/views/spree/admin/style_guide/topics/tables/_pagination.html.erb +11 -0
- data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +64 -0
- data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +19 -0
- data/app/views/spree/admin/style_guide/topics/typography/_icons.html.erb +13 -0
- data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +25 -0
- data/app/views/spree/admin/style_guide/topics/typography/_tags.html.erb +25 -0
- data/app/views/spree/admin/taxonomies/_js_head.html.erb +0 -0
- data/app/views/spree/admin/taxonomies/edit.erb +5 -6
- data/app/views/spree/admin/taxonomies/index.html.erb +0 -2
- data/app/views/spree/admin/taxonomies/new.html.erb +0 -2
- data/app/views/spree/admin/taxons/_form.html.erb +1 -1
- data/app/views/spree/admin/taxons/_list_template.html.erb +17 -0
- data/app/views/spree/admin/taxons/index.html.erb +0 -3
- data/app/views/spree/admin/users/orders.html.erb +1 -1
- data/app/views/spree/admin/variants/edit.html.erb +0 -2
- data/app/views/spree/admin/variants/index.html.erb +0 -2
- data/app/views/spree/layouts/admin.html.erb +3 -4
- data/app/views/spree/layouts/admin_style_guide.html.erb +58 -0
- data/config/routes.rb +4 -2
- data/lib/spree/backend/engine.rb +0 -1
- data/lib/spree/backend.rb +0 -3
- data/solidus_backend.gemspec +5 -7
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +14 -14
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -4
- data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -2
- data/spec/controllers/spree/admin/products_controller_spec.rb +3 -3
- data/spec/controllers/spree/admin/reports_controller_spec.rb +4 -4
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
- data/spec/controllers/spree/admin/stock_transfers_controller_spec.rb +13 -11
- data/spec/features/admin/configuration/general_settings_spec.rb +10 -7
- data/spec/features/admin/configuration/payment_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
- data/spec/features/admin/configuration/states_spec.rb +1 -1
- data/spec/features/admin/configuration/tax_rates_spec.rb +6 -7
- data/spec/features/admin/configuration/taxonomies_spec.rb +3 -3
- data/spec/features/admin/homepage_spec.rb +6 -6
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +4 -8
- data/spec/features/admin/orders/customer_details_spec.rb +9 -8
- data/spec/features/admin/orders/line_items_spec.rb +1 -1
- data/spec/features/admin/orders/listing_spec.rb +2 -2
- data/spec/features/admin/orders/log_entries_spec.rb +3 -3
- data/spec/features/admin/orders/new_order_spec.rb +3 -15
- data/spec/features/admin/orders/order_details_spec.rb +17 -20
- data/spec/features/admin/orders/payments_spec.rb +10 -10
- data/spec/features/admin/orders/shipments_spec.rb +2 -2
- data/spec/features/admin/products/edit/images_spec.rb +5 -3
- data/spec/features/admin/products/edit/products_spec.rb +11 -11
- data/spec/features/admin/products/edit/taxons_spec.rb +14 -38
- data/spec/features/admin/products/edit/variants_spec.rb +3 -3
- data/spec/features/admin/products/option_types_spec.rb +22 -21
- data/spec/features/admin/products/products_spec.rb +15 -12
- data/spec/features/admin/products/properties_spec.rb +3 -3
- data/spec/features/admin/products/prototypes_spec.rb +4 -4
- data/spec/features/admin/products/stock_management_spec.rb +5 -5
- data/spec/features/admin/products/variant_spec.rb +8 -8
- data/spec/features/admin/promotion_adjustments_spec.rb +6 -13
- data/spec/features/admin/promotions/option_value_rule_spec.rb +0 -20
- data/spec/features/admin/reports_spec.rb +2 -2
- data/spec/features/admin/stock_transfer_spec.rb +3 -3
- data/spec/features/admin/store_credits_spec.rb +2 -2
- data/spec/features/admin/users_spec.rb +6 -6
- data/spec/helpers/admin/navigation_helper_spec.rb +5 -0
- data/spec/helpers/admin/reimbursements_helper_spec.rb +1 -1
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +1 -1
- data/spec/spec_helper.rb +3 -1
- data/spec/support/feature/base_feature_helper.rb +10 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_0_eeeeee_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_55_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_100_f6f6f6_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_25_0073ea_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-bg_highlight-soft_50_dddddd_1x100.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_0073ea_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_454545_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_666666_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ff0084_256x240.png +0 -0
- data/vendor/assets/images/jquery-ui/ui-icons_ffffff_256x240.png +0 -0
- data/vendor/assets/javascripts/jquery.powertip.js +792 -423
- data/vendor/assets/javascripts/jquery.sticky-kit.min.js +10 -0
- data/vendor/assets/javascripts/prism.js +7 -0
- data/vendor/assets/stylesheets/prism.css +139 -0
- metadata +44 -51
- data/app/assets/stylesheets/spree/backend/plugins/_jstree.scss +0 -135
- data/app/views/spree/admin/shared/_sub_menu.html.erb +0 -9
- data/spec/features/admin/promotions/user_rule_spec.rb +0 -25
- data/vendor/assets/javascripts/equalize.js +0 -41
- data/vendor/assets/javascripts/jquery.jstree/jquery.jstree.js +0 -4540
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/bg.jpg +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/d.png +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/dot_for_ie.gif +0 -0
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/style.scss +0 -61
- data/vendor/assets/javascripts/jquery.jstree/themes/apple/throbber.gif +0 -0
- data/vendor/assets/javascripts/jquery.vAlign.js +0 -11
- data/vendor/assets/javascripts/modernizr.js +0 -4
- data/vendor/assets/javascripts/responsive-tables.js +0 -42
- data/vendor/assets/stylesheets/responsive-tables.css +0 -21
@@ -2,7 +2,7 @@ module Spree
|
|
2
2
|
module Admin
|
3
3
|
class OrdersController < Spree::Admin::BaseController
|
4
4
|
before_action :initialize_order_events
|
5
|
-
before_action :load_order, only: [:edit, :update, :complete, :advance, :cancel, :resume, :approve, :resend, :
|
5
|
+
before_action :load_order, only: [:edit, :update, :complete, :advance, :cancel, :resume, :approve, :resend, :unfinalize_adjustments, :finalize_adjustments, :cart, :confirm]
|
6
6
|
around_filter :lock_order, :only => [:update, :advance, :complete, :confirm, :cancel, :resume, :approve, :resend]
|
7
7
|
|
8
8
|
rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
|
@@ -39,7 +39,7 @@ module Spree
|
|
39
39
|
|
40
40
|
@search = Order.accessible_by(current_ability, :index).ransack(params[:q])
|
41
41
|
|
42
|
-
#
|
42
|
+
# lazy loading other models here (via includes) may result in an invalid query
|
43
43
|
# e.g. SELECT DISTINCT DISTINCT "spree_orders".id, "spree_orders"."created_at" AS alias_0 FROM "spree_orders"
|
44
44
|
# see https://github.com/spree/spree/pull/3919
|
45
45
|
@orders = if query_present
|
@@ -151,18 +151,18 @@ module Spree
|
|
151
151
|
redirect_to :back
|
152
152
|
end
|
153
153
|
|
154
|
-
def
|
154
|
+
def unfinalize_adjustments
|
155
155
|
adjustments = @order.all_adjustments.finalized
|
156
156
|
adjustments.each(&:unfinalize!)
|
157
|
-
flash[:success] = Spree.t(:
|
157
|
+
flash[:success] = Spree.t(:all_adjustments_unfinalized)
|
158
158
|
|
159
159
|
respond_with(@order) { |format| format.html { redirect_to :back } }
|
160
160
|
end
|
161
161
|
|
162
|
-
def
|
162
|
+
def finalize_adjustments
|
163
163
|
adjustments = @order.all_adjustments.not_finalized
|
164
164
|
adjustments.each(&:finalize!)
|
165
|
-
flash[:success] = Spree.t(:
|
165
|
+
flash[:success] = Spree.t(:all_adjustments_finalized)
|
166
166
|
|
167
167
|
respond_with(@order) { |format| format.html { redirect_to :back } }
|
168
168
|
end
|
@@ -20,7 +20,7 @@ module Spree
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def create
|
23
|
-
@payment
|
23
|
+
@payment = PaymentCreate.new(@order, object_params).build
|
24
24
|
if @payment.payment_method.source_required? && params[:card].present? and params[:card] != 'new'
|
25
25
|
@payment.source = @payment.payment_method.payment_source_class.find_by_id(params[:card])
|
26
26
|
end
|
@@ -29,9 +29,9 @@ module Spree
|
|
29
29
|
params[:q] = {} unless params[:q]
|
30
30
|
|
31
31
|
if params[:q][:completed_at_gt].blank?
|
32
|
-
params[:q][:completed_at_gt] = Time.
|
32
|
+
params[:q][:completed_at_gt] = Time.current.beginning_of_month
|
33
33
|
else
|
34
|
-
params[:q][:completed_at_gt] = Time.zone.parse(params[:q][:completed_at_gt]).beginning_of_day rescue Time.
|
34
|
+
params[:q][:completed_at_gt] = Time.zone.parse(params[:q][:completed_at_gt]).beginning_of_day rescue Time.current.beginning_of_month
|
35
35
|
end
|
36
36
|
|
37
37
|
if params[:q] && !params[:q][:completed_at_lt].blank?
|
@@ -9,26 +9,28 @@ module Spree
|
|
9
9
|
# And then JSON building with something like Active Model Serializers
|
10
10
|
def users
|
11
11
|
if params[:ids]
|
12
|
-
|
12
|
+
# split here may be String#split or Array#split, so we must flatten the results
|
13
|
+
@users = Spree.user_class.where(id: params[:ids].split(',').flatten)
|
13
14
|
else
|
14
15
|
@users = Spree.user_class.ransack({
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
16
|
+
m: 'or',
|
17
|
+
email_start: params[:q],
|
18
|
+
addresses_firstname_start: params[:q],
|
19
|
+
addresses_lastname_start: params[:q]
|
19
20
|
}).result.limit(10)
|
20
21
|
end
|
21
22
|
end
|
22
23
|
|
23
24
|
def products
|
24
25
|
if params[:ids]
|
25
|
-
|
26
|
+
# split here may be String#split or Array#split, so we must flatten the results
|
27
|
+
@products = Product.where(id: params[:ids].split(",").flatten)
|
26
28
|
else
|
27
29
|
@products = Product.ransack(params[:q]).result
|
28
30
|
end
|
29
31
|
|
30
32
|
@products = @products.distinct.page(params[:page]).per(params[:per_page])
|
31
|
-
expires_in 15.minutes, :
|
33
|
+
expires_in 15.minutes, public: true
|
32
34
|
headers['Surrogate-Control'] = "max-age=#{15.minutes}"
|
33
35
|
end
|
34
36
|
end
|
@@ -7,7 +7,7 @@ module Spree
|
|
7
7
|
{ translation_key: :name, attr_name: :name }
|
8
8
|
]
|
9
9
|
|
10
|
-
before_filter :
|
10
|
+
before_filter :load_viewable_stock_locations, only: :index
|
11
11
|
before_filter :load_variant_display_attributes, only: [:receive, :edit, :show, :tracking_info]
|
12
12
|
before_filter :load_source_stock_locations, only: :new
|
13
13
|
before_filter :load_destination_stock_locations, only: :edit
|
@@ -43,7 +43,7 @@ module Spree
|
|
43
43
|
|
44
44
|
def ship
|
45
45
|
if @stock_transfer.transfer
|
46
|
-
@stock_transfer.ship(shipped_at: DateTime.
|
46
|
+
@stock_transfer.ship(shipped_at: DateTime.current)
|
47
47
|
flash[:success] = Spree.t(:stock_transfer_complete)
|
48
48
|
redirect_to admin_stock_transfers_path
|
49
49
|
else
|
@@ -100,16 +100,16 @@ module Spree
|
|
100
100
|
authorize! :create, duplicate
|
101
101
|
end
|
102
102
|
|
103
|
-
def
|
104
|
-
@stock_locations =
|
103
|
+
def load_viewable_stock_locations
|
104
|
+
@stock_locations = Spree::StockLocation.accessible_by(current_ability, :read)
|
105
105
|
end
|
106
106
|
|
107
107
|
def load_source_stock_locations
|
108
|
-
@source_stock_locations
|
108
|
+
@source_stock_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_from)
|
109
109
|
end
|
110
110
|
|
111
111
|
def load_destination_stock_locations
|
112
|
-
@destination_stock_locations
|
112
|
+
@destination_stock_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_to).where.not(id: @stock_transfer.source_location_id)
|
113
113
|
end
|
114
114
|
|
115
115
|
def load_variant_display_attributes
|
@@ -142,14 +142,6 @@ module Spree
|
|
142
142
|
@stock_transfer.destination_location.move(transfer_item.variant, transfer_item.received_quantity, @stock_transfer)
|
143
143
|
end
|
144
144
|
end
|
145
|
-
|
146
|
-
def accessible_source_stock_locations
|
147
|
-
@source_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_from)
|
148
|
-
end
|
149
|
-
|
150
|
-
def accessible_destination_stock_locations
|
151
|
-
@destination_locations ||= Spree::StockLocation.accessible_by(current_ability, :transfer_to)
|
152
|
-
end
|
153
145
|
end
|
154
146
|
end
|
155
147
|
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
module Spree
|
2
|
+
module Admin
|
3
|
+
class StyleGuideController < Spree::Admin::BaseController
|
4
|
+
respond_to :html
|
5
|
+
layout '/spree/layouts/admin_style_guide'
|
6
|
+
|
7
|
+
def index
|
8
|
+
@topics = {
|
9
|
+
typography: [
|
10
|
+
'fonts',
|
11
|
+
'colors',
|
12
|
+
'lists',
|
13
|
+
'icons',
|
14
|
+
'tags'
|
15
|
+
],
|
16
|
+
forms: [
|
17
|
+
'building_forms',
|
18
|
+
'validation'
|
19
|
+
],
|
20
|
+
messaging: [
|
21
|
+
'loading',
|
22
|
+
'flashes',
|
23
|
+
'tooltips'
|
24
|
+
],
|
25
|
+
tables: [
|
26
|
+
'building_tables',
|
27
|
+
'pagination'
|
28
|
+
]
|
29
|
+
}
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
@@ -26,15 +26,11 @@ module Spree
|
|
26
26
|
parts << variant.product.name
|
27
27
|
parts << "(#{variant.options_text})" if variant.options_text.present?
|
28
28
|
parts << line_item.display_total
|
29
|
-
|
29
|
+
parts.join("<br>").html_safe
|
30
30
|
end
|
31
31
|
|
32
32
|
def display_shipment(shipment)
|
33
|
-
|
34
|
-
"#{Spree.t(:shipment)} ##{shipment.number}",
|
35
|
-
shipment.display_cost
|
36
|
-
]
|
37
|
-
safe_join(parts, "<br />".html_safe)
|
33
|
+
"#{Spree.t(:shipment)} ##{shipment.number}<br>#{shipment.display_cost}".html_safe
|
38
34
|
end
|
39
35
|
|
40
36
|
def display_order(order)
|
@@ -15,8 +15,8 @@ module Spree
|
|
15
15
|
obj = object.respond_to?(:errors) ? object : instance_variable_get("@#{object}")
|
16
16
|
|
17
17
|
if obj && obj.errors[method].present?
|
18
|
-
errors =
|
19
|
-
content_tag(:span, errors, class
|
18
|
+
errors = obj.errors[method].map { |err| h(err) }.join('<br />').html_safe
|
19
|
+
content_tag(:span, errors, :class => 'formError')
|
20
20
|
else
|
21
21
|
''
|
22
22
|
end
|
@@ -132,11 +132,12 @@ module Spree
|
|
132
132
|
|
133
133
|
def preference_fields(object, form)
|
134
134
|
return unless object.respond_to?(:preferences)
|
135
|
-
|
135
|
+
object.preferences.keys.map{ |key|
|
136
|
+
|
136
137
|
form.label("preferred_#{key}", Spree.t(key) + ": ") +
|
137
|
-
preference_field_for(form, "preferred_#{key}", type
|
138
|
-
|
139
|
-
|
138
|
+
preference_field_for(form, "preferred_#{key}", :type => object.preference_type(key))
|
139
|
+
|
140
|
+
}.join("<br />").html_safe
|
140
141
|
end
|
141
142
|
|
142
143
|
def link_to_add_fields(name, target, options = {})
|
@@ -6,7 +6,7 @@ module Spree
|
|
6
6
|
# * :label to override link text, otherwise based on the first resource name (translated)
|
7
7
|
# * :route to override automatically determining the default route
|
8
8
|
# * :match_path as an alternative way to control when the tab is active, /products would match /admin/products, /admin/products/5/variants etc.
|
9
|
-
def tab(*args)
|
9
|
+
def tab(*args, &block)
|
10
10
|
options = {:label => args.first.to_s}
|
11
11
|
|
12
12
|
if args.last.is_a?(Hash)
|
@@ -38,7 +38,7 @@ module Spree
|
|
38
38
|
if options[:css_class]
|
39
39
|
css_classes << options[:css_class]
|
40
40
|
end
|
41
|
-
content_tag('li', link, :
|
41
|
+
content_tag('li', link + (yield if block_given?), class: css_classes.join(' ') )
|
42
42
|
end
|
43
43
|
|
44
44
|
def link_to_clone(resource, options={})
|
@@ -74,7 +74,7 @@ module Spree
|
|
74
74
|
options[:class] = (options[:class].to_s + " fa fa-#{icon_name} icon_link with-tip").strip
|
75
75
|
options[:class] += ' no-text' if options[:no_text]
|
76
76
|
options[:title] = text if options[:no_text]
|
77
|
-
text = options[:no_text] ? '' :
|
77
|
+
text = options[:no_text] ? '' : raw("<span class='text'>#{text}</span>")
|
78
78
|
options.delete(:no_text)
|
79
79
|
link_to(text, url, options)
|
80
80
|
end
|
@@ -88,6 +88,7 @@ module Spree
|
|
88
88
|
end
|
89
89
|
|
90
90
|
def button_link_to(text, url, html_options = {})
|
91
|
+
html_options = {class: ''}.merge(html_options)
|
91
92
|
if (html_options[:method] &&
|
92
93
|
html_options[:method].to_s.downcase != 'get' &&
|
93
94
|
!html_options[:remote])
|
@@ -102,15 +103,21 @@ module Spree
|
|
102
103
|
|
103
104
|
html_options.delete('data-update') unless html_options['data-update']
|
104
105
|
|
105
|
-
html_options[:class]
|
106
|
+
html_options[:class] += ' button'
|
106
107
|
|
107
108
|
if html_options[:icon]
|
108
109
|
html_options[:class] += " fa fa-#{html_options[:icon]}"
|
109
110
|
end
|
110
|
-
link_to(text, url, html_options)
|
111
|
+
link_to(text_for_button_link(text, html_options), url, html_options)
|
111
112
|
end
|
112
113
|
end
|
113
114
|
|
115
|
+
def text_for_button_link(text, html_options)
|
116
|
+
s = ''
|
117
|
+
s << text
|
118
|
+
raw(s)
|
119
|
+
end
|
120
|
+
|
114
121
|
def configurations_menu_item(link_text, url, description = '')
|
115
122
|
%(<tr>
|
116
123
|
<td>#{link_to(link_text, url)}</td>
|
@@ -9,8 +9,7 @@ module Spree
|
|
9
9
|
:selected => ('selected' if selected)) do
|
10
10
|
(taxon.ancestors.pluck(:name) + [taxon.name]).join(" -> ")
|
11
11
|
end
|
12
|
-
end
|
13
|
-
safe_join(options)
|
12
|
+
end.join("").html_safe
|
14
13
|
end
|
15
14
|
|
16
15
|
def option_types_options_for(product)
|
@@ -21,8 +20,7 @@ module Spree
|
|
21
20
|
:selected => ('selected' if selected)) do
|
22
21
|
option_type.name
|
23
22
|
end
|
24
|
-
end
|
25
|
-
safe_join(options)
|
23
|
+
end.join("").html_safe
|
26
24
|
end
|
27
25
|
end
|
28
26
|
end
|
@@ -15,9 +15,9 @@ module Spree
|
|
15
15
|
|
16
16
|
def display_variant(stock_movement)
|
17
17
|
variant = stock_movement.stock_item.variant
|
18
|
-
output =
|
19
|
-
output
|
20
|
-
|
18
|
+
output = variant.name
|
19
|
+
output += "<br>(#{variant.options_text})" unless variant.options_text.blank?
|
20
|
+
output.html_safe
|
21
21
|
end
|
22
22
|
end
|
23
23
|
end
|
@@ -14,10 +14,10 @@
|
|
14
14
|
<td class="align-center" colspan='4'>
|
15
15
|
<% if can? :update, Spree::Adjustment %>
|
16
16
|
<div>
|
17
|
-
<%= button_to Spree.t(:
|
17
|
+
<%= button_to Spree.t(:unfinalize_all_adjustments), adjustments_unfinalize_admin_order_path(@order), method: :get %>
|
18
18
|
</div>
|
19
19
|
<div>
|
20
|
-
<%= button_to Spree.t(:
|
20
|
+
<%= button_to Spree.t(:finalize_all_adjustments), adjustments_finalize_admin_order_path(@order), method: :get %>
|
21
21
|
</div>
|
22
22
|
<% end %>
|
23
23
|
</td>
|
@@ -19,7 +19,7 @@
|
|
19
19
|
<% return_item = item_fields.object %>
|
20
20
|
|
21
21
|
<tr>
|
22
|
-
<td class="align-center
|
22
|
+
<td class="align-center inventory-unit-checkbox">
|
23
23
|
<div style="display:none">
|
24
24
|
<%= item_fields.hidden_field :inventory_unit_id %>
|
25
25
|
<%= item_fields.hidden_field :return_authorization_id %>
|
@@ -16,7 +16,7 @@
|
|
16
16
|
<% end %>
|
17
17
|
|
18
18
|
<% if @pending_return_items.any? %>
|
19
|
-
<fieldset data-hook="
|
19
|
+
<fieldset data-hook="pending_return_items" class="no-border-bottom">
|
20
20
|
<legend align="center"><%= Spree.t(:pending) %></legend>
|
21
21
|
<%= render partial: 'return_item_decision', locals: {return_items: @pending_return_items, show_decision: true} %>
|
22
22
|
</fieldset>
|
@@ -1,5 +1,3 @@
|
|
1
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
-
|
3
1
|
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Images' } %>
|
4
2
|
|
5
3
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @image } %>
|
@@ -16,7 +14,7 @@
|
|
16
14
|
<%= link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:product) %>
|
17
15
|
</div>
|
18
16
|
<div class="nine columns omega">
|
19
|
-
<%= render :partial => 'form', :locals => { :f => f } %>
|
17
|
+
<%= render :partial => 'form', :locals => { :f => f } %>
|
20
18
|
</div>
|
21
19
|
<div class="clear"></div>
|
22
20
|
<div class="form-buttons filter-actions actions" data-hook="buttons">
|
@@ -1,5 +1,3 @@
|
|
1
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
-
|
3
1
|
<% content_for :page_title do %>
|
4
2
|
<%= Spree.t(:editing_option_type) %> <span class="green">"<%= @option_type.name %>"</span>
|
5
3
|
<% end %>
|
@@ -8,7 +6,7 @@
|
|
8
6
|
<li>
|
9
7
|
<span id="new_add_option_value" data-hook>
|
10
8
|
<%= link_to_add_fields Spree.t(:add_option_value), "tbody#option_values", :class => 'button fa fa-plus' %>
|
11
|
-
</span>
|
9
|
+
</span>
|
12
10
|
</li>
|
13
11
|
<li>
|
14
12
|
<%= button_link_to Spree.t(:back_to_option_types_list), spree.admin_option_types_path, :icon => 'arrow-left' %>
|
@@ -20,7 +18,7 @@
|
|
20
18
|
<%= form_for [:admin, @option_type] do |f| %>
|
21
19
|
<fieldset>
|
22
20
|
<legend align="center"><%= Spree.t(:option_values) %></legend>
|
23
|
-
|
21
|
+
|
24
22
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
25
23
|
|
26
24
|
<table class="index sortable" data-hook data-sortable-link="<%= update_values_positions_admin_option_types_url %>">
|
@@ -25,7 +25,7 @@
|
|
25
25
|
<%= link_to '', '#', :class => 'save-item fa fa-check no-text with-tip', :data => {'shipment-number' => shipment_number, 'variant-id' => item.variant.id, :action => 'save'}, :title => Spree.t('actions.save'), :style => 'display: none' %>
|
26
26
|
<%= link_to '', '#', :class => 'cancel-item fa fa-cancel no-text with-tip', :data => {:action => 'cancel'}, :title => Spree.t('actions.cancel'), :style => 'display: none' %>
|
27
27
|
<%= link_to '', '#', :class => 'split-item icon_link fa fa-arrows-h no-text with-tip', :data => {:action => 'split', 'variant-id' => item.variant.id}, :title => Spree.t('split') %>
|
28
|
-
<%= link_to '', '#', :class => 'delete-item fa fa-trash no-text with-tip', :data => { '
|
28
|
+
<%= link_to '', '#', :class => 'delete-item fa fa-trash no-text with-tip', :data => { 'line-item-id' => item.line_item.id}, :title => Spree.t('delete') %>
|
29
29
|
<% end %>
|
30
30
|
</td>
|
31
31
|
</tr>
|
@@ -7,8 +7,6 @@
|
|
7
7
|
<% end %>
|
8
8
|
<% end %>
|
9
9
|
|
10
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
11
|
-
|
12
10
|
<%= render :partial => 'spree/admin/shared/product_tabs', :locals => { :current => 'Product Details' } %>
|
13
11
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>
|
14
12
|
|
@@ -8,8 +8,6 @@
|
|
8
8
|
</li>
|
9
9
|
<% end if can?(:create, Spree::Product) %>
|
10
10
|
|
11
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
12
|
-
|
13
11
|
<% content_for :table_filter_title do %>
|
14
12
|
<%= Spree.t(:search) %>
|
15
13
|
<% end %>
|
@@ -77,10 +75,10 @@
|
|
77
75
|
<tbody>
|
78
76
|
<% @collection.each do |product| %>
|
79
77
|
<tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows" class="<%= cycle('odd', 'even') %>">
|
80
|
-
<td class="align-center"><%= product.sku
|
78
|
+
<td class="align-center"><%= product.sku %></td>
|
81
79
|
<td class="align-center"><%= image_tag product.display_image.attachment(:mini) %></td>
|
82
80
|
<td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
|
83
|
-
<td class="align-center"><%= product.display_price.to_html
|
81
|
+
<td class="align-center"><%= product.display_price.to_html %></td>
|
84
82
|
<td class="actions" data-hook="admin_products_index_row_actions">
|
85
83
|
<%= link_to_edit product, :no_text => true, :class => 'edit' if can?(:edit, product) && !product.deleted? %>
|
86
84
|
|
@@ -1,5 +1,3 @@
|
|
1
|
-
<%= render :partial => 'spree/admin/shared/product_sub_menu' %>
|
2
|
-
|
3
1
|
<%= render :partial => 'spree/shared/error_messages', :locals => { :target => @product } %>
|
4
2
|
|
5
3
|
<%= form_for [:admin, @product], method: :post, url: admin_products_path, :html => { :multipart => true } do |f| %>
|
@@ -2,8 +2,6 @@
|
|
2
2
|
<%= Spree.t(:editing_promotion_category) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
<%= render 'spree/admin/shared/promotion_sub_menu' %>
|
6
|
-
|
7
5
|
<%= form_for @promotion_category, :url => object_url, :method => :put do |f| %>
|
8
6
|
<fieldset class="no-border-top">
|
9
7
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
@@ -2,8 +2,6 @@
|
|
2
2
|
<%= Spree.t(:new_promotion_category) %>
|
3
3
|
<% end %>
|
4
4
|
|
5
|
-
<%= render 'spree/admin/shared/promotion_sub_menu' %>
|
6
|
-
|
7
5
|
<%= form_for :promotion_category, :url => collection_url do |f| %>
|
8
6
|
<fieldset class="no-border-top">
|
9
7
|
<%= render :partial => 'form', :locals => { :f => f } %>
|
@@ -1,28 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div class="field alpha four columns">
|
4
|
-
<% field_name = "#{param_prefix}[calculator_type]" %>
|
5
|
-
<%= label_tag field_name, Spree.t(:calculator) %>
|
6
|
-
<%= select_tag field_name,
|
7
|
-
options_from_collection_for_select(@calculators, :to_s, :description, promotion_action.calculator.type),
|
8
|
-
:class => 'type-select select2 fullwidth' %>
|
9
|
-
<% if promotion_action.calculator.respond_to?(:preferences) %>
|
10
|
-
<span class="warning info"><%= Spree.t(:calculator_settings_warning) %></span>
|
11
|
-
<% end %>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<% unless promotion_action.new_record? %>
|
15
|
-
<div class="settings field omega four columns">
|
16
|
-
<% type_name = promotion_action.calculator.type.demodulize.underscore %>
|
17
|
-
<% if lookup_context.exists?("fields",
|
18
|
-
["spree/admin/promotions/calculators/#{type_name}"], true) %>
|
19
|
-
<%= render "spree/admin/promotions/calculators/#{type_name}/fields",
|
20
|
-
calculator: promotion_action.calculator, prefix: param_prefix %>
|
21
|
-
<% else %>
|
22
|
-
<%= render "spree/admin/promotions/calculators/default_fields",
|
23
|
-
calculator: promotion_action.calculator, prefix: param_prefix %>
|
24
|
-
<% end %>
|
25
|
-
<%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
|
26
|
-
</div>
|
27
|
-
<% end %>
|
28
|
-
</div>
|
1
|
+
<%= render partial: 'spree/admin/promotions/actions/promotion_calculators_with_custom_fields',
|
2
|
+
locals: { calculators: @calculators, promotion_action: promotion_action, param_prefix: param_prefix } %>
|
@@ -1,26 +1,2 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
<div class="field alpha four columns">
|
4
|
-
<% field_name = "#{param_prefix}[calculator_type]" %>
|
5
|
-
<%= label_tag field_name, Spree.t(:calculator) %>
|
6
|
-
<%= select_tag field_name,
|
7
|
-
options_from_collection_for_select(Spree::Promotion::Actions::CreateItemAdjustments.calculators, :to_s, :description, promotion_action.calculator.type),
|
8
|
-
:class => 'type-select select2 fullwidth' %>
|
9
|
-
<% if promotion_action.calculator.respond_to?(:preferences) %>
|
10
|
-
<span class="warning info"><%= Spree.t(:calculator_settings_warning) %></span>
|
11
|
-
<% end %>
|
12
|
-
</div>
|
13
|
-
|
14
|
-
<% unless promotion_action.new_record? %>
|
15
|
-
<div class="settings field omega four columns">
|
16
|
-
<% promotion_action.calculator.preferences.keys.map do |key| %>
|
17
|
-
<% field_name = "#{param_prefix}[calculator_attributes][preferred_#{key}]" %>
|
18
|
-
<%= label_tag field_name, Spree.t(key.to_s) %>
|
19
|
-
<%= preference_field_tag(field_name,
|
20
|
-
promotion_action.calculator.get_preference(key),
|
21
|
-
:type => promotion_action.calculator.preference_type(key)) %>
|
22
|
-
<% end %>
|
23
|
-
<%= hidden_field_tag "#{param_prefix}[calculator_attributes][id]", promotion_action.calculator.id %>
|
24
|
-
</div>
|
25
|
-
<% end %>
|
26
|
-
</div>
|
1
|
+
<%= render partial: 'spree/admin/promotions/actions/promotion_calculators_with_custom_fields',
|
2
|
+
locals: { calculators: Spree::Promotion::Actions::CreateItemAdjustments.calculators, promotion_action: promotion_action, param_prefix: param_prefix } %>
|