spree_backend 4.2.0.rc2 → 4.2.0.rc3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend.js +0 -1
  3. data/app/assets/javascripts/spree/backend/address_states.js +20 -9
  4. data/app/assets/javascripts/spree/backend/calculator.js +2 -0
  5. data/app/assets/javascripts/spree/backend/checkouts/edit.js +99 -71
  6. data/app/assets/javascripts/spree/backend/line_items_on_order_edit.js +1 -1
  7. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +31 -37
  8. data/app/assets/javascripts/spree/backend/option_value_picker.js +50 -23
  9. data/app/assets/javascripts/spree/backend/product_picker.js +35 -19
  10. data/app/assets/javascripts/spree/backend/promotions.js +32 -27
  11. data/app/assets/javascripts/spree/backend/shipments.js +28 -37
  12. data/app/assets/javascripts/spree/backend/spree-select2.js +33 -14
  13. data/app/assets/javascripts/spree/backend/stock_transfer.js +32 -13
  14. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +30 -43
  15. data/app/assets/javascripts/spree/backend/taxons.js +60 -47
  16. data/app/assets/javascripts/spree/backend/user_picker.js +16 -18
  17. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +23 -22
  18. data/app/assets/stylesheets/spree/backend/components/_badges.scss +1 -1
  19. data/app/assets/stylesheets/spree/backend/components/_tables.scss +2 -2
  20. data/app/assets/stylesheets/spree/backend/global/_variables.scss +1 -1
  21. data/app/assets/stylesheets/spree/backend/plugins/_select2_custom.scss +11 -0
  22. data/app/assets/stylesheets/spree/backend/plugins/select2_bootstrap4.scss +622 -0
  23. data/app/assets/stylesheets/spree/backend/spree_admin.css.scss +2 -1
  24. data/app/controllers/spree/admin/orders_controller.rb +15 -2
  25. data/app/controllers/spree/admin/products_controller.rb +2 -2
  26. data/app/controllers/spree/admin/states_controller.rb +1 -1
  27. data/app/controllers/spree/admin/taxons_controller.rb +15 -5
  28. data/app/helpers/spree/admin/base_helper.rb +21 -5
  29. data/app/helpers/spree/admin/navigation_helper.rb +11 -1
  30. data/app/helpers/spree/admin/payments_helper.rb +3 -3
  31. data/app/helpers/spree/admin/stock_movements_helper.rb +2 -0
  32. data/app/views/spree/admin/countries/index.html.erb +6 -6
  33. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +3 -1
  34. data/app/views/spree/admin/customer_returns/_return_item_selection.html.erb +3 -1
  35. data/app/views/spree/admin/customer_returns/index.html.erb +2 -2
  36. data/app/views/spree/admin/customer_returns/new.html.erb +1 -1
  37. data/app/views/spree/admin/general_settings/edit.html.erb +25 -2
  38. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  39. data/app/views/spree/admin/orders/_add_line_item.html.erb +1 -1
  40. data/app/views/spree/admin/orders/_add_product.html.erb +1 -1
  41. data/app/views/spree/admin/orders/_channel_form.html.erb +18 -0
  42. data/app/views/spree/admin/orders/_shipment.html.erb +3 -1
  43. data/app/views/spree/admin/orders/channel.html.erb +7 -0
  44. data/app/views/spree/admin/orders/customer_details/_autocomplete.js.erb +35 -12
  45. data/app/views/spree/admin/orders/customer_details/_form.html.erb +2 -2
  46. data/app/views/spree/admin/orders/customer_details/edit.html.erb +1 -1
  47. data/app/views/spree/admin/orders/index.html.erb +10 -11
  48. data/app/views/spree/admin/payment_methods/_form.html.erb +65 -46
  49. data/app/views/spree/admin/payment_methods/index.html.erb +1 -1
  50. data/app/views/spree/admin/products/_form.html.erb +4 -4
  51. data/app/views/spree/admin/products/index.html.erb +2 -1
  52. data/app/views/spree/admin/products/new.html.erb +2 -2
  53. data/app/views/spree/admin/promotion_rules/create.js.erb +1 -1
  54. data/app/views/spree/admin/promotions/_form.html.erb +1 -1
  55. data/app/views/spree/admin/promotions/actions/_create_line_items.html.erb +1 -1
  56. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +8 -7
  57. data/app/views/spree/admin/promotions/rules/_product.html.erb +1 -1
  58. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +1 -1
  59. data/app/views/spree/admin/promotions/rules/_user.html.erb +1 -1
  60. data/app/views/spree/admin/refunds/new.html.erb +1 -1
  61. data/app/views/spree/admin/reimbursements/edit.html.erb +4 -2
  62. data/app/views/spree/admin/reimbursements/show.html.erb +3 -1
  63. data/app/views/spree/admin/return_authorizations/_form.html.erb +7 -5
  64. data/app/views/spree/admin/return_authorizations/index.html.erb +2 -2
  65. data/app/views/spree/admin/return_index/customer_returns.html.erb +2 -2
  66. data/app/views/spree/admin/return_index/return_authorizations.html.erb +2 -2
  67. data/app/views/spree/admin/shared/_account_nav.html.erb +1 -1
  68. data/app/views/spree/admin/shared/_address_form.html.erb +7 -7
  69. data/app/views/spree/admin/shared/_head.html.erb +4 -0
  70. data/app/views/spree/admin/shared/_order_summary.html.erb +25 -21
  71. data/app/views/spree/admin/shared/_order_tabs.html.erb +9 -0
  72. data/app/views/spree/admin/shared/_refunds.html.erb +1 -1
  73. data/app/views/spree/admin/shared/_translations.html.erb +1 -0
  74. data/app/views/spree/admin/shared/_update_order_state.js.erb +6 -2
  75. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  76. data/app/views/spree/admin/shipping_methods/_form.html.erb +2 -2
  77. data/app/views/spree/admin/shipping_methods/index.html.erb +5 -1
  78. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  79. data/app/views/spree/admin/stock_locations/index.html.erb +2 -2
  80. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +1 -1
  81. data/app/views/spree/admin/stock_transfers/index.html.erb +42 -37
  82. data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
  83. data/app/views/spree/admin/stores/_form.html.erb +64 -11
  84. data/app/views/spree/admin/stores/index.html.erb +11 -6
  85. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  86. data/app/views/spree/admin/tax_rates/index.html.erb +2 -2
  87. data/app/views/spree/admin/taxons/_form.html.erb +39 -35
  88. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  89. data/app/views/spree/admin/users/_addresses_form.html.erb +4 -6
  90. data/app/views/spree/admin/variants/_form.html.erb +2 -2
  91. data/app/views/spree/admin/zones/index.html.erb +1 -1
  92. data/config/routes.rb +7 -1
  93. data/spree_backend.gemspec +1 -1
  94. metadata +15 -14
  95. data/app/assets/javascripts/spree/backend/tag_picker.js +0 -52
  96. data/app/assets/stylesheets/spree/backend/plugins/_select2.scss +0 -190
  97. data/app/views/spree/admin/general_settings/_form.html.erb +0 -17
