solidus_backend 4.3.4 → 4.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (104) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/namespaces.js +0 -1
  3. data/app/assets/javascripts/spree/backend/templates/index.js +0 -3
  4. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +11 -8
  5. data/app/assets/javascripts/spree/backend/views/cart/empty_cart_button.js +1 -1
  6. data/app/assets/javascripts/spree/backend/views/index.js +0 -2
  7. data/app/assets/javascripts/spree/backend/views/order/details_adjustments.js +1 -2
  8. data/app/assets/javascripts/spree/backend.js +0 -2
  9. data/app/assets/stylesheets/spree/backend/sections/_adjustments.scss +0 -3
  10. data/app/assets/stylesheets/spree/backend/sections/index.scss +0 -1
  11. data/app/controllers/spree/admin/cancellations_controller.rb +1 -1
  12. data/app/controllers/spree/admin/dashboards_controller.rb +4 -0
  13. data/app/controllers/spree/admin/option_types_controller.rb +1 -1
  14. data/app/controllers/spree/admin/orders/customer_details_controller.rb +2 -2
  15. data/app/controllers/spree/admin/resource_controller.rb +1 -1
  16. data/app/helpers/spree/admin/base_helper.rb +2 -2
  17. data/app/helpers/spree/admin/navigation_helper.rb +1 -1
  18. data/app/views/spree/admin/adjustments/_adjustment.html.erb +0 -1
  19. data/app/views/spree/admin/dashboards/home.html.erb +1 -0
  20. data/app/views/spree/admin/orders/_adjustments.html.erb +1 -1
  21. data/app/views/spree/admin/orders/_order_details.html.erb +3 -3
  22. data/app/views/spree/admin/orders/confirm.html.erb +3 -3
  23. data/app/views/spree/admin/orders/index.html.erb +4 -82
  24. data/app/views/spree/admin/products/index.html.erb +2 -2
  25. data/app/views/spree/admin/shared/_locale_selection_solidus_admin.html.erb +1 -1
  26. data/app/views/spree/admin/shared/search_fields/_checkbox.html.erb +8 -0
  27. data/app/views/spree/admin/shared/search_fields/_date_range_picker.html.erb +16 -0
  28. data/app/views/spree/admin/shared/search_fields/_select.html.erb +6 -0
  29. data/app/views/spree/admin/shared/search_fields/_text_field.html.erb +6 -0
  30. data/app/views/spree/admin/shared/search_fields/_variant_autocomplete.html.erb +6 -0
  31. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  32. data/app/views/spree/admin/users/index.html.erb +1 -1
  33. data/app/views/spree/admin/users/items.html.erb +3 -3
  34. data/app/views/spree/admin/users/orders.html.erb +3 -3
  35. data/app/views/spree/admin/variants/_form.html.erb +1 -1
  36. data/app/views/spree/admin/zones/index.html.erb +1 -1
  37. data/config/routes.rb +0 -11
  38. data/lib/spree/backend_configuration.rb +83 -18
  39. data/solidus_backend.gemspec +1 -1
  40. metadata +13 -72
  41. data/app/assets/javascripts/spree/backend/promotions/activation.js +0 -26
  42. data/app/assets/javascripts/spree/backend/promotions.js +0 -35
  43. data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +0 -23
  44. data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +0 -23
  45. data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +0 -12
  46. data/app/assets/javascripts/spree/backend/views/calculators/tiered.js +0 -54
  47. data/app/assets/javascripts/spree/backend/views/promotions/option_values_rule.js +0 -79
  48. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +0 -138
  49. data/app/controllers/spree/admin/promotion_actions_controller.rb +0 -51
  50. data/app/controllers/spree/admin/promotion_categories_controller.rb +0 -8
  51. data/app/controllers/spree/admin/promotion_code_batches_controller.rb +0 -30
  52. data/app/controllers/spree/admin/promotion_codes_controller.rb +0 -48
  53. data/app/controllers/spree/admin/promotion_rules_controller.rb +0 -60
  54. data/app/controllers/spree/admin/promotions_controller.rb +0 -67
  55. data/app/helpers/spree/admin/promotions_helper.rb +0 -15
  56. data/app/helpers/spree/promotion_rules_helper.rb +0 -12
  57. data/app/views/spree/admin/promotion_actions/create.js.erb +0 -10
  58. data/app/views/spree/admin/promotion_actions/destroy.js.erb +0 -1
  59. data/app/views/spree/admin/promotion_categories/_form.html.erb +0 -14
  60. data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -10
  61. data/app/views/spree/admin/promotion_categories/index.html.erb +0 -47
  62. data/app/views/spree/admin/promotion_categories/new.html.erb +0 -10
  63. data/app/views/spree/admin/promotion_code_batches/_form_fields.html.erb +0 -22
  64. data/app/views/spree/admin/promotion_code_batches/download.csv.ruby +0 -8
  65. data/app/views/spree/admin/promotion_code_batches/index.html.erb +0 -65
  66. data/app/views/spree/admin/promotion_code_batches/new.html.erb +0 -8
  67. data/app/views/spree/admin/promotion_codes/index.csv.ruby +0 -8
  68. data/app/views/spree/admin/promotion_codes/index.html.erb +0 -32
  69. data/app/views/spree/admin/promotion_codes/new.html.erb +0 -31
  70. data/app/views/spree/admin/promotion_rules/create.js.erb +0 -8
  71. data/app/views/spree/admin/promotion_rules/destroy.js.erb +0 -3
  72. data/app/views/spree/admin/promotions/_actions.html.erb +0 -37
  73. data/app/views/spree/admin/promotions/_activations_edit.html.erb +0 -22
  74. data/app/views/spree/admin/promotions/_activations_new.html.erb +0 -43
  75. data/app/views/spree/admin/promotions/_form.html.erb +0 -67
  76. data/app/views/spree/admin/promotions/_promotion_action.html.erb +0 -13
  77. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +0 -12
  78. data/app/views/spree/admin/promotions/_rules.html.erb +0 -42
  79. data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +0 -2
  80. data/app/views/spree/admin/promotions/actions/_create_item_adjustments.html.erb +0 -6
  81. data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +0 -10
  82. data/app/views/spree/admin/promotions/actions/_free_shipping.html.erb +0 -0
  83. data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +0 -29
  84. data/app/views/spree/admin/promotions/calculators/_default_fields.html.erb +0 -6
  85. data/app/views/spree/admin/promotions/calculators/distributed_amount/_fields.html.erb +0 -56
  86. data/app/views/spree/admin/promotions/calculators/flat_rate/_fields.html.erb +0 -6
  87. data/app/views/spree/admin/promotions/calculators/tiered_flat_rate/_fields.html.erb +0 -30
  88. data/app/views/spree/admin/promotions/calculators/tiered_percent/_fields.html.erb +0 -30
  89. data/app/views/spree/admin/promotions/edit.html.erb +0 -35
  90. data/app/views/spree/admin/promotions/index.html.erb +0 -124
  91. data/app/views/spree/admin/promotions/new.html.erb +0 -9
  92. data/app/views/spree/admin/promotions/rules/_first_order.html.erb +0 -0
  93. data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +0 -13
  94. data/app/views/spree/admin/promotions/rules/_item_total.html.erb +0 -14
  95. data/app/views/spree/admin/promotions/rules/_minimum_quantity.html.erb +0 -5
  96. data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +0 -12
  97. data/app/views/spree/admin/promotions/rules/_one_use_per_user.html.erb +0 -0
  98. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +0 -13
  99. data/app/views/spree/admin/promotions/rules/_product.html.erb +0 -15
  100. data/app/views/spree/admin/promotions/rules/_store.html.erb +0 -6
  101. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +0 -9
  102. data/app/views/spree/admin/promotions/rules/_user.html.erb +0 -4
  103. data/app/views/spree/admin/promotions/rules/_user_logged_in.html.erb +0 -0
  104. data/app/views/spree/admin/promotions/rules/_user_role.html.erb +0 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a28e10929444f614078beef56951eeb1400caee5af900a0d1c74cc745e69376
