solidus_backend 2.0.3 → 2.1.0.beta1

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 (192) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/handlebars_extensions.coffee +14 -6
  3. data/app/assets/javascripts/spree/backend/images/upload.js +203 -0
  4. data/app/assets/javascripts/spree/backend/option_value_picker.js +2 -1
  5. data/app/assets/javascripts/spree/backend/stock_management/index_update_forms.coffee +1 -1
  6. data/app/assets/javascripts/spree/backend/taxon_autocomplete.js +5 -1
  7. data/app/assets/javascripts/spree/backend/taxons.js.coffee +1 -1
  8. data/app/assets/javascripts/spree/backend/templates/index.js +15 -0
  9. data/app/assets/javascripts/spree/backend/templates/products/upload_progress.hbs +12 -0
  10. data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_flat_rate.hbs +13 -11
  11. data/app/assets/javascripts/spree/backend/templates/promotions/calculators/fields/tiered_percent.hbs +12 -10
  12. data/app/assets/javascripts/spree/backend/templates/promotions/rules/option_values.hbs +7 -5
  13. data/app/assets/javascripts/spree/backend.js +57 -3
  14. data/app/assets/stylesheets/spree/backend/_bootstrap_custom.scss +1 -1
  15. data/app/assets/stylesheets/spree/backend/components/_sidebar.scss +2 -0
  16. data/app/assets/stylesheets/spree/backend/components/_table-filter.scss +3 -1
  17. data/app/assets/stylesheets/spree/backend/components/_tabs.scss +2 -0
  18. data/app/assets/stylesheets/spree/backend/sections/_adjustments.scss +3 -0
  19. data/app/assets/stylesheets/spree/backend/sections/_products.scss +29 -17
  20. data/app/assets/stylesheets/spree/backend/sections/_stock_management.scss +6 -0
  21. data/app/assets/stylesheets/spree/backend/shared/_header.scss +2 -0
  22. data/app/assets/stylesheets/spree/backend/shared/_layout.scss +5 -0
  23. data/app/assets/stylesheets/spree/backend/shared/_utilities.scss +1 -2
  24. data/app/assets/stylesheets/spree/backend/spree_admin.scss +1 -3
  25. data/app/controllers/spree/admin/orders_controller.rb +2 -0
  26. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  27. data/app/controllers/spree/admin/prices_controller.rb +7 -1
  28. data/app/controllers/spree/admin/products_controller.rb +0 -6
  29. data/app/controllers/spree/admin/promotions_controller.rb +0 -2
  30. data/app/controllers/spree/admin/users_controller.rb +3 -0
  31. data/app/helpers/spree/admin/adjustments_helper.rb +1 -1
  32. data/app/helpers/spree/admin/base_helper.rb +0 -35
  33. data/app/helpers/spree/admin/stock_transfers_helper.rb +14 -0
  34. data/app/models/spree/backend_configuration.rb +2 -2
  35. data/app/views/spree/admin/adjustment_reasons/index.html.erb +1 -1
  36. data/app/views/spree/admin/adjustment_reasons/shared/_form.html.erb +14 -16
  37. data/app/views/spree/admin/adjustments/_adjustment.html.erb +4 -1
  38. data/app/views/spree/admin/adjustments/_form.html.erb +24 -20
  39. data/app/views/spree/admin/cancellations/index.html.erb +2 -3
  40. data/app/views/spree/admin/countries/_form.html.erb +4 -4
  41. data/app/views/spree/admin/customer_returns/index.html.erb +1 -1
  42. data/app/views/spree/admin/customer_returns/new.html.erb +5 -7
  43. data/app/views/spree/admin/general_settings/edit.html.erb +55 -46
  44. data/app/views/spree/admin/images/_form.html.erb +13 -11
  45. data/app/views/spree/admin/images/_image_row.html.erb +22 -0
  46. data/app/views/spree/admin/images/create.js.erb +9 -0
  47. data/app/views/spree/admin/images/edit.html.erb +12 -8
  48. data/app/views/spree/admin/images/index.html.erb +57 -49
  49. data/app/views/spree/admin/option_types/_form.html.erb +2 -2
  50. data/app/views/spree/admin/option_types/index.html.erb +1 -1
  51. data/app/views/spree/admin/orders/_add_line_item.html.erb +5 -3
  52. data/app/views/spree/admin/orders/_add_product.html.erb +5 -3
  53. data/app/views/spree/admin/orders/_shipment.html.erb +14 -6
  54. data/app/views/spree/admin/orders/cart.html.erb +1 -1
  55. data/app/views/spree/admin/orders/confirm/_customer_details.html.erb +17 -15
  56. data/app/views/spree/admin/orders/customer_details/_form.html.erb +28 -26
  57. data/app/views/spree/admin/orders/customer_details/show.html.erb +1 -1
  58. data/app/views/spree/admin/orders/edit.html.erb +1 -1
  59. data/app/views/spree/admin/orders/index.html.erb +70 -63
  60. data/app/views/spree/admin/payment_methods/_form.html.erb +54 -48
  61. data/app/views/spree/admin/payment_methods/index.html.erb +7 -5
  62. data/app/views/spree/admin/payments/_form.html.erb +2 -2
  63. data/app/views/spree/admin/payments/index.html.erb +1 -1
  64. data/app/views/spree/admin/payments/source_forms/_gateway.html.erb +32 -30
  65. data/app/views/spree/admin/payments/source_forms/_storecredit.html.erb +1 -0
  66. data/app/views/spree/admin/payments/source_views/_gateway.html.erb +1 -1
  67. data/app/views/spree/admin/payments/source_views/_storecredit.html.erb +8 -1
  68. data/app/views/spree/admin/prices/_form.html.erb +38 -43
  69. data/app/views/spree/admin/prices/_master_variant_table.html.erb +41 -0
  70. data/app/views/spree/admin/prices/_table.html.erb +35 -33
  71. data/app/views/spree/admin/prices/index.html.erb +37 -35
  72. data/app/views/spree/admin/product_properties/index.html.erb +0 -7
  73. data/app/views/spree/admin/products/_form.html.erb +153 -144
  74. data/app/views/spree/admin/products/edit.html.erb +1 -1
  75. data/app/views/spree/admin/products/index.html.erb +19 -13
  76. data/app/views/spree/admin/products/new.html.erb +5 -38
  77. data/app/views/spree/admin/promotion_categories/_form.html.erb +1 -1
  78. data/app/views/spree/admin/promotion_rules/create.js.erb +6 -0
  79. data/app/views/spree/admin/promotions/_actions.html.erb +1 -1
  80. data/app/views/spree/admin/promotions/_form.html.erb +48 -44
  81. data/app/views/spree/admin/promotions/_promotion_rule.html.erb +1 -1
  82. data/app/views/spree/admin/promotions/_rules.html.erb +8 -4
  83. data/app/views/spree/admin/promotions/actions/_create_quantity_adjustments.html.erb +9 -5
  84. data/app/views/spree/admin/promotions/actions/_promotion_calculators_with_custom_fields.html.erb +30 -24
  85. data/app/views/spree/admin/promotions/edit.html.erb +2 -2
  86. data/app/views/spree/admin/promotions/index.html.erb +22 -20
  87. data/app/views/spree/admin/promotions/new.html.erb +1 -1
  88. data/app/views/spree/admin/promotions/rules/_first_repeat_purchase_since.html.erb +11 -5
  89. data/app/views/spree/admin/promotions/rules/_item_total.html.erb +18 -8
  90. data/app/views/spree/admin/promotions/rules/_landing_page.html.erb +7 -5
  91. data/app/views/spree/admin/promotions/rules/_nth_order.html.erb +13 -6
  92. data/app/views/spree/admin/promotions/rules/_option_value.html.erb +11 -7
  93. data/app/views/spree/admin/promotions/rules/_product.html.erb +11 -7
  94. data/app/views/spree/admin/promotions/rules/_taxon.html.erb +15 -9
  95. data/app/views/spree/admin/promotions/rules/_user.html.erb +5 -3
  96. data/app/views/spree/admin/promotions/rules/_user_role.html.erb +12 -0
  97. data/app/views/spree/admin/properties/_form.html.erb +2 -2
  98. data/app/views/spree/admin/properties/index.html.erb +7 -5
  99. data/app/views/spree/admin/refund_reasons/index.html.erb +1 -1
  100. data/app/views/spree/admin/refund_reasons/shared/_form.html.erb +14 -16
  101. data/app/views/spree/admin/refunds/edit.html.erb +2 -2
  102. data/app/views/spree/admin/refunds/new.html.erb +4 -4
  103. data/app/views/spree/admin/shared/_configuration_menu.html.erb +0 -4
  104. data/app/views/spree/admin/shared/_head.html.erb +1 -1
  105. data/app/views/spree/admin/shared/_product_sub_menu.html.erb +0 -3
  106. data/app/views/spree/admin/shared/_rebuild_vat_prices_checkbox.html.erb +1 -1
  107. data/app/views/spree/admin/shared/_settings_sub_menu.html.erb +2 -2
  108. data/app/views/spree/admin/shared/_sidebar.html.erb +1 -1
  109. data/app/views/spree/admin/shared/_variant_search.html.erb +12 -8
  110. data/app/views/spree/admin/shared/named_types/_form.html.erb +1 -1
  111. data/app/views/spree/admin/shared/named_types/_index.html.erb +1 -1
  112. data/app/views/spree/admin/shipping_categories/index.html.erb +1 -1
  113. data/app/views/spree/admin/shipping_methods/_form.html.erb +74 -81
  114. data/app/views/spree/admin/shipping_methods/index.html.erb +3 -3
  115. data/app/views/spree/admin/states/_form.html.erb +2 -2
  116. data/app/views/spree/admin/states/index.html.erb +9 -5
  117. data/app/views/spree/admin/stock_locations/_form.html.erb +42 -28
  118. data/app/views/spree/admin/stock_locations/_transfer_stock_form.html.erb +4 -4
  119. data/app/views/spree/admin/stock_locations/index.html.erb +1 -1
  120. data/app/views/spree/admin/stock_movements/_form.html.erb +1 -1
  121. data/app/views/spree/admin/stock_movements/index.html.erb +1 -1
  122. data/app/views/spree/admin/stock_transfers/_stock_movements.html.erb +1 -1
  123. data/app/views/spree/admin/stock_transfers/_transfer_item_table.html.erb +10 -1
  124. data/app/views/spree/admin/stock_transfers/index.html.erb +29 -27
  125. data/app/views/spree/admin/stock_transfers/show.html.erb +26 -24
  126. data/app/views/spree/admin/store_credits/_form.html.erb +3 -3
  127. data/app/views/spree/admin/store_credits/_update_reason_field.html.erb +1 -1
  128. data/app/views/spree/admin/store_credits/edit_amount.html.erb +1 -1
  129. data/app/views/spree/admin/store_credits/index.html.erb +2 -2
  130. data/app/views/spree/admin/style_guide/topics/forms/_building_forms.html.erb +49 -47
  131. data/app/views/spree/admin/style_guide/topics/messaging/_loading.html.erb +11 -1
  132. data/app/views/spree/admin/tax_categories/_form.html.erb +4 -4
  133. data/app/views/spree/admin/tax_categories/index.html.erb +1 -1
  134. data/app/views/spree/admin/tax_rates/_form.html.erb +28 -28
  135. data/app/views/spree/admin/tax_rates/index.html.erb +1 -1
  136. data/app/views/spree/admin/taxonomies/index.html.erb +1 -1
  137. data/app/views/spree/admin/taxons/_form.html.erb +6 -6
  138. data/app/views/spree/admin/taxons/index.html.erb +2 -2
  139. data/app/views/spree/admin/users/_addresses_form.html.erb +19 -15
  140. data/app/views/spree/admin/users/_form.html.erb +9 -6
  141. data/app/views/spree/admin/users/_user_page_actions.html.erb +1 -1
  142. data/app/views/spree/admin/users/addresses.html.erb +1 -1
  143. data/app/views/spree/admin/users/edit.html.erb +2 -2
  144. data/app/views/spree/admin/users/items.html.erb +2 -2
  145. data/app/views/spree/admin/users/orders.html.erb +2 -2
  146. data/app/views/spree/admin/variants/_form.html.erb +73 -49
  147. data/app/views/spree/admin/variants/_table_filter.html.erb +12 -8
  148. data/app/views/spree/admin/variants/index.html.erb +2 -2
  149. data/app/views/spree/admin/zones/_country_members.html.erb +1 -1
  150. data/app/views/spree/admin/zones/_form.html.erb +34 -31
  151. data/app/views/spree/admin/zones/_state_members.html.erb +1 -1
  152. data/app/views/spree/admin/zones/index.html.erb +1 -3
  153. data/app/views/spree/layouts/admin.html.erb +4 -4
  154. data/config/routes.rb +0 -11
  155. data/solidus_backend.gemspec +4 -1
  156. data/spec/controllers/spree/admin/payments_controller_spec.rb +2 -3
  157. data/spec/controllers/spree/admin/prices_controller_spec.rb +5 -3
  158. data/spec/features/admin/configuration/general_settings_spec.rb +12 -0
  159. data/spec/features/admin/configuration/payment_methods_spec.rb +3 -2
  160. data/spec/features/admin/configuration/shipping_methods_spec.rb +1 -1
  161. data/spec/features/admin/homepage_spec.rb +0 -3
  162. data/spec/features/admin/orders/adjustments_spec.rb +28 -25
  163. data/spec/features/admin/orders/customer_details_spec.rb +1 -1
  164. data/spec/features/admin/orders/order_details_spec.rb +27 -1
  165. data/spec/features/admin/orders/payments_spec.rb +1 -1
  166. data/spec/features/admin/products/edit/images_spec.rb +28 -1
  167. data/spec/features/admin/products/pricing_spec.rb +17 -2
  168. data/spec/features/admin/products/products_spec.rb +0 -104
  169. data/spec/features/admin/store_credits_spec.rb +3 -3
  170. data/spec/features/admin/users_spec.rb +7 -1
  171. metadata +21 -32
  172. data/app/assets/javascripts/spree/backend/nested-attribute.js +0 -27
  173. data/app/assets/stylesheets/spree/backend/sections/_adjustments_table.scss +0 -8
  174. data/app/assets/stylesheets/spree/backend/sections/_edit_checkouts.scss +0 -72
  175. data/app/assets/stylesheets/spree/backend/sections/_tax_zones.scss +0 -15
  176. data/app/controllers/spree/admin/prototypes_controller.rb +0 -26
  177. data/app/controllers/spree/admin/trackers_controller.rb +0 -6
  178. data/app/views/spree/admin/prototypes/_form.html.erb +0 -36
  179. data/app/views/spree/admin/prototypes/_prototypes.html.erb +0 -25
  180. data/app/views/spree/admin/prototypes/available.js.erb +0 -2
  181. data/app/views/spree/admin/prototypes/edit.html.erb +0 -15
  182. data/app/views/spree/admin/prototypes/index.html.erb +0 -50
  183. data/app/views/spree/admin/prototypes/new.html.erb +0 -9
  184. data/app/views/spree/admin/prototypes/new.js.erb +0 -5
  185. data/app/views/spree/admin/prototypes/select.js.erb +0 -4
  186. data/app/views/spree/admin/prototypes/show.html.erb +0 -42
  187. data/app/views/spree/admin/trackers/_form.html.erb +0 -28
  188. data/app/views/spree/admin/trackers/edit.html.erb +0 -19
  189. data/app/views/spree/admin/trackers/index.html.erb +0 -54
  190. data/app/views/spree/admin/trackers/new.html.erb +0 -18
  191. data/spec/features/admin/configuration/analytics_tracker_spec.rb +0 -50
  192. data/spec/features/admin/products/prototypes_spec.rb +0 -110