@@ -33,7 +33,9 @@
33
33
  <% end %>
34
34
  </td>
35
35
  <td>
36
- <div class="variant-name"><%= inventory_unit.variant.name %></div>
36
+ <div class="variant-name">
37
+ <%= link_to return_item.inventory_unit.variant.name, spree.edit_admin_product_path(return_item.inventory_unit.variant.product) %>
38
+ </div>
37
39
  <div class="variant-options"><%= inventory_unit.variant.options_text %></div>
38
40
  </td>
39
41
  <td><%= inventory_unit.state.humanize %></td>
@@ -59,7 +61,7 @@
59
61
  </td>
60
62
  <td>
61
63
  <% if editable %>
62
- <%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'select2'} %>
64
+ <%= item_fields.select :preferred_reimbursement_type_id, @reimbursement_types.collect{|r|[r.name.humanize, r.id]}, {include_blank: true}, {class: 'select2-clear'} %>
63
65
  <% end %>
64
66
  </td>
65
67
  <td>
@@ -67,7 +69,7 @@
67
69
  <% if return_item.exchange_processed? %>
68
70
  <%= return_item.exchange_variant.exchange_name %>
69
71
  <% else %>
70
- <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2 return-item-exchange-selection" } %>
72
+ <%= item_fields.collection_select :exchange_variant_id, return_item.eligible_exchange_variants, :id, :exchange_name, { include_blank: true }, { class: "select2-clear return-item-exchange-selection" } %>
71
73
  <% end %>