4
- data.tar.gz: 7e090b803b158eea69a0bebf9ec68c4f68bb194c30d5e49b942b08a8bd34007f
3
+ metadata.gz: 80a90789fe2e7df10cab902ad495b6d25980448801fa8cc03a593069babb157c
4
+ data.tar.gz: cfaa6f5111283f821071b3c333ca41804567f44bbbc9476a4dd7419c99785104
5
5
  SHA512:
6
- metadata.gz: 9b06ede62b152b63928c67d7acc2d4007e14e3e887874358d0f2af792e8e60aea53e554033e6e67eab8df77f9703f369cf9b1654d2ae6441e9e7dc9f28ea4d54
7
- data.tar.gz: 0a172fbf3ffdad8495a41a3b22ee13a2cd5fece342d22ad6ec2c41a4cec08fbd69e2d338cbff62b4ca8a5f038861f7db82093a3057750e4cc944a8050eba4c3e
6
+ metadata.gz: d4caa30a62fc16223f5aa9bfcf41c3fd2f8ed091a15d4a082f9a65e621a5823966fcce5ec4cf291af7d88518210d748a6ad3562bda5373e82589a063029404ed
7
+ data.tar.gz: c1782137a614b7f6e8713e100f0cea0c49173ad8946ce9e0605573cfaed6444ce7a7a13587e24f975065b0ccde4d89314aa8870b34b4f4196ca4fc40acea6cc3
@@ -9,7 +9,6 @@ _.extend(window.Spree, {
9
9
  Zones: {},
10
10
  Payment: {},
11
11
  Product: {},
12
- Promotions: {},
13
12
  Stock: {},
14
13
  Tables: {}
15
14
  }
@@ -8,9 +8,6 @@
8
8
  //= require spree/backend/templates/orders/shipping_method
9
9
  //= require spree/backend/templates/products/sortable
10
10
  //= require spree/backend/templates/products/upload_progress
11
- //= require spree/backend/templates/promotions/calculators/fields/tiered_flat_rate
12
- //= require spree/backend/templates/promotions/calculators/fields/tiered_percent
13
- //= require spree/backend/templates/promotions/rules/option_values
14
11
  //= require spree/backend/templates/stock_items/stock_location_stock_item
15
12
  //= require spree/backend/templates/taxons/_tree
16
13
  //= require spree/backend/templates/taxons/tree
@@ -10,17 +10,18 @@
10
10
  /**
11
11
  * Make the element a select2 dropdown used for finding Variants. By default, the search term will be
12
12
  * passed to the defined Spree::Config.variant_search_class by the controller with its defined scope.
13
- * @param {Object|undefined|null} options Options
13
+ * @param {Object|undefined|null} options Options to be passed to select2. If null, the default options will be used.
14
14
  * @param {Function|undefined} options.searchParameters Returns a hash object for params to merge on the select2 ajax request
15
15
  * Accepts an argument of the select2 search term. To use Ransack, define
16
16
  * variant_search_term as a falsy value, and q as the Ransack query. Note,
17
17
  * you need to ensure that the attributes are allowed to be Ransacked.
18
18
  */
19
- $.fn.variantAutocomplete = function(options) {
19
+ $.fn.variantAutocomplete = function(options = {}) {
20
20
  // Default options
21
- options = options || {}
22
-
23
- this.select2({
21
+ const searchParameters = options.searchParameters || null
22
+ delete options.searchParameters
23
+ const select2options = options
24
+ const defaultOptions = {
24
25
  placeholder: Spree.translations.variant_placeholder,
25
26
  minimumInputLength: 3,
26
27
  initSelection: function(element, callback) {
@@ -39,7 +40,7 @@
39
40
  }
40
41
  },
41
42
  data: function(term, page) {
42
- const extraParameters = options["searchParameters"] ? options["searchParameters"](term) : {}
43
+ const extraParameters = searchParameters ? searchParameters(term) : {}
43
44
 
44
45
  return {
45
46
  variant_search_term: term,
@@ -64,7 +65,9 @@
64
65
  } else {
65
66
  return Select2.util.escapeMarkup(variant.name);
66
67
  }
67
- }
68
- });
68
+ },
69
+ }
70
+
71
+ this.select2(Object.assign({}, defaultOptions, select2options));
69
72
  };
