solidus_backend 3.3.0 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (150) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/datepicker.js +2 -1
  3. data/app/assets/javascripts/spree/backend/navigation.js +13 -3
  4. data/app/assets/javascripts/spree/backend/shipments.js +1 -1
  5. data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +1 -1
  6. data/app/assets/javascripts/spree/backend/templates/variants/line_items_autocomplete_stock.hbs +2 -2
  7. data/app/controllers/spree/admin/orders_controller.rb +4 -0
  8. data/app/controllers/spree/admin/payments_controller.rb +2 -0
  9. data/app/controllers/spree/admin/resource_controller.rb +3 -1
  10. data/app/helpers/spree/admin/adjustments_helper.rb +2 -2
  11. data/app/helpers/spree/admin/base_helper.rb +1 -1
  12. data/app/helpers/spree/admin/orders_helper.rb +18 -0
  13. data/app/helpers/spree/admin/stock_movements_helper.rb +1 -1
  14. data/app/views/spree/admin/adjustment_reasons/index.html.erb +3 -3
  15. data/app/views/spree/admin/adjustment_reasons/shared/_form.html.erb +2 -2
  16. data/app/views/spree/admin/adjustments/_form.html.erb +1 -1
  17. data/app/views/spree/admin/adjustments/index.html.erb +2 -2
  18. data/app/views/spree/admin/adjustments/new.html.erb +0 -1
  19. data/app/views/spree/admin/cancellations/index.html.erb +6 -6
  20. data/app/views/spree/admin/customer_returns/_return_item_decision.html.erb +1 -1
  21. data/app/views/spree/admin/customer_returns/new.html.erb +0 -1
  22. data/app/views/spree/admin/images/_image_row.html.erb +1 -2
  23. data/app/views/spree/admin/images/edit.html.erb +0 -1
  24. data/app/views/spree/admin/images/index.html.erb +0 -1
  25. data/app/views/spree/admin/option_types/_form.html.erb +2 -2
  26. data/app/views/spree/admin/option_types/_option_value_fields.html.erb +1 -1
  27. data/app/views/spree/admin/option_types/edit.html.erb +0 -1
  28. data/app/views/spree/admin/option_types/index.html.erb +0 -1
  29. data/app/views/spree/admin/orders/_adjustments.html.erb +2 -2
  30. data/app/views/spree/admin/orders/_carton.html.erb +5 -5
  31. data/app/views/spree/admin/orders/_carton_manifest.html.erb +1 -1
  32. data/app/views/spree/admin/orders/_form.html.erb +2 -2
  33. data/app/views/spree/admin/orders/_line_items.html.erb +6 -6
  34. data/app/views/spree/admin/orders/_risk_analysis.html.erb +20 -44
  35. data/app/views/spree/admin/orders/_shipment.html.erb +6 -6
  36. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +1 -1
  37. data/app/views/spree/admin/orders/cart.html.erb +2 -3
  38. data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +1 -1
  39. data/app/views/spree/admin/orders/confirm/_line_items.html.erb +1 -1
  40. data/app/views/spree/admin/orders/confirm/_shipment_manifest.html.erb +1 -1
  41. data/app/views/spree/admin/orders/confirm.html.erb +0 -1
  42. data/app/views/spree/admin/orders/confirm_advance.html.erb +1 -2
  43. data/app/views/spree/admin/orders/customer_details/edit.html.erb +0 -1
  44. data/app/views/spree/admin/orders/customer_details/show.html.erb +0 -2
  45. data/app/views/spree/admin/orders/edit.html.erb +2 -2
  46. data/app/views/spree/admin/orders/index.html.erb +1 -2
  47. data/app/views/spree/admin/payment_methods/index.html.erb +2 -3
  48. data/app/views/spree/admin/payment_methods/new.html.erb +0 -1
  49. data/app/views/spree/admin/payments/_form.html.erb +1 -1
  50. data/app/views/spree/admin/payments/_list.html.erb +11 -8
  51. data/app/views/spree/admin/payments/_log_entries.html.erb +3 -3
  52. data/app/views/spree/admin/payments/credit.html.erb +0 -1
  53. data/app/views/spree/admin/payments/new.html.erb +0 -1
  54. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +1 -1
  55. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +46 -3
  56. data/app/views/spree/admin/payments/source_views/_store_credit.html.erb +1 -1
  57. data/app/views/spree/admin/products/_form.html.erb +60 -63
  58. data/app/views/spree/admin/products/index.html.erb +1 -1
  59. data/app/views/spree/admin/promotion_categories/edit.html.erb +0 -1
  60. data/app/views/spree/admin/promotion_categories/index.html.erb +0 -1
  61. data/app/views/spree/admin/promotion_categories/new.html.erb +0 -1
  62. data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
  63. data/app/views/spree/admin/promotions/_form.html.erb +4 -4
  64. data/app/views/spree/admin/promotions/_rules.html.erb +1 -2
  65. data/app/views/spree/admin/promotions/actions/_create_adjustment.html.erb +1 -1
  66. data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +1 -2
  67. data/app/views/spree/admin/promotions/index.html.erb +0 -1
  68. data/app/views/spree/admin/properties/_form.html.erb +2 -2
  69. data/app/views/spree/admin/properties/edit.html.erb +0 -1
  70. data/app/views/spree/admin/properties/filtered.html.erb +1 -1
  71. data/app/views/spree/admin/properties/index.html.erb +0 -1
  72. data/app/views/spree/admin/refund_reasons/index.html.erb +3 -4
  73. data/app/views/spree/admin/refund_reasons/new.html.erb +0 -1
  74. data/app/views/spree/admin/refund_reasons/shared/_form.html.erb +2 -2
  75. data/app/views/spree/admin/refunds/edit.html.erb +2 -2
  76. data/app/views/spree/admin/refunds/new.html.erb +3 -4
  77. data/app/views/spree/admin/reimbursement_types/index.html.erb +0 -1
  78. data/app/views/spree/admin/reimbursements/edit.html.erb +1 -2
  79. data/app/views/spree/admin/reimbursements/show.html.erb +0 -1
  80. data/app/views/spree/admin/return_authorizations/edit.html.erb +4 -4
  81. data/app/views/spree/admin/return_authorizations/index.html.erb +0 -1
  82. data/app/views/spree/admin/return_authorizations/new.html.erb +0 -1
  83. data/app/views/spree/admin/shared/_head.html.erb +5 -5
  84. data/app/views/spree/admin/shared/_js_locale_data.html.erb +1 -1
  85. data/app/views/spree/admin/shared/_order_summary.html.erb +1 -1
  86. data/app/views/spree/admin/shared/_order_tabs.html.erb +0 -1
  87. data/app/views/spree/admin/shared/named_types/_edit.html.erb +0 -1
  88. data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
  89. data/app/views/spree/admin/shared/named_types/_index.html.erb +3 -4
  90. data/app/views/spree/admin/shared/named_types/_new.html.erb +0 -1
  91. data/app/views/spree/admin/shipping_categories/edit.html.erb +0 -1
  92. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -2
  93. data/app/views/spree/admin/shipping_categories/new.html.erb +0 -1
  94. data/app/views/spree/admin/shipping_methods/edit.html.erb +0 -1
  95. data/app/views/spree/admin/shipping_methods/index.html.erb +1 -2
  96. data/app/views/spree/admin/shipping_methods/new.html.erb +0 -1
  97. data/app/views/spree/admin/stock_items/_stock_management.html.erb +5 -5
  98. data/app/views/spree/admin/stock_locations/_form.html.erb +1 -1
  99. data/app/views/spree/admin/stock_locations/edit.html.erb +1 -2
  100. data/app/views/spree/admin/stock_locations/index.html.erb +9 -9
  101. data/app/views/spree/admin/stock_locations/new.html.erb +0 -1
  102. data/app/views/spree/admin/stock_movements/index.html.erb +8 -13
  103. data/app/views/spree/admin/store_credit_reasons/index.html.erb +3 -3
  104. data/app/views/spree/admin/store_credit_reasons/shared/_form.html.erb +1 -1
  105. data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -2
  106. data/app/views/spree/admin/store_credits/edit_validity.html.erb +0 -1
  107. data/app/views/spree/admin/store_credits/index.html.erb +0 -1
  108. data/app/views/spree/admin/store_credits/new.html.erb +0 -1
  109. data/app/views/spree/admin/store_credits/show.html.erb +10 -11
  110. data/app/views/spree/admin/stores/_form.html.erb +6 -5
  111. data/app/views/spree/admin/style_guide/topics/components/_modals.html.erb +12 -14
  112. data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +0 -1
  113. data/app/views/spree/admin/style_guide/topics/forms/_helper_text.html.erb +0 -6
  114. data/app/views/spree/admin/style_guide/topics/forms/_inputs.html.erb +1 -1
  115. data/app/views/spree/admin/style_guide/topics/layout/_full_width_table_layout.html.erb +0 -4
  116. data/app/views/spree/admin/style_guide/topics/messaging/_flashes.html.erb +1 -1
  117. data/app/views/spree/admin/style_guide/topics/messaging/_tooltips.html.erb +2 -2
  118. data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +0 -1
  119. data/app/views/spree/admin/style_guide/topics/typography/_lists.html.erb +1 -1
  120. data/app/views/spree/admin/tax_categories/edit.html.erb +0 -1
  121. data/app/views/spree/admin/tax_categories/index.html.erb +11 -10
  122. data/app/views/spree/admin/tax_categories/new.html.erb +0 -2
  123. data/app/views/spree/admin/tax_rates/_form.html.erb +1 -1
  124. data/app/views/spree/admin/tax_rates/edit.html.erb +0 -1
  125. data/app/views/spree/admin/tax_rates/index.html.erb +9 -10
  126. data/app/views/spree/admin/tax_rates/new.html.erb +0 -1
  127. data/app/views/spree/admin/taxonomies/_form.html.erb +1 -1
  128. data/app/views/spree/admin/taxonomies/edit.html.erb +0 -2
  129. data/app/views/spree/admin/taxonomies/index.html.erb +0 -1
  130. data/app/views/spree/admin/taxonomies/new.html.erb +0 -1
  131. data/app/views/spree/admin/taxons/_form.html.erb +7 -7
  132. data/app/views/spree/admin/taxons/edit.html.erb +0 -1
  133. data/app/views/spree/admin/taxons/index.html.erb +1 -1
  134. data/app/views/spree/admin/users/_form.html.erb +0 -1
  135. data/app/views/spree/admin/users/_tabs.html.erb +5 -5
  136. data/app/views/spree/admin/users/addresses.html.erb +0 -1
  137. data/app/views/spree/admin/users/index.html.erb +2 -2
  138. data/app/views/spree/admin/users/items.html.erb +8 -8
  139. data/app/views/spree/admin/users/orders.html.erb +1 -2
  140. data/app/views/spree/admin/variants/_form.html.erb +0 -2
  141. data/app/views/spree/admin/variants/_table.html.erb +5 -5
  142. data/app/views/spree/admin/variants/edit.html.erb +0 -2
  143. data/app/views/spree/admin/variants/index.html.erb +1 -1
  144. data/app/views/spree/admin/zones/_form.html.erb +4 -4
  145. data/app/views/spree/admin/zones/edit.html.erb +0 -1
  146. data/app/views/spree/admin/zones/index.html.erb +4 -4
  147. data/app/views/spree/admin/zones/new.html.erb +0 -1
  148. data/app/views/spree/layouts/admin_style_guide.html.erb +1 -1
  149. data/config/routes.rb +1 -1
  150. metadata +7 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 167281f642dc52cabba45304f1ec89744ea6583885fc53783303a88d949d83e6