@@ -1,46 +1,60 @@
1
1
  <div data-hook="variants">
2
2
  <fieldset class="no-border-top no-border-bottom">
3
- <div class="field four columns alpha" data-hook="sku">
4
- <%= f.label :sku %>
5
- <%= f.text_field :sku, :class => 'fullwidth' %>
6
- </div>
7
- <div class="field four columns checkbox" data-hook="track_inventory">
8
- <%= f.label :track_inventory do %>
9
- <%= f.check_box :track_inventory %>
10
- <%= Spree::Variant.human_attribute_name(:track_inventory) %>
11
- <% end %>
3
+ <div class="row">
4
+ <div class="col-xs-3">
5
+ <div class="field" data-hook="sku">
6
+ <%= f.label :sku %>
7
+ <%= f.text_field :sku, :class => 'fullwidth' %>
8
+ </div>
9
+ </div>
10
+ <div class="col-xs-3">
11
+ <div class="field checkbox" data-hook="track_inventory">
12
+ <%= f.label :track_inventory do %>
13
+ <%= f.check_box :track_inventory %>
14
+ <%= Spree::Variant.human_attribute_name(:track_inventory) %>
15
+ <% end %>
16
+ </div>
17
+ </div>
12
18
  </div>
13
19
  </fieldset>