72
74
  <% end %>
73
75
  </td>
@@ -82,13 +84,13 @@
82
84
 
83
85
  <%= f.field_container :stock_location, class: ['form-group'] do %>
84
86
  <%= f.label :stock_location, Spree.t(:stock_location) %> <span class="required">*</span>
85
- <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name, l.id]}, {include_blank: true}, {class: 'select2', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
87
+ <%= f.select :stock_location_id, Spree::StockLocation.order_default.active.to_a.collect{|l|[l.name, l.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_stock_location)} %>
86
88
  <%= f.error_message_on :stock_location %>
87
89
  <% end %>
88
90
 
89
91
  <%= f.field_container :reason, class: ['form-group'] do %>
90
92
  <%= f.label :reason, Spree.t(:reason) %> <span class="required">*</span>
91
- <%= f.select :return_authorization_reason_id, @reasons.collect{|r|[r.name, r.id]}, {include_blank: true}, {class: 'select2', "data-placeholder" => Spree.t(:select_a_return_authorization_reason)} %>
93
+ <%= f.select :return_authorization_reason_id, @reasons.collect{|r|[r.name, r.id]}, {include_blank: true}, {class: 'select2-clear', "data-placeholder" => Spree.t(:select_a_return_authorization_reason)} %>
92
94
  <%= f.error_message_on :reason %>
93
95
  <% end %>
94
96
 
@@ -27,9 +27,9 @@
27
27
  <tr id="<%= spree_dom_id(return_authorization) %>" data-hook="rma_row">
28
28
  <td><%= return_authorization.number %></td>
29
29
  <td>
30
- <span class="badge badge-<%= return_authorization.state %>">
30
+ <strong class="badge badge-<%= return_authorization.state %> text-uppercase">
31
31
  <%= Spree.t("return_authorization_states.#{return_authorization.state}") %>
32
- </span>
32
+ </strong>
33
33
  </td>
34
34
  <td><%= return_authorization.display_pre_tax_total.to_html %></td>
35
35
  <td><%= pretty_time(return_authorization.created_at) %></td>
@@ -41,9 +41,9 @@
41
41
  <td><%= link_to customer_return.order.number, spree.edit_admin_order_path(customer_return.order) %></td>
42
42
  <td>
43
43
  <% if customer_return.fully_reimbursed? %>
44
- <span class="badge badge-success"><%= Spree.t(:reimbursed) %></span>
44
+ <span class="badge badge-success text-uppercase"><%= Spree.t(:reimbursed) %></span>
45
45
  <% else %>
46
- <span class="badge badge-info"><%= Spree.t(:incomplete) %></span>
46
+ <span class="badge badge-inactive text-uppercase"><%= Spree.t(:incomplete) %></span>
47
47
  <% end %>
48
48
  </td>
49
49
  <td><%= customer_return.display_pre_tax_total.to_html %></td>
@@ -33,7 +33,7 @@
33
33
  <div class="col-12 col-lg-6">
34
34
  <div class="form-group">
35
35
  <%= label_tag :q_state_eq, Spree.t(:status) %>
36
- <%= f.select :state_eq, Spree::ReturnAuthorization.state_machines[:state].states.collect {|s| [Spree.t("return_authorization_states.#{s.name}"), s.value]}, {include_blank: true}, class: 'select2 js-filterable' %>
36
+ <%= f.select :state_eq, Spree::ReturnAuthorization.state_machines[:state].states.collect {|s| [Spree.t("return_authorization_states.#{s.name}"), s.value]}, {include_blank: true}, class: 'select2-clear js-filterable' %>
37
37
  </div>
38
38
  </div>
39
39
  </div>
@@ -63,7 +63,7 @@
63
63
  <td><%= link_to return_authorization.number, spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization) %></td>
64
64
  <td><%= link_to return_authorization.order.number, spree.edit_admin_order_path(return_authorization.order) %></td>
65
65
  <td>