4
- data.tar.gz: 1a49a77a9e9c3dedbe2fedbfb5877a61c5fade7e435df5a28b88755bcf8cb6ed
3
+ metadata.gz: a8bfc5033e09dc3332e9851c3b6e2e1b3744ab88caa25a9bc6bb17491826f8e5
4
+ data.tar.gz: 133c9020003cfb7608879df10ae659232397be9625071f8ee4dd5e4ab38d2d4f
5
5
  SHA512:
6
- metadata.gz: 4715eaba5c97daa199678e78498cb606bf1ce3cfaffe9b209c0dd388175454d91f9c46666c5143dff8244342fc1aa1061dbe18b202482c1e1a8e9531263fbb21
7
- data.tar.gz: 5f9bd79cd6ce2c349bbe553889d00ba0fdf0dc3fd06961e8f72cc9ff208db8a427eaac33d038b774d840d074cd34300faef41f46558f101b7179fd354014a0df
6
+ metadata.gz: 8b43fe61f409ed7243b52a3f1e6d2a3268a4c255e542179b82408dcc1855105ec6afc2a87e0c95da1b079c97579c90a971b3c0a9cc8e7751502c380098146751
7
+ data.tar.gz: 2edd986c1cf4fb91f3cd2feef82d9a84f9b8b8171297d8f9b45f3de9a47fd48231e625137cf1e05bae34c85cfd7b1fb85e589aee0008b7a02191d57f56d631c7
@@ -11,7 +11,8 @@ Spree.ready(function(){
11
11
  });
