solidus_backend 2.8.6 → 2.9.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of solidus_backend might be problematic. Click here for more details.

Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/components/sortable_table.js +1 -0
  3. data/app/assets/javascripts/spree/backend/components/tabs.js +1 -0
  4. data/app/assets/javascripts/spree/backend/shipments.js +1 -0
  5. data/app/assets/javascripts/spree/backend/stock_management.js +9 -0
  6. data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +1 -1
  7. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +24 -16
  8. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +12 -0
  9. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +18 -0
  10. data/app/assets/stylesheets/spree/backend/components/_image_placeholder.scss +2 -2
  11. data/app/assets/stylesheets/spree/backend/components/_list_group.scss +2 -2
  12. data/app/assets/stylesheets/spree/backend/components/_messages.scss +20 -12
  13. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +46 -10
  14. data/app/assets/stylesheets/spree/backend/components/_progress.scss +3 -3
  15. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +1 -2
  16. data/app/assets/stylesheets/spree/backend/components/_tabs.scss +6 -5
  17. data/app/assets/stylesheets/spree/backend/globals/_deprecated_variables.scss +24 -0
  18. data/app/assets/stylesheets/spree/backend/globals/_deprecation.scss +10 -1
  19. data/app/assets/stylesheets/spree/backend/globals/_variables.scss +62 -39
  20. data/app/assets/stylesheets/spree/backend/globals/_variables_override.scss +1 -0
  21. data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +1 -1
  22. data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +1 -1
  23. data/app/assets/stylesheets/spree/backend/sections/_log_entries.scss +8 -2
  24. data/app/assets/stylesheets/spree/backend/sections/_orders.scss +17 -6
  25. data/app/assets/stylesheets/spree/backend/sections/_products.scss +3 -1
  26. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +5 -5
  27. data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +4 -4
  28. data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +1 -1
  29. data/app/assets/stylesheets/spree/backend/shared/_fonts.scss +15 -0
  30. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +27 -7
  31. data/app/assets/stylesheets/spree/backend/shared/_header.scss +3 -2
  32. data/app/assets/stylesheets/spree/backend/shared/_icons.scss +5 -1
  33. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -4
  34. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +9 -4
  35. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +10 -6
  36. data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -0
  37. data/app/controllers/spree/admin/customer_returns_controller.rb +8 -1
  38. data/app/controllers/spree/admin/log_entries_controller.rb +3 -0
  39. data/app/controllers/spree/admin/orders_controller.rb +0 -1
  40. data/app/controllers/spree/admin/users_controller.rb +4 -2
  41. data/app/helpers/spree/admin/base_helper.rb +9 -3
  42. data/app/helpers/spree/admin/promotions_helper.rb +15 -0
  43. data/app/views/spree/admin/images/index.html.erb +1 -1
  44. data/app/views/spree/admin/log_entries/index.html.erb +1 -19
  45. data/app/views/spree/admin/option_types/edit.html.erb +1 -1
  46. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -1
  47. data/app/views/spree/admin/payments/_capture_events.html.erb +15 -18
  48. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  49. data/app/views/spree/admin/payments/_log_entries.html.erb +29 -0
  50. data/app/views/spree/admin/payments/show.html.erb +13 -6
  51. data/app/views/spree/admin/payments/source_forms/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  52. data/app/views/spree/admin/payments/source_views/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  53. data/app/views/spree/admin/prices/_form.html.erb +1 -1
  54. data/app/views/spree/admin/products/_form.html.erb +16 -5
  55. data/app/views/spree/admin/products/edit.html.erb +1 -1
  56. data/app/views/spree/admin/promotions/_form.html.erb +2 -2
  57. data/app/views/spree/admin/promotions/index.html.erb +4 -4
  58. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  59. data/app/views/spree/admin/shared/_head.html.erb +0 -3
  60. data/app/views/spree/admin/shared/_modal.html.erb +1 -1
  61. data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -10
  62. data/app/views/spree/admin/stock_items/_stock_management.html.erb +1 -1
  63. data/app/views/spree/admin/store_credits/edit_validity.html.erb +1 -1
  64. data/app/views/spree/admin/store_credits/index.html.erb +1 -1
  65. data/app/views/spree/admin/store_credits/show.html.erb +1 -1
  66. data/app/views/spree/admin/stores/_form.html.erb +1 -0
  67. data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +30 -20
  68. data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +1 -1
  69. data/app/views/spree/admin/taxonomies/edit.html.erb +1 -1
  70. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  71. data/app/views/spree/admin/taxons/edit.html.erb +2 -2
  72. data/app/views/spree/admin/users/edit.html.erb +2 -2
  73. data/app/views/spree/admin/users/index.html.erb +2 -2
  74. data/app/views/spree/admin/variants/_form.html.erb +1 -1
  75. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  76. data/spec/controllers/spree/admin/locale_controller_spec.rb +45 -0
  77. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +3 -3
  78. data/spec/controllers/spree/admin/orders_controller_spec.rb +2 -2
  79. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
  80. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  81. data/spec/features/admin/orders/customer_details_spec.rb +5 -7
  82. data/spec/features/admin/orders/customer_returns_spec.rb +28 -0
  83. data/spec/features/admin/orders/listing_spec.rb +1 -6
  84. data/spec/features/admin/orders/log_entries_spec.rb +2 -2
  85. data/spec/features/admin/orders/new_order_spec.rb +3 -3
  86. data/spec/features/admin/orders/order_details_spec.rb +8 -3
  87. data/spec/features/admin/orders/payments_spec.rb +80 -39
  88. data/spec/features/admin/products/edit/products_spec.rb +25 -0
  89. data/spec/features/admin/products/edit/taxons_spec.rb +2 -8
  90. data/spec/features/admin/products/pricing_spec.rb +24 -6
  91. data/spec/features/admin/products/products_spec.rb +4 -4
  92. data/spec/features/admin/products/variant_spec.rb +1 -1
  93. data/spec/features/admin/promotions/promotion_spec.rb +52 -0
  94. data/spec/features/admin/store_credits_spec.rb +3 -3
  95. data/spec/features/admin/users_spec.rb +22 -0
  96. data/spec/spec_helper.rb +1 -2
  97. data/spec/support/appear_before_matcher.rb +1 -1
  98. data/spec/teaspoon_env.rb +23 -8
  99. data/vendor/assets/fonts/inter/Inter-Regular.woff +0 -0
  100. data/vendor/assets/fonts/inter/Inter-Regular.woff2 +0 -0
  101. data/vendor/assets/fonts/inter/Inter-SemiBold.woff +0 -0
  102. data/vendor/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
  103. data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +4 -0
  104. metadata +22 -10
  105. data/.eslintrc +0 -21
