solidus_backend 2.7.4 → 2.9.2

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 (214) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +12 -8
  3. data/app/assets/images/favicon.ico +0 -0
  4. data/app/assets/javascripts/spree/backend.js +0 -2
  5. data/app/assets/javascripts/spree/backend/adjustments.js +1 -1
  6. data/app/assets/javascripts/spree/backend/components/sortable_table.js +1 -0
  7. data/app/assets/javascripts/spree/backend/components/tabs.js +1 -0
  8. data/app/assets/javascripts/spree/backend/components/tooltips.js +21 -17
  9. data/app/assets/javascripts/spree/backend/option_type_autocomplete.js +1 -1
  10. data/app/assets/javascripts/spree/backend/product_picker.js +1 -1
  11. data/app/assets/javascripts/spree/backend/shipments.js +7 -1
  12. data/app/assets/javascripts/spree/backend/stock_management.js +18 -0
  13. data/app/assets/javascripts/spree/backend/store_credits.js +18 -2
  14. data/app/assets/javascripts/spree/backend/taxons.js +1 -1
  15. data/app/assets/javascripts/spree/backend/templates/orders/line_item.hbs +1 -1
  16. data/app/assets/javascripts/spree/backend/templates/stock_items/stock_location_stock_item.hbs +24 -25
  17. data/app/assets/javascripts/spree/backend/user_picker.js +1 -1
  18. data/app/assets/javascripts/spree/backend/variant_autocomplete.js +1 -1
  19. data/app/assets/javascripts/spree/backend/views/order/customer_select.js +1 -1
  20. data/app/assets/javascripts/spree/backend/views/order/summary.js +2 -2
  21. data/app/assets/javascripts/spree/backend/views/stock/add_stock_item.js +15 -4
  22. data/app/assets/javascripts/spree/backend/views/stock/edit_stock_item_row.js +46 -10
  23. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +24 -16
  24. data/app/assets/stylesheets/spree/backend/components/_breadcrumb.scss +12 -0
  25. data/app/assets/stylesheets/spree/backend/components/_buttons.scss +18 -0
  26. data/app/assets/stylesheets/spree/backend/components/_image_placeholder.scss +2 -2
  27. data/app/assets/stylesheets/spree/backend/components/_list_group.scss +2 -2
  28. data/app/assets/stylesheets/spree/backend/components/_messages.scss +20 -12
  29. data/app/assets/stylesheets/spree/backend/components/_navigation.scss +45 -11
  30. data/app/assets/stylesheets/spree/backend/components/_progress.scss +3 -3
  31. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +1 -2
  32. data/app/assets/stylesheets/spree/backend/components/_tabs.scss +14 -13
  33. data/app/assets/stylesheets/spree/backend/globals/_deprecated_variables.scss +24 -0
  34. data/app/assets/stylesheets/spree/backend/globals/_deprecation.scss +10 -1
  35. data/app/assets/stylesheets/spree/backend/globals/_functions.scss +2 -0
  36. data/app/assets/stylesheets/spree/backend/globals/_variables.scss +88 -57
  37. data/app/assets/stylesheets/spree/backend/globals/_variables_override.scss +1 -0
  38. data/app/assets/stylesheets/spree/backend/globals/mixins/_caret.scss +1 -1
  39. data/app/assets/stylesheets/spree/backend/globals/mixins/_line_through.scss +1 -1
  40. data/app/assets/stylesheets/spree/backend/sections/_log_entries.scss +8 -2
  41. data/app/assets/stylesheets/spree/backend/sections/_orders.scss +25 -6
  42. data/app/assets/stylesheets/spree/backend/sections/_products.scss +3 -1
  43. data/app/assets/stylesheets/spree/backend/sections/_promotions.scss +5 -5
  44. data/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +77 -2
  45. data/app/assets/stylesheets/spree/backend/sections/_style_guide.scss +4 -4
  46. data/app/assets/stylesheets/spree/backend/sections/_taxonomies.scss +1 -1
  47. data/app/assets/stylesheets/spree/backend/shared/_fonts.scss +15 -0
  48. data/app/assets/stylesheets/spree/backend/shared/_forms.scss +27 -7
  49. data/app/assets/stylesheets/spree/backend/shared/_header.scss +2 -2
  50. data/app/assets/stylesheets/spree/backend/shared/_icons.scss +5 -1
  51. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -4
  52. data/app/assets/stylesheets/spree/backend/shared/_tables.scss +11 -6
  53. data/app/assets/stylesheets/spree/backend/shared/_typography.scss +10 -6
  54. data/app/assets/stylesheets/spree/backend/spree_admin.scss +3 -1
  55. data/app/controllers/spree/admin/cancellations_controller.rb +2 -2
  56. data/app/controllers/spree/admin/customer_returns_controller.rb +8 -1
  57. data/app/controllers/spree/admin/locale_controller.rb +1 -1
  58. data/app/controllers/spree/admin/log_entries_controller.rb +3 -0
  59. data/app/controllers/spree/admin/orders/customer_details_controller.rb +8 -1
  60. data/app/controllers/spree/admin/orders_controller.rb +1 -12
  61. data/app/controllers/spree/admin/products_controller.rb +10 -6
  62. data/app/controllers/spree/admin/promotion_codes_controller.rb +19 -1
  63. data/app/controllers/spree/admin/promotions_controller.rb +1 -1
  64. data/app/controllers/spree/admin/reimbursements_controller.rb +7 -2
  65. data/app/controllers/spree/admin/resource_controller.rb +1 -0
  66. data/app/controllers/spree/admin/store_credit_reasons_controller.rb +8 -0
  67. data/app/controllers/spree/admin/store_credits_controller.rb +11 -11
  68. data/app/controllers/spree/admin/users_controller.rb +4 -2
  69. data/app/helpers/spree/admin/base_helper.rb +9 -3
  70. data/app/helpers/spree/admin/navigation_helper.rb +1 -1
  71. data/app/helpers/spree/admin/promotions_helper.rb +15 -0
  72. data/app/models/spree/backend_configuration.rb +38 -21
  73. data/app/views/spree/admin/cancellations/index.html.erb +3 -1
  74. data/app/views/spree/admin/images/_image_row.html.erb +1 -1
  75. data/app/views/spree/admin/images/edit.html.erb +3 -3
  76. data/app/views/spree/admin/images/index.html.erb +3 -3
  77. data/app/views/spree/admin/log_entries/index.html.erb +1 -19
  78. data/app/views/spree/admin/option_types/edit.html.erb +1 -1
  79. data/app/views/spree/admin/orders/_carton_manifest.html.erb +3 -1
  80. data/app/views/spree/admin/orders/_line_items_edit_form.html.erb +1 -1
  81. data/app/views/spree/admin/orders/_shipment_manifest.html.erb +3 -1
  82. data/app/views/spree/admin/orders/confirm/_line_items.html.erb +3 -2
  83. data/app/views/spree/admin/orders/confirm/_shipment_manifest.html.erb +3 -1
  84. data/app/views/spree/admin/orders/index.html.erb +1 -1
  85. data/app/views/spree/admin/payments/_capture_events.html.erb +15 -18
  86. data/app/views/spree/admin/payments/_list.html.erb +1 -1
  87. data/app/views/spree/admin/payments/_log_entries.html.erb +29 -0
  88. data/app/views/spree/admin/payments/show.html.erb +13 -6
  89. data/app/views/spree/admin/payments/source_forms/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  90. data/app/views/spree/admin/payments/source_views/{_storecredit.html.erb → _store_credit.html.erb} +0 -0
  91. data/app/views/spree/admin/prices/_form.html.erb +1 -1
  92. data/app/views/spree/admin/product_properties/index.html.erb +1 -1
  93. data/app/views/spree/admin/products/_form.html.erb +23 -12
  94. data/app/views/spree/admin/products/edit.html.erb +5 -0
  95. data/app/views/spree/admin/products/index.html.erb +3 -1
  96. data/app/views/spree/admin/promotion_categories/index.html.erb +1 -1
  97. data/app/views/spree/admin/promotion_code_batches/index.html.erb +1 -1
  98. data/app/views/spree/admin/promotion_codes/index.html.erb +5 -1
  99. data/app/views/spree/admin/promotion_codes/new.html.erb +31 -0
  100. data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
  101. data/app/views/spree/admin/promotions/_activations_edit.html.erb +1 -1
  102. data/app/views/spree/admin/promotions/_form.html.erb +6 -5
  103. data/app/views/spree/admin/promotions/_rules.html.erb +1 -1
  104. data/app/views/spree/admin/promotions/edit.html.erb +3 -1
  105. data/app/views/spree/admin/promotions/index.html.erb +4 -4
  106. data/app/views/spree/admin/refunds/new.html.erb +1 -1
  107. data/app/views/spree/admin/reimbursements/edit.html.erb +2 -2
  108. data/app/views/spree/admin/shared/_address_form.html.erb +10 -3
  109. data/app/views/spree/admin/shared/_edit_resource_links.html.erb +1 -1
  110. data/app/views/spree/admin/shared/_head.html.erb +1 -3
  111. data/app/views/spree/admin/shared/_image.html.erb +2 -2
  112. data/app/views/spree/admin/shared/_modal.html.erb +1 -1
  113. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +1 -1
  114. data/app/views/spree/admin/shared/_settings_checkout_tabs.html.erb +4 -0
  115. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +3 -3
  116. data/app/views/spree/admin/shared/_tabs.html.erb +3 -2
  117. data/app/views/spree/admin/shared/_variant_search.html.erb +1 -1
  118. data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -10
  119. data/app/views/spree/admin/stock_items/_stock_management.html.erb +56 -38
  120. data/app/views/spree/admin/stock_locations/_form.html.erb +133 -121
  121. data/app/views/spree/admin/stock_locations/edit.html.erb +4 -2
  122. data/app/views/spree/admin/store_credit_reasons/edit.html.erb +15 -0
  123. data/app/views/spree/admin/store_credit_reasons/index.html.erb +56 -0
  124. data/app/views/spree/admin/store_credit_reasons/new.html.erb +18 -0
  125. data/app/views/spree/admin/store_credit_reasons/shared/_form.html.erb +15 -0
  126. data/app/views/spree/admin/store_credits/_store_credit_reason_field.html.erb +7 -0
  127. data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -1
  128. data/app/views/spree/admin/store_credits/edit_validity.html.erb +2 -2
  129. data/app/views/spree/admin/store_credits/index.html.erb +1 -1
  130. data/app/views/spree/admin/store_credits/show.html.erb +3 -3
  131. data/app/views/spree/admin/stores/_form.html.erb +1 -0
  132. data/app/views/spree/admin/style_guide/topics/typography/_colors.html.erb +30 -20
  133. data/app/views/spree/admin/style_guide/topics/typography/_fonts.html.erb +1 -1
  134. data/app/views/spree/admin/taxonomies/edit.html.erb +1 -1
  135. data/app/views/spree/admin/taxons/_form.html.erb +1 -1
  136. data/app/views/spree/admin/taxons/edit.html.erb +2 -2
  137. data/app/views/spree/admin/users/edit.html.erb +2 -2
  138. data/app/views/spree/admin/users/index.html.erb +2 -2
  139. data/app/views/spree/admin/users/items.html.erb +3 -1
  140. data/app/views/spree/admin/users/orders.html.erb +1 -1
  141. data/app/views/spree/admin/variants/_form.html.erb +1 -1
  142. data/app/views/spree/admin/variants/index.html.erb +1 -1
  143. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  144. data/config/routes.rb +2 -8
  145. data/lib/spree/backend.rb +1 -1
  146. data/solidus_backend.gemspec +3 -4
  147. data/spec/controllers/spree/admin/base_controller_spec.rb +1 -1
  148. data/spec/controllers/spree/admin/cancellations_controller_spec.rb +7 -3
  149. data/spec/controllers/spree/admin/locale_controller_spec.rb +45 -0
  150. data/spec/controllers/spree/admin/orders/customer_details_controller_spec.rb +50 -2
  151. data/spec/controllers/spree/admin/orders_controller_spec.rb +25 -13
  152. data/spec/controllers/spree/admin/payments_controller_spec.rb +1 -1
  153. data/spec/controllers/spree/admin/products_controller_spec.rb +72 -0
  154. data/spec/controllers/spree/admin/promotion_codes_controller_spec.rb +13 -1
  155. data/spec/controllers/spree/admin/reimbursements_controller_spec.rb +11 -0
  156. data/spec/controllers/spree/admin/resource_controller_spec.rb +22 -0
  157. data/spec/controllers/spree/admin/stock_items_controller_spec.rb +1 -1
  158. data/spec/controllers/spree/admin/stock_locations_controller_spec.rb +1 -1
  159. data/spec/controllers/spree/admin/store_credits_controller_spec.rb +7 -7
  160. data/spec/features/admin/configuration/payment_methods_spec.rb +2 -2
  161. data/spec/features/admin/configuration/shipping_methods_spec.rb +2 -2
  162. data/spec/features/admin/homepage_spec.rb +1 -6
  163. data/spec/features/admin/locale_spec.rb +1 -2
  164. data/spec/features/admin/orders/adjustments_spec.rb +1 -1
  165. data/spec/features/admin/orders/customer_details_spec.rb +5 -7
  166. data/spec/features/admin/orders/customer_returns_spec.rb +28 -0
  167. data/spec/features/admin/orders/listing_spec.rb +2 -7
  168. data/spec/features/admin/orders/log_entries_spec.rb +2 -2
  169. data/spec/features/admin/orders/new_order_spec.rb +117 -0
  170. data/spec/features/admin/orders/new_refund_spec.rb +35 -0
  171. data/spec/features/admin/orders/order_details_spec.rb +10 -5
  172. data/spec/features/admin/orders/payments_spec.rb +82 -41
  173. data/spec/features/admin/orders/return_payment_state_spec.rb +3 -0
  174. data/spec/features/admin/orders/shipments_spec.rb +28 -0
  175. data/spec/features/admin/products/edit/products_spec.rb +25 -0
  176. data/spec/features/admin/products/edit/taxons_spec.rb +4 -0
  177. data/spec/features/admin/products/pricing_spec.rb +24 -6
  178. data/spec/features/admin/products/products_spec.rb +5 -5
  179. data/spec/features/admin/products/stock_management_spec.rb +27 -13
  180. data/spec/features/admin/products/variant_spec.rb +1 -1
  181. data/spec/features/admin/promotion_adjustments_spec.rb +12 -12
  182. data/spec/features/admin/promotions/option_value_rule_spec.rb +2 -2
  183. data/spec/features/admin/promotions/product_rule_spec.rb +1 -1
  184. data/spec/features/admin/promotions/promotion_spec.rb +52 -0
  185. data/spec/features/admin/promotions/tiered_calculator_spec.rb +1 -1
  186. data/spec/features/admin/promotions/user_rule_spec.rb +2 -2
  187. data/spec/features/admin/reimbursements_spec.rb +1 -1
  188. data/spec/features/admin/store_credits_spec.rb +51 -2
  189. data/spec/features/admin/taxons_spec.rb +35 -0
  190. data/spec/features/admin/users_spec.rb +44 -11
  191. data/spec/helpers/admin/navigation_helper_spec.rb +4 -2
  192. data/spec/helpers/admin/store_credit_events_helper_spec.rb +2 -2
  193. data/spec/javascripts/spec_helper.js +2 -0
  194. data/spec/models/spree/backend_configuration/menu_item_spec.rb +17 -0
  195. data/spec/models/spree/backend_configuration_spec.rb +22 -0
  196. data/spec/spec_helper.rb +2 -2
  197. data/spec/support/appear_before_matcher.rb +1 -1
  198. data/spec/support/feature/order_feature_helper.rb +1 -1
  199. data/spec/views/spree/admin/shared/navigation_footer_spec.rb +1 -1
  200. data/vendor/assets/fonts/inter/Inter-Regular.woff +0 -0
  201. data/vendor/assets/fonts/inter/Inter-Regular.woff2 +0 -0
  202. data/vendor/assets/fonts/inter/Inter-SemiBold.woff +0 -0
  203. data/vendor/assets/fonts/inter/Inter-SemiBold.woff2 +0 -0
  204. data/vendor/assets/javascripts/solidus_admin/select2_locales/select2_locale_en-US.js +10 -0
  205. data/vendor/assets/stylesheets/solidus_admin/bootstrap/_pagination.scss +4 -0
  206. metadata +38 -36
  207. data/.eslintrc +0 -21
  208. data/app/controllers/spree/admin/reports_controller.rb +0 -82
  209. data/app/views/spree/admin/reports/index.html.erb +0 -19
  210. data/app/views/spree/admin/reports/sales_total.html.erb +0 -35
  211. data/app/views/spree/admin/shared/_report_order_criteria.html.erb +0 -19
  212. data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +0 -7
  213. data/spec/controllers/spree/admin/reports_controller_spec.rb +0 -133
  214. data/spec/features/admin/reports_spec.rb +0 -63