12
12
 
13
13
  $('.datepicker').flatpickr({
14
- allowInput: true
14
+ allowInput: true,
15
+ dateFormat: Spree.t('date_picker.js_format')
15
16
  });
16
17
 
17
18
  // Handle range dates
@@ -3,11 +3,21 @@ Spree.ready(function() {
3
3
  return $('.admin-nav-header').outerHeight() + $('.admin-nav-menu').outerHeight() + $('.admin-nav-footer').outerHeight();
4
4
  };
5
5
 
6
- var checkSideBarFit = function() {
7
- $('.admin-nav').toggleClass('fits', navHeight() < $(window).height());
6
+ var initStickyNavbar = function() {
7
+ $(".admin-nav-sticky, .admin-nav").stick_in_parent();
8
+ };
9
+
10
+ var detachStickyNavbar = function() {
11
+ $(".admin-nav-sticky, .admin-nav").trigger("sticky_kit:detach");
8
12
  };
9
13
 
10
- $(".admin-nav-sticky, .admin-nav").stick_in_parent();
14
+ var checkSideBarFit = function() {
15
+ var fits = navHeight() < $(window).height();
16
+
17
+ $('.admin-nav').toggleClass('fits', fits);
18
+
19
+ fits ? initStickyNavbar() : detachStickyNavbar();
20
+ };
11
21
 
12
22
  checkSideBarFit();
13
23
  $(window).on('resize', checkSideBarFit);
@@ -53,7 +53,7 @@ adjustShipmentItems = function(shipment_number, variant_id, quantity){
53
53
  json = response.responseJSON;
54
54
  message = json.error;
55
55
  for (error in json.errors) {
56
- message += '<br />' + json.errors[error].join();
56
+ message += '<br>' + json.errors[error].join();
57
57
  }
58
58
  window.show_flash('error', message);
59
59
  }
@@ -9,7 +9,7 @@
9
9
  <td class="line-item-name">
10
10
  {{ line_item.variant.name }}<br>
11
11
  {{#if line_item.variant.options_text }}
12
- {{ line_item.variant.options_text }}<br/>
12
+ {{ line_item.variant.options_text }}<br>
13
13
  {{/if}}
14
14
  <strong>{{ t "sku" }}:</strong> {{ line_item.variant.sku }}
15
15
  </td>
@@ -1,8 +1,8 @@
1
1
  <fieldset>
2
2
  <table class="stock-levels" data-hook="stock-levels">
3
3
  <colgroup>
4
- <col style="width: 50%;" />
5
- <col style="width: 50%;" />
4
+ <col style="width: 50%;">
5
+ <col style="width: 50%;">
6
6
  </colgroup>
7
7
  <thead>
8
8
  <th>{{ t "name" }}</th>
@@ -10,6 +10,10 @@ module Spree
10
10
  rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
11
11
  respond_to :html
12
12
 
13
+ def show
14
+ redirect_to action: :edit
15
+ end
16
+
13
17
  def index
14
18
  params[:q] ||= {}
15
19
  params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
@@ -11,6 +11,8 @@ module Spree
11
11
  before_action :load_data
12
12
  before_action :require_bill_address, only: [:index]
13
13
 
14
+ helper ::Spree::Admin::OrdersHelper
15
+
14
16
  respond_to :html
15
17
 
16
18
  def index
@@ -82,7 +82,9 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
82
82
  records = model_class.where(id: positions.keys).to_a
83
83
 
84
84
  positions.each do |id, index|
85
- records.find { |r| r.id == id.to_i }&.set_list_position(index)
85
+ # To permit the use of UUID as id, we compare models id in database
86
+ # and in params under the string representation instead of integer
87
+ records.find { |r| r.id.to_s == id }&.set_list_position(index)
86
88
  end
87
89
  end
88
90
 
@@ -27,7 +27,7 @@ module Spree
27
27
  parts << variant.product.name
28
28
  parts << "(#{variant.options_text})" if variant.options_text.present?
29
29
  parts << line_item.display_amount
30
- safe_join(parts, "<br />".html_safe)
30
+ safe_join(parts, "<br>".html_safe)
31
31
  end
32
32
 
33
33
  def display_shipment(shipment)
@@ -35,7 +35,7 @@ module Spree
35
35
  "#{t('spree.shipment')} ##{shipment.number}",
36
36
  shipment.display_cost
37
37
  ]
38
- safe_join(parts, "<br />".html_safe)
38
+ safe_join(parts, "<br>".html_safe)
39
39
  end
40
40
 
41
41
  def display_order(_order)
@@ -17,7 +17,7 @@ module Spree
17
17
  obj = object.respond_to?(:errors) ? object : instance_variable_get("@#{object}")
18
18
 
19
19
  if obj && obj.errors[method].present?
20
- errors = safe_join(obj.errors[method], "<br />".html_safe)
20
+ errors = safe_join(obj.errors[method], "<br>".html_safe)
21
21
  content_tag(:span, errors, class: 'formError')
22
22
  else
23
23
  ''
@@ -4,10 +4,13 @@ module Spree
4
4
  module Admin
5
5
  module OrdersHelper
6
6
  # Renders all the extension partials that may have been specified in the extensions
7
+ #
8
+ # @return [ActiveSupport::SafeBuffer] the string returned is already html-safe
7
9
  def event_links
8
10
  links = []
9
11
  @order_events.sort.each do |event|
10
12
  next unless @order.send("can_#{event}?")
13
+
11
14
  translated_event = t(event, scope: [:spree, :admin, :order, :events])
12
15
  links << button_to(
13
16
  translated_event,
@@ -19,10 +22,18 @@ module Spree
19
22
  safe_join(links, "&nbsp;".html_safe)
20
23
  end
21
24
 
25
+ # @deprecated use `Spree::LineItem#display_amount` instead
22
26
  def line_item_shipment_price(line_item, quantity)
23
27
  Spree::Money.new(line_item.price * quantity, { currency: line_item.currency })
24
28
  end
29
+ deprecate deprecator: Spree::Deprecation,
30
+ line_item_shipment_price: "use Spree::LineItem#display_amount instead"
25
31
 
32
+ # Addresss Verification System response code
33
+ #
34
+ # @see https://en.wikipedia.org/wiki/Address_verification_service
35
+ #
36
+ # @return [Hash] codes as keys, descriptions as values
26
37
  def avs_response_code
27
38
  {
28
39
  "A" => "Street address matches, but 5-digit and 9-digit postal code do not match.",
@@ -54,6 +65,13 @@ module Spree
54
65
  }
55
66
  end
56
67
 
68
+ # Addresss Verification System response code
69
+ #
70
+ # @see https://developer.visa.com/request_response_codes#card_verification2_results
71
+ # @see https://developer.paypal.com/api/nvp-soap/AVSResponseCodes/#cvv2-error-response-codes
72
+ # @see https://www.checkout.com/docs/resources/codes/cvv-response-codes
73
+ #
74
+ # @return [Hash] codes as keys, descriptions as values
57
75
  def cvv_response_code
58
76
  {
59
77
  "M" => "CVV2 Match",
@@ -23,7 +23,7 @@ module Spree
23
23
  variant = stock_movement.stock_item.variant
24
24
  output = [variant.name]
25
25
  output << variant.options_text unless variant.options_text.blank?
26
- safe_join(output, "<br />".html_safe)
26
+ safe_join(output, "<br>".html_safe)
27
27
  end
28
28
  end
29
29
  end
@@ -17,9 +17,9 @@
17
17
  <% if @adjustment_reasons.any? %>
18
18
  <table class="index" id='listing_adjustment_reasons'>
19
19
  <colgroup>
20
- <col style="width: 65%" />
21
- <col style="width: 20%" />
22
- <col style="width: 15%" />
20
+ <col style="width: 65%">
21
+ <col style="width: 20%">
22
+ <col style="width: 15%">
23
23
  </colgroup>
24
24
  <thead>
25
25
  <tr data-hook="adjustment_reasons_header">
@@ -1,12 +1,12 @@
1
1
  <div data-hook="admin_adjustment_reason_form_fields" class="row">
2
2
  <div class="col-3">
3
3
  <%= f.field_container :name do %>
4
- <%= f.label :name, class: 'required' %><br />
4
+ <%= f.label :name, class: 'required' %><br>
5
5
  <%= f.text_field :name, class: 'fullwidth' %>
6
6
  <% end %>
7
7
 
8
8
  <%= f.field_container :code do %>
9
- <%= f.label :code, class: 'required' %><br />
9
+ <%= f.label :code, class: 'required' %><br>
10
10
  <%= f.text_field :code, class: 'fullwidth' %>
11
11
  <% end %>
12
12
 
@@ -19,7 +19,7 @@
19
19
 
20
20
  <div class="col-3">
21
21
  <%= f.field_container :label do %>
22
- <%= f.label :adjustment_reason_id %><br/>
22
+ <%= f.label :adjustment_reason_id %><br>
23
23
  <%= f.collection_select(:adjustment_reason_id, reasons_for(@adjustment), :id, :name, {include_blank: true}, {"data-placeholder" => t('spree.select_a_reason'), class: 'custom-select fullwidth'}) %>
24
24
  <% end %>
25
25
  </div>
@@ -18,6 +18,6 @@
18
18
  <%= button_tag t('spree.add_coupon_code'), id: "add_coupon_code", class: 'btn btn-primary' %>
19
19
  </div>
20
20
  <% end %>
21
- <%= javascript_tag do -%>
21
+ <script>
22
22
  var order_number = '<%= @order.number %>';
23
- <% end -%>
23
+ </script>
@@ -3,7 +3,6 @@
3
3
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Adjustment), spree.admin_order_adjustments_path(@order)) %>
4
4
  <% admin_breadcrumb(t('spree.new_adjustment')) %>
5
5
 
6
-
7
6
  <% content_for :page_actions do %>
8
7
  <% end %>
9
8
 
@@ -4,12 +4,12 @@
4
4
 
5
5
  <table class="stock-contents index">
6
6
  <colgroup>
7
- <col style="width: 10%;" />
8
- <col style="width: 35%;" />
9
- <col style="width: 10%;" />
10
- <col style="width: 15%;" />
11
- <col style="width: 20%;" />
12
- <col style="width: 10%;" />
7
+ <col style="width: 10%;">
8
+ <col style="width: 35%;">
9
+ <col style="width: 10%;">
10
+ <col style="width: 15%;">
11
+ <col style="width: 20%;">
12
+ <col style="width: 10%;">
13
13
  </colgroup>
14
14
 
15
15
  <thead>
@@ -8,7 +8,7 @@
8
8
  <th class="wrap-text"><%= Spree::ReturnItem.human_attribute_name(:exchange_variant) %></th>
9
9
  <th class="wrap-text"><%= Spree::ReturnItem.human_attribute_name(:acceptance_status_errors) %></th>
10
10
  <th class="wrap-text"><%= Spree::ReturnItem.human_attribute_name(:reception_status) %></th>
11
- <% unless return_items.all?(&:received?)%>
11
+ <% unless return_items.all?(&:received?) %>
12
12
  <th class="wrap-text"><%= Spree::ReturnItem.human_attribute_name(:item_received?) %></th>
13
13
  <% end %>
14
14
  <% if show_decision %>
@@ -3,7 +3,6 @@
3
3
  <% admin_breadcrumb(link_to plural_resource_name(Spree::CustomerReturn), spree.admin_order_customer_returns_url(@order)) %>
4
4
  <% admin_breadcrumb(t('spree.new_customer_return')) %>
5
5
 
6
-
7
6
  <% content_for :page_actions do %>
8
7
  <% end %>
9
8
 
@@ -1,5 +1,4 @@
1
1
  <tr id="<%= spree_dom_id image %>" data-hook="images_row">
2
-
3
2
  <td>
4
3
  <% if can?(:update_positions, Spree::Image) %>
5
4
  <span class="handle"></span>
@@ -28,7 +27,7 @@
28
27
  <%= f.select :viewable_id, options_for_select(@variants, image.viewable_id), {}, class: 'select2 fullwidth', autocomplete: "off" %>
29
28
  <% end %>
30
29
  </td>
31
- <% end # @product.has_variants? %>
30
+ <% end %>
32
31
 
33
32
  <td>
34
33
  <%= fields_for image do |f| %>
@@ -5,7 +5,6 @@
5
5
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Image), admin_product_images_path(@product)) %>
6
6
  <% admin_breadcrumb(@image.filename) %>
7
7
 
8
-
9
8
  <% content_for :page_actions do %>
10
9
  <li><%= link_to t('spree.back_to_images_list'), admin_product_images_url(@product), class: 'btn btn-primary' %></li>
11
10
  <% end %>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <% admin_breadcrumb(plural_resource_name(Spree::Image)) %>
4
4
 
5
-
6
5
  <% content_for :page_actions do %>
7
6
  <% if can?(:create, Spree::Image) %>
8
7
  <li>
@@ -1,7 +1,7 @@
1
1
  <div data-hook="admin_option_type_form_fields" class="align-center row">
2
2
  <div class="col-6">
3
3
  <%= f.field_container :name do %>
4
- <%= f.label :name, class: 'required' %><br />
4
+ <%= f.label :name, class: 'required' %><br>
5
5
  <%= f.text_field :name, class: "fullwidth" %>
6
6
  <%= f.error_message_on :name %>
7
7
  <% end %>
@@ -9,7 +9,7 @@
9
9
 
10
10
  <div class="col-6">
11
11
  <%= f.field_container :presentation do %>
12
- <%= f.label :presentation, class: 'required' %><br />
12
+ <%= f.label :presentation, class: 'required' %><br>
13
13
  <%= f.text_field :presentation, class: "fullwidth" %>
14
14
  <%= f.error_message_on :presentation %>
15
15
  <% end %>
@@ -1,4 +1,4 @@
1
- <tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value">
1
+ <tr class="option_value fields" id="spree_<%= dom_id(f.object) %>" data-hook="option_value">
2
2
  <td>
3
3
  <% if f.object.persisted? %>
4
4
  <span class="handle"></span>
@@ -2,7 +2,6 @@
2
2
  <% admin_breadcrumb(link_to plural_resource_name(Spree::OptionType), spree.admin_option_types_path) %>
3
3
  <% admin_breadcrumb(@option_type.name) %>
4
4
 
5
-
6
5
  <% content_for :page_actions do %>
7
6
  <li>
8
7
  <span id="new_add_option_value" data-hook>
@@ -1,7 +1,6 @@
1
1
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Product), spree.admin_products_path) %>
2
2
  <% admin_breadcrumb(plural_resource_name(Spree::OptionType)) %>