70
73
  })();
@@ -24,6 +24,6 @@ Spree.Views.Cart.EmptyCartButton = Backbone.View.extend({
24
24
 
25
25
  render: function() {
26
26
  var isNew = function (item) { return item.isNew() };
27
- this.$el.prop("disabled", !this.collection.length || this.collection.some(isNew));
27
+ this.$el.prop("disabled", !this.collection.length || this.collection.some(isNew) || this.model.get("completed_at"));
28
28
  }
29
29
  });
@@ -1,4 +1,3 @@
1
- //= require 'spree/backend/views/calculators/tiered'
2
1
  //= require 'spree/backend/views/cart/add_line_item_button'
3
2
  //= require 'spree/backend/views/cart/empty_cart_button'
4
3
  //= require 'spree/backend/views/cart/line_item_row'
@@ -22,7 +21,6 @@
22
21
  //= require 'spree/backend/views/payment/payment_row'
23
22
  //= require 'spree/backend/views/payment/edit_credit_card'
24
23
  //= require 'spree/backend/views/product/search'
25
- //= require 'spree/backend/views/promotions/option_values_rule'
26
24
  //= require 'spree/backend/views/tables/editable_table'
27
25
  //= require 'spree/backend/views/tables/editable_table_row'
28
26
  //= require 'spree/backend/views/tables/return_items'