66
- <span class="badge badge-<%= return_authorization.state %>"><%= Spree.t("return_authorization_states.#{return_authorization.state}") %></span>
66
+ <span class="badge badge-<%= return_authorization.state %> text-uppercase"><%= Spree.t("return_authorization_states.#{return_authorization.state}") %></span>
67
67
  </td>
68
68
  <td class="actions actions-1 text-right">
69
69
  <%= link_to_edit return_authorization, url: spree.edit_admin_order_return_authorization_path(return_authorization.order, return_authorization), no_text: true if can?(:edit, return_authorization) %>
@@ -5,7 +5,7 @@
5
5
  <%= svg_icon name: "user.svg", width: '24', height: '24' %>
6
6
  </button>
7
7
 
8
- <div class="dropdown-menu dropdown-menu-right mt-2 p-0 mr-2">
8
+ <div class="dropdown-menu dropdown-menu-right overflow-hidden mt-2 p-0 mr-2">
9
9
  <div class="dropdown-item px-0 text-center bg-light">
10
10
  <span class="d-block text-dark py-2 px-4"><%= try_spree_current_user.email %></span>
11
11
  </div>
@@ -4,25 +4,25 @@
4
4
  <% if field == "country" %>
5
5
  <%= field_container (s_or_b + '_' + field), nil, class: ["form-group", "#{type}-row"] do %>
6
6
  <%= f.label :country_id, Spree.t(:country) %>
7
- <span id="<%= s_or_b %>country">
8
- <%= f.collection_select :country_id, available_countries, :id, :name, {}, { class: 'select2' } %>
9
- </span>
7
+ <div id="<%= s_or_b %>country">
8
+ <%= f.collection_select :country_id, available_countries, :id, :name, {}, { class: 'select2 w-100' } %>
9
+ </div>
10
10
  <% end %>
11
11
  <% elsif field == "state" %>
12
12
  <%= field_container (s_or_b + '_' + field), :state, class: ["form-group", "#{type}-row"] do %>
13
13
  <%= f.label :state_id, Spree.t(:state) %>
14
- <span id="<%= s_or_b %>state">
14
+ <div id="<%= s_or_b %>state">
15
15
  <% if f.object.country.try(:states) %>
16
16
  <%= f.text_field :state_name,
17
17
  style: "display: #{f.object.country.try(:states) && f.object.country.states.empty? ? 'block' : 'none' };",
18
18
  disabled: !(f.object.country.try(:states) && f.object.country.states.empty?), class: 'form-control state_name' %>
19
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, { class: 'select2', style: "display: #{ f.object.country.states.empty? ? 'none' : 'block' };", disabled: f.object.country.states.empty? } %>
19
+ <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, { class: 'select2 w-100', disabled: f.object.country.states.empty? } %>
20
20
  <% else %>
21
21
  <div>
22
22
  <em><%= Spree.t(:no_country) %></em>
23
23
  </div>
24
24
  <% end %>
25
- </span>
25
+ </div>
26
26
  <%= error_message_on f.object, :state_id %>
27
27
  <% end %>
28
28
  <% else %>
@@ -38,7 +38,7 @@
38
38
  <% content_for :head do %>
39
39
  <%= javascript_tag do %>
40
40
  $(document).ready(function(){
41
- $('span#<%= s_or_b %>country .select2').on('change', function() { update_state('<%= s_or_b %>'); });
41
+ $('#<%= s_or_b %>country select').on('change', function() { update_state('<%= s_or_b %>'); });
42
42
  });
43
43
  <% end %>
44
44
  <% end %>
@@ -22,6 +22,10 @@
22
22
  <%= javascript_tag do %>
23
23
  <%== "var AUTH_TOKEN = #{form_authenticity_token.inspect};" %>
24
24
  <%== "Spree.api_key = '#{try_spree_current_user.spree_api_key}';" if try_spree_current_user %>
25
+ <%== "var ADDRESS_FIELDS = #{Spree::Address::ADDRESS_FIELDS}" %>
26
+ <% if Rails.env.test? %>
27
+ jQuery.fx.off = false
28
+ <% end %>
25
29
  <% end %>
26
30
 
27
31
  <%= yield :head %>