3
3
 
4
-
5
4
  <% content_for :page_actions do %>
6
5
  <% if can?(:create, Spree::OptionType) %>
7
6
  <li id="new_ot_link">
@@ -3,8 +3,8 @@
3
3
  <table>
4
4
  <thead>
5
5
  <tr>
6
- <th><%= Spree::Adjustment.human_attribute_name(:name)%></th>
7
- <th><%= Spree::Adjustment.human_attribute_name(:amount)%></th>
6
+ <th><%= Spree::Adjustment.human_attribute_name(:name) %></th>
7
+ <th><%= Spree::Adjustment.human_attribute_name(:amount) %></th>
8
8
  </tr>
9
9
  </thead>
10
10
  <tbody data-hook="order_details_adjustments">
@@ -12,11 +12,11 @@
12
12
 
13
13
  <table class="stock-contents carton index" data-hook="stock-contents">
14
14
  <colgroup>
15
- <col style="width: 10%;" />
16
- <col style="width: 45%;" />
17
- <col style="width: 15%;" />
18
- <col style="width: 15%;" />
19
- <col style="width: 15%;" />
15
+ <col style="width: 10%;">
16
+ <col style="width: 45%;">
17
+ <col style="width: 15%;">
18
+ <col style="width: 15%;">
19
+ <col style="width: 15%;">
20
20
  </colgroup>