14
20
  <% if f.object.new_record? %>
15
21
  <fieldset class="no-border-top no-border-bottom">
22
+ <div class="row">
16
23
  <% @product.option_types.each_with_index do |option_type, index| %>
17
- <div class="field four columns <%= 'alpha' if index % 3 == 0 %><%= 'omega' if index % 3 == 2 %>" data-hook="presentation">
18
- <%= label :new_variant, option_type.presentation %>
19
- <%= f.collection_select 'option_value_ids',
20
- option_type.option_values,
21
- :id,
22
- :presentation,
23
- { include_blank: true },
24
- {
25
- name: 'variant[option_value_ids][]',
26
- class: "select2 fullwidth"
27
- } %>
28
- </div>
24
+ <div class="col-xs-3">
25
+ <div class="field" data-hook="presentation">
26
+ <%= label :new_variant, option_type.presentation %>
27
+ <%= f.collection_select 'option_value_ids',
28
+ option_type.option_values,
29
+ :id,
30
+ :presentation,
31
+ { include_blank: true },
32
+ {
33
+ name: 'variant[option_value_ids][]',
34
+ class: "select2 fullwidth"
35
+ } %>
36
+ </div>
37
+ </div>
29
38
  <% end %>
39
+ </div>
30
40
  </fieldset>
