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
@@ -19,6 +19,8 @@
19
19
  <%= render partial: 'spree/shared/error_messages', locals: { target: @stock_location } %>
20
20
 
21
21
  <%= form_for [:admin, @stock_location] do |f| %>
22
- <%= render :partial => 'form', :locals => { :f => f } %>
23
- <%= render :partial => 'spree/admin/shared/edit_resource_links' %>
22
+ <fieldset class="no-border-top">
23
+ <%= render 'form', f: f %>
24
+ <%= render 'spree/admin/shared/edit_resource_links' %>
25
+ </fieldset>
24
26
  <% end %>
@@ -0,0 +1,15 @@
1
+ <%= render 'spree/admin/shared/settings_checkout_tabs' %>
2
+
3
+ <% admin_breadcrumb t('spree.settings') %>
4
+ <% admin_breadcrumb t('spree.admin.tab.checkout') %>
5
+ <% admin_breadcrumb link_to plural_resource_name(Spree::StoreCreditReason), spree.admin_store_credit_reasons_path %>
6
+ <% admin_breadcrumb @object.name %>
7
+
8
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @object } %>
9
+
10
+ <%= form_for [:admin, @object] do |f| %>
11
+ <fieldset class='no-border-top' data-hook='edit_store_credit_reason'>
12
+ <%= render partial: 'spree/admin/store_credit_reasons/shared/form', locals: { f: f } %>
13
+ <%= render partial: 'spree/admin/shared/edit_resource_links' %>
14
+ </fieldset>
15
+ <% end %>
@@ -0,0 +1,56 @@
1
+ <%= render 'spree/admin/shared/settings_checkout_tabs' %>
2
+
3
+ <% admin_breadcrumb(t('spree.settings')) %>
4
+ <% admin_breadcrumb(t('spree.admin.tab.checkout')) %>
5
+ <% admin_breadcrumb(plural_resource_name(Spree::StoreCreditReason)) %>
6
+
7
+ <% content_for :page_actions do %>
8
+ <ul class='actions inline-menu'>
9
+ <li>
10
+ <%= link_to t('spree.new_adjustment_reason'), new_object_url, id: 'admin_new_named_type', class: 'btn btn-primary' %>
11
+ </li>
12
+ </ul>
13
+ <% end %>
14
+
15
+ <% if @collection.any? %>
16
+ <table class='index' id='listing_store_credit_reasons'>
17
+ <colgroup>
18
+ <col style='width: 65%' />
19
+ <col style='width: 20%' />
20
+ <col style='width: 15%' />
21
+ </colgroup>
22
+ <thead>
23
+ <tr data-hook='store_credit_reasons_header'>
24
+ <th><%= Spree::StoreCreditReason.human_attribute_name(:name) %></th>
25
+ <th><%= Spree::StoreCreditReason.human_attribute_name(:state) %></th>
26
+ <th class='actions'></th>
27
+ </tr>
28
+ </thead>
29
+ <tbody>
30
+ <% @collection.each do |store_credit_reason| %>
31
+ <tr id='<%= spree_dom_id store_credit_reason %>' data-hook='store_credit_reason_row'>
32
+ <td>
33
+ <%= store_credit_reason.name %>
34
+ </td>
35
+ <td>
36
+ <span class="pill pill-<%= store_credit_reason.active? ? 'active' : 'inactive' %>">
37
+ <%= t(store_credit_reason.active? ? :active : :inactive, scope: 'spree') %>
38
+ </span>
39
+ </td>
40
+ <td class='actions'>
41
+ <%= link_to_edit store_credit_reason, no_text: true %>
42
+ <% if can?(:destroy, store_credit_reason) %>
43
+ <%= link_to_delete store_credit_reason, no_text: true %>
44
+ <% end %>
45
+ </td>
46
+ </tr>
47
+ <% end %>
48
+ </tbody>
49
+ </table>
50
+ <% else %>
51
+ <div class='no-objects-found'>
52
+ <%= render 'spree/admin/shared/no_objects_found',
53
+ resource: Spree::StoreCreditReason,
54
+ new_resource_url: new_object_url %>
55
+ </div>
56
+ <% end %>
@@ -0,0 +1,18 @@
1
+ <%= render 'spree/admin/shared/settings_checkout_tabs' %>
2
+
3
+ <% admin_breadcrumb(t('spree.settings')) %>
4
+ <% admin_breadcrumb(t('spree.admin.tab.checkout')) %>
5
+ <% admin_breadcrumb(link_to plural_resource_name(Spree::StoreCreditReason), spree.admin_store_credit_reasons_path) %>
6
+ <% admin_breadcrumb(t('spree.new_store_credit_reason')) %>
7
+
8
+ <% content_for :page_actions do %>
9
+ <% end %>
10
+
11
+ <%= render partial: 'spree/shared/error_messages', locals: { target: @object } %>
12
+
13
+ <%= form_for [:admin, @object] do |f| %>
14
+ <fieldset class='no-border-top'>
15
+ <%= render partial: 'spree/admin/store_credit_reasons/shared/form', locals: { f: f } %>
16
+ <%= render partial: 'spree/admin/shared/new_resource_links' %>
17
+ </fieldset>
18
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <div data-hook='admin_named_type_form_fields' class='row'>
2
+ <div class='col-3'>
3
+ <%= f.field_container :name do %>
4
+ <%= f.label :name, class: 'required' %><br />
5
+ <%= f.text_field :name, class: 'fullwidth' %>
6
+ <% end %>
7
+
8
+ <div class='checkbox'>
9
+ <label>
10
+ <%= f.check_box :active %>
11
+ <%= t('spree.active') %>
12
+ </label>
13
+ </div>
14
+ </div>
15
+ </div>
@@ -0,0 +1,7 @@
1
+ <%= f.field_container :reason do %>
2
+ <%= f.label :store_credit_reason, t('spree.reason'), class: 'required' %>
3
+ <%= select_tag :store_credit_reason_id, options_from_collection_for_select(@store_credit_reasons, :id, :name),
4
+ include_blank: t('spree.choose_reason'), class: 'custom-select fullwidth',
5
+ placeholder: t('spree.admin.store_credits.select_amount_store_credit_reason') %>
6
+ <%= f.error_message_on :store_credit_reason %>
7
+ <% end %>
@@ -23,7 +23,7 @@
23
23
  <% end %>