@@ -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
 
@@ -37,7 +37,7 @@
37
37
  <div id="progress-zone" class="row"></div>
38
38
  </fieldset>
39
39
 
40
- <% no_images = @product.images.empty? && @product.variant_images.empty? %>
40
+ <% no_images = @product.gallery.images.empty? %>
41
41
 
42
42
  <table class="index sortable inline-editable-table <%= 'hidden' if no_images %>" id="images-table" data-hook="images_table" data-sortable-link="<%= update_positions_admin_product_images_url(@product) %>">
43
43
  <colgroup>
@@ -63,7 +63,7 @@
63
63
  </thead>
64
64
 
65
65
  <tbody>
66
- <%= render partial: 'image_row', collection: @product.variant_images, as: :image %>
66
+ <%= render partial: 'image_row', collection: @product.gallery.images, as: :image %>
67
67
  </tbody>
68
68
  </table>
69
69
 
@@ -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? ? 'ok-circle' : 'remove-sign' %>'></i> <%= pretty_time(entry.created_at) %></h4>
17
- </td>
18
- </tr>
19
- </thead>
20
- <tbody>
21
- <tr>
22
- <td>Message</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 %>
@@ -1,7 +1,9 @@
1
1
  <% carton.manifest_for_order(order).each do |item| %>