@@ -9,8 +9,7 @@ Spree.Views.Order.DetailsAdjustments = Backbone.View.extend({
9
9
  var collection = this.collection ? this.collection.chain() : _.chain([this.model]);
10
10
  collection
11
11
  .map(function(item) {
12
- return (item.get("adjustments") || [])
13
- .filter(function(adjustment) { return (adjustment.eligible === true); });
12
+ return (item.get("adjustments") || []);
14
13
  })
15
14
  .flatten(true)
16
15
  .each(function(adjustment){
@@ -50,8 +50,6 @@
50
50
  //= require spree/backend/products/index
51
51
  //= require spree/backend/product_picker
52
52
  //= require spree/backend/progress
53
- //= require spree/backend/promotions
54
- //= require spree/backend/promotions/activation
55
53
  //= require spree/backend/shipments
56
54
  //= require spree/backend/spree-select2
57
55
  //= require spree/backend/stock_management
@@ -1,3 +0,0 @@
1
- .adjustment-ineligible {
2
- text-decoration: line-through;
3
- }
@@ -2,7 +2,6 @@
2
2
  @import 'spree/backend/sections/orders';
3
3
  @import 'spree/backend/sections/products';
4
4
  @import 'spree/backend/sections/variants';
5
- @import 'spree/backend/sections/promotions';
6
5
  @import 'spree/backend/sections/bulk_transfer';
7
6
  @import 'spree/backend/sections/return_authorizations';
8
7
  @import 'spree/backend/sections/log_entries';
@@ -20,7 +20,7 @@ module Spree
20
20
  flash[:error] = t('spree.no_inventory_selected')
21
21
  redirect_to admin_order_cancellations_path(@order)
22
22
  else
23
- @order.cancellations.short_ship(inventory_units, created_by: created_by)
23
+ @order.cancellations.short_ship(inventory_units, created_by:)
24
24
 
25
25
  flash[:success] = t('spree.inventory_canceled')
26
26
  redirect_to edit_admin_order_url(@order)
@@ -3,6 +3,10 @@
3
3
  module Spree
4
4
  module Admin
5
5
  class DashboardsController < BaseController
6
+ before_action :deprecate
7
+ def deprecate
8
+ Spree.deprecator.warn "The #{self.class.name} is deprecated. If you still use dashboards, please copy all controllers and views from solidus_backend to your application."
9
+ end
6
10
  end
7
11
  end
8
12
  end
@@ -7,7 +7,7 @@ module Spree
7
7
 
8
8
  def update_values_positions
9
9
  params[:positions].each do |id, index|
10
- Spree::OptionValue.where(id: id).update_all(position: index)
10
+ Spree::OptionValue.where(id:).update_all(position: index)
11
11
  end
12
12
 
13
13
  respond_to do |format|
@@ -15,8 +15,8 @@ module Spree
15
15
  def edit
16
16
  country_id = default_country_id
17
17
 
18
- @order.build_bill_address(country_id: country_id) if @order.bill_address.nil?
19
- @order.build_ship_address(country_id: country_id) if @order.ship_address.nil?
18
+ @order.build_bill_address(country_id:) if @order.bill_address.nil?
19
+ @order.build_ship_address(country_id:) if @order.ship_address.nil?
20
20
 
21
21
  @order.bill_address.country_id = country_id if @order.bill_address.country.nil?
22
22
  @order.ship_address.country_id = country_id if @order.ship_address.country.nil?
@@ -88,7 +88,7 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
88
88
  #
89
89
  # TODO : create a global set_list_position on all concerned objects
90
90
  # maybe in the acts_as_list gem
91
- model_class.where(id: id).first&.set_list_position(index)
91
+ model_class.where(id:).first&.set_list_position(index)
92
92
  end
93
93
  end
94
94
 
@@ -25,7 +25,7 @@ module Spree
25
25
  end
26
26
 
27
27
  def admin_hint(title, text)
28
- content_tag(:span, class: 'hint-tooltip', title: title, data: { content: text }) do
28
+ content_tag(:span, class: 'hint-tooltip', title:, data: { content: text }) do
29
29
  content_tag(:i, '', class: 'fa fa-info-circle')
30
30
  end
31
31
  end
@@ -39,7 +39,7 @@ module Spree
39
39
  t('spree.date_picker.format', default: '%Y/%m/%d')
40
40
  end
41
41
 
42
- l(date, format: format)
42
+ l(date, format:)
43
43
  end
44
44
 
45
45
  def spree_dom_id(record)
@@ -114,7 +114,7 @@ module Spree
114
114
  name = options[:name] || t('spree.actions.delete')
115
115
  confirm = options[:confirm] || t('spree.are_you_sure')
116
116
  options[:class] = "#{options[:class]} delete-resource".strip
117
- options[:data] = { confirm: confirm, action: 'remove' }
117
+ options[:data] = { confirm:, action: 'remove' }
118
118
  link_to_with_icon 'trash', name, url, options
119
119
  end
120
120
 
@@ -4,7 +4,6 @@
4
4
  %>
5
5
  <tr id="<%= spree_dom_id(adjustment) %>"
6
6
  data-hook="adjustment_row"
7
- class="<%= "adjustment-ineligible" if !adjustment.eligible? %>"
8
7
  >
9
8
  <td><%= display_adjustable(adjustment.adjustable) %></td>
10
9
  <td><%= adjustment.label %></td>
@@ -1 +1,2 @@
1
1
  <%# Placeholder view for a home dashboard %>
2
+ <p><%= Spree.deprecator.warn "The Home view is deprecated, If you still use dashboards, please copy all controllers and views from solidus_backend to your application." %></p>
@@ -8,7 +8,7 @@
8
8
  </tr>
9
9
  </thead>
10
10
  <tbody data-hook="order_details_adjustments">
11
- <% adjustments.eligible.group_by(&:label).each do |label, adjustments| %>
11
+ <% adjustments.group_by(&:label).each do |label, adjustments| %>
12
12
  <tr class="total">
13
13
  <td><%= label %>:</td>
14
14
  <td class="total"><span><%= Spree::Money.new(adjustments.sum(&:amount), currency: adjustments.first.order.try(:currency)) %></span></td>
@@ -1,4 +1,4 @@
1
- <div class="js-order-line-item-adjustments <%= "hidden" if order.line_item_adjustments.eligible.none? %>">
1
+ <div class="js-order-line-item-adjustments <%= "hidden" if order.line_item_adjustments.none? %>">
2
2
  <%=
3
3
  render "spree/admin/orders/adjustments", {
4
4
  adjustments: order.line_item_adjustments,
@@ -7,7 +7,7 @@
7
7
  }
8
8
  %>
9
9
  </div>
10
- <div class="js-order-shipment-adjustments <%= "hidden" if order.shipment_adjustments.eligible.none? %>">
10
+ <div class="js-order-shipment-adjustments <%= "hidden" if order.shipment_adjustments.none? %>">
11
11
  <%=
12
12
  render "spree/admin/orders/adjustments", {
13
13
  adjustments: order.shipment_adjustments,
@@ -16,7 +16,7 @@
16
16
  }
17
17
  %>
18
18
  </div>
19
- <div class="js-order-adjustments <%= "hidden" if order.adjustments.eligible.none? %>">
19
+ <div class="js-order-adjustments <%= "hidden" if order.adjustments.none? %>">
20
20
  <%=
21
21
  render "spree/admin/orders/adjustments", {
22
22
  adjustments: order.adjustments,
@@ -18,7 +18,7 @@
18
18
  order: @order,
19
19
  title: t('spree.line_item_adjustments'),
20
20
  }
21
- ) if @order.line_item_adjustments.eligible.any?
21
+ ) if @order.line_item_adjustments.any?
22
22
  %>
23
23
 
24
24
  <%=
@@ -29,7 +29,7 @@
29
29
  order: @order,
30
30
  title: t('spree.shipment_adjustments'),
31
31
  }
32
- ) if @order.shipment_adjustments.eligible.any?
32
+ ) if @order.shipment_adjustments.any?
33
33
  %>