@@ -10,7 +10,7 @@
10
10
  <strong><%= Spree.t(:status) %>:</strong>
11
11
  </td>
12
12
  <td>
13
- <span class="state badge badge-<%= @order.state %>">
13
+ <span class="state badge badge-<%= @order.state %> text-uppercase">
14
14
  <%= Spree.t(@order.state, scope: :order_state) %>
15
15
  </span>
16
16
  </td>
@@ -71,26 +71,30 @@
71
71
  </tr>
72
72
 
73
73
  <% if @order.completed? %>
74
- <tr>
75
- <td>
76
- <strong><%= Spree.t(:shipment) %>:</strong>
77
- </td>
78
- <td id='shipment_status'>
79
- <span class="state badge badge-<%= @order.shipment_state %>">
80
- <%= Spree.t(@order.shipment_state, scope: :shipment_states, default: [:missing, "none"]) %>
81
- </span>
82
- </td>
83
- </tr>
84
- <tr>
85
- <td>
86
- <strong><%= Spree.t(:payment) %>:</strong>
87
- </td>
88
- <td id='payment_status'>
89
- <span class="state badge badge-<%= @order.payment_state %>">
90
- <%= Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>
91
- </span>
92
- </td>
93
- </tr>
74
+ <% if @order.shipment_state.present? %>
75
+ <tr>
76
+ <td>
77
+ <strong><%= Spree.t(:shipment) %>:</strong>
78
+ </td>
79
+ <td id='shipment_status'>
80
+ <span class="state badge badge-<%= @order.shipment_state %> text-uppercase">
81
+ <%= Spree.t(@order.shipment_state, scope: :shipment_states, default: [:missing, "none"]) %>
82
+ </span>
83
+ </td>
84
+ </tr>
85
+ <% end %>
86
+ <% if @order.payment_state.present? %>
87
+ <tr>
88
+ <td>
89
+ <strong><%= Spree.t(:payment) %>:</strong>
90
+ </td>
91
+ <td id='payment_status'>
92
+ <span class="state badge badge-<%= @order.payment_state %> text-uppercase">
93
+ <%= Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>
94
+ </span>
95
+ </td>
96
+ </tr>
97
+ <% end %>
94
98
  <tr>
95
99
  <td data-hook='admin_order_tab_date_completed_title'>
96
100
  <strong><%= Spree.t(:date_completed) %>:</strong>
@@ -23,6 +23,15 @@
23
23
  </li>
24
24
  <% end %>
25
25
 
26
+ <% if can? :update, @order %>
27
+ <li data-hook='admin_order_tabs_channel_details'>
28
+ <%= link_to_with_icon 'split.svg',
29
+ Spree.t(:channel),
30
+ channel_admin_order_url(@order),
31
+ class: "#{'active' if current == :channel} nav-link" %>
32
+ </li>
33
+ <% end %>
34
+
26
35
  <% if can?(:update, @order) && @order.checkout_steps.include?("address") %>
27
36
  <li data-hook='admin_order_tabs_customer_details'>
28
37
  <%= link_to_with_icon 'user.svg',
@@ -17,7 +17,7 @@
17
17
  <% refunds.each do |refund| %>
18
18
  <tr id="<%= dom_id(refund) %>" data-hook="refunds_row" class="<%= cycle('odd', 'even', name: 'refund_table_cycle')%>">
19
19
  <td><%= pretty_time(refund.created_at) %></td>
20
- <td><%= refund.payment.number %></td>
20
+ <td><%= link_to refund.payment.number, spree.admin_order_payment_path(refund.payment.order, refund.payment) %></td>
21
21
  <td class="amount"><%= refund.display_amount %></td>
22
22
  <td><%= payment_method_name(refund.payment) %></td>
23
23
  <td><%= refund.transaction_id %></td>
@@ -64,6 +64,7 @@
64
64
  save: Spree.t(:save, scope: :actions),
65
65
  searching: Spree.t(:searching),
66
66
  server_error: Spree.t(:server_error),
67
+ select_an_option: Spree.t(:select_an_option),
67
68
  sku: Spree.t(:sku),
68
69
  type_to_search: Spree.t(:type_to_search),