2
2
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
3
3
  <td class="item-image">
4
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
4
+ <%= render 'spree/admin/shared/image',
5
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
6
+ size: :mini %>
5
7
  </td>
6
8
  <td class="item-name">
7
9
  <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -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 } %>
@@ -4,7 +4,9 @@
4
4
  data-variant-id="<%= item.variant.id %>"
5
5
  >
6
6
  <td class="item-image align-center">
7
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
7
+ <%= render 'spree/admin/shared/image',
8
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
9
+ size: :mini %>
8
10
  </td>
9
11
  <td class="item-name">
10
12
  <%= link_to item.variant.product.name, edit_admin_product_path(item.variant.product) %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -9,10 +9,11 @@
9
9
 
10
10
  <tbody>
11
11
  <% order.line_items.each do |item| %>
12
-
13
12
  <tr class="line-item" id="line-item-<%= item.id %>">
14
13
  <td class="line-item-image">
15
- <%= mini_image(item.variant) %>
14
+ <%= render 'spree/admin/shared/image',
15
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
16
+ size: :mini %>
16
17
  </td>
17
18
  <td class="line-item-name">
18
19
  <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -1,7 +1,9 @@
1
1
  <% shipment.manifest.each do |item| %>
2
2
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
3
3
  <td class="item-image">