24
24
  </div>
25
25
  <div class="col-6">
26
- <%= render 'update_reason_field', f: f %>
26
+ <%= render 'store_credit_reason_field', f: f %>
27
27
  </div>
28
28
  </div>
29
29
  <%= render 'spree/admin/shared/edit_resource_links',
@@ -15,12 +15,12 @@
15
15
  <legend align="center"><%= t('spree.admin.store_credits.invalidate_store_credit') %></legend>
16
16
  <div data-hook="admin_store_credit_form_fields" class="row">
17
17
  <div class="col-12">
18
- <%= render partial: 'update_reason_field', locals: { f: f } %>
18
+ <%= render partial: 'store_credit_reason_field', locals: { f: f } %>
19
19
  </div>
20
20
  </div>
21
21
  <div class="form-buttons filter-actions actions" data-hook="buttons">
22
22
  <%= button_tag t('spree.store_credit.actions.invalidate'), class: 'btn btn-primary' %>
23
- <%= link_to t('spree.actions.cancel'), admin_user_store_credit_path(@user, @store_credit), class: 'btn btn-primary' %>
23
+ <%= link_to t('spree.actions.cancel'), admin_user_store_credit_path(@user, @store_credit), class: 'btn btn-default' %>
24
24
  </div>
25
25
  </fieldset>
26
26
  <% end %>
@@ -7,7 +7,7 @@
7
7
  <%= render 'spree/admin/users/tabs', current: :store_credits %>
8
8
  <% content_for :page_actions do %>
9
9
  <% if can?(:create, Spree::StoreCredit) %>
10
- <li><%= link_to t('spree.admin.store_credits.add'), new_admin_user_store_credit_path(@user), class: 'button' %></li>
10
+ <li><%= link_to t('spree.admin.store_credits.add'), new_admin_user_store_credit_path(@user), class: 'button btn btn-primary' %></li>
11
11
  <% end %>
12
12
  <% end %>
13
13
 
@@ -8,7 +8,7 @@
8
8
  <%= render 'spree/admin/users/tabs', current: :store_credits %>
9
9
  <% content_for :page_actions do %>