21
21
 
22
22
  <thead>
@@ -18,6 +18,6 @@
18
18
  <%= count %> x <%= t(state, scope: 'spree.inventory_states') %>
19
19
  <% end %>
20
20
  </td>
21
- <td class="item-total"><%= line_item_shipment_price(item.line_item, item.quantity) %></td>
21
+ <td class="item-total"><%= item.line_item.display_amount %></td>
22
22
  </tr>
23
23
  <% end %>
@@ -8,12 +8,12 @@
8
8
 
9
9
  <%= render "spree/admin/orders/order_details", { order: order } %>
10
10
 
11
- <%= javascript_tag do -%>
11
+ <script>
12
12
  var order_number = '<%= @order.number %>';
13
13
  var shipments = [];
14
14
 
15
15
  <% @order.shipments.each do |shipment| %>
16
16
  shipments.push(<%== shipment.as_json(root: false, only: [:id, :tracking, :number, :state, :stock_location_id], include: [:inventory_units, :stock_location]).to_json %>);
17
17
  <% end %>
18
- <% end -%>
18
+ </script>
19
19
  </div>
@@ -1,11 +1,11 @@
1
1
  <table class="line-items index" data-hook="line-items">
2
2
  <colgroup>
3
- <col style="width: 10%;" />
4
- <col style="width: 45%;" />
5
- <col style="width: 10%;" />
6
- <col style="width: 10%;" />
7
- <col style="width: 10%;" />
8
- <col style="width: 15%;" />
3
+ <col style="width: 10%;">
4
+ <col style="width: 45%;">
5
+ <col style="width: 10%;">
6
+ <col style="width: 10%;">
7
+ <col style="width: 10%;">
8
+ <col style="width: 15%;">
9
9
  </colgroup>