4
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
4
+ <%= render 'spree/admin/shared/image',
5
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
6
+ size: :mini %>
5
7
  </td>
6
8
  <td class="item-name">
7
9
  <%= item.variant.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -10,7 +10,7 @@
10
10
  <% end if can? :create, Spree::Order %>
11
11
 
12
12
  <% content_for :table_filter_title do %>
13
- <%= t('spree.search') %>
13
+ <%= t('spree.filter') %>
14
14
  <% end %>
15
15
 
16
16
  <% content_for :table_filter do %>
@@ -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 %>
@@ -26,7 +26,7 @@
26
26
  <div data-hook="admin_product_price_form_amount" class="col-4">
27
27
  <%= f.field_container :price do %>
28
28
  <%= f.label :price %>
29
- <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency_attr: :currency %>
29
+ <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency_attr: :currency, currency: @price.currency %>
30
30
  <% end %>
31
31
  </div>
32
32
  </div>
@@ -7,7 +7,7 @@
7
7
  <% if can?(:create, Spree::ProductProperty) %>
8
8
  <ul class="tollbar inline-menu">
9
9
  <li>
10
- <%= link_to_add_fields t('spree.add_product_properties'), 'tbody#product_properties', class: 'plus button' %>
10
+ <%= link_to_add_fields t('spree.add_product_properties'), 'tbody#product_properties', class: 'plus btn btn-primary' %>
11
11
  </li>