10
10
  <% if @store_credit.editable? && can?(:edit, @store_credit) %>
11
- <li><%= link_to t('spree.admin.store_credits.change_amount'), edit_amount_admin_user_store_credit_path(@user, @store_credit), class: 'button' %></li>
11
+ <li><%= link_to t('spree.admin.store_credits.change_amount'), edit_amount_admin_user_store_credit_path(@user, @store_credit), class: 'button btn btn-primary' %></li>
12
12
  <% end %>
13
13
  <% if @store_credit.invalidateable? && can?(:invalidate, @store_credit) %>
14
14
  <li><%= link_to t('spree.invalidate'), edit_validity_admin_user_store_credit_path(@user, @store_credit), class: 'button' %></li>
@@ -84,7 +84,7 @@
84
84
  <th><%= t('spree.admin.store_credits.created_by') %></th>
85
85
  <th><%= Spree::StoreCreditEvent.human_attribute_name(:user_total_amount) %></th>
86
86
  <th><%= Spree::StoreCreditEvent.human_attribute_name(:amount_remaining) %></th>
87
- <th><%= Spree::StoreCreditUpdateReason.human_attribute_name(:name) %></th>
87
+ <th><%= Spree::StoreCreditReason.human_attribute_name(:name) %></th>
88
88
  </tr>
89
89
  </thead>
90
90
  <tbody>
@@ -98,7 +98,7 @@
98
98
  <td><%= store_credit_event_originator_link(event) %></td>
99
99
  <td><%= event.display_user_total_amount %></td>
100
100
  <td><%= event.display_remaining_amount %></td>
101
- <td><%= event.update_reason.try!(:name) %></td>
101
+ <td><%= event.store_credit_reason.try!(:name) %></td>
102
102
  </tr>
103
103
  <% end %>
104
104
  </tbody>
@@ -8,6 +8,7 @@
8
8
 
9
9
  <%= f.field_container :code do %>
10
10
  <%= f.label :code, class: 'required' %>
11
+ <%= f.field_hint :code %>
11
12
  <%= f.text_field :code, required: true, class: 'fullwidth' %>
12
13
  <%= f.error_message_on :code %>
13
14
  <% end %>
@@ -9,39 +9,49 @@
9
9
  <%-
10
10
  colors = [
11
11
  {
12
- name: '$color-1',
12
+ name: '$color-white',
13
13
  value: '#FFFFFF',
14
- used_for: 'Backgrounds.'
14
+ used_for: 'Body background color.'
15
15
  },
16
16
  {
17
- name: '$color-2',
18
- value: '#9FC820',
19
- used_for: 'Active states.'
17
+ name: '$color-light',
18
+ value: '#F9FAFB',
19
+ used_for: 'Sidebar and header background color.'
20
20
  },
21
21
  {
22
- name: '$color-3',
23
- value: '#5498DA',
24
- used_for: 'Buttons, links, form text.'
22
+ name: '$color-light-dark',
23
+ value: '#E5E7EB',
24
+ used_for: 'Borders color.'
25
25
  },
26
26
  {
27
- name: '$color-4',
28
- value: '#6788A2',
29
- used_for: 'Non-interactive text outside of form fields.'
27
+ name: '$color-dark',
28
+ value: '#24282F',
29
+ used_for: 'Text and headings color.'
30
30
  },
31
31
  {
32
- name: '$color-5',
33
- value: '#C60F13',
34
- used_for: 'Errors, destructive action warnings.'
32
+ name: '$color-dark-light',
33
+ value: '#808C9E',
34
+ used_for: 'Main text color for navigation, tabs, breadcrumb.'
35
+ },
36
+ {
37
+ name: '$color-primary',
38
+ value: '#3D76F1',
39
+ used_for: 'Buttons primary actions, links, active states.'
35
40
  },
36
41
  {
37
- name: '$color-6',
38
- value: '#FF9300',
39
- used_for: 'Warnings'
42
+ name: '$color-success',
43
+ value: '#52B73B',
44
+ used_for: 'Success actions.'
45
+ },
46
+ {
47
+ name: '$color-error',
48
+ value: '#CE452A',
49
+ used_for: 'Errors, destructive action warnings.'
40
50
  },
41
51
  {
42
- name: '$color-7',
43
- value: '#F4F4F4',
44
- used_for: 'Disabled states'
52
+ name: '$color-notice',
53
+ value: '#FFDD59',
54
+ used_for: 'Warnings actions.'
45
55
  }
46
56
  ]