34
34
 
35
35
  <%=
@@ -40,7 +40,7 @@
40
40
  order: @order,
41
41
  title: t('spree.order_adjustments'),
42
42
  }
43
- ) if @order.adjustments.eligible.any?
43
+ ) if @order.adjustments.any?
44
44
  %>
45
45
 
46
46
  <% if @order.line_items.exists? %>
@@ -16,89 +16,11 @@
16
16
  <div data-hook="admin_orders_index_search">
17
17
  <%= search_form_for [:admin, @search] do |f| %>
18
18
  <div class="row">
19
- <div class="field-block col-12 col-md-6 col-lg-4 col-xl-3">
20
- <div class="date-range-filter field">
21
- <%= label_tag :q_created_at_gt, t('spree.date_range') %>
22
- <div class="date-range-fields input-group">
23
- <%= f.text_field :created_at_gt, class: 'datepicker form-control datepicker-from', value: params[:q][:created_at_gt], placeholder: t('spree.start') %>
24
-
25
- <div class="input-group-prepend input-group-append">
26
- <span class="input-group-text range-divider">
27
- <i class="fa fa-arrow-right"></i>
28
- </span>
29
- </div>
30
-
31
- <%= f.text_field :created_at_lt, class: 'datepicker form-control datepicker-to', value: params[:q][:created_at_lt], placeholder: t('spree.stop') %>
32
- </div>
33
- </div>
34
-
35
- <div class="field">
36
- <%= label_tag :q_state_eq, t('spree.status') %>
37
- <%= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [t(s.name, scope: 'spree.order_state'), s.value]}, {include_blank: true}, class: 'custom-select fullwidth' %>
38
- </div>
39
-
40
- <div class="field">
41
- <%= label_tag nil, t('spree.promotion') %>
42
- <%= f.text_field :order_promotions_promotion_code_value_start, size: 25 %>
43
- </div>
44
-
45
- <div class="field">
46
- <%= label_tag nil, t('spree.shipment_number') %>
47
- <%= f.text_field :shipments_number_start %>
48
- </div>
49
-
50
- <div class="field">
51
- <%= label_tag :q_shipment_state, t('spree.shipment_state') %>
52
- <%= f.select :shipment_state_eq, %i[backorder canceled partial pending ready shipped].map { |state| [t("spree.shipment_states.#{state}"), state] }, { include_blank: true }, { class: "custom-select fullwidth" } %>
53
- </div>
54
- </div>
55
-
56
- <div class="col-12 col-md-6 col-lg-4 col-xl-6">
57
- <div class="row">
58
- <div class="col-12 col-xl-6">
59
- <div class="field">
60
- <%= label_tag :q_number_start, t('spree.order_number', number: '') %>
61
- <%= f.text_field :number_start %>
62
- </div>
63
-
64
- <div class="field">
65
- <%= label_tag :q_email_start, t('spree.email') %>
66
- <%= f.text_field :email_start %>
67
- </div>
68
- </div>
69
-
70
- <div class="col-12 col-xl-6">
71
- <div class="field">
72
- <%= label_tag :q_bill_address_name_cont, t('spree.name_contains') %>
73
- <%= f.text_field :bill_address_name_cont, size: 25 %>
74
- </div>
75
- </div>
76
-
77
- <div class="col-12 col-xl-6">
78
- <div class="field" data-hook="sku-select">
79
- <%= label_tag :q_line_items_variant_id_in, t('spree.variant') %>
80
- <%= f.text_field :line_items_variant_id_in, class: "variant_autocomplete fullwidth" %>
81
- </div>
82
- </div>
83
- </div>
84
- </div>
85
-
86
- <div class="col-12 col-md-6 col-lg-4 col-xl-3">
87
- <% if Spree::Store.count > 1 %>
88
- <div class="field">
89
- <%= label_tag :q_store_id_eq, t('spree.store') %>
90
- <%= f.select :store_id_eq, Spree::Store.all.map { |s| [s.name, s.id] }, { include_blank: true }, { class: "custom-select fullwidth" } %>
91
- </div>
19
+ <% Spree::Backend::Config.search_fields[controller_path].each do |field_config| %>
20
+ <% if !field_config.has_key?(:if) || field_config[:if].call %>
21
+ <%= render field_config.except(:if).deep_merge(locals: { f: f }) %>
92
22
  <% end %>