12
12
  </ul>
13
13
  <% end %>
@@ -32,11 +32,22 @@
32
32
  <div data-hook="admin_product_form_price">
33
33
  <%= f.field_container :price do %>
34
34
  <%= f.label :price, class: Spree::Config.require_master_price ? 'required' : '' %>
35
- <%= render "spree/admin/shared/number_with_currency", f: f,
36
- amount_attr: :price,
37
- required: Spree::Config.require_master_price,
38
- currency: Spree::Config.default_pricing_options.currency %>
39
- <%= f.error_message_on :price %>
35
+
36
+ <% if f.object.new_record? || f.object.has_default_price? %>
37
+ <%= render "spree/admin/shared/number_with_currency",
38
+ f: f,
39
+ amount_attr: :price,
40
+ required: Spree::Config.require_master_price,
41
+ currency: Spree::Config.default_pricing_options.currency %>
42
+ <%= f.error_message_on :price %>
43
+ <% else %>
44
+ <span class="info">
45
+ <%= t('spree.product_without_default_price_info',
46
+ default_currency: Spree::Config.default_pricing_options.currency) %>
47
+ <%= link_to t('spree.product_without_default_price_cta'),
48
+ spree.admin_product_prices_url(@product) %>
49
+ </span>
50
+ <% end %>
40
51
  <% end %>