69
70
  taxon_placeholder: Spree.t(:taxon_placeholder),
@@ -2,6 +2,10 @@ $('#order_tab_summary h5#order_status').html('<%= j Spree.t(:status) %>: <%= j S
2
2
  $('#order_tab_summary h5#order_total').html('<%= j Spree.t(:total) %>: <%= j @order.display_total.to_html %>');
3
3
 
4
4
  <% if @order.completed? %>
5
- $('#order_tab_summary h5#payment_status').html('<%= j Spree.t(:payment) %>: <%= j Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>');
6
- $('#order_tab_summary h5#shipment_status').html('<%= j Spree.t(:shipment) %>: <%= j Spree.t(@order.shipment_state, scope: :shipment_state, default: [:missing, "none"]) %>');
5
+ <% if @order.payment_state.present? %>
6
+ $('#order_tab_summary h5#payment_status').html('<%= j Spree.t(:payment) %>: <%= j Spree.t(@order.payment_state, scope: :payment_states, default: [:missing, "none"]) %>');
7
+ <% end %>
8
+ <% if @order.shipment_state.present? %>
9
+ $('#order_tab_summary h5#shipment_status').html('<%= j Spree.t(:shipment) %>: <%= j Spree.t(@order.shipment_state, scope: :shipment_state, default: [:missing, "none"]) %>');
10
+ <% end %>
7
11
  <% end %>
@@ -23,7 +23,7 @@
23
23
  <%= named_type.name %>
24
24
  </td>
25
25
  <td class="align-center">
26
- <%= Spree.t(named_type.active? ? :active : :inactive) %>
26
+ <%= active_badge(named_type.active, label: Spree.t(named_type.active? ? :active : :inactive)) %>
27
27
  </td>
28
28
  <td class="actions actions-1 text-right">
29
29
  <% if named_type.mutable? %>
@@ -11,7 +11,7 @@
11
11
  <div data-hook="admin_shipping_method_form_display_field" class="col-12 col-lg-6">
12
12
  <%= f.field_container :display_on, class: ['form-group'] do %>
13
13
  <%= f.label :display_on, Spree.t(:display) %>
14
- <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, { include_blank: true }, { class: 'select2' }) %>
14
+ <%= select(:shipping_method, :display_on, Spree::ShippingMethod::DISPLAY.collect { |display| [Spree.t(display), display.to_s] }, { include_blank: true }, { class: 'select2-clear' }) %>
15
15
  <%= f.error_message_on :display_on %>
16
16
  <% end %>
17
17
  </div>
@@ -110,7 +110,7 @@
110
110
 
111
111
  <div class="card-body">
112
112
  <%= f.field_container :categories, class: ['form-group'] do %>
113
- <%= f.select :tax_category_id, @tax_categories.map { |tc| [tc.name, tc.id] }, { include_blank: true }, class: "select2" %>
113
+ <%= f.select :tax_category_id, @tax_categories.map { |tc| [tc.name, tc.id] }, { include_blank: true }, class: "select2-clear" %>
114
114
  <%= f.error_message_on :tax_category_id %>
115
115
  <% end %>
116
116
  </div>
@@ -22,7 +22,11 @@
22
22
  <% @shipping_methods.includes(:zones, :calculator).each do |shipping_method|%>
23
23
  <tr id="<%= spree_dom_id shipping_method %>" data-hook="admin_shipping_methods_index_rows">
24
24
  <td><%= shipping_method.admin_name + ' / ' if shipping_method.admin_name.present? %><%= shipping_method.name %></td>
25
- <td><%= shipping_method.zones.collect(&:name).join(", ") if shipping_method.zones %></td>
25
+ <td>
26
+ <% shipping_method.zones.each do |zone| %>
27
+ <%= link_to zone.name, spree.edit_admin_zone_path(zone) %>
28
+ <% end %>
29
+ </td>
26
30
  <td><%= shipping_method.calculator.description %></td>
27
31
  <td class="text-center"><%= shipping_method.display_on.blank? ? Spree.t(:none) : Spree.t(shipping_method.display_on) %></td>
28
32
  <td data-hook="admin_shipping_methods_index_row_actions" class="actions actions-2 text-right">