47
57
 
@@ -1,6 +1,6 @@
1
1
  <div class="half">
2
2
  <p>
3
- The typography base is "Open Sans" and Helvetica which we leave to the browser to provide.
3
+ The typography base is "Inter" and Helvetica which we load by stylesheet with @font-face rule.
4
4
  Set at 13px with no specified line-height.
5
5
  </p>
6
6
 
@@ -14,7 +14,7 @@
14
14
  <%= render partial: 'form', locals: { f: f } %>
15
15
  <div class="filter-actions actions">
16
16
  <%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
17
- <%= link_to t('spree.actions.cancel'), admin_taxonomies_path, class: 'btn btn-primary' %>
17
+ <%= link_to t('spree.actions.cancel'), admin_taxonomies_path, class: 'btn btn-default' %>
18
18
  </div>
19
19
  </fieldset>
20
20
 
@@ -23,7 +23,7 @@
23
23
  <%= f.field_container :icon do %>
24
24
  <%= f.label :icon %><br />
25
25
  <%= f.file_field :icon %>
26
- <%= image_tag f.object.icon(:mini) if f.object.icon.present? %>
26
+ <%= image_tag f.object.icon(:mini) if f.object.icon_present? %>
27
27
  <% end %>
28
28
  </div>
29
29
 
@@ -3,7 +3,7 @@
3
3
 
4
4
  <% content_for :page_actions do %>
5
5
  <li>
6
- <%= link_to t('spree.back_to_taxonomies_list'), spree.admin_taxonomies_path, class: 'btn btn-primary' %>
6
+ <%= link_to t('spree.back_to_taxonomies_list'), spree.admin_taxonomies_path, class: 'btn btn-default' %>
7
7
  </li>
8
8
  <% end %>
9
9
 
@@ -14,6 +14,6 @@
14
14
 
15
15
  <div class="form-buttons filter-actions" data-hook="buttons">
16
16
  <%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
17
- <%= link_to t('spree.actions.cancel'), edit_admin_taxonomy_url(@taxonomy), class: 'btn btn-primary' %>
17
+ <%= link_to t('spree.actions.cancel'), edit_admin_taxonomy_url(@taxonomy), class: 'btn btn-default' %>
18
18
  </div>
19
19
  <% end %>
@@ -41,8 +41,8 @@
41
41
 
42
42
  </div>
43
43
  <div class="filter-actions actions">
44
- <%= button_to t('.clear_key'), spree.clear_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_clear_key') }, class: 'btn btn-primary' %>
45
- <%= button_to t('.regenerate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_regenerate_key') }, class: 'btn btn-primary' %>
44
+ <%= button_to t('.clear_key'), spree.clear_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_clear_key') }, class: 'btn btn-default' %>
45
+ <%= button_to t('.regenerate_key'), spree.generate_api_key_admin_user_path(@user), method: :put, data: { confirm: t('.confirm_regenerate_key') }, class: 'btn btn-default' %>
46
46
  </div>
47
47
 
48
48
  <% else %>
@@ -82,14 +82,14 @@
82
82
  <tr id="<%= spree_dom_id user %>" data-hook="admin_users_index_rows">
83
83
  <td class='user_email'><%=link_to user.email, edit_admin_user_url(user) %></td>
84
84
  <td><%= user.spree_roles.map(&:name).to_sentence %></td>
85
- <td class="align-center"><%= link_to user.orders.count, spree.orders_admin_user_path(user) %></td>
85
+ <td class="align-center"><%= link_to user.order_count, spree.orders_admin_user_path(user) %></td>
86
86
  <td class="align-center"><%= link_to user.display_lifetime_value, spree.items_admin_user_path(user) %></td>
87
87
  <td class="align-center"><%= l user.created_at.to_date %></td>
88
88
  <td data-hook="admin_users_index_row_actions" class="actions">
89
89
  <% if can?(:edit, user) %>
90
90
  <%= link_to_edit user, no_text: true %>
91
91
  <% end %>