41
52
  </div>
42
53
 
@@ -82,6 +93,13 @@
82
93
  <% end %>
83
94
  </div>
84
95
 
96
+ <div data-hook="admin_product_form_sku">
97
+ <%= f.field_container :sku do %>
98
+ <%= f.label :sku, t('spree.master_sku') %>
99
+ <%= f.text_field :sku, size: 16 %>
100
+ <% end %>
101
+ </div>
102
+
85
103
  <% if @product.has_variants? %>
86
104
  <div data-hook="admin_product_form_multiple_variants">
87
105
  <%= f.label :skus, t('spree.skus') %>
@@ -103,13 +121,6 @@
103
121
  </div>
104
122
  </div>
105
123
  <% else %>
106
- <div data-hook="admin_product_form_sku">
107
- <%= f.field_container :sku do %>
108
- <%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %>
109
- <%= f.text_field :sku, size: 16 %>
110
- <% end %>
111
- </div>
112
-
113
124
  <div id="shipping_specs" class="row">
114
125
  <% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
115
126
  <div id="shipping_specs_<%= field %>_field" class="col-6">
@@ -4,6 +4,11 @@
4
4
  <%= link_to t('spree.new_product'), new_object_url, id: 'admin_new_product', class: 'btn btn-primary' %>
5
5
  </li>