@@ -2,8 +2,9 @@
2
2
  display: flex;
3
3
  align-items: center;
4
4
  padding: 15px $grid-gutter-width;
5
- background-color: very-light($color-3, 4);
5
+ background-color: $color-header-bg;
6
6
  border-bottom: 1px solid $color-border;
7
+ border-top: 4px solid $color-primary;
7
8
  height: $main-header-height;
8
9
 
9
10
  @media print { display: none }
@@ -17,7 +18,7 @@
17
18
  -moz-osx-font-smoothing: grayscale;
18
19
 
19
20
  i {
20
- color: $color-2;
21
+ color: $color-primary;
21
22
  }
22
23
  }
23
24
 
@@ -14,6 +14,10 @@
14
14
  }
15
15
  }
16
16
 
17
+ .btn.fa {
18
+ font: normal normal $btn-font-weight #{$font-size-base}/#{$btn-line-height} "FontAwesome";
19
+ }
20
+
17
21
  .fa-email { @extend .fa-envelope }
18
22
  .fa-resume { @extend .fa-refresh }
19
23
  .fa-approve { @extend .fa-check }
@@ -26,7 +30,7 @@
26
30
 
27
31
  .fa-trash { @extend .fa-trash-o }
28
32
 
29
- .fa-capture { @extend .fa-check }
33
+ .fa-capture { @extend .fa-thumbs-up }
30
34
  .fa-credit { @extend .fa-check }
31
35
  .fa-approve { @extend .fa-check }
32
36
  .fa-icon-cogs { @extend .fa-cogs }
@@ -8,6 +8,10 @@ body {
8
8
  padding-left: $width-sidebar;
9
9
  }