31
41
  <% end %>
32
42
  </div>
33
43
 
34
44
  <div data-hook="admin_variant_form_additional_fields">
35
45
  <fieldset class="no-border-top no-border-bottom">
36
- <% [:weight, :height, :width, :depth].each_with_index do |field, index| %>
37
- <div class="field four columns <%= 'alpha' if index % 4 == 0 %> <%= 'omega' if index % 4 == 3 %>" data-hook="<%= field %>">
38
- <%= f.label field %>
39
- <%= f.text_field field,
40
- value: number_with_precision(@variant.send(field), :precision => 2),
41
- class: 'fullwidth' %>
42
- </div>
43
- <% end %>
46
+ <div class="row">
47
+ <% [:weight, :height, :width, :depth].each_with_index do |field, index| %>
48
+ <div class="col-xs-3">
49
+ <div class="field" data-hook="<%= field %>">
50
+ <%= f.label field %>
51
+ <%= f.text_field field,
52
+ value: number_with_precision(@variant.send(field), :precision => 2),
53
+ class: 'fullwidth' %>
54
+ </div>
55
+ </div>
56
+ <% end %>
57
+ </div>
44
58
  </fieldset>
45
59
  </div>
46
60
 
@@ -48,29 +62,39 @@
48
62
  <fieldset class="no-border-top no-border-bottom">
49
63
  <p> <%== t('.pricing_hint') %> </p>
50
64
 
51
- <div class="field four columns alpha" data-hook="price">
52
- <%= f.label :price %>
53
- <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => ''), :class => 'fullwidth' %>
54
- </div>
65
+ <div class="row">
66
+ <div class="col-xs-3">
67
+ <div class="field" data-hook="price">
68
+ <%= f.label :price %>
69
+ <%= f.text_field :price, :value => number_to_currency(@variant.price, :unit => ''), :class => 'fullwidth' %>
70
+ </div>
71
+ </div>
55
72
 
56
- <% if show_rebuild_vat_checkbox? %>
57
- <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "variant", wrapper_class: "field four columns" %>
58
- <% end %>
73
+ <% if show_rebuild_vat_checkbox? %>
74
+ <div class="col-xs-3">
75
+ <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "variant", wrapper_class: "field" %>
76
+ </div>
77
+ <% end %>
59
78
 
60
- <div class="field four columns" data-hook="cost_price">
61
- <%= f.label :cost_price %>
62
- <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => ''), :class => 'fullwidth' %>
63
- </div>
79
+ <div class="col-xs-3">
80
+ <div class="field" data-hook="cost_price">
81
+ <%= f.label :cost_price %>
82
+ <%= f.text_field :cost_price, :value => number_to_currency(@variant.cost_price, :unit => ''), :class => 'fullwidth' %>
83
+ </div>
84
+ </div>
64
85
 
65
- <div class="field four columns omega" data-hook="tax_category">
66
- <%= f.label :tax_category %>
67
- <%= f.field_hint :tax_category %>
68
- <%= f.collection_select :tax_category_id,
69
- @tax_categories,
70
- :id,
71
- :name,
72
- { :include_blank => t('.use_product_tax_category') },
73
- { :class => 'select2 fullwidth' } %>
86
+ <div class="col-xs-3">
87
+ <div class="field" data-hook="tax_category">
88
+ <%= f.label :tax_category %>
89
+ <%= f.field_hint :tax_category %>
90
+ <%= f.collection_select :tax_category_id,
91
+ @tax_categories,
92
+ :id,
93
+ :name,
94
+ { :include_blank => t('.use_product_tax_category') },
95
+ { :class => 'select2 fullwidth' } %>
96
+ </div>
97
+ </div>
74
98
  </div>