@@ -80,7 +80,7 @@
80
80
  <%= f.label :state_id, Spree.t(:state) %>
81
81
  <span id="state" class="region">
82
82
  <%= f.text_field :state_name, style: "#{f.object.country.states.empty? ? '' : 'display: none;'}", disabled: !f.object.country.states.empty?, class: 'state_name form-control' %>
83
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, {class: 'select2', style: "#{f.object.country.states.empty? ? 'display: none;' : '' };", disabled: f.object.country.states.empty?} %>
83
+ <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, { include_blank: true }, {class: 'select2-clear', style: "#{f.object.country.states.empty? ? 'display: none;' : '' };", disabled: f.object.country.states.empty?} %>
84
84
  </span>
85
85
  <% end %>
86
86
  </div>
@@ -12,8 +12,8 @@
12
12
  <thead>
13
13
  <tr data-hook="stock_locations_header">
14
14
  <th><%= Spree.t(:name) %></th>
15
- <th><%= Spree.t(:status) %></th>
16
15
  <th><%= Spree.t(:stock_movements) %></th>
16
+ <th><%= Spree.t(:status) %></th>
17
17
  <th class="actions"></th>
18
18
  </tr>
19
19
  </thead>
@@ -24,8 +24,8 @@
24
24
  %>
25
25
  <tr id="<%= spree_dom_id stock_location %>" data-hook="stock_location_row">
26
26
  <td><%= display_name(stock_location) %></td>
27
- <td><span class="state <%= state(stock_location) %>"><%= Spree.t(state(stock_location)) %></span></td>
28
27
  <td><%= link_to Spree.t(:stock_movements), admin_stock_location_stock_movements_path(stock_location.id) %> </td>
28
+ <td><%= active_badge(stock_location.active, label: Spree.t(state(stock_location))) %></td>
29
29
  <td class="actions actions-2 text-center">
30
30
  <%= link_to_edit(stock_location, no_text: true) if can? :create, stock_location %>
31
31
  <%= link_to_delete(stock_location, no_text: true) if can? :create, stock_location %>
@@ -12,7 +12,7 @@
12
12
  <tbody id="bulk_variants_tbody">
13
13
  <% stock_movements.each do |movement| %>
14
14
  <tr>
15
- <td><%= movement.stock_item.variant.name %></td>
15
+ <td><%= link_to movement.stock_item.variant.name, spree.edit_admin_product_path(movement.stock_item.variant.product) %></td>
16
16
  <td><%= movement.stock_item.variant.sku %></td>
17
17
  <td><%= movement.quantity %></td>
18
18
  <td><%= movement.stock_item.count_on_hand %></td>
@@ -6,68 +6,73 @@
6
6
  <%= button_link_to Spree.t(:new_stock_transfer), new_admin_stock_transfer_path, { icon: 'add.svg', class: 'btn-success' } %>
7
7
  <% end if can? :create, Spree::StockTransfer %>
8
8
 
9
- <div data-hook="admin_orders_index_search" class="card bg-light mb-3">
10
- <div class="card-body">
11
- <fieldset>
12
- <legend class="border-bottom"><%= Spree.t(:search) %></legend>
13
- <%= search_form_for @q, url: admin_stock_transfers_path do |f| %>
9
+ <% content_for :table_filter do %>
10
+ <div data-hook="admin_orders_index_search">
11
+ <%= search_form_for @q, url: admin_stock_transfers_path do |f| %>
14
12
 
15
- <div class="row mb-0">
16
- <div class="col-12 col-lg-4">
17
- <div class="form-group">
18
- <%= f.label :reference_cont, Spree.t(:reference_contains) %>
19
- <%= f.text_field :reference_cont, class: 'form-control' %>
20
- </div>
21
- </div>
22
-
23
- <div class="col-12 col-lg-4">
24
- <div class="form-group">
25
- <%= f.label :source_location, Spree.t(:source) %>
26
- <%= f.select :source_location_id_eq,
27
- options_from_collection_for_select(@stock_locations, :id, :name, @q.source_location_id_eq),
28
- { include_blank: true }, class: 'select2' %>
29
- </div>
13
+ <div class="row mb-0">
14
+ <div class="col-12 col-lg-4">
15
+ <div class="form-group">
16
+ <%= f.label :reference_cont, Spree.t(:reference_contains) %>
17
+ <%= f.text_field :reference_cont, class: 'form-control' %>
30
18
  </div>