92
- <% if can?(:destroy, user) %>
92
+ <% if can?(:destroy, user) && user.orders.count.zero? %>
93
93
  <%= link_to_delete user, no_text: true %>
94
94
  <% end %>
95
95
  </td>
@@ -41,7 +41,9 @@
41
41
  <tr class="stock-item" data-item-quantity="<%= item.quantity %>">
42
42
  <td class="order-completed-at"><%= l(order.completed_at.to_date) if order.completed_at %></td>
43
43
  <td class="item-image">
44
- <%= render 'spree/admin/shared/image', image: item.variant.display_image, size: :mini %>
44
+ <%= render 'spree/admin/shared/image',
45
+ image: (item.variant.gallery.images.first || item.variant.product.gallery.images.first),
46
+ size: :mini %>
45
47
  </td>
46
48
  <td class="item-name">
47
49
  <%= item.product.name %><br><%= "(" + variant_options(item.variant) + ")" unless item.variant.option_values.empty? %>
@@ -74,7 +74,7 @@
74
74
  <div class="no-objects-found">
75
75
  <%= render 'spree/admin/shared/no_objects_found',
76
76
  resource: Spree::Order,
77
- new_resource_url: spree.new_admin_order_path %>
77
+ new_resource_url: spree.new_admin_order_path(user_id: @user.id) %>
78
78
  </div>
79
79
  <% end %>
80
80
 
@@ -65,7 +65,7 @@
65
65
  <div class="col-3">
66
66
  <div class="field" data-hook="price">
67
67
  <%= f.label :price %>
68
- <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency: @variant.default_price.currency %>
68
+ <%= render "spree/admin/shared/number_with_currency", f: f, amount_attr: :price, currency: @variant.find_or_build_default_price.currency %>
69
69
  </div>
70
70
  </div>
71
71
 
@@ -8,7 +8,7 @@
8
8
  <%= link_to(
9
9
  t('spree.new_variant'),
10
10
  new_admin_product_variant_url(@product),
11
- class: 'button'
11
+ class: 'btn btn-primary'
12
12
  ) %>
13
13
  </li>
14
14
  <% end %>
@@ -4,7 +4,7 @@
4
4
 
5
5
  <%= zone_form.field_container :state_ids do %>
6
6
  <%= zone_form.label :state_ids, plural_resource_name(Spree::State) %><br>
7
- <%= zone_form.collection_select :state_ids, @states, :id, :name, {}, { multiple: true, class: "select2 fullwidth" } %>
7
+ <%= zone_form.collection_select :state_ids, @states, :id, :state_with_country, {}, { multiple: true, class: "select2 fullwidth" } %>
8
8
  <% end %>
9
9
  </fieldset>
10
10
  </div>
data/config/routes.rb CHANGED
@@ -16,7 +16,7 @@ Spree::Core::Engine.routes.draw do
16
16
  resources :promotions do
17
17
  resources :promotion_rules
18
18
  resources :promotion_actions
19
- resources :promotion_codes, only: [:index]
19
+ resources :promotion_codes, only: [:index, :new, :create]
20
20
  resources :promotion_code_batches, only: [:index, :new, :create] do
21
21
  get '/download', to: "promotion_code_batches#download", defaults: { format: "csv" }
22
22
  end
@@ -141,17 +141,11 @@ Spree::Core::Engine.routes.draw do
141
141
  end
142
142
  end
143
143
 
144
- resources :reports, only: [:index] do
145
- collection do
146
- get :sales_total
147
- post :sales_total
148
- end
149
- end
150
-
151
144
  resources :reimbursement_types, only: [:index]
152
145
  resources :adjustment_reasons, except: [:show, :destroy]
153
146
  resources :refund_reasons, except: [:show, :destroy]
154
147
  resources :return_reasons, except: [:show, :destroy]
148
+ resources :store_credit_reasons, except: [:show]
155
149
 
156
150
  resources :shipping_methods
157
151
  resources :shipping_categories
data/lib/spree/backend.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  require 'rails/all'
4
4
  require 'jquery-rails'
5
5
  require 'coffee-rails'
6
- require 'sass-rails'
6
+ require 'sassc-rails'
7
7
  require 'handlebars_assets'
8
8
  require 'font-awesome-rails'
9
9
  require 'autoprefixer-rails'