10
10
 
11
11
  <thead>
@@ -1,50 +1,26 @@
1
- <fieldset class="no-border-bottom" id="risk_analysis">
2
- <legend><%= "#{t('spree.risk_analysis')}: #{t('spree.not') unless @order.is_risky?} #{t('spree.risky')}" %></legend>
1
+ <details id="risk_analysis">
2
+ <summary><%= t('spree.risk_analysis') %>: <%= t('spree.risky') %></summary>
3
+
3
4
  <table>
4
5
  <thead>
5
- <th><%= t('spree.risk')%></th>
6
- <th><%= t('spree.status')%></th>
6
+ <th><%= t('spree.payment') %></th>
7
+ <th><%= t('spree.risk') %></th>
8
+ <th><%= t('spree.status') %></th>
7
9
  </thead>
8
10
  <tbody id="risk-analysis" data-hook="order_details_adjustments" class="with-border">
9
- <tr class="">
10
- <td><strong>
11
- <%= t('spree.failed_payment_attempts') %>:
12
- </strong></td>
13
- <td>
14
- <span class="pill pill-<%= @order.payments.failed.count > 0 ? 'warning' : 'complete' %>">
15
- <%= t(
16
- 'spree.payments_failed_count',
17
- count: @order.payments.failed.count
18
- ) %>
19
- </span>
20
- </td>
21
- </tr>
22
-
23
- <tr>
24
- <td><strong><%= t('spree.avs_response') %>:</strong></td>
25
- <td>
26
- <span class="pill pill-<%= latest_payment.is_avs_risky? ? 'warning' : 'complete' %>">
27
- <% if latest_payment.is_avs_risky? %>
28
- <%= avs_response_code[latest_payment.avs_response] %>
29
- <% else %>
30
- <%= t('spree.success') %>
31
- <% end %>
32
- </span>
33
- </td>
34
- </tr>
35
-
36
- <tr>
37
- <td><strong><%= t('spree.cvv_response') %>:</strong></td>
38
- <td>
39
- <span class="pill pill-<%= latest_payment.is_cvv_risky? ? 'warning' : 'complete' %>">
40
- <% if latest_payment.is_cvv_risky? %>
41
- <%= cvv_response_code[latest_payment.cvv_response_code] %>
42
- <% else %>
43
- <%= t('spree.success') %>
44
- <% end %>
45
- </span>
46
- </td>
47
- </tr>
11
+ <% order.payments.risky.each do |payment| %>
12
+ <tr class="">
13
+ <td><%= link_to payment.number, admin_order_payment_path(order, payment) %></td>
14
+ <td>
15
+ <span class="pill pill-warning"><%= t('spree.risky') %></span>
16
+ </td>
17
+ <td>
18
+ <span class="pill pill-<%= payment.state %>">
19
+ <%= t(payment.state, scope: 'spree.payment_states') %>
20
+ </span>
21
+ </td>
22
+ </tr>
23
+ <% end %>
48
24
  </tbody>