19
+ </div>
31
20
 
32
- <div class="col-12 col-lg-4">
33
- <div class="form-group">
34
- <%= f.label :destination_location, Spree.t(:destination) %>
35
- <%= f.select :destination_location_id_eq,
36
- options_from_collection_for_select(@stock_locations, :id, :name, @q.destination_location_id_eq),
37
- { include_blank: true }, class: 'select2' %>
38
- </div>
21
+ <div class="col-12 col-lg-4">
22
+ <div class="form-group">
23
+ <%= f.label :source_location, Spree.t(:source) %>
24
+ <%= f.select :source_location_id_eq,
25
+ options_from_collection_for_select(@stock_locations, :id, :name, @q.source_location_id_eq),
26
+ { include_blank: true }, class: 'select2-clear js-filterable' %>
39
27
  </div>
40
28
  </div>
41
29
 
42
- <div class="form-actions">
43
- <div data-hook="admin_stock_transfers_index_search_buttons">
44
- <%= button Spree.t(:filter_results), 'search.svg' %>
30
+ <div class="col-12 col-lg-4">
31
+ <div class="form-group">
32
+ <%= f.label :destination_location, Spree.t(:destination) %>
33
+ <%= f.select :destination_location_id_eq,
34
+ options_from_collection_for_select(@stock_locations, :id, :name, @q.destination_location_id_eq),
35
+ { include_blank: true }, class: 'select2-clear js-filterable' %>
45
36
  </div>
46
37
  </div>
47
- <% end %>
48
- </fieldset>
38
+ </div>
39
+
40
+ <div class="form-actions" data-hook="admin_stock_transfers_index_search_buttons">
41
+ <%= button Spree.t(:filter_results), 'search.svg' %>
42
+ </div>
43
+ <% end %>
49
44
  </div>
50
- </div>
45
+ <% end %>
51
46
 
52
47
  <% if @stock_transfers.any? %>
53
48
  <div class="table-responsive">
54
49
  <table class="table" id='listing_stock_transfers' data-hook>
55
50
  <thead>
56
51
  <tr data-hook='stock_transfers_header'>
57
- <th><%= Spree.t(:created_at) %></th>
52
+ <th><%= Spree.t(:number) %></th>
58
53
  <th><%= Spree.t(:reference) %></th>
59
54
  <th><%= Spree.t(:source) %></th>
60
55
  <th><%= Spree.t(:destination) %></th>
56
+ <th><%= Spree.t(:created_at) %></th>
61
57
  <th class='actions'></th>
62
58
  </tr>
63
59
  </thead>
64
60
  <tbody>
65
61
  <% @stock_transfers.each do |stock_transfer| %>
66
62
  <tr id="<%= spree_dom_id stock_transfer %>" data-hook="stock_transfer_row">
67
- <td><%= link_to stock_transfer.created_at.strftime('%F %T %Z'), admin_stock_transfer_path(stock_transfer) %></td>
63
+ <td><%= link_to stock_transfer.number, admin_stock_transfer_path(stock_transfer) %></td>
68
64
  <td><%= stock_transfer.reference %></td>
69
- <td><%= stock_transfer.source_location.try(:name) %></td>
70
- <td><%= stock_transfer.destination_location.try(:name) %></td>
65
+ <td>
66
+ <% if stock_transfer.source_location.present? %>
67
+ <%= stock_transfer.source_location.name %>
68
+ <% end %>
69
+ </td>
70
+ <td>
71
+ <% if stock_transfer.destination_location.present? %>
72
+ <%= stock_transfer.destination_location.name %>
73
+ <% end %>
74
+ </td>
75
+ <td><%= stock_transfer.created_at.strftime('%F %T %Z') %></td>
71
76
  <td class="actions actions-1">
72
77
  <%= link_to_with_icon 'show', Spree.t(:show), admin_stock_transfer_path(stock_transfer), class: 'btn btn-outline-secondary btn-sm', no_text: true, data: {action: 'view'} %>
73
78
  </td>