solidus_backend 2.5.2 → 2.6.0.rc1
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/Rakefile +5 -3
- data/app/assets/javascripts/spree/backend.js +1 -0
- data/app/assets/javascripts/spree/backend/admin.js +1 -0
- data/app/assets/javascripts/spree/backend/highlight_negative_numbers.js +14 -0
- data/app/assets/javascripts/spree/backend/locale_selection.js +18 -0
- data/app/assets/javascripts/spree/backend/templates/products/sortable.hbs +1 -1
- data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +11 -2
- data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +3 -1
- data/app/assets/stylesheets/spree/backend/components/_navigation.scss +6 -2
- data/app/assets/stylesheets/spree/backend/globals/_functions.scss +1 -2
- data/app/assets/stylesheets/spree/backend/shared/_typography.scss +3 -0
- data/app/controllers/spree/admin/adjustment_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/adjustments_controller.rb +2 -0
- data/app/controllers/spree/admin/base_controller.rb +2 -0
- data/app/controllers/spree/admin/cancellations_controller.rb +2 -0
- data/app/controllers/spree/admin/customer_returns_controller.rb +2 -0
- data/app/controllers/spree/admin/dashboards_controller.rb +2 -0
- data/app/controllers/spree/admin/general_settings_controller.rb +2 -0
- data/app/controllers/spree/admin/images_controller.rb +2 -0
- data/app/controllers/spree/admin/locale_controller.rb +24 -0
- data/app/controllers/spree/admin/log_entries_controller.rb +2 -0
- data/app/controllers/spree/admin/option_types_controller.rb +2 -0
- data/app/controllers/spree/admin/option_values_controller.rb +2 -0
- data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -0
- data/app/controllers/spree/admin/orders_controller.rb +4 -2
- data/app/controllers/spree/admin/payment_methods_controller.rb +2 -0
- data/app/controllers/spree/admin/payments_controller.rb +2 -0
- data/app/controllers/spree/admin/prices_controller.rb +2 -0
- data/app/controllers/spree/admin/product_properties_controller.rb +2 -0
- data/app/controllers/spree/admin/products_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_actions_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_code_batches_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_codes_controller.rb +2 -0
- data/app/controllers/spree/admin/promotion_rules_controller.rb +6 -0
- data/app/controllers/spree/admin/promotions_controller.rb +2 -0
- data/app/controllers/spree/admin/properties_controller.rb +2 -0
- data/app/controllers/spree/admin/refund_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/refunds_controller.rb +2 -0
- data/app/controllers/spree/admin/reimbursement_types_controller.rb +2 -0
- data/app/controllers/spree/admin/reimbursements_controller.rb +2 -0
- data/app/controllers/spree/admin/reports_controller.rb +2 -0
- data/app/controllers/spree/admin/resource_controller.rb +2 -0
- data/app/controllers/spree/admin/return_authorizations_controller.rb +2 -0
- data/app/controllers/spree/admin/return_items_controller.rb +2 -0
- data/app/controllers/spree/admin/return_reasons_controller.rb +2 -0
- data/app/controllers/spree/admin/root_controller.rb +2 -0
- data/app/controllers/spree/admin/search_controller.rb +2 -0
- data/app/controllers/spree/admin/shipping_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/shipping_methods_controller.rb +2 -0
- data/app/controllers/spree/admin/stock_items_controller.rb +2 -0
- data/app/controllers/spree/admin/stock_locations_controller.rb +2 -1
- data/app/controllers/spree/admin/stock_movements_controller.rb +2 -0
- data/app/controllers/spree/admin/store_credits_controller.rb +2 -0
- data/app/controllers/spree/admin/stores_controller.rb +2 -0
- data/app/controllers/spree/admin/style_guide_controller.rb +2 -0
- data/app/controllers/spree/admin/tax_categories_controller.rb +2 -0
- data/app/controllers/spree/admin/tax_rates_controller.rb +2 -0
- data/app/controllers/spree/admin/taxonomies_controller.rb +2 -0
- data/app/controllers/spree/admin/taxons_controller.rb +2 -0
- data/app/controllers/spree/admin/users_controller.rb +4 -1
- data/app/controllers/spree/admin/variant_property_rule_values_controller.rb +2 -0
- data/app/controllers/spree/admin/variants_controller.rb +2 -0
- data/app/controllers/spree/admin/variants_including_master_controller.rb +2 -0
- data/app/controllers/spree/admin/zones_controller.rb +2 -0
- data/app/helpers/spree/admin/adjustments_helper.rb +2 -0
- data/app/helpers/spree/admin/base_helper.rb +6 -3
- data/app/helpers/spree/admin/customer_returns_helper.rb +2 -0
- data/app/helpers/spree/admin/navigation_helper.rb +11 -7
- data/app/helpers/spree/admin/orders_helper.rb +5 -3
- data/app/helpers/spree/admin/payments_helper.rb +4 -3
- data/app/helpers/spree/admin/products_helper.rb +2 -0
- data/app/helpers/spree/admin/reimbursement_type_helper.rb +2 -0
- data/app/helpers/spree/admin/stock_locations_helper.rb +2 -0
- data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
- data/app/helpers/spree/admin/store_credit_events_helper.rb +2 -0
- data/app/helpers/spree/promotion_rules_helper.rb +2 -0
- data/app/models/spree/backend_configuration.rb +2 -0
- data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/adjustments/edit.html.erb +1 -1
- data/app/views/spree/admin/adjustments/index.html.erb +2 -2
- data/app/views/spree/admin/adjustments/new.html.erb +2 -2
- data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
- data/app/views/spree/admin/customer_returns/new.html.erb +2 -2
- data/app/views/spree/admin/images/_image_row.html.erb +1 -1
- data/app/views/spree/admin/images/_new.html.erb +1 -1
- data/app/views/spree/admin/images/edit.html.erb +2 -2
- data/app/views/spree/admin/log_entries/index.html.erb +2 -2
- data/app/views/spree/admin/option_types/index.html.erb +1 -1
- data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
- data/app/views/spree/admin/orders/cart.html.erb +2 -2
- data/app/views/spree/admin/orders/confirm/_payments.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/_form.html.erb +1 -1
- data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
- data/app/views/spree/admin/orders/edit.html.erb +1 -1
- data/app/views/spree/admin/orders/index.html.erb +2 -2
- data/app/views/spree/admin/payment_methods/edit.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
- data/app/views/spree/admin/payment_methods/new.html.erb +1 -1
- data/app/views/spree/admin/payments/_list.html.erb +2 -2
- data/app/views/spree/admin/payments/credit.html.erb +1 -1
- data/app/views/spree/admin/payments/index.html.erb +1 -1
- data/app/views/spree/admin/payments/new.html.erb +1 -1
- data/app/views/spree/admin/payments/show.html.erb +2 -2
- data/app/views/spree/admin/prices/_form.html.erb +1 -1
- data/app/views/spree/admin/prices/index.html.erb +2 -2
- data/app/views/spree/admin/product_properties/index.html.erb +1 -1
- data/app/views/spree/admin/products/_form.html.erb +4 -1
- data/app/views/spree/admin/products/edit.html.erb +1 -1
- data/app/views/spree/admin/products/index.html.erb +2 -2
- data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
- data/app/views/spree/admin/promotion_categories/index.html.erb +37 -29
- data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +2 -0
- data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
- data/app/views/spree/admin/promotion_code_batches/new.html.erb +6 -1
- data/app/views/spree/admin/promotion_codes/index.csv.ruby +2 -0
- data/app/views/spree/admin/promotion_codes/index.html.erb +1 -1
- data/app/views/spree/admin/promotions/_actions.html.erb +2 -2
- data/app/views/spree/admin/promotions/_activations_new.html.erb +4 -0
- data/app/views/spree/admin/promotions/_rules.html.erb +2 -2
- data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +5 -2
- data/app/views/spree/admin/promotions/edit.html.erb +2 -2
- data/app/views/spree/admin/promotions/index.html.erb +2 -2
- data/app/views/spree/admin/promotions/rules/_store.html.erb +6 -0
- data/app/views/spree/admin/properties/index.html.erb +2 -2
- data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
- data/app/views/spree/admin/refunds/edit.html.erb +2 -2
- data/app/views/spree/admin/refunds/new.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
- data/app/views/spree/admin/reimbursements/index.html.erb +1 -1
- data/app/views/spree/admin/reimbursements/show.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/edit.html.erb +3 -3
- data/app/views/spree/admin/return_authorizations/index.html.erb +1 -1
- data/app/views/spree/admin/return_authorizations/new.html.erb +2 -2
- data/app/views/spree/admin/search/products.json.jbuilder +2 -0
- data/app/views/spree/admin/search/users.json.jbuilder +2 -0
- data/app/views/spree/admin/shared/_datepicker.html.erb +8 -0
- data/app/views/spree/admin/shared/_edit_resource_links.html.erb +2 -2
- data/app/views/spree/admin/shared/_locale_selection.html.erb +15 -0
- data/app/views/spree/admin/shared/_navigation.html.erb +1 -0
- data/app/views/spree/admin/shared/_new_resource_links.html.erb +1 -1
- data/app/views/spree/admin/shared/_no_objects_found.html.erb +1 -1
- data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
- data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
- data/app/views/spree/admin/shared/_report_order_criteria.html.erb +1 -1
- data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
- data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
- data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
- data/app/views/spree/admin/shipping_methods/_form.html.erb +8 -0
- data/app/views/spree/admin/shipping_methods/index.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
- data/app/views/spree/admin/stock_locations/edit.html.erb +7 -0
- data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
- data/app/views/spree/admin/stock_movements/index.html.erb +15 -15
- data/app/views/spree/admin/store_credits/edit_validity.html.erb +2 -2
- data/app/views/spree/admin/store_credits/show.html.erb +2 -0
- data/app/views/spree/admin/stores/_form.html.erb +77 -60
- data/app/views/spree/admin/stores/edit.html.erb +1 -1
- data/app/views/spree/admin/stores/index.html.erb +3 -3
- data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
- data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/{edit.erb → edit.html.erb} +3 -3
- data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
- data/app/views/spree/admin/taxonomies/new.html.erb +1 -1
- data/app/views/spree/admin/taxons/edit.html.erb +3 -3
- data/app/views/spree/admin/taxons/search.json.jbuilder +2 -0
- data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
- data/app/views/spree/admin/users/edit.html.erb +3 -3
- data/app/views/spree/admin/users/index.html.erb +2 -2
- data/app/views/spree/admin/zones/index.html.erb +1 -1
- data/config/initializers/assets.rb +2 -0
- data/config/initializers/form_builder.rb +2 -0
- data/config/routes.rb +4 -0
- data/lib/solidus_backend.rb +2 -0
- data/lib/spree/backend.rb +2 -0
- data/lib/spree/backend/action_callbacks.rb +2 -0
- data/lib/spree/backend/callbacks.rb +2 -0
- data/lib/spree/backend/engine.rb +2 -0
- data/lib/spree_backend.rb +2 -0
- data/script/rails +4 -2
- data/solidus_backend.gemspec +6 -5
- data/spec/controllers/spree/admin/base_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/cancellations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/customer_returns_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/missing_products_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +2 -1
- data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -9
- data/spec/controllers/spree/admin/payment_methods_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/prices_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/product_properties_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/products_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_actions_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/promotion_rules_controller_spec.rb +27 -12
- data/spec/controllers/spree/admin/promotions_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/refunds_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/reports_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/resource_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/return_authorizations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/return_items_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/root_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/search_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/shipping_methods_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/stock_items_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/store_credits_controller_spec.rb +2 -0
- data/spec/controllers/spree/admin/users_controller_spec.rb +2 -1
- data/spec/controllers/spree/admin/variants_controller_spec.rb +2 -0
- data/spec/features/admin/configuration/payment_methods_spec.rb +2 -0
- data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -0
- data/spec/features/admin/configuration/stock_locations_spec.rb +2 -0
- data/spec/features/admin/configuration/store_spec.rb +2 -0
- data/spec/features/admin/configuration/tax_categories_spec.rb +2 -0
- data/spec/features/admin/configuration/tax_rates_spec.rb +2 -0
- data/spec/features/admin/configuration/taxonomies_spec.rb +2 -0
- data/spec/features/admin/configuration/zones_spec.rb +2 -0
- data/spec/features/admin/homepage_spec.rb +2 -0
- data/spec/features/admin/javascript_format_money_spec.rb +2 -0
- data/spec/features/admin/locale_spec.rb +3 -0
- data/spec/features/admin/orders/adjustments_promotions_spec.rb +2 -0
- data/spec/features/admin/orders/adjustments_spec.rb +2 -0
- data/spec/features/admin/orders/cancelling_and_resuming_spec.rb +2 -0
- data/spec/features/admin/orders/cancelling_inventory_spec.rb +2 -0
- data/spec/features/admin/orders/customer_details_spec.rb +3 -1
- data/spec/features/admin/orders/line_items_spec.rb +2 -0
- data/spec/features/admin/orders/listing_spec.rb +2 -0
- data/spec/features/admin/orders/log_entries_spec.rb +2 -0
- data/spec/features/admin/orders/new_order_spec.rb +3 -1
- data/spec/features/admin/orders/order_details_spec.rb +3 -2
- data/spec/features/admin/orders/payments_spec.rb +5 -6
- data/spec/features/admin/orders/return_authorizations_spec.rb +2 -0
- data/spec/features/admin/orders/return_payment_state_spec.rb +2 -0
- data/spec/features/admin/orders/risk_analysis_spec.rb +2 -0
- data/spec/features/admin/orders/shipments_spec.rb +2 -0
- data/spec/features/admin/payments/store_credits_spec.rb +2 -0
- data/spec/features/admin/products/edit/images_spec.rb +2 -0
- data/spec/features/admin/products/edit/products_spec.rb +2 -1
- data/spec/features/admin/products/edit/taxons_spec.rb +3 -1
- data/spec/features/admin/products/edit/variants_spec.rb +2 -0
- data/spec/features/admin/products/option_types_spec.rb +2 -0
- data/spec/features/admin/products/pricing_spec.rb +2 -0
- data/spec/features/admin/products/products_spec.rb +2 -1
- data/spec/features/admin/products/properties_spec.rb +2 -0
- data/spec/features/admin/products/stock_management_spec.rb +2 -0
- data/spec/features/admin/products/variant_spec.rb +2 -1
- data/spec/features/admin/promotion_adjustments_spec.rb +2 -0
- data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -0
- data/spec/features/admin/promotions/product_rule_spec.rb +2 -0
- data/spec/features/admin/promotions/promotion_categories_spec.rb +83 -0
- data/spec/features/admin/promotions/tiered_calculator_spec.rb +3 -1
- data/spec/features/admin/promotions/user_rule_spec.rb +2 -0
- data/spec/features/admin/reimbursements_spec.rb +2 -0
- data/spec/features/admin/reports_spec.rb +2 -0
- data/spec/features/admin/store_credits_spec.rb +2 -0
- data/spec/features/admin/stores_spec.rb +2 -0
- data/spec/features/admin/style_guide_spec.rb +2 -0
- data/spec/features/admin/taxons_spec.rb +2 -0
- data/spec/features/admin/users_spec.rb +2 -0
- data/spec/helpers/admin/base_helper_spec.rb +2 -0
- data/spec/helpers/admin/navigation_helper_spec.rb +2 -1
- data/spec/helpers/admin/stock_movements_helper_spec.rb +2 -0
- data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -0
- data/spec/helpers/promotion_rules_helper_spec.rb +2 -0
- data/spec/spec_helper.rb +3 -1
- data/spec/support/appear_before_matcher.rb +2 -0
- data/spec/support/feature/base_feature_helper.rb +2 -0
- data/spec/support/feature/order_feature_helper.rb +2 -0
- data/spec/teaspoon_env.rb +3 -1
- data/spec/views/spree/admin/shared/navigation_footer_spec.rb +2 -1
- metadata +43 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f79830d32bfa95c9482aeca3614e8d72742a3e9b565087d09b4bd42e296a2c15
|
4
|
+
data.tar.gz: deb28571eea0833eaef03429c6f1fc508e0f2516ccb7f006cb6a22f8d4788cd4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dfdfd52a7a26db75deeb3180e2d4f70c68e0381fb74200de5ac35e97da95f1d0ef870aa48570e1d4fc2eb0c363e3f7cc1788a20a22b5032a812517e6be9936df
|
7
|
+
data.tar.gz: 2d009959f1e8c74be278aa12f28b0704ab6842a9597b908fe402e710213bf1fc6900e5d3562661653f4356c61ddd85992fdc99d6fadf8485820a30dd2add41f7
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubygems'
|
2
4
|
require 'rake'
|
3
5
|
require 'rake/testtask'
|
@@ -10,7 +12,7 @@ RSpec::Core::RakeTask.new
|
|
10
12
|
task default: [:spec, 'spec:js']
|
11
13
|
|
12
14
|
DummyApp::RakeTasks.new(
|
13
|
-
gem_root: File.expand_path(
|
15
|
+
gem_root: File.expand_path(__dir__),
|
14
16
|
lib_name: 'solidus_backend'
|
15
17
|
)
|
16
18
|
|
@@ -26,7 +28,7 @@ task :teaspoon do
|
|
26
28
|
driver_options: ENV["driver_options"],
|
27
29
|
}
|
28
30
|
|
29
|
-
options.delete_if { |
|
31
|
+
options.delete_if { |_k, v| v.nil? }
|
30
32
|
|
31
33
|
abort("rake teaspoon failed") if Teaspoon::Console.new(options).failures?
|
32
34
|
end
|
@@ -35,7 +37,7 @@ desc "Run javascript specs"
|
|
35
37
|
task 'spec:js' => :teaspoon
|
36
38
|
|
37
39
|
namespace :teaspoon do
|
38
|
-
task :server
|
40
|
+
task :server do
|
39
41
|
require 'teaspoon'
|
40
42
|
Rake::Task['dummy_environment'].invoke
|
41
43
|
require 'teaspoon/server'
|
@@ -37,6 +37,7 @@
|
|
37
37
|
//= require spree/backend/handlebars_extensions
|
38
38
|
//= require spree/backend/images/index
|
39
39
|
//= require spree/backend/images/upload
|
40
|
+
//= require spree/backend/locale_selection
|
40
41
|
//= require spree/backend/navigation
|
41
42
|
//= require spree/backend/option_type_autocomplete
|
42
43
|
//= require spree/backend/option_value_picker
|
@@ -0,0 +1,14 @@
|
|
1
|
+
Spree.ready(function() {
|
2
|
+
// Highlight negative numbers in red.
|
3
|
+
document.querySelector('body').addEventListener('input', function(e){
|
4
|
+
var el = e.target;
|
5
|
+
var isInputNumber = el instanceof HTMLInputElement && el.type == 'number';
|
6
|
+
if (isInputNumber) {
|
7
|
+
if (el.value < 0) {
|
8
|
+
el.classList.add("negative");
|
9
|
+
} else {
|
10
|
+
el.classList.remove("negative");
|
11
|
+
}
|
12
|
+
}
|
13
|
+
});
|
14
|
+
});
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Spree.ready(function() {
|
2
|
+
var localeSelect = document.querySelector('.js-locale-selection');
|
3
|
+
if (!localeSelect) return;
|
4
|
+
|
5
|
+
localeSelect.addEventListener('change', function() {
|
6
|
+
Spree.ajax({
|
7
|
+
type: "PUT",
|
8
|
+
dataType: "json",
|
9
|
+
url: Spree.pathFor("admin/locale/set"),
|
10
|
+
data: {
|
11
|
+
switch_to_locale: localeSelect.value
|
12
|
+
},
|
13
|
+
success: function(data) {
|
14
|
+
document.location.href = data.location;
|
15
|
+
}
|
16
|
+
});
|
17
|
+
});
|
18
|
+
});
|
@@ -1,5 +1,5 @@
|
|
1
1
|
<a href="#" id="product_{{ id }}" data-product-id="{{ id }}" class="sort_item list-group-item">
|
2
2
|
<i class="fa fa-sort"></i>
|
3
3
|
<span class="product_name">{{ name }}</span>
|
4
|
-
<span class="right">{{ display_price }}</span>
|
4
|
+
<span class="float-right">{{ display_price }}</span>
|
5
5
|
</a>
|
data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs
CHANGED
@@ -11,10 +11,19 @@
|
|
11
11
|
<td>
|
12
12
|
{{#if editing}}
|
13
13
|
<form>
|
14
|
-
<input
|
14
|
+
<input
|
15
|
+
{{#if negative}}
|
16
|
+
class="fullwidth negative"
|
17
|
+
{{else}}
|
18
|
+
class="fullwidth"
|
19
|
+
{{/if}}
|
20
|
+
name="count_on_hand"
|
21
|
+
type="number"
|
22
|
+
value="{{count_on_hand}}"
|
23
|
+
>
|
15
24
|
</form>
|
16
25
|
{{else}}
|
17
|
-
<span>{{count_on_hand}}</span>
|
26
|
+
<span {{#if negative}}class="negative"{{/if}}>{{count_on_hand}}</span>
|
18
27
|
{{/if}}
|
19
28
|
</td>
|
20
29
|
<td class="actions">
|
@@ -4,6 +4,7 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
|
|
4
4
|
initialize: function(options) {
|
5
5
|
this.stockLocationName = options.stockLocationName;
|
6
6
|
this.editing = false;
|
7
|
+
this.negative = this.model.attributes.count_on_hand < 0;
|
7
8
|
this.render();
|
8
9
|
},
|
9
10
|
|
@@ -19,7 +20,8 @@ Spree.Views.Stock.EditStockItemRow = Backbone.View.extend({
|
|
19
20
|
render: function() {
|
20
21
|
var renderAttr = {
|
21
22
|
stockLocationName: this.stockLocationName,
|
22
|
-
editing: this.editing
|
23
|
+
editing: this.editing,
|
24
|
+
negative: this.negative
|
23
25
|
};
|
24
26
|
_.extend(renderAttr, this.model.attributes);
|
25
27
|
this.$el.attr("data-variant-id", this.model.get('variant_id'));
|
@@ -160,6 +160,10 @@ nav.menu {
|
|
160
160
|
}
|
161
161
|
}
|
162
162
|
|
163
|
+
.admin-locale-selection {
|
164
|
+
margin: 1em;
|
165
|
+
}
|
166
|
+
|
163
167
|
.admin-nav.fits .admin-nav-footer {
|
164
168
|
position: fixed;
|
165
169
|
bottom: 0;
|
@@ -170,8 +174,8 @@ nav.menu {
|
|
170
174
|
|
171
175
|
.admin-login-nav {
|
172
176
|
list-style: none;
|
173
|
-
|
174
|
-
|
177
|
+
padding: 0;
|
178
|
+
margin: 1rem 0;
|
175
179
|
|
176
180
|
li {
|
177
181
|
padding: 0.3rem 1.2rem;
|
@@ -1,5 +1,5 @@
|
|
1
1
|
// Make color very close to white
|
2
|
-
@function very-light($color, $adjust: 3){
|
2
|
+
@function very-light($color, $adjust: 3){
|
3
3
|
@if type-of($adjust) == 'number' and $adjust > 0 {
|
4
4
|
@for $i from 0 through 100 {
|
5
5
|
@if lighten($color, $i) == white and ($i - $adjust) > $adjust {
|
@@ -10,7 +10,6 @@
|
|
10
10
|
@else {
|
11
11
|
@debug "Please correct $adjust value. It should be number and larger then 0. Currently it is '#{type-of($adjust)}' with value '#{$adjust}'"
|
12
12
|
}
|
13
|
-
@return $color;
|
14
13
|
};
|
15
14
|
|
16
15
|
// Quick fix for dynamic variables missing in SASS
|
@@ -98,6 +98,9 @@ dl {
|
|
98
98
|
.red { color: $color-5 }
|
99
99
|
.yellow { color: $color-6 }
|
100
100
|
|
101
|
+
.negative { color: $red }
|
102
|
+
input[type="number"].negative { color: $red } // needed to override blue style that is more specific than '.negative'
|
103
|
+
|
101
104
|
.no-objects-found {
|
102
105
|
text-align: center;
|
103
106
|
font-size: 120%;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Spree
|
4
|
+
module Admin
|
5
|
+
class LocaleController < Spree::Admin::BaseController
|
6
|
+
def set
|
7
|
+
locale = params[:switch_to_locale].to_s.presence
|
8
|
+
|
9
|
+
if locale && I18n.available_locales.include?(locale.to_sym)
|
10
|
+
I18n.locale = locale
|
11
|
+
session[:locale] = locale
|
12
|
+
|
13
|
+
respond_to do |format|
|
14
|
+
format.json { render json: { locale: locale, location: spree.admin_url } }
|
15
|
+
end
|
16
|
+
else
|
17
|
+
respond_to do |format|
|
18
|
+
format.json { render json: { locale: I18n.locale }, status: 404 }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module Spree
|
2
4
|
module Admin
|
3
5
|
class OrdersController < Spree::Admin::BaseController
|
@@ -30,7 +32,7 @@ module Spree
|
|
30
32
|
if params[:q][:created_at_gt].present?
|
31
33
|
params[:q][:created_at_gt] = begin
|
32
34
|
Time.zone.parse(params[:q][:created_at_gt]).beginning_of_day
|
33
|
-
rescue
|
35
|
+
rescue StandardError
|
34
36
|
""
|
35
37
|
end
|
36
38
|
end
|
@@ -38,7 +40,7 @@ module Spree
|
|
38
40
|
if params[:q][:created_at_lt].present?
|
39
41
|
params[:q][:created_at_lt] = begin
|
40
42
|
Time.zone.parse(params[:q][:created_at_lt]).end_of_day
|
41
|
-
rescue
|
43
|
+
rescue StandardError
|
42
44
|
""
|
43
45
|
end
|
44
46
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class Spree::Admin::PromotionRulesController < Spree::Admin::BaseController
|
2
4
|
helper 'spree/promotion_rules'
|
3
5
|
|
@@ -33,6 +35,10 @@ class Spree::Admin::PromotionRulesController < Spree::Admin::BaseController
|
|
33
35
|
@promotion = Spree::Promotion.find(params[:promotion_id])
|
34
36
|
end
|
35
37
|
|
38
|
+
def model_class
|
39
|
+
Spree::PromotionRule
|
40
|
+
end
|
41
|
+
|
36
42
|
def validate_promotion_rule_type
|
37
43
|
requested_type = params[:promotion_rule].delete(:type)
|
38
44
|
promotion_rule_types = Rails.application.config.spree.promotions.rules
|