6
6
  <% end %>
7
+ <% if defined?(Spree::Frontend::Engine) %>
8
+ <li id="view_product_link">
9
+ <%= link_to t('spree.view_product'), spree.product_path(@product), id: 'admin_view_product', class: 'btn btn-default ml-2' %>
10
+ </li>
11
+ <% end %>
7
12
  <% end %>
8
13
 
9
14
  <%= render partial: 'spree/admin/shared/product_tabs', locals: { current: 'Product Details' } %>
@@ -74,7 +74,9 @@
74
74
  <% @collection.each do |product| %>
75
75
  <tr <%== "style='color: red;'" if product.deleted? %> id="<%= spree_dom_id product %>" data-hook="admin_products_index_rows">
76
76
  <td><%= product.sku %></td>
77
- <td class="align-center"><%= render 'spree/admin/shared/image', image: product.display_image, size: :mini %></td>
77
+ <td class="align-center">
78
+ <%= render 'spree/admin/shared/image', image: product.gallery.images.first, size: :mini %>
79
+ </td>
78
80
  <td><%= link_to product.try(:name), edit_admin_product_path(product) %></td>
79
81
  <td class="align-right"><%= product.display_price.to_html %></td>
80
82
  <td class="actions" data-hook="admin_products_index_row_actions">
@@ -1,5 +1,5 @@
1
1
  <% admin_breadcrumb(link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path) %>
2
- <% admin_breadcrumb(Spree::PromotionCategory.model_name.human(count: :many)) %>
2
+ <% admin_breadcrumb(plural_resource_name(Spree::PromotionCategory)) %>
3
3
 
4
4
 
5
5
  <% content_for :page_actions do %>
@@ -37,7 +37,7 @@
37
37
  number_of_codes: promotion_code_batch.number_of_codes
38
38
  ) %>