10
10
 
11
+ .admin {
12
+ background-color: $admin-body-bg;
13
+ }
14
+
11
15
  .admin-nav {
12
16
  position: absolute;
13
17
  top: 0;
@@ -18,6 +22,7 @@ body {
18
22
  }
19
23
 
20
24
  .content-wrapper {
25
+ background-color: $content-wrapper-bg;
21
26
  padding-top: 1rem;
22
27
  padding-left: $grid-gutter-width;
23
28
  padding-right: $grid-gutter-width;
@@ -29,10 +34,6 @@ body {
29
34
  }
30
35
  }
31
36
 
32
- .content-main {
33
- overflow-x: hidden; // makes sure that the tabs are able to resize
34
- }
35
-
36
37
  #content {
37
38
  position: relative;
38
39
  padding: 0;
@@ -47,12 +47,12 @@ table {
47
47
 
48
48
  button[class*='fa-'] {
49
49
  color: $link-color;
50
- background-color: transparent;
50
+ background: transparent;
51
51
  border: 0 none;
52
52
  padding: 0 !important;
53
53
 
54
54
  &:hover {
55
- background-color: transparent;
55
+ background: transparent;
56
56
  }
57
57
  }
58
58
 
@@ -61,7 +61,7 @@ table {
61
61
  padding-left: 0px;
62
62
 
63
63
  &:hover {
64
- color: $color-3;
64
+ color: $color-dark-light;
65
65
  }
66
66
  }
67
67
 
@@ -108,7 +108,7 @@ table {
108
108
  }
109
109
 
110
110
  th a {
111
- color: $color-4;
111
+ color: $color-dark;
112
112
  }
113
113
 
114
114
  tbody {
@@ -123,4 +123,9 @@ table {
123
123
  border-top: none;
124
124
  }
125
125
  }
126
+
127
+ pre {
128
+ font-size: 100%;
129
+ margin-bottom: 0;
130
+ }
126
131
  }
@@ -7,7 +7,7 @@ html {
7
7
 
8
8
  body {
9
9
  padding: 0;
10
- font-weight: 400;
10
+ font-weight: $font-weight-normal;
11
11
  text-rendering: optimizeLegibility;
12
12
  }
13
13
 
@@ -17,6 +17,11 @@ hr {
17
17
  border-left: none;
18
18
  }
19
19
 
20
+ strong,
21
+ b {
22
+ font-weight: $font-weight-bold;
23
+ }
24
+
20
25
  // Headings
21
26
  //--------------------------------------------------------------
22
27
 
@@ -68,7 +73,6 @@ dl {
68
73
  width: 40%;
69
74
  font-weight: $font-weight-bold;
70
75
  padding-left: 0;
71
- font-size: 85%;
72
76
  clear: left;
73
77
  }
74
78
 
@@ -93,10 +97,10 @@ dl {
93
97
 
94
98
  .uppercase { text-transform: uppercase }
95
99
 
96
- .green { color: $color-2 }
97
- .blue { color: $color-3 }
98
- .red { color: $color-5 }
99
- .yellow { color: $color-6 }
100
+ .green { color: $color-green }
101
+ .blue { color: $color-primary }
102
+ .red { color: $color-red }
103
+ .yellow { color: $color-yellow }
100
104
 
101
105
  .negative { color: $red }
102
106
  input[type="number"].negative { color: $red } // needed to override blue style that is more specific than '.negative'
@@ -2,12 +2,14 @@
2
2
  @import 'spree/backend/globals/deprecation';
3
3
  @import 'spree/backend/globals/variables_override';
4
4
  @import 'spree/backend/globals/variables';
5
+ @import 'spree/backend/globals/deprecated_variables';
5
6
 
6
7
  @import 'bootstrap_custom';
7
8
  @import 'solidus_admin/bootstrap/bootstrap';
8
9
 
9
10
  @import 'spree/backend/globals/mixins';
10
11
 
12
+ @import 'spree/backend/shared/fonts';
11
13
  @import 'spree/backend/shared/typography';
12
14
  @import 'spree/backend/shared/images';
13
15
  @import 'spree/backend/shared/tables';
@@ -20,6 +22,7 @@
20
22
  @import 'spree/backend/components/states';
21
23
  @import 'spree/backend/components/actions';
22
24
  @import 'spree/backend/components/breadcrumb';
25
+ @import 'spree/backend/components/buttons';
23
26
  @import 'spree/backend/components/number_with_currency';
24
27
  @import 'spree/backend/components/hint';
25
28
  @import 'spree/backend/components/image_placeholder';
@@ -10,6 +10,7 @@ module Spree
10
10
  before_action :load_form_data, only: [:new, :edit]
11
11
  before_action :build_return_items_from_params, only: [:create]
12
12
  create.fails :load_form_data
13
+ create.after :order_process_return
13
14
 
14
15
  def edit
15
16
  @pending_return_items = @customer_return.return_items.select(&:pending?)
@@ -23,6 +24,10 @@ module Spree
23
24
 
24
25
  private
25
26
 
27
+ def order_process_return
28
+ @customer_return.process_return!
29
+ end
30
+
26
31
  def location_after_save
27
32
  url_for([:edit, :admin, @order, @customer_return])
28
33
  end
@@ -60,11 +65,13 @@ module Spree
60
65
 
61
66
  def build_return_items_from_params
62
67
  return_items_params = permitted_resource_params.delete(:return_items_attributes).values
63
-
64
68
  @customer_return.return_items = return_items_params.map do |item_params|
65
69
  next unless item_params.delete('returned') == '1'
66
70
  return_item = item_params[:id] ? Spree::ReturnItem.find(item_params[:id]) : Spree::ReturnItem.new
67
71
  return_item.assign_attributes(item_params)
72
+
73
+ return_item.skip_customer_return_processing = true
74
+
68
75
  if item_params[:reception_status_event].blank?
69
76
  return redirect_to(new_object_url, flash: { error: 'Reception status choice required' })
70
77
  end
@@ -6,6 +6,9 @@ module Spree
6
6
  before_action :find_order_and_payment
7
7
 
8
8
  def index
9
+ Spree::Deprecation.warn 'Using a dedicated route for payment log entries ' \
10
+ 'has been deprecated in favor of displaying the log entries on ' \
11
+ 'the payment screen itself.', caller_locations(0)
9
12
  @log_entries = @payment.log_entries
10
13
  end
11
14
 
@@ -14,7 +14,6 @@ module Spree
14
14
  respond_to :html
15
15
 
16
16
  def index
17
- query_present = params[:q]
18
17
  params[:q] ||= {}
19
18
  params[:q][:completed_at_not_null] ||= '1' if Spree::Config[:show_only_complete_orders_by_default]
20
19
  @show_only_completed = params[:q][:completed_at_not_null] == '1'
@@ -71,24 +71,26 @@ module Spree
71
71
 
72
72
  def items
73
73
  params[:q] ||= {}
74
+
74
75
  @search = Spree::Order.includes(
75
76
  line_items: {
76
77
  variant: [:product, { option_values: :option_type }]
77
78
  }
78
79
  ).ransack(params[:q].merge(user_id_eq: @user.id))
80
+
79
81
  @orders = @search.result.page(params[:page]).per(Spree::Config[:admin_products_per_page])
80
82
  end
81
83
 
82
84
  def generate_api_key
83
85
  if @user.generate_spree_api_key!
84
- flash[:success] = t('spree.api.key_generated')
86
+ flash[:success] = t('spree.admin.api.key_generated')
85
87
  end
86
88
  redirect_to edit_admin_user_path(@user)
87
89
  end
88
90
 
89
91
  def clear_api_key
90
92
  if @user.clear_spree_api_key!
91
- flash[:success] = t('spree.api.key_cleared')
93
+ flash[:success] = t('spree.admin.api.key_cleared')
92
94
  end
93
95
  redirect_to edit_admin_user_path(@user)
94
96
  end
@@ -30,10 +30,16 @@ module Spree
30
30
  end
31
31
  end
32
32
 
33
- def datepicker_field_value(date)
34
- unless date.blank?
35
- l(date, format: t('spree.date_picker.format', default: '%Y/%m/%d'))
33
+ def datepicker_field_value(date, with_time: false)
34
+ return if date.blank?
35
+
36
+ format = if with_time
37
+ t('spree.date_picker.format_with_time', default: '%Y/%m/%d %H:%M')
38
+ else
39
+ t('spree.date_picker.format', default: '%Y/%m/%d')
36
40
  end
41
+
42
+ l(date, format: format)
37
43
  end
38
44
 
39
45
  # @deprecated Render `spree/admin/shared/preference_fields/\#{preference_type}' instead
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spree
4
+ module Admin
5
+ module PromotionsHelper
6
+ def admin_promotion_status(promotion)
7
+ return :active if promotion.active?
8
+ return :not_started if promotion.not_started?
9
+ return :expired if promotion.expired?
10
+
11
+ :inactive
12
+ end
13
+ end
14
+ end
15
+ end
@@ -5,7 +5,7 @@
5
5
 
6
6
  <% content_for :page_actions do %>
7
7
  <% if can?(:create, Spree::Image) %>
8
- <li><%= link_to_with_icon('plus', t('spree.new_image'), new_admin_product_image_url(@product), id: 'new_image_link', class: 'button') %></li>
8
+ <li><%= link_to_with_icon('plus', t('spree.new_image'), new_admin_product_image_url(@product), id: 'new_image_link', class: 'btn btn-primary') %></li>
9
9
  <% end %>
10
10
  <% end %>
11
11
 
@@ -8,22 +8,4 @@
8
8
  <li><%= link_to t('spree.back_to_payment'), spree.admin_order_payment_url(@order, @payment), class: 'btn btn-primary' %></li>
9
9
  <% end %>
10
10
 
11
- <table class='index' id='listing_log_entries'>
12
- <% @log_entries.each do |entry| %>
13
- <thead>
14
- <tr class="log_entry <%= entry.parsed_details.success? ? 'success' : 'fail' %>">
15
- <td colspan='2'>
16
- <h4><i class='fa fa-<%= entry.parsed_details.success? ? 'check' : 'remove' %>'></i> <%= pretty_time(entry.created_at) %></h4>
17
- </td>
18
- </tr>
19
- </thead>
20
- <tbody>
21
- <tr>
22
- <td><%= Spree::LogEntry.human_attribute_name(:details) %></td>
23
- <td>
24
- <pre><%= entry.parsed_details.message %></pre>
25
- </td>
26
- </tr>
27
- </tbody>
28
- <% end %>
29
- </table>
11
+ <%= render 'spree/admin/payments/log_entries', log_entries: @log_entries %>
@@ -6,7 +6,7 @@
6
6
  <% content_for :page_actions do %>
7
7
  <li>
8
8
  <span id="new_add_option_value" data-hook>
9
- <%= link_to_add_fields t('spree.add_option_value'), "tbody#option_values", class: 'button' %>
9
+ <%= link_to_add_fields t('spree.add_option_value'), "tbody#option_values", class: 'btn btn-primary' %>
10
10
  </span>
11
11
  </li>
12
12
  <% end %>
@@ -6,7 +6,7 @@
6
6
  <%= render partial: "spree/admin/orders/line_items", locals: { order: order } %>
7
7
 
8
8
  <% if can?(:update, @order) && can?(:create, Spree::LineItem) %>
9
- <button class="js-add-line-item" disabled><%= t('spree.add_line_item') %></button>
9
+ <button class="js-add-line-item btn btn-primary" disabled><%= t('spree.add_line_item') %></button>
10
10
  <% end %>
11
11
 
12
12
  <%= render "spree/admin/orders/order_details", { order: order } %>
@@ -1,19 +1,16 @@
1
- <% if @payment.capture_events.exists? %>
2
- <h3><%= plural_resource_name(Spree::PaymentCaptureEvent) %></h3>
3
- <table class="index" id="capture_events">
4
- <thead>
5
- <tr data-hook="payments_header">
6
- <th><%= "#{t('spree.date')}/#{t('spree.time')}" %></th>
7
- <th><%= t('spree.amount') %></th>
1
+ <table class="index" id="capture_events">
2
+ <thead>
3
+ <tr data-hook="payments_header">
4
+ <th><%= Spree::PaymentCaptureEvent.human_attribute_name(:created_at) %></th>
5
+ <th class="text-right"><%= Spree::PaymentCaptureEvent.human_attribute_name(:amount) %></th>
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ <% @payment.capture_events.each do |capture_event| %>
10
+ <tr id="<%= dom_id(capture_event) %>" data-hook="capture_events_row">
11
+ <td><%= pretty_time(capture_event.created_at) %></td>
12
+ <td class="text-right"><%= capture_event.display_amount %></td>
8
13
  </tr>
9
- </thead>
10
- <tbody>
11
- <% @payment.capture_events.each do |capture_event| %>
12
- <tr id="<%= dom_id(capture_event) %>" data-hook="capture_events_row">
13
- <td><%= pretty_time(capture_event.created_at) %></td>
14
- <td><%= capture_event.display_amount %></td>
15
- </tr>
16
- <% end %>
17
- </tbody>
18
- </table>
19
- <% end %>
14
+ <% end %>
15
+ </tbody>
16
+ </table>
@@ -48,7 +48,7 @@
48
48
  </td>
49
49
  <td class="actions">
50
50
  <div class="editing-show">
51
- <%= link_to_with_icon 'save', t('spree.actions.save'), nil, no_text: true, class: "js-save", data: {action: 'save'} %>
51
+ <%= link_to_with_icon 'ok', t('spree.actions.save'), nil, no_text: true, class: "js-save", data: {action: 'save'} %>
52
52
  <%= link_to_with_icon 'cancel', t('spree.actions.cancel'), nil, no_text: true, class: "js-cancel", data: {action: 'cancel'} %>
53
53
  </div>
54
54
  <div class="editing-hide">
@@ -0,0 +1,29 @@
1
+ <table class='index' id='listing_log_entries'>
2
+ <colgroup>
3
+ <col style="width: 30%" />
4
+ <col style="width: 60%" />
5
+ <col style="width: 10%" />
6
+ </colgroup>
7
+ <thead>
8
+ <tr>
9
+ <th><%= Spree::LogEntry.human_attribute_name(:created_at) %></th>
10
+ <th><%= Spree::LogEntry.human_attribute_name(:details) %></th>
11
+ <th></th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+ <% log_entries.each do |entry| %>
16
+ <tr class="log_entry <%= entry.parsed_details.success? ? 'success' : 'fail' %>">
17
+ <td>
18
+ <%= pretty_time(entry.created_at) %>
19
+ </td>
20
+ <td>
21
+ <pre><%= entry.parsed_details.message %></pre>
22
+ </td>
23
+ <td class="text-right">
24
+ <i class='fa fa-<%= entry.parsed_details.success? ? 'check' : 'remove' %>'></i>
25
+ </td>
26
+ </tr>
27
+ <% end %>
28
+ </tbody>
29
+ </table>
@@ -8,15 +8,22 @@
8
8
  </span>
9
9
  <% end %>
10
10
 
11
-
12
- <% content_for :page_actions do %>
13
- <li><%= link_to t('spree.logs'), spree.admin_order_payment_log_entries_url(@order, @payment), class: 'btn btn-primary' %></li>
14
- <% end %>
15
-
16
11
  <%= render partial: "spree/admin/payments/source_views/#{@payment.payment_method.partial_name}", locals: { payment: @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment } %>
17
12
 
18
13
  <div data-hook="amount" class="align-center">
19
14
  <h5><%= label_tag nil, Spree::Payment.human_attribute_name(:amount) %>: <span class="green"><%= @payment.display_amount.to_html %></span> </h5>
20
15
  </div>
21
16
 
22
- <%= render 'spree/admin/payments/capture_events' %>
17
+ <% if @payment.capture_events.any? %>
18
+ <fieldset class="no-border-bottom">
19
+ <legend><%= plural_resource_name(Spree::PaymentCaptureEvent) %></legend>
20
+ <%= render 'spree/admin/payments/capture_events' %>
21
+ </fieldset>
22
+ <% end %>
23
+
24
+ <% if @payment.log_entries.any? %>
25
+ <fieldset class="no-border-bottom">
26
+ <legend><%= plural_resource_name(Spree::LogEntry) %></legend>
27
+ <%= render 'spree/admin/payments/log_entries', log_entries: @payment.log_entries %>
28
+ </fieldset>
29
+ <% end %>