49
25
  </table>
50
- </fieldset>
26
+ </details>
@@ -27,12 +27,12 @@
27
27
 
28
28
  <table class="stock-contents shipment index" data-hook="stock-contents">
29
29
  <colgroup>
30
- <col style="width: 17.5%;" />
31
- <col style="width: 30%;" />
32
- <col style="width: 12.5%;" />
33
- <col style="width: 15%;" />
34
- <col style="width: 15%;" />
35
- <col style="width: 10%;" />
30
+ <col style="width: 17.5%;">
31
+ <col style="width: 30%;">
32
+ <col style="width: 12.5%;">
33
+ <col style="width: 15%;">
34
+ <col style="width: 15%;">
35
+ <col style="width: 10%;">
36
36
  </colgroup>
37
37
 
38
38
  <thead>
@@ -20,7 +20,7 @@
20
20
  <%= count %> x <%= t(state, scope: 'spree.inventory_states') %>
21
21
  <% end %>
22
22
  </td>
23
- <td class="item-total"><%= line_item_shipment_price(item.line_item, item.quantity) %></td>
23
+ <td class="item-total"><%= item.line_item.display_amount %></td>
24
24
 
25
25
  <td class="cart-item-delete actions" data-hook="cart_item_delete">
26
26
  <% if can? :update, item %>
