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
@@ -6,7 +6,7 @@
6
6
 
7
7
  <% if can?(:update, @promotion) %>
8
8
  <div class="field">
9
- <%= label_tag :promotion_rule_type, t('spree.add_rule_of_type') %>
9
+ <%= label_tag :promotion_rule_type, t('spree.discount_rules') %>
10
10
  <%= select_tag('promotion_rule[type]', options_for_promotion_rule_types(@promotion), include_blank: t(:choose_promotion_rule, scope: 'spree'), class: 'custom-select fullwidth') %>
11
11
  </div>
12
12
  <div class="filter-actions actions">
@@ -6,7 +6,9 @@
6
6
  <% content_for :page_actions do %>
7
7
  <li>
8
8
  <% if can?(:display, Spree::PromotionCode) %>
9
- <%= link_to t('spree.download_promotion_code_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id, format: :csv), class: 'btn btn-primary' %>
9
+ <%= link_to t('spree.view_promotion_codes_list'), admin_promotion_promotion_codes_path(promotion_id: @promotion.id), class: 'btn btn-primary' %>
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' %>
10
12
  <% end %>
11
13
 
12
14
  <% if can?(:display, Spree::PromotionCodeBatch) %>
@@ -78,11 +78,11 @@
78
78
  <tr id="<%= spree_dom_id promotion %>">
79
79
  <td><%= promotion.name %></td>
80
80
  <td>
81
- <%= (promotion.codes.size == 1) ? promotion.codes.first.try!(:value) : t('spree.number_of_codes', count: promotion.codes.size) %>
81
+ <%= (promotion.codes.size == 1) ? promotion.codes.take.try!(:value) : t('spree.number_of_codes', count: promotion.codes.size) %>
82
82
  </td>
83
83
  <td>
84
84
  <span class="pill pill-<%= promotion.active? ? 'active' : 'inactive' %>">
85
- <%= t(promotion.active?? :active : :inactive, scope: 'spree') %>
85
+ <%= t(admin_promotion_status(promotion), scope: 'spree.admin.promotion_status') %>
86
86
  </span>
87
87
  </td>
88
88
  <td>
@@ -92,10 +92,10 @@
92
92
  <%= promotion.usage_count %>
93
93
  </td>
94
94
  <td>
95
- <%= promotion.starts_at.to_date.to_s(:short_date) if promotion.starts_at %>
95
+ <%= promotion.starts_at.to_s(:long) if promotion.starts_at %>
96
96
  </td>
97
97
  <td>
98
- <%= promotion.expires_at.to_date.to_s(:short_date) if promotion.expires_at %>
98
+ <%= promotion.expires_at.to_s(:long) if promotion.expires_at %>
99
99
  </td>
100
100
  <td class="actions">
101
101
  <% if can?(:edit, promotion) %>
@@ -35,7 +35,7 @@
35
35
  </div>
36
36
 
37
37
  <div class="form-buttons filter-actions actions" data-hook="buttons">
38
- <%= button_tag Spree::Refund.model_name.human, class: 'btn btn-primary' %>
38
+ <%= f.submit Spree::Refund.model_name.human, class: 'btn btn-primary' %>
39
39
  <%= link_to t('spree.actions.cancel'), admin_order_payments_url(@refund.payment.order), class: 'btn btn-primary' %>
40
40
  </div>
41
41
  </fieldset>
@@ -97,10 +97,10 @@
97
97
  <% end %>
98
98
  <div class="form-buttons filter-actions actions" data-hook="reimburse-buttons">
99
99
  <% if !@reimbursement.reimbursed? %>
100
- <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button', method: 'post' } do %>
100
+ <%= button_to [:perform, :admin, @order, @reimbursement], { class: 'button btn btn-primary', method: 'post' } do %>
101
101
  <%= t('spree.reimburse') %>
102
102
  <% end %>
103
- <%= link_to t('spree.actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), class: 'btn btn-primary' %>
103
+ <%= link_to t('spree.actions.cancel'), url_for([:admin, @order, @reimbursement.customer_return]), class: 'btn btn-default' %>
104
104
  <% end %>
105
105
  </div>
106
106
  </fieldset>
@@ -49,11 +49,18 @@
49
49
  <%= f.label :state_id, Spree::State.model_name.human %>
50
50
  <span id="<%= s_or_b %>state">
51
51
  <%= f.hidden_field :state_name, value: nil %>
52
+ <% states = f.object.country.try(:states).nil? ? [] : f.object.country.states %>
52
53
  <%= f.text_field :state_name,
53
- style: "display: #{f.object.country.states.empty? ? 'block' : 'none' };",
54
- disabled: !f.object.country.states.empty?, class: 'fullwidth state_name js-state_name' %>
54
+ style: "display: #{states.empty? ? 'block' : 'none' };",
55
+ disabled: !states.empty?, class: 'fullwidth state_name js-state_name' %>
55
56
  <%= f.hidden_field :state_id, value: nil %>
56
- <%= f.collection_select :state_id, f.object.country.states.sort, :id, :name, {include_blank: true}, {class: 'custom-select fullwidth js-state_id', style: "display: #{f.object.country.states.empty? ? 'none' : 'block' };", disabled: f.object.country.states.empty?} %>
57
+ <%= f.collection_select :state_id,
58
+ states.sort,
59
+ :id, :name,
60
+ { include_blank: true },
61
+ { class: 'custom-select fullwidth js-state_id',
62
+ style: "display: #{states.empty? ? 'none' : 'block' };",
63
+ disabled: states.empty? } %>
57
64
  </span>
58
65
  </div>
59
66
 
@@ -1,4 +1,4 @@
1
1
  <div class="form-buttons filter-actions actions" data-hook="buttons">
2
2
  <%= button_tag t('spree.actions.update'), class: 'btn btn-primary' %>
3
- <%= link_to t('spree.actions.cancel'), collection_url, class: 'btn btn-primary' %>
3
+ <%= link_to t('spree.actions.cancel'), collection_url, class: 'button' %>
4
4
  </div>
@@ -5,9 +5,7 @@
5
5
 
6
6
  <title><%= admin_page_title %></title>
7
7
 
8
- <!-- Get "Open Sans" font from Google -->
9
- <link href='//fonts.googleapis.com/css?family=Open+Sans:400italic,600italic,400,600&subset=latin,cyrillic,greek,vietnamese' rel='stylesheet' type='text/css'>
10
-
8
+ <%= favicon_link_tag 'favicon.ico' %>
11
9
  <%= stylesheet_link_tag 'spree/backend/all', media: 'all', data: {turbolinks_track: 'reload'} %>
12
10
  <%= javascript_include_tag 'spree/backend/all', data: {turbolinks_track: 'reload'} %>
13
11
 
@@ -1,7 +1,7 @@
1
1
  <% size ||= :mini %>
2
2
 
3
- <% if image && image.attachment? %>
4
- <%= image_tag image.attachment(size) %>
3
+ <% if image_url = image.try(:url, size) %>
4
+ <%= image_tag image_url %>
5
5
  <% else %>
6
6
  <span class="image-placeholder <%= size %>"></span>
7
7
  <% end %>
@@ -11,7 +11,7 @@
11
11
  <%= content %>
12
12
  </div>
13
13
  <div class="modal-footer">
14
- <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
14
+ <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
15
15
  </div>
16
16
  </div>
17
17
  </div>
@@ -12,6 +12,6 @@
12
12
  <%= tab :taxonomies %>
13
13
  <% end %>
14
14
  <% if can? :admin, Spree::Taxon %>
15
- <%= tab :taxons, label: :display_order %>
15
+ <%= tab :taxons, label: :display_order, match_path: '/taxons' %>
16
16
  <% end %>
17
17
  </ul>
@@ -16,6 +16,10 @@
16
16
  <% if can?(:display, Spree::AdjustmentReason) %>
17
17
  <%= settings_tab_item plural_resource_name(Spree::AdjustmentReason), spree.admin_adjustment_reasons_path %>
18
18
  <% end %>
19
+
20
+ <% if can?(:display, Spree::StoreCreditReason) %>
21
+ <%= settings_tab_item plural_resource_name(Spree::StoreCreditReason), spree.admin_store_credit_reasons_path %>
22
+ <% end %>
19
23
  </ul>
20
24
  </nav>
21
25
  <% end %>
@@ -8,12 +8,12 @@
8
8
  <% end %>
9
9
 
10
10
  <% if can?(:display, Spree::TaxCategory) || can?(:display, Spree::TaxRate) %>
11
- <%= tab :taxes, url: spree.admin_tax_categories_path %>
11
+ <%= tab :taxes, url: spree.admin_tax_categories_path, match_path: %r(tax_categories|tax_rates) %>
12
12
  <% end %>
13
13
 
14
14
  <% if can?(:display, Spree::RefundReason) || can?(:display, Spree::ReimbursementType) ||
15
- can?(:display, Spree::ReturnReason) || can?(:display, Spree::AdjustmentReason) %>
16
- <%= tab :checkout, url: spree.admin_refund_reasons_path %>
15
+ can?(:display, Spree::ReturnReason) || can?(:display, Spree::AdjustmentReason) %>
16
+ <%= tab :checkout, url: spree.admin_refund_reasons_path, match_path: %r(refund_reasons|reimbursement_types|return_reasons|adjustment_reasons) %>
17
17
  <% end %>
18
18
 
19
19
  <% if can?(:display, Spree::ShippingMethod) || can?(:display, Spree::ShippingCategory) || can?(:display, Spree::StockLocation) %>
@@ -1,11 +1,12 @@
1
- <% Spree::Backend::Config.menu_items.each do |menu_item| %>
1
+ <% Spree::Backend::Config.menu_items.sort_by { |item| item.position || Float::INFINITY }.each do |menu_item| %>
2
2
  <% if instance_exec(&menu_item.condition) %>
3
3
  <%=
4
4
  tab(
5
5
  *menu_item.sections,
6
6
  icon: menu_item.icon,
7
7
  label: menu_item.label,
8
- url: menu_item.url.is_a?(Symbol) ? spree.public_send(menu_item.url) : menu_item.url
8
+ url: menu_item.url.is_a?(Symbol) ? spree.public_send(menu_item.url) : menu_item.url,
9
+ match_path: menu_item.match_path,
9
10
  ) do
10
11
  %>
11
12
  <%- render partial: menu_item.partial if menu_item.partial %>
@@ -4,7 +4,7 @@
4
4
  <div class="field-block col-3">
5
5
  <div class="field">
6
6
  <%= label_tag nil, Spree::StockLocation.model_name.human %>
7
- <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { include_blank: true, class: 'custom-select fullwidth', "data-placeholder" => t('spree.select_a_stock_location') } %>
7
+ <%= select_tag :stock_location_id, options_from_collection_for_select(stock_locations, :id, :name, params[:stock_location_id]), { include_blank: t('spree.all'), class: 'custom-select fullwidth', "data-placeholder" => t('spree.select_a_stock_location') } %>
8
8
  </div>
9
9
  </div>
10
10
  <div class="<%= if content_for?(:sidebar) then 'col-6' else 'col-9' end %>">
@@ -1,7 +1,7 @@
1
1
  <div data-hook="admin_shipping_method_form_fields" class="row">
2
2
  <div data-hook="admin_shipping_method_form_name_field" class="col-5">
3
3
  <%= f.field_container :name do %>
4
- <%= f.label :name %><br />
4
+ <%= f.label :name, class: 'required' %>
5
5
  <%= f.text_field :name, class: 'fullwidth' %>
6
6
  <%= error_message_on :shipping_method, :name %>
7
7
  <% end %>
@@ -9,32 +9,32 @@
9
9
 
10
10
  <div data-hook="admin_shipping_method_form_internal_name_field" class="col-5">
11
11
  <%= f.field_container :admin_name do %>
12
- <%= f.label :admin_name %><br />
13
- <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
12
+ <%= f.label :admin_name %>
13
+ <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
14
14
  <%= error_message_on :shipping_method, :admin_name %>
15
15
  <% end %>
16
16
  </div>
17
17
 
18
18
  <div data-hook="admin_shipping_method_form_code" class="col-5">
19
19
  <%= f.field_container :code do %>
20
- <%= f.label :code %><br />
21
- <%= f.text_field :code, class: 'fullwidth', label: false %>
20
+ <%= f.label :code %>
21
+ <%= f.text_field :code, class: 'fullwidth', label: false %>
22
22
  <%= error_message_on :shipping_method, :code %>
23
23
  <% end %>
24
24
  </div>
25
25
 
26
26
  <div class="col-5">
27
27
  <%= f.field_container :carrier do %>
28
- <%= f.label :carrier %><br />
29
- <%= f.text_field :carrier, class: 'fullwidth', label: false %>
28
+ <%= f.label :carrier %>
29
+ <%= f.text_field :carrier, class: 'fullwidth', label: false %>
30
30
  <%= error_message_on :shipping_method, :carrier %>
31
31
  <% end %>
32
32
  </div>
33
33
 
34
34
  <div class="col-5">
35
35
  <%= f.field_container :service_level do %>
36
- <%= f.label :service_level %><br />
37
- <%= f.text_field :service_level, class: 'fullwidth', label: false %>
36
+ <%= f.label :service_level %>
37
+ <%= f.text_field :service_level, class: 'fullwidth', label: false %>
38
38
  <%= error_message_on :shipping_method, :service_level %>
39
39
  <% end %>
40
40
  </div>
@@ -49,7 +49,7 @@
49
49
 
50
50
  <div data-hook="admin_shipping_method_form_tracking_url_field" class="col-10">
51
51
  <%= f.field_container :tracking_url do %>
52
- <%= f.label :tracking_url %><br />
52
+ <%= f.label :tracking_url %>
53
53
  <%= f.text_field :tracking_url, class: 'fullwidth', placeholder: t('spree.tracking_url_placeholder') %>
54
54
  <%= error_message_on :shipping_method, :tracking_url %>
55
55
  <% end %>
@@ -1,34 +1,37 @@
1
+ <% admin_layout "full-width" %>
2
+
1
3
  <%= paginate @variants, theme: "solidus_admin" %>
2
4
 
3
5
  <table class="index stock-table" id="listing_product_stock">
4
6
  <colgroup>
5
- <col style="width: 50%" />
6
- <col style="width: 20%" />
7
- <col style="width: 10%" />
8
- <col style="width: 5%" />
9
- <col style="width: 5%" />
10
- <col style="width: 10%" />
7
+ <col style="width: 30%">
8
+ <col style="width: 15%">
9
+ <col style="width: 14%">
10
+ <col style="width: 11%">
11
+ <col style="width: 11%">
12
+ <col style="width: 10%">
13
+ <col style="width: 9%">
11
14
  </colgroup>
12
15
  <thead>
13
16
  <tr>
14
17
  <th><%= t('spree.item') %></th>
15
- <th><%= t('spree.options') %></th>
18
+ <th><%= Spree::Variant.model_name.human %></th>
16
19
  <th><%= Spree::StockLocation.model_name.human %></th>
17
- <th><%= t('spree.backorderable_header') %></th>
18
- <th><%= t('spree.count_on_hand') %></th>
20
+ <th class="align-center"><%= t('spree.backorderable_header') %></th>
21
+ <th class="align-center"><%= t('spree.count_on_hand') %></th>
22
+ <th><%= t('spree.modify_stock_count') %></th>
19
23
  <th class="actions"></th>
20
24
  </tr>
21
25
  </thead>
22
26
  <% variants.each do |variant| %>
23
- <%- locations_without_items = @stock_item_stock_locations - variant.stock_items.flat_map(&:stock_location) %>
24
- <%- display_add_row = locations_without_items.any? && can?(:create, Spree::StockItem) %>
25
- <%- row_count = @stock_item_stock_locations.count + 2 %>
26
27
  <tbody class="variant-stock-items">
27
28
  <tr id="<%= spree_dom_id variant %>">
28
- <td class="no-padding" rowspan="<%= row_count %>">
29
+ <td>
29
30
  <div class='variant-container'>
30
31
  <div class='variant-image'>
31
- <%= render 'spree/admin/shared/image', image: variant.display_image(fallback: false), size: :small %>
32
+ <%= render 'spree/admin/shared/image',
33
+ image: variant.gallery.images.first,
34
+ size: :small %>
32
35
  </div>
33
36
  <div class='variant-details'>
34
37
  <table class='stock-variant-field-table'>
@@ -46,7 +49,7 @@
46
49
  </div>
47
50
  </div>
48
51
  </td>
49
- <td rowspan="<%= row_count %>">
52
+ <td class="align-center">
50
53
  <table class='stock-variant-field-table'>
51
54
  <% variant.option_values.sort_by(&:option_type_name).each do |option_value| %>
52
55
  <tr>
@@ -58,30 +61,45 @@
58
61
  <% end %>
59
62
  </table>
60
63
  </td>
64
+ <td class="stock-location-items-cell" colspan="5">
65
+ <table class="stock-location-items-table">
66
+ <colgroup>
67
+ <col style="width: 25%" />
68
+ <col style="width: 20%" />
69
+ <col style="width: 20%" />
70
+ <col style="width: 20%" />
71
+ <col style="width: 15%" />
72
+ </colgroup>
73
+ <% variant.stock_items.each do |item| %>
74
+ <% if @stock_item_stock_locations.include?(item.stock_location) %>
75
+ <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>" data-track-inventory="<%= variant.should_track_inventory? %>" data-can-edit="<%= can?(:admin, Spree::StockItem) %>">
76
+ <%# This is rendered in JS %>
77
+ </tr>
78
+ <% end %>
79
+ <% end %>
80
+ <% locations_without_items = @stock_item_stock_locations - variant.stock_items.flat_map(&:stock_location) %>
81
+ <% if locations_without_items.any? && can?(:create, Spree::StockItem) %>
82
+ <tr class="js-add-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>">
83
+ <form>
84
+ <td class='location-name-cell'>
85
+ <%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), class: 'custom-select', prompt: t('spree.add_to_stock_location'), id: "variant-stock-location-#{variant.id}" %>
86
+ </td>
87
+ <td class="align-center">
88
+ <%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %>
89
+ </td>
90
+ <td>
91
+ <%= number_field_tag :count_on_hand, "", class: 'fullwidth', id: "variant-count-on-hand-#{variant.id}" %>
92
+ </td>
93
+ <td></td>
94
+ <td class="actions">
95
+ <%= link_to_with_icon 'plus', t('spree.actions.create'), '#', no_text: true, data: { action: 'add' }, class: "submit" %>
96
+ </td>
97
+ </form>
98
+ </tr>
99
+ <% end %>
100
+ </table>
101
+ </td>
61
102
  </tr>
62
- <% variant.stock_items.each do |item| %>
63
- <% if @stock_item_stock_locations.include?(item.stock_location) %>
64
- <tr class="js-edit-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>" data-stock-item="<%= item.to_json %>" data-stock-location-name="<%= item.stock_location.name %>">
65
- <%# This is rendered in JS %>
66
- </tr>
67
- <% end %>
68
- <% end %>
69
- <% if display_add_row %>
70
- <tr class="js-add-stock-item stock-item-edit-row" data-variant-id="<%= variant.id %>">
71
- <td class='location-name-cell'>
72
- <%= select_tag :stock_location_id, options_from_collection_for_select(locations_without_items, :id, :name), { include_blank: true, class: 'custom-select', "data-placeholder" => t('spree.add_to_stock_location'), id: "variant-stock-location-#{variant.id}" } %>
73
- </td>
74
- <td class="align-center">
75
- <%= check_box_tag :backorderable, 'backorderable', false, id: "variant-backorderable-#{variant.id}" %>
76
- </td>
77
- <td class="align-center">
78
- <%= number_field_tag :count_on_hand, "", class: 'fullwidth', id: "variant-count-on-hand-#{variant.id}" %>
79
- </td>
80
- <td class="actions">
81
- <%= link_to_with_icon 'plus', t('spree.actions.create'), '#', no_text: true, data: { action: 'add' }, class: "submit" %>
82
- </td>
83
- </tr>
84
- <% end %>
85
103
  </tbody>
86
104
  <% end %>
87
105
  </table>
@@ -1,122 +1,134 @@
1
- <div data-hook="admin_stock_locations_form_fields" class="js-addresses-form">
2
- <fieldset class="no-border-bottom">
3
- <legend><%= t('.general') %></legend>
4
-
5
- <%= f.field_container :name do %>
6
- <%= f.label :name, class: 'required' %><br />
7
- <%= f.text_field :name, class: 'fullwidth', required: true %>
8
- <% end %>
9
-
10
- <%= f.field_container :code do %>
11
- <%= f.label :code %>
12
- <%= f.text_field :code, :class => 'fullwidth', :label => false %>
13
- <% end %>
14
-
15
- <%= f.field_container :admin_name do %>
16
- <%= f.label :admin_name %>
17
- <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
18
- <% end %>
19
- </fieldset>
20
-
21
- <fieldset class="no-border-bottom">
22
- <legend><%= t('.settings') %></legend>
23
-
24
- <%= f.field_container :active do %>
25
- <label>
26
- <%= f.check_box :active %>
27
- <%= Spree::StockLocation.human_attribute_name :active %>
28
- <%= f.field_hint :active %>
29
- </label>
30
- <% end %>
31
-
32
- <%= f.field_container :default do %>
33
- <label>
34
- <%= f.check_box :default %>
35
- <%= Spree::StockLocation.human_attribute_name :default %>
36
- </label>
37
- <% end %>
38
-
39
- <%= f.field_container :backorderable_default do %>
40
- <label>
41
- <%= f.check_box :backorderable_default %>
42
- <%= Spree::StockLocation.human_attribute_name :backorderable_default %>
43
- <%= f.field_hint :backorderable_default %>
44
- </label>
45
- <% end %>
46
-
47
- <%= f.field_container :propagate_all_variants do %>
48
- <label>
49
- <%= f.check_box :propagate_all_variants %>
50
- <%= Spree::StockLocation.human_attribute_name :propagate_all_variants %>
51
- <%= f.field_hint :propagate_all_variants %>
52
- </label>
53
- <% end %>
54
-
55
- <%= f.field_container :restock_inventory do %>
56
- <label>
57
- <%= f.check_box :restock_inventory %>
58
- <%= Spree::StockLocation.human_attribute_name :restock_inventory %>
59
- <%= f.field_hint :restock_inventory %>
60
- </label>
61
- <% end %>
62
-
63
- <%= f.field_container :fulfillable do %>
64
- <label>
65
- <%= f.check_box :fulfillable %>
66
- <%= Spree::StockLocation.human_attribute_name :fulfillable %>
67
- <%= f.field_hint :fulfillable %>
68
- </label>
69
- <% end %>
70
-
71
- <%= f.field_container :check_stock_on_transfer do %>
72
- <label>
73
- <%= f.check_box :check_stock_on_transfer %>
74
- <%= Spree::StockLocation.human_attribute_name :check_stock_on_transfer %>
75
- <%= f.field_hint :check_stock_on_transfer %>
76
- </label>
77
- <% end %>
78
- </fieldset>
79
-
80
- <fieldset>
81
- <legend><%= t('.address') %></legend>
82
-
83
- <%= f.field_container :check_stock_on_transfer do %>
84
- <%= f.label :address1 %>
85
- <%= f.text_field :address1, class: 'fullwidth' %>
86
- <% end %>
87
-
88
- <%= f.field_container :address2 do %>
89
- <%= f.label :address2 %>
90
- <%= f.text_field :address2, class: 'fullwidth' %>
91
- <% end %>
92
-
93
- <%= f.field_container :city do %>
94
- <%= f.label :city %>
95
- <%= f.text_field :city, class: 'fullwidth' %>
96
- <% end %>
97
-
98
- <%= f.field_container :zipcode do %>
99
- <%= f.label :zipcode %>
100
- <%= f.text_field :zipcode, class: 'fullwidth' %>
101
- <% end %>
102
-
103
- <%= f.field_container :phone do %>
104
- <%= f.label :phone %>
105
- <%= f.phone_field :phone, class: 'fullwidth' %>
106
- <% end %>
107
-
108
- <%= f.field_container :country_id do %>
109
- <%= f.label :country_id %>
110
- <span id="country"><%= f.collection_select :country_id, available_countries(restrict_to_zone: nil), :id, :name, { include_blank: true }, { class: 'custom-select js-country_id fullwidth' } %></span>
111
- <% end %>
112
-
113
- <%= f.field_container :state do %>
114
- <% country = f.object.country %>
115
- <%= f.label :state_id %>
116
- <span id="state" class="region">
117
- <%= f.text_field :state_name, style: "display: none", class: 'fullwidth state_name js-state_name' %>
118
- <%= f.collection_select :state_id, country ? country.states.sort : [], :id, :name, { include_blank: true }, {class: 'custom-select fullwidth js-state_id', style: "display: none" } %>
119
- </span>
120
- <% end %>
121
- </fieldset>
1
+ <div data-hook="admin_stock_locations_form_fields" class="js-addresses-form row">
2
+ <div class="col-md-6">
3
+ <fieldset class="no-border-bottom">
4
+ <legend><%= t('.general') %></legend>
5
+
6
+ <%= f.field_container :name do %>
7
+ <%= f.label :name, class: 'required' %><br />
8
+ <%= f.text_field :name, class: 'fullwidth', required: true %>
9
+ <% end %>
10
+
11
+ <%= f.field_container :code do %>
12
+ <%= f.label :code %>
13
+ <%= f.text_field :code, :class => 'fullwidth', :label => false %>
14
+ <% end %>
15
+
16
+ <%= f.field_container :admin_name do %>
17
+ <%= f.label :admin_name %>
18
+ <%= f.text_field :admin_name, class: 'fullwidth', label: false %>
19
+ <% end %>
20
+ </fieldset>
21
+ </div>
22
+
23
+ <div class="col-md-6">
24
+ <fieldset class="no-border-bottom">
25
+ <legend><%= t('.address') %></legend>
26
+
27
+ <%= f.field_container :check_stock_on_transfer do %>
28
+ <%= f.label :address1 %>
29
+ <%= f.text_field :address1, class: 'fullwidth' %>
30
+ <% end %>
31
+
32
+ <%= f.field_container :address2 do %>
33
+ <%= f.label :address2 %>
34
+ <%= f.text_field :address2, class: 'fullwidth' %>
35
+ <% end %>
36
+
37
+ <%= f.field_container :city do %>
38
+ <%= f.label :city %>
39
+ <%= f.text_field :city, class: 'fullwidth' %>
40
+ <% end %>
41
+
42
+ <%= f.field_container :zipcode do %>
43
+ <%= f.label :zipcode %>
44
+ <%= f.text_field :zipcode, class: 'fullwidth' %>
45
+ <% end %>
46
+
47
+ <%= f.field_container :phone do %>
48
+ <%= f.label :phone %>
49
+ <%= f.phone_field :phone, class: 'fullwidth' %>
50
+ <% end %>
51
+
52
+ <%= f.field_container :country_id do %>
53
+ <%= f.label :country_id %>
54
+ <span id="country"><%= f.collection_select :country_id, available_countries(restrict_to_zone: nil), :id, :name, { include_blank: true }, { class: 'custom-select js-country_id fullwidth' } %></span>
55
+ <% end %>
56
+
57
+ <%= f.field_container :state do %>
58
+ <% country = f.object.country %>
59
+ <%= f.label :state_id %>
60
+ <span id="state" class="region">
61
+ <%= f.text_field :state_name, style: "display: none", class: 'fullwidth state_name js-state_name' %>
62
+ <%= f.collection_select :state_id, country ? country.states.sort : [], :id, :name, { include_blank: true }, {class: 'custom-select fullwidth js-state_id', style: "display: none" } %>
63
+ </span>
64
+ <% end %>
65
+ </fieldset>
66
+ </div>
67
+
68
+ <div class="col-md-12">
69
+ <fieldset class="no-border-bottom">
70
+ <legend><%= t('.settings') %></legend>
71
+
72
+ <div class="row">
73
+ <div class="col-md-6">
74
+ <%= f.field_container :active do %>
75
+ <label>
76
+ <%= f.check_box :active %>
77
+ <%= Spree::StockLocation.human_attribute_name :active %>
78
+ <%= f.field_hint :active %>
79
+ </label>
80
+ <% end %>
81
+
82
+ <%= f.field_container :default do %>
83
+ <label>
84
+ <%= f.check_box :default %>
85
+ <%= Spree::StockLocation.human_attribute_name :default %>
86
+ </label>
87
+ <% end %>
88
+
89
+ <%= f.field_container :backorderable_default do %>
90
+ <label>
91
+ <%= f.check_box :backorderable_default %>
92
+ <%= Spree::StockLocation.human_attribute_name :backorderable_default %>
93
+ <%= f.field_hint :backorderable_default %>
94
+ </label>
95
+ <% end %>
96
+ </div>
97
+
98
+ <div class="col-md-6">
99
+ <%= f.field_container :propagate_all_variants do %>
100
+ <label>
101
+ <%= f.check_box :propagate_all_variants %>
102
+ <%= Spree::StockLocation.human_attribute_name :propagate_all_variants %>
103
+ <%= f.field_hint :propagate_all_variants %>
104
+ </label>
105
+ <% end %>
106
+
107
+ <%= f.field_container :restock_inventory do %>
108
+ <label>
109
+ <%= f.check_box :restock_inventory %>
110
+ <%= Spree::StockLocation.human_attribute_name :restock_inventory %>
111
+ <%= f.field_hint :restock_inventory %>
112
+ </label>
113
+ <% end %>
114
+
115
+ <%= f.field_container :fulfillable do %>
116
+ <label>
117
+ <%= f.check_box :fulfillable %>
118
+ <%= Spree::StockLocation.human_attribute_name :fulfillable %>
119
+ <%= f.field_hint :fulfillable %>
120
+ </label>
121
+ <% end %>
122
+
123
+ <%= f.field_container :check_stock_on_transfer do %>
124
+ <label>
125
+ <%= f.check_box :check_stock_on_transfer %>
126
+ <%= Spree::StockLocation.human_attribute_name :check_stock_on_transfer %>
127
+ <%= f.field_hint :check_stock_on_transfer %>
128
+ </label>
129
+ <% end %>
130
+ </div>
131
+ </div>
132
+ </fieldset>
133
+ </div>
122
134
  </div>