75
99
  </fieldset>
76
100
  </div>
@@ -4,17 +4,21 @@
4
4
 
5
5
  <% content_for :table_filter do %>
6
6
  <%= form_for :variant_search, url: spree.admin_product_variants_path(product), method: :get do |f| %>
7
- <div data-hook="admin_variants_index_search" class="field thirteen columns alpha">
8
- <%= f.label :variant_search_term, Spree.t(:variant_search_placeholder) %>
9
- <%= text_field_tag :variant_search_term, params[:variant_search_term], :class => "fullwidth", :placeholder => Spree.t(:variant_search_placeholder) %>
7
+ <div class="col-xs-10">
8
+ <div data-hook="admin_variants_index_search" class="field">
9
+ <%= f.label :variant_search_term, Spree.t(:variant_search_placeholder) %>
10
+ <%= text_field_tag :variant_search_term, params[:variant_search_term], :class => "fullwidth", :placeholder => Spree.t(:variant_search_placeholder) %>
11
+ </div>
10
12
  </div>
11
13
 
12
14
  <% if product.variants.only_deleted.any? %>
13
- <div class="field checkbox three columns omega">
14
- <%= label_tag :deleted do %>
15
- <%= check_box_tag :deleted, "on", params[:deleted] == "on" %>
16
- <%= t('.show_deleted') %>
17
- <% end %>
15
+ <div class="col-xs-2">
16
+ <div class="field checkbox">
17
+ <%= label_tag :deleted do %>
18
+ <%= check_box_tag :deleted, "on", params[:deleted] == "on" %>
19
+ <%= t('.show_deleted') %>
20
+ <% end %>
21
+ </div>
18
22
  </div>
19
23
  <% end %>
20
24
 
@@ -17,12 +17,12 @@
17
17
  <% end %>
18
18
  </p>
19
19
  <% elsif @product.empty_option_values? %>
20
- <div class="alpha twelve columns no-objects-found">
20
+ <div class="col-xs-9 no-objects-found">
21
21
  <%= Spree.t :no_option_values_on_product_html,
22
22
  link: link_to(Spree.t(:product_details), [:edit, :admin, @product]) %>
23
23
  </div>
24
24
  <% else %>
25
- <div class="alpha twelve columns no-objects-found">
25
+ <div class="col-xs-9 no-objects-found">
26
26
  <%= Spree.t(:no_resource, resource: plural_resource_name(Spree::Variant)) %>
27
27
  <% if can? :create, Spree::Variant %>
28
28
  <%= link_to Spree.t(:create_one), new_object_url, remote: true %>
@@ -1,4 +1,4 @@
1
- <div id="country_members" data-hook="member" class="omega six columns">
1
+ <div id="country_members" data-hook="member">
2
2
  <fieldset class="no-border-bottom">
3
3
  <legend align="center"><%= plural_resource_name(Spree::Country) %></legend>
4
4
 
@@ -1,37 +1,40 @@
1
- <div class="alpha six columns" data-hook="admin_zone_form_fields">
2
- <fieldset class="no-border-bottom">
3
- <legend align="center"><%= Spree.t(:general_settings)%></legend>
1
+ <div class="row">
2
+ <div class="col-xs-5">
4
3
 
5
- <%= zone_form.field_container :name do %>
6
- <%= zone_form.label :name %><br />
7
- <%= zone_form.text_field :name, :class => 'fullwidth' %>
8
- <% end %>
4
+ <div data-hook="admin_zone_form_fields">
5
+ <fieldset class="no-border-bottom">
6
+ <legend align="center"><%= Spree.t(:general_settings)%></legend>
9
7
 
10
- <%= zone_form.field_container :description do %>
11
- <%= zone_form.label :description %><br />
12
- <%= zone_form.text_field :description, :class => 'fullwidth' %>
13
- <% end %>
8
+ <%= zone_form.field_container :name do %>
9
+ <%= zone_form.label :name %><br />
10
+ <%= zone_form.text_field :name, :class => 'fullwidth' %>
11
+ <% end %>
14
12
 
15
- <div data-hook="default" class="field">
16
- <%= zone_form.check_box :default_tax %>
17
- <%= zone_form.label :default_tax %>
18
- </div>
13
+ <%= zone_form.field_container :description do %>
14
+ <%= zone_form.label :description %><br />
15
+ <%= zone_form.text_field :description, :class => 'fullwidth' %>
16
+ <% end %>
19
17
 
20
- <div data-hook="type" class="field">
21
- <%= label_tag Spree.t(:type) %>
22
- <ul>
23
- <li>
24
- <%= zone_form.radio_button('kind', 'country', { :id => 'country_based' }) %>
25
- <%= label_tag :country_based, Spree.t(:country_based) %>
26
- </li>
27
- <li>
28
- <%= zone_form.radio_button('kind', 'state', { :id => 'state_based' }) %>
29
- <%= label_tag :state_based, Spree.t(:state_based) %>
30
- </li>
31
- </ul>
18
+ <div data-hook="type" class="field">
19
+ <%= label_tag Spree.t(:type) %>
20
+ <ul>
21
+ <li>
22
+ <%= zone_form.radio_button('kind', 'country', { :id => 'country_based' }) %>
23
+ <%= label_tag :country_based, Spree.t(:country_based) %>
24
+ </li>
25
+ <li>
26
+ <%= zone_form.radio_button('kind', 'state', { :id => 'state_based' }) %>
27
+ <%= label_tag :state_based, Spree.t(:state_based) %>
28
+ </li>
29
+ </ul>
30
+ </div>
31
+ </fieldset>
32
32
  </div>