39
39
  <%= link_to(
40
- t('spree.download_promotion_code_list'),
40
+ t('spree.download_promotion_codes_list'),
41
41
  admin_promotion_promotion_code_batch_download_path(
42
42
  promotion_code_batch_id: promotion_code_batch.id,
43
43
  format: :csv
@@ -4,7 +4,11 @@
4
4
 
5
5
  <% content_for :page_actions do %>
6
6
  <li>
7
- <%= link_to t('spree.download_promotion_code_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
7
+ <% if can?(:create, Spree::PromotionCode) %>
8
+ <%= link_to t('spree.create_promotion_code'), new_admin_promotion_promotion_code_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
9
+ <% end %>
10
+
11
+ <%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
8
12
  </li>
9
13
  <% end %>
10
14
 
@@ -0,0 +1,31 @@
1
+ <% admin_breadcrumb link_to plural_resource_name(Spree::Promotion), spree.admin_promotions_path %>
2
+ <% admin_breadcrumb link_to(@promotion.name, spree.edit_admin_promotion_path(@promotion)) %>
3
+ <% admin_breadcrumb plural_resource_name(Spree::PromotionCode) %>
4
+
5
+ <% content_for :page_actions do %>
6
+ <li>
7
+ <%= link_to t('spree.view_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
8
+
9
+ <%= link_to t('spree.download_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
10
+ </li>
11
+ <% end %>
12
+
13
+ <%= form_for [:admin, @promotion, @promotion_code], method: :post do |f| %>
14
+ <fieldset class="no-border-top">
15
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @promotion_code } %>
16
+
17
+ <div class="row">
18
+ <div class="col-4">
19
+ <%= f.field_container :value do %>
20
+ <%= f.label :value, class: 'required' %>
21
+ <%= f.text_field :value, class: 'fullwidth', required: true %>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+
26
+ <div class="form-buttons filter-actions actions" data-hook="buttons">
27
+ <%= button_tag t('spree.actions.create'), class: 'btn btn-primary' %>
28
+ <%= link_to t('spree.actions.cancel'), admin_promotion_promotion_codes_url(@promotion), class: 'button' %>
29
+ </div>
30
+ </fieldset>
31
+ <% end %>
@@ -6,7 +6,7 @@
6
6
  <legend align="center"><%= t('spree.promotion_actions') %></legend>
7
7
  <% if can?(:update, @promotion) %>
8
8
  <div class="field">
9
- <%= label_tag :action_type, t('spree.add_action_of_type')%>
9
+ <%= label_tag :action_type, t('spree.adjustment_type')%>
10
10
  <%= select_tag 'action_type', options, include_blank: t(:choose_promotion_action, scope: 'spree'), class: 'custom-select fullwidth' %>
11
11
  </div>
12
12
  <div class="filter-actions actions">
@@ -18,5 +18,5 @@
18
18
  <div class="field">
19
19
  <%= f.label :path %>
20
20
  <%= f.text_field :path, class: "fullwidth" %>
21
- </p>
21
+ </div>
22
22
  <% end %>
@@ -1,7 +1,5 @@
1
1
  <%= render partial: 'spree/shared/error_messages', locals: { target: @promotion } %>
2
- <fieldset class="form-group no-border-bottom">
3
- <legend><%= t '.general' %></legend>
4
-
2
+ <fieldset class="form-group no-border-bottom no-border-top">
5
3
  <div class="row">
6
4
  <div id="general_fields" class="col-9">
7
5
  <div class="row">
@@ -14,6 +12,9 @@
14
12
  <%= f.field_container :description do %>
15
13
  <%= f.label :description %><br />
16
14
  <%= f.text_area :description, rows: 7, class: 'fullwidth' %>
15
+ <span class="info">
16
+ <%= t('spree.character_limit') %>
17
+ </span>
17
18
  <% end %>
18
19
 
19
20
  <%= f.field_container :category do %>
@@ -43,13 +44,13 @@
43
44
  <div id="starts_at_field" class="field">
44
45
  <%= f.label :starts_at %>
45
46
  <%= f.field_hint :starts_at %>
46
- <%= f.text_field :starts_at, value: datepicker_field_value(@promotion.starts_at), placeholder: t(".starts_at_placeholder"), class: 'datepicker datepicker-from fullwidth' %>
47
+ <%= f.text_field :starts_at, value: datepicker_field_value(@promotion.starts_at, with_time: true), placeholder: t(".starts_at_placeholder"), class: 'datepicker datepicker-from fullwidth', data: { :'enable-time' => true, :'default-hour' => 0 } %>
47
48
  </div>
48
49
 
49
50
  <div id="expires_at_field" class="field">
50
51
  <%= f.label :expires_at %>
51
52
  <%= f.field_hint :expires_at %>
52
- <%= f.text_field :expires_at, value: datepicker_field_value(@promotion.expires_at), placeholder: t(".expires_at_placeholder"), class: 'datepicker datepicker-to fullwidth' %>
53
+ <%= f.text_field :expires_at, value: datepicker_field_value(@promotion.expires_at, with_time: true), placeholder: t(".expires_at_placeholder"), class: 'datepicker datepicker-to fullwidth', data: { :'enable-time' => true, :'default-hour' => 0 } %>
53
54
  </div>
54
55
  </div>
55
56
  </div>