@@ -11,13 +11,12 @@
11
11
 
12
12
  <% admin_breadcrumb(t('spree.cart')) %>
13
13
 
14
-
15
14
  <div data-hook="admin_order_edit_header">
16
15
  <%= render partial: 'spree/shared/error_messages', locals: { target: @order } %>
17
16
  </div>
18
17
 
19
- <% if @order.payments.exists? && @order.is_risky? %>
20
- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.reorder("created_at DESC").first %>
18
+ <% if @order.is_risky? %>
19
+ <%= render 'spree/admin/orders/risk_analysis', order: @order %>
21
20
  <% end %>
22
21
 
23
22
  <div data-hook="admin_order_edit_form">
@@ -1,6 +1,6 @@
1
1
  <fieldset class="no-border-bottom" data-hook="customer_details_total">
2
2
  <legend><%= t('spree.customer') %></legend>
3
- <div class="customer"><%= order.user.try(:email) %></div><br/>
3
+ <div class="customer"><%= order.user.try(:email) %></div><br>
4
4
  </fieldset>
5
5
 
6
6
  <fieldset class="no-border-bottom no-border-top">
@@ -25,7 +25,7 @@
25
25
  <%= item.quantity %>
26
26
  </td>
27
27
  <td class="line-item-total">
28
- <%= line_item_shipment_price(item, item.quantity) %>
28
+ <%= item.display_amount %>
29
29
  </td>
30
30
  </tr>
31
31
  <% end %>
@@ -17,6 +17,6 @@
17
17
  <%= count %> x <%= t(state, scope: 'spree.inventory_states') %>
18
18
  <% end %>
19
19
  </td>
20
- <td class="item-total"><%= line_item_shipment_price(item.line_item, item.quantity) %></td>
20
+ <td class="item-total"><%= item.line_item.display_amount %></td>
21
21
  </tr>
22
22
  <% end %>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <% admin_breadcrumb(t('spree.confirm_order')) %>
4
4
 
5
-
6
5
  <%= render partial: 'spree/admin/orders/confirm/customer_details', locals: {order: @order} %>
7
6
 
8
7
  <% if Spree::Order.checkout_step_names.include?(:delivery) %>
@@ -2,9 +2,8 @@
2
2
 
3
3
  <% admin_breadcrumb(t('spree.confirm_order')) %>
4
4
 
5
-
6
5
  <div class="form-buttons filter-actions actions" data-hook="complete-order-button">
7
- <div><%= t('spree.order_please_refresh') %></div><br/>
6
+ <div><%= t('spree.order_please_refresh') %></div><br>
8
7
  <%= button_to [:advance, :admin, @order], { class: 'button', method: 'put' } do %>
9
8
  <%= t('spree.order_refresh_totals') %>
10
9
  <% end %>
@@ -2,7 +2,6 @@
2
2
 
3
3
  <% admin_breadcrumb(t('spree.customer_details')) %>
4
4
 
5
-
6
5
  <% content_for :page_actions do %>
7
6
  <% end %>
8
7