33
- </fieldset>
34
- </div>
33
+ </div>
34
+ <div class="col-xs-5">
35
35
 
36
- <%= render :partial => 'state_members', :locals => { :zone_form => zone_form }%>
37
- <%= render :partial => 'country_members', :locals => { :zone_form => zone_form } %>
36
+ <%= render :partial => 'state_members', :locals => { :zone_form => zone_form }%>
37
+ <%= render :partial => 'country_members', :locals => { :zone_form => zone_form } %>
38
+ </div>
39
+
40
+ </div>
@@ -1,4 +1,4 @@
1
- <div id="state_members" data-hook="member" class="omega six columns">
1
+ <div id="state_members" data-hook="member">
2
2
  <fieldset class="no-border-bottom">
3
3
  <legend align="center"><%= plural_resource_name(Spree::State) %></legend>
4
4
 
@@ -29,7 +29,6 @@
29
29
  <th>
30
30
  <%= sort_link @search,:description, Spree::Zone.human_attribute_name(:description), {}, {:title => 'zones_order_by_description_title'} %>
31
31
  </th>
32
- <th><%= Spree.t(:default_tax) %></th>
33
32
  <th class="actions"></th>
34
33
  </tr>
35
34
  </thead>
@@ -38,7 +37,6 @@
38
37
  <tr id="<%= spree_dom_id zone %>" data-hook="zones_row" class="<%= cycle('odd', 'even')%>">
39
38
  <td class="align-center"><%= zone.name %></td>
40
39
  <td><%= zone.description %></td>
41
- <td class="align-center"><%= zone.default_tax? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
42
40
  <td class="actions">
43
41
  <% if can?(:update, zone) %>
44
42
  <%= link_to_edit zone, :no_text => true %>
@@ -52,7 +50,7 @@
52
50
  </tbody>
53
51
  </table>
54
52
  <% else %>
55
- <div class="alpha twelve columns no-objects-found">
53
+ <div class="col-xs-9 no-objects-found">
56
54
  <%= render 'spree/admin/shared/no_objects_found',
57
55
  resource: Spree::Zone,
58
56
  new_resource_url: new_object_url %>
@@ -24,14 +24,14 @@
24
24
  <% else %>
25
25
  <% # Legacy layout %>
26
26
  <div class="container">
27
- <div class="row">
28
- <div class="<%= 'with-sidebar ' if content_for?(:sidebar) %>" id="content" data-hook>
27
+ <div class="<%= 'with-sidebar ' if content_for?(:sidebar) %>" id="content" data-hook>
28
+ <div class="row">
29
29
  <% if content_for?(:tabs) %>
30
- <div class="sixteen columns">
30
+ <div class="col-xs-12">
31
31
  <%= yield :tabs %>
32
32
  </div>
33
33
  <% end %>
34
- <div class="js-content-below-tabs <%= if content_for?(:sidebar) then 'twelve' else 'sixteen' end %> columns">
34
+ <div class="js-content-below-tabs <%= if content_for?(:sidebar) then 'col-xs-9' else 'col-xs-12' end %>">
35
35
  <%= render :partial => 'spree/admin/shared/table_filter' %>
36
36
  <%= yield %>
37
37
  </div>
data/config/routes.rb CHANGED
@@ -71,16 +71,6 @@ Spree::Core::Engine.routes.draw do
71
71
 
72
72
  delete '/product_properties/:id', to: "product_properties#destroy", as: :product_property
73
73
 
74
- resources :prototypes do
75
- member do
76
- get :select
77
- end
78
-
79
- collection do
80
- get :available
81
- end
82
- end
83
-
84
74
  resources :orders, except: [:show] do
85
75
  member do
86
76
  get :cart
@@ -183,7 +173,6 @@ Spree::Core::Engine.routes.draw do
183
173
  resources :stock_items, except: [:show, :new, :edit]
184
174
  resources :tax_rates
185
175
 
186
- resources :trackers
187
176
  resources :payment_methods do
188
177
  collection do
189
178
  post :update_positions
@@ -12,12 +12,15 @@ Gem::Specification.new do |s|
12
12
  s.author = 'Solidus Team'
13
13
  s.email = 'contact@solidus.io'
14
14
  s.homepage = 'http://solidus.io'
15
- s.rubyforge_project = 'solidus_backend'
15
+ s.license = 'BSD-3-Clause'
16
16
 
17
17
  s.files = `git ls-files`.split("\n")
18
18
  s.require_path = 'lib'
19
19
  s.requirements << 'none'
20
20
 
21
+ s.required_ruby_version = '>= 2.2.2'
22
+ s.required_rubygems_version = '>= 1.8.23'
23
+
21
24
  s.add_dependency 'solidus_api', s.version
22
25
  s.add_dependency 'solidus_core', s.version
23
26
 
@@ -13,7 +13,7 @@ module Spree
13
13
  describe '#create' do
14
14
  context "with a valid credit card" do
15
15
  let(:order) { create(:order_with_line_items, state: "payment") }
16
- let(:payment_method) { create(:credit_card_payment_method, display_on: "back_end") }
16
+ let(:payment_method) { create(:credit_card_payment_method, available_to_admin: true) }
17
17
  let(:attributes) do