93
-
94
- <div class="field checkbox">
95
- <label>
96
- <%= f.check_box :completed_at_not_null, {checked: @show_only_completed}, '1', '0' %>
97
- <%= t('spree.show_only_complete_orders') %>
98
- </label>
99
- </div>
100
- </div>
101
-
23
+ <% end %>
102
24
  </div>
103
25
 
104
26
  <div class="clearfix"></div>
@@ -71,8 +71,8 @@
71
71
  <tr data-hook="admin_products_index_headers">
72
72
  <th><%= Spree::Variant.human_attribute_name(:sku) %></th>
73
73
  <th></th>
74
- <th><%= sort_link @search,:name, Spree::Product.human_attribute_name(:name), { default_order: "desc" }, {title: 'admin_products_listing_name_title'} %></th>
75
- <th class="align-right"><%= sort_link @search,:master_default_price_amount, Spree::Product.human_attribute_name(:price), {}, {title: 'admin_products_listing_price_title'} %></th>
74
+ <th><%= sort_link @search,:name, Spree::Product.human_attribute_name(:name), { default_order: "desc", title: 'admin_products_listing_name_title'} %></th>
75
+ <th class="align-right"><%= sort_link @search,:master_default_price_amount, Spree::Product.human_attribute_name(:price), {title: 'admin_products_listing_price_title'} %></th>
76
76
  <th data-hook="admin_products_index_header_actions" class="actions"></th>