18
18
  {
19
19
  order_id: order.number,
@@ -54,7 +54,6 @@ module Spree
54
54
  let(:address_attributes) do
55
55
  {
56
56
  'firstname' => address.firstname,
57
- 'lastname' => address.lastname,
58
57
  'address1' => address.address1,
59
58
  'city' => address.city,
60
59
  'country_id' => address.country_id,
@@ -77,7 +76,7 @@ module Spree
77
76
  # Regression test for https://github.com/spree/spree/issues/3233
78
77
  context "with a backend payment method" do
79
78
  before do
80
- @payment_method = create(:check_payment_method, display_on: "back_end")
79
+ @payment_method = create(:check_payment_method, available_to_admin: true)
81
80
  end
82
81
 
83
82
  it "loads backend payment methods" do
@@ -16,7 +16,8 @@ describe Spree::Admin::PricesController do
16
16
  it 'assigns usable instance variables' do
17
17
  subject
18
18
  expect(assigns(:search)).to be_a(Ransack::Search)
19
- expect(assigns(:prices)).to eq(product.prices)
19
+ expect(assigns(:variant_prices)).to eq(product.prices.for_variant)
20
+ expect(assigns(:master_prices)).to eq(product.prices.for_master)
20
21
  expect(assigns(:product)).to eq(product)
21
22
  end
22
23
  end
@@ -32,8 +33,9 @@ describe Spree::Admin::PricesController do
32
33
  it 'assigns usable instance variables' do
33
34
  subject
34
35
  expect(assigns(:search)).to be_a(Ransack::Search)
35
- expect(assigns(:prices)).to eq(product.prices)
36
- expect(assigns(:prices)).to include(variant.default_price)
36
+ expect(assigns(:variant_prices)).to eq(product.prices.for_variant)
37
+ expect(assigns(:master_prices)).to eq(product.prices.for_master)
38
+ expect(assigns(:variant_prices)).to include(variant.default_price)
37
39
  expect(assigns(:product)).to eq(product)
38
40
  end
39
41
  end
@@ -8,6 +8,8 @@ describe "Store", type: :feature, js: true do
8
8
  mail_from_address: 'test@example.org')
9
9
  end
10
10
 
11
+ let!(:vat_country) { create(:country, iso: "DE", name: "Germany") }
12
+
11
13
  before(:each) do
12
14
  visit spree.admin_path
13
15
  click_link "Settings"
@@ -35,6 +37,16 @@ describe "Store", type: :feature, js: true do
35
37
  expect(page).to have_field("store_name", with: "Spree Demo Site99")
36
38
  expect(page).to have_field("store_mail_from_address", with: "spree@example.org")
37
39
  end
40
+
41
+ it "should be able to update the default cart tax country" do
42
+ expect(page).to have_select("Tax Country for Empty Carts", selected: "No taxes on carts without address")
43
+
44
+ select "Germany", from: "Tax Country for Empty Carts"
45
+ click_button "Update"
46
+
47
+ assert_successful_update_message(:general_settings)
48
+ expect(page).to have_select("Tax Country for Empty Carts", selected: "Germany")
49
+ end
38
50
  end
39
51
 
40
52
  context "update fails" do
@@ -17,8 +17,9 @@ describe "Payment Methods", type: :feature do
17
17
  within("table#listing_payment_methods") do
18
18
  expect(all("th")[1].text).to eq("Name")
19
19
  expect(all("th")[2].text).to eq("Provider")
20
- expect(all("th")[3].text).to eq("Display")
21
- expect(all("th")[4].text).to eq("Active")
20
+ expect(all("th")[3].text).to eq("Available to users")
21
+ expect(all("th")[4].text).to eq("Available to admin")
22
+ expect(all("th")[5].text).to eq("Active")
22
23
  end
23
24
 
24
25
  within('table#listing_payment_methods') do
@@ -26,7 +26,7 @@ describe "Shipping Methods", type: :feature do
26
26
  expect(column_text(1)).to eq(shipping_method.name)
27
27
  expect(column_text(2)).to eq(zone.name)
28
28
  expect(column_text(3)).to eq("Flat rate")
29
- expect(column_text(4)).to eq("Both")
29
+ expect(column_text(4)).to eq("Yes")
30
30
  end
31
31
  end
32
32
  end
@@ -47,9 +47,6 @@ describe "Homepage", type: :feature do
47
47
  within('.selected .admin-subnav') { page.find_link("Property Types")['/admin/properties'] }
48
48
  end
49
49
 
50
- it "should have a link to prototypes" do
51
- within('.selected .admin-subnav') { page.find_link("Prototypes")['/admin/prototypes'] }
52
- end
53
50
  end
54
51
  end
55
52
 
@@ -3,29 +3,26 @@ require 'spec_helper'
3
3
  describe "Adjustments", type: :feature do
4
4
  stub_authorization!
5
5
 
6
- let!(:order) { create(:completed_order_with_totals, line_items_count: 5) }
7
- let!(:line_item) do
8
- line_item = order.line_items.first
9
- # so we can be sure of a determinate price in our assertions
10
- line_item.update_column(:price, 10)
11
- line_item
6
+ let!(:ship_address) { create(:address) }
7
+ let!(:tax_zone) { create(:global_zone) } # will include the above address
8
+ let!(:tax_rate) { create(:tax_rate, amount: 0.20, zone: tax_zone, tax_category: tax_category) }
9
+
10
+ let!(:order) do
11
+ create(
12
+ :completed_order_with_totals,
13
+ line_items_attributes: [{ price: 10, variant: variant }] * 5,
14
+ ship_address: ship_address,
15
+ )
12
16
  end
17
+ let!(:line_item) { order.line_items[0] }
13
18
 
14
- let!(:tax_adjustment) do
15
- create(:tax_adjustment,
16
- adjustable: line_item,
17
- finalized: true,
18
- order: order,
19
- label: "VAT 5%",
20
- amount: 10)
21
- end
19
+ let(:tax_category) { create(:tax_category) }
20
+ let(:variant) { create(:variant, tax_category: tax_category) }
22
21
 
23
22
  let!(:adjustment) { order.adjustments.create!(order: order, label: 'Rebate', amount: 10) }
24
23
 
25
24
  before(:each) do
26
- # To ensure the order totals are correct
27
- order.update_totals
28
- order.persist_totals
25
+ order.update!
29
26
 
30
27
  visit spree.admin_path
31
28
  click_link "Orders"
@@ -35,9 +32,9 @@ describe "Adjustments", type: :feature do
35
32
 
36
33
  context "admin managing adjustments" do
37
34
  it "should display the correct values for existing order adjustments" do
38
- within_row(1) do
39
- expect(column_text(2)).to eq("VAT 5%")
40
- expect(column_text(3)).to eq("$10.00")
35
+ within first('table tr', text: 'Tax') do
36
+ expect(column_text(2)).to match(/TaxCategory - \d+ 20\.000%/)
37
+ expect(column_text(3)).to eq("$2.00")
41
38
  end
42
39
  end
43
40
 
@@ -76,7 +73,9 @@ describe "Adjustments", type: :feature do
76
73
 
77
74
  context "admin editing an adjustment" do
78
75
  before(:each) do
79
- within_row(2) { click_icon :edit }
76
+ within('table tr', text: 'Rebate') do
77
+ click_icon :edit
78
+ end
80
79
  end
81
80
 
82
81
  context "successfully" do
@@ -106,15 +105,19 @@ describe "Adjustments", type: :feature do
106
105
  end
107
106
 
108
107
  context "deleting an adjustment" do
109
- it "should not be possible if adjustment is closed" do
110
- within_row(1) do
111
- expect(page).not_to have_css('.fa-trash')
108
+ context 'when the adjustment is finalized' do
109
+ let!(:adjustment) { super().tap(&:finalize!) }
110
+
111
+ it 'should not be possible' do
112
+ within('table tr', text: 'Rebate') do
113
+ expect(page).not_to have_css('.fa-trash')
114
+ end
112
115
  end
113
116
  end
114
117
 
115
118
  it "should update the total", js: true do
116
119
  accept_alert do
117
- within_row(2) do
120
+ within('table tr', text: 'Rebate') do
118
121
  click_icon(:trash)
119
122
  end
120
123
  end
@@ -5,7 +5,7 @@ describe "Customer Details", type: :feature, js: true do
5
5
 
6
6
  let(:country) { create(:country, name: "Kangaland") }
7
7
  let(:state) { create(:state, name: "Alabama", country: country) }
8
- let!(:shipping_method) { create(:shipping_method, display_on: "front_end") }
8
+ let!(:shipping_method) { create(:shipping_method) }
9
9
  let!(:order) { create(:order, ship_address: ship_address, bill_address: bill_address, state: 'complete', completed_at: "2011-02-01 12:36:15") }
10
10
  let!(:product) { create(:product_in_stock) }
11
11
 
@@ -77,7 +77,7 @@ describe "Order Details", type: :feature, js: true do
77
77
 
78
78
  within_row(1) do
79
79
  # Click "cancel" on confirmation dialog
80
- dismiss_alert do
80
+ dismiss_confirm do
81
81
  click_icon :trash
82
82
  end
83
83
  end
@@ -438,6 +438,32 @@ describe "Order Details", type: :feature, js: true do
438
438
  end
439
439
  end
440
440
  end
441
+
442
+ describe 'line item sort order' do
443
+ let(:product2) { create(:product) }
444
+ let(:product3) { create(:product) }
445
+
446
+ before do
447
+ # grab this one first and then create others that should end up before
448
+ # and after
449
+ @middle_line_item = order.line_items[0]
450
+
451
+ @first_line_item = order.contents.add(product2.master)
452
+ @first_line_item.update_columns(created_at: 1.day.ago)
453
+ @last_line_item = order.contents.add(product3.master)
454
+ @last_line_item.update_columns(created_at: 1.day.from_now)
455
+ end
456
+
457
+ it 'orders the items in a shipment by created_at' do
458
+ visit spree.edit_admin_order_path(order)
459
+
460
+ stock_items = page.all(:css, '.stock-item', count: 3)
461
+
462
+ expect(stock_items[0]).to have_text(@first_line_item.variant.sku)
463
+ expect(stock_items[1]).to have_text(@middle_line_item.variant.sku)
464
+ expect(stock_items[2]).to have_text(@last_line_item.variant.sku)
465
+ end
466
+ end
441
467
  end
442
468
  end
443
469
 
@@ -27,7 +27,7 @@ describe 'Payments', type: :feature do
27
27
  create(:payment,
28
28
  order: order,
29
29
  amount: order.outstanding_balance,
30
- payment_method: create(:check_payment_method) # Check
30
+ payment_method: create(:check_payment_method, available_to_admin: true) # Check
31
31
  )
32
32
  end
33
33