77
77
  </tr>
78
78
  </thead>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <% if available_locale_options_for_select.size > 1 %>
6
6
  <li>
7
- <%= form_tag(admin_set_locale_path(format: :html), method: :put, style: "width: 100%;") do %>
7
+ <%= form_tag(spree.admin_set_locale_path(format: :html), method: :put, style: "width: 100%;") do %>
8
8
  <label>
9
9
  <svg aria-hidden="true"><use xlink:href="<%= image_path('spree/backend/themes/solidus_admin/remixicon.symbol.svg') %>#ri-global-line"></use></svg>
10
10
  <select name="switch_to_locale" onchange="this.form.requestSubmit()">
@@ -0,0 +1,8 @@
1
+ <div class="col-12 col-md-6 col-lg-4 col-xl-3">
2
+ <div class="field checkbox">
3
+ <label>
4
+ <%= f.check_box ransack, {checked: params[:q][ransack] == '1' }, '1', '0' %>
5
+ <%= label.respond_to?(:call) ? label.call : label %>
6
+ </label>
7
+ </div>
8
+ </div>
@@ -0,0 +1,16 @@
1
+ <div class="col-12 col-md-6 col-lg-4 col-xl-3">
2
+ <div class="date-range-filter field">
3
+ <%= label_tag "q_#{attribute}", label.respond_to?(:call) ? label.call : label %>
4
+ <div class="date-range-fields input-group">
5
+ <%= f.text_field "#{attribute}_gt", class: 'datepicker form-control datepicker-from', value: params[:q][:created_at_gt], placeholder: t('spree.start') %>
6
+
7
+ <div class="input-group-prepend input-group-append">
8
+ <span class="input-group-text range-divider">
9
+ <i class="fa fa-arrow-right"></i>
10
+ </span>
11
+ </div>
12
+
13
+ <%= f.text_field "#{attribute}_lt", class: 'datepicker form-control datepicker-to', value: params[:q][:created_at_lt], placeholder: t('spree.stop') %>
14
+ </div>
15
+ </div>
16
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="col-12 col-md-6 col-lg-4 col-xl-3">
2
+ <div class="field">
3
+ <%= label_tag "q_#{ransack}", label.respond_to?(:call) ? label.call : label %>
4
+ <%= f.select ransack, options_for_select(options.call, params[:q][ransack]), {include_blank: true}, class: 'custom-select fullwidth' %>
5
+ </div>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="col-12 col-md-6 col-lg-4 col-xl-3">
2
+ <div class="field">
3
+ <%= label_tag "q_#{ransack}", label.respond_to?(:call) ? label.call : label %>
4
+ <%= f.text_field ransack, class: 'form-control', value: params[:q][ransack] %>
5
+ </div>
6
+ </div>
@@ -0,0 +1,6 @@
1
+ <div class="col-12 col-md-6 col-lg-4 col-xl-3">
2
+ <div class="field">
3
+ <%= label_tag "q_#{ransack}", label.respond_to?(:call) ? label.call : label %>
4
+ <%= f.text_field ransack, class: 'variant_autocomplete fullwidth', value: params[:q][ransack] %>
5
+ </div>
6
+ </div>
@@ -81,7 +81,7 @@
81
81
  <td><%= tax_rate.amount %></td>
82
82
  <td><%= tax_rate.included_in_price? ? t('spree.say_yes') : t('spree.say_no') %></td>
83
83
  <td><%= tax_rate.show_rate_in_label? ? t('spree.say_yes') : t('spree.say_no') %></td>
84
- <td><%= tax_rate.expires_at.to_date.to_s(:short_date) if tax_rate.expires_at %></td>
84
+ <td><%= tax_rate.expires_at.to_date.to_fs(:short_date) if tax_rate.expires_at %></td>
85
85
  <td><%= tax_rate.calculator && tax_rate.calculator.class.model_name.human %></td>
86
86
  <td class="actions">
87
87
  <% if can?(:update, tax_rate) %>
@@ -69,7 +69,7 @@
69
69
  </colgroup>
70
70
  <thead>
71
71
  <tr data-hook="admin_users_index_headers">
72
- <th><%= sort_link @search, :email, Spree.user_class.human_attribute_name(:email), {}, {title: 'users_email_title'} %></th>
72
+ <th><%= sort_link @search, :email, Spree.user_class.human_attribute_name(:email), {title: 'users_email_title'} %></th>
73
73
  <th><%= Spree.user_class.human_attribute_name(:spree_roles) %></th>
74
74
  <th class="align-center"><%= t('spree.num_orders') %></th>
75
75
  <th class="align-center"><%= Spree.user_class.human_attribute_name(:lifetime_value) %></th>
@@ -25,13 +25,13 @@
25
25
  </colgroup>
26
26
 
27
27
  <thead>
28
- <th><%= sort_link @search, :completed_at, Spree::Order.human_attribute_name(:completed_at), {}, {title: 'orders_completed_at_title'} %></th>
28
+ <th><%= sort_link @search, :completed_at, Spree::Order.human_attribute_name(:completed_at), {title: 'orders_completed_at_title'} %></th>
29
29
  <th colspan=2><%= Spree::LineItem.human_attribute_name(:description) %></th>
30
30
  <th><%= Spree::LineItem.human_attribute_name(:price) %></th>
31
31
  <th><%= Spree::LineItem.human_attribute_name(:quantity) %></th>
32
32
  <th><%= Spree::Order.human_attribute_name(:total) %></th>
33
- <th><%= sort_link @search, :state, Spree::Order.human_attribute_name(:state), {}, {title: 'orders_state_title'} %></th>
34
- <th><%= sort_link @search, :number, t('spree.admin.user.order_num'), {}, {title: 'orders_number_title'} %></th>
33
+ <th><%= sort_link @search, :state, Spree::Order.human_attribute_name(:state), {title: 'orders_state_title'} %></th>
34
+ <th><%= sort_link @search, :number, t('spree.admin.user.order_num'), {title: 'orders_number_title'} %></th>
35
35
  </thead>
36
36
 
37
37
  <tbody>
@@ -22,14 +22,14 @@
22
22
  </colgroup>
23
23
  <thead>
24
24
  <tr data-hook="admin_orders_index_headers">
25
- <th><%= sort_link @search, :completed_at, Spree::Order.human_attribute_name(:completed_at), {}, {title: 'orders_completed_at_title'} %></th>
26
- <th><%= sort_link @search, :number, Spree::Order.human_attribute_name(:number), {}, {title: 'orders_number_title'} %></th>
25
+ <th><%= sort_link @search, :completed_at, Spree::Order.human_attribute_name(:completed_at), {title: 'orders_completed_at_title'} %></th>
26
+ <th><%= sort_link @search, :number, Spree::Order.human_attribute_name(:number), {title: 'orders_number_title'} %></th>
27
27
  <th><%= sort_link @search, :state %></th>
28
28
  <th><%= sort_link @search, :payment_state %></th>
29
29
  <% if Spree::Order.checkout_step_names.include?(:delivery) %>
30
30
  <th><%= sort_link @search, :shipment_state %></th>
31
31
  <% end %>
32
- <th><%= sort_link @search, :total, Spree::Order.human_attribute_name(:total), {}, {title: 'orders_total_title'} %></th>
32
+ <th><%= sort_link @search, :total, Spree::Order.human_attribute_name(:total), {title: 'orders_total_title'} %></th>
33
33
  </tr>
34
34
  </thead>
35
35
  <tbody>
@@ -103,7 +103,7 @@
103
103
  @shipping_categories,
104
104
  :id,
105
105
  :name,
106
- { include_blank: t('.use_product_shipping_category') },
106
+ { include_blank: t('.use_product_shipping_category'), selected: @variant[:shipping_category_id] },
107
107
  { class: 'custom-select fullwidth' } %>
108
108
  </div>
109
109
  </div>
@@ -23,7 +23,7 @@
23
23
  <tr data-hook="zones_header">
24
24
  <th><%= sort_link @search,:name, Spree::Zone.human_attribute_name(:name), title: 'zones_order_by_name_title' %></th>
25
25
  <th>
26
- <%= sort_link @search,:description, Spree::Zone.human_attribute_name(:description), {}, {title: 'zones_order_by_description_title'} %>
26
+ <%= sort_link @search,:description, Spree::Zone.human_attribute_name(:description), {title: 'zones_order_by_description_title'} %>
27
27
  </th>
28
28
  <th class="actions"></th>
29
29
  </tr>
data/config/routes.rb CHANGED
@@ -14,17 +14,6 @@ Spree::Core::Engine.routes.draw do
14
14
  end
15
15
  end
16
16
 
17
- resources :promotions do
18
- resources :promotion_rules
19
- resources :promotion_actions
20
- resources :promotion_codes, only: [:index, :new, :create]
21
- resources :promotion_code_batches, only: [:index, :new, :create] do
22
- get '/download', to: "promotion_code_batches#download", defaults: { format: "csv" }
23
- end
24
- end
25
-
26
- resources :promotion_categories, except: [:show]
27
-
28
17
  resources :zones
29
18
 
30
19
  resources :tax_categories