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,174 +1,189 @@
1
1
  <div data-hook="admin_product_form_fields">
2
2
 
3
- <div class="left twelve columns alpha" data-hook="admin_product_form_left">
4
- <div data-hook="admin_product_form_name">
5
- <%= f.field_container :name do %>
6
- <%= f.label :name, class: 'required' %>
7
- <%= f.text_field :name, :class => 'fullwidth title', :required => true %>
8
- <%= f.error_message_on :name %>
9
- <% end %>
10
- </div>
3
+ <div class="row">
4
+
5
+ <div class="left col-xs-9" data-hook="admin_product_form_left">
6
+ <div data-hook="admin_product_form_name">
7
+ <%= f.field_container :name do %>
8
+ <%= f.label :name, class: 'required' %>
9
+ <%= f.text_field :name, :class => 'fullwidth title', :required => true %>
10
+ <%= f.error_message_on :name %>
11
+ <% end %>
12
+ </div>
11
13
 
12
- <div data-hook="admin_product_form_slug">
13
- <%= f.field_container :slug do %>
14
- <%= f.label :slug, class: 'required' %>
15
- <%= f.text_field :slug, :class => 'fullwidth title', :required => true %>
16
- <%= f.error_message_on :slug %>
17
- <% end %>
18
- </div>
14
+ <div data-hook="admin_product_form_slug">
15
+ <%= f.field_container :slug do %>
16
+ <%= f.label :slug, class: 'required' %>
17
+ <%= f.text_field :slug, :class => 'fullwidth title', :required => true %>
18
+ <%= f.error_message_on :slug %>
19
+ <% end %>
20
+ </div>
19
21
 
20
- <div data-hook="admin_product_form_description">
21
- <%= f.field_container :description do %>
22
- <%= f.label :description %>
23
- <%= f.text_area :description, {:rows => "#{unless @product.has_variants? then '22' else '15' end}", :class => 'fullwidth'} %>
24
- <%= f.error_message_on :description %>
25
- <% end %>
22
+ <div data-hook="admin_product_form_description">
23
+ <%= f.field_container :description do %>
24
+ <%= f.label :description %>
25
+ <%= f.text_area :description, {:rows => "#{unless @product.has_variants? then '22' else '15' end}", :class => 'fullwidth'} %>
26
+ <%= f.error_message_on :description %>
27
+ <% end %>
28
+ </div>
26
29
  </div>
27
- </div>
28
30
 
29
- <div class="right four columns omega" data-hook="admin_product_form_right">
30
- <div data-hook="admin_product_form_price" class="alpha omega four columns">
31
- <%= f.field_container :price do %>
32
- <%= f.label :price, class: 'required' %>
33
- <%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :required => true %>
34
- <%= f.error_message_on :price %>
31
+ <div class="right col-xs-3" data-hook="admin_product_form_right">
32
+ <div data-hook="admin_product_form_price">
33
+ <%= f.field_container :price do %>
34
+ <%= f.label :price, class: 'required' %>
35
+ <%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :required => true %>
36
+ <%= f.error_message_on :price %>
37
+ <% end %>
38
+ </div>
39
+
40
+ <% if show_rebuild_vat_checkbox? %>
41
+ <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product" %>
42
+ <div class="clearfix"></div>
35
43
  <% end %>
36
- </div>
37
44
 
38
- <% if show_rebuild_vat_checkbox? %>
39
- <%= render "spree/admin/shared/rebuild_vat_prices_checkbox", form: f, model_name: "product", wrapper_class: "alpha omega field four columns" %>
40
- <div class="clearfix"></div>
41
- <% end %>
45
+ <div class="row">
42
46
 
43
- <div data-hook="admin_product_form_cost_price" class="alpha two columns">
44
- <%= f.field_container :cost_price do %>
45
- <%= f.label :cost_price %>
46
- <%= f.text_field :cost_price, :value => number_to_currency(@product.cost_price, :unit => '') %>
47
- <%= f.error_message_on :cost_price %>
48
- <% end %>
49
- </div>
47
+ <div data-hook="admin_product_form_cost_price" class="col-xs-6">
48
+ <%= f.field_container :cost_price do %>
49
+ <%= f.label :cost_price %>
50
+ <%= f.text_field :cost_price, :value => number_to_currency(@product.cost_price, :unit => '') %>
51
+ <%= f.error_message_on :cost_price %>
52
+ <% end %>
53
+ </div>
50
54
 
51
- <div data-hook="admin_product_form_cost_currency" class="omega two columns">
52
- <%= f.field_container :cost_currency do %>
53
- <%= f.label :cost_currency %>
54
- <%= f.text_field :cost_currency %>
55
- <%= f.error_message_on :cost_currency %>
56
- <% end %>
57
- </div>
55
+ <div data-hook="admin_product_form_cost_currency" class="col-xs-6">
56
+ <%= f.field_container :cost_currency do %>
57
+ <%= f.label :cost_currency %>
58
+ <%= f.text_field :cost_currency %>
59
+ <%= f.error_message_on :cost_currency %>
60
+ <% end %>
61
+ </div>
58
62
 
59
- <div class="clear"></div>
63
+ </div>
60
64
 
61
- <div data-hook="admin_product_form_available_on">
62
- <%= f.field_container :available_on do %>
63
- <%= f.label :available_on %>
64
- <%= f.error_message_on :available_on %>
65
- <%= f.text_field :available_on, :value => datepicker_field_value(@product.available_on), :class => 'datepicker' %>
66
- <% end %>
67
- </div>
65
+ <div class="clear"></div>
68
66
 
69
- <div data-hook="admin_product_form_promotionable">
70
- <%= f.field_container :promotionable do %>
71
- <%= f.label :promotionable do %>
72
- <%= f.check_box :promotionable %> <%= Spree::Product.human_attribute_name(:promotionable) %>
67
+ <div data-hook="admin_product_form_available_on">
68
+ <%= f.field_container :available_on do %>
69
+ <%= f.label :available_on %>
70
+ <%= f.error_message_on :available_on %>
71
+ <%= f.text_field :available_on, :value => datepicker_field_value(@product.available_on), :class => 'datepicker' %>
73
72
  <% end %>
74
- <%= f.field_hint :promotionable %>
75
- <% end %>
76
- </div>
73
+ </div>
77
74
 
78
- <% if @product.has_variants? %>
79
- <div data-hook="admin_product_form_multiple_variants">
80
- <%= f.label :skus, Spree.t(:skus) %>
81
- <span class="info">
82
- <%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.count) %>
83
- <ul class="text_list">
84
- <% @product.variants.first(5).each do |variant| %>
85
- <li><%= link_to variant.sku, spree.edit_admin_product_variant_path(@product, variant) %></li>
75
+ <div data-hook="admin_product_form_promotionable">
76
+ <%= f.field_container :promotionable do %>
77
+ <%= f.label :promotionable do %>
78
+ <%= f.check_box :promotionable %> <%= Spree::Product.human_attribute_name(:promotionable) %>
79
+ <% end %>
80
+ <%= f.field_hint :promotionable %>
81
+ <% end %>
82
+ </div>
83
+
84
+ <% if @product.has_variants? %>
85
+ <div data-hook="admin_product_form_multiple_variants">
86
+ <%= f.label :skus, Spree.t(:skus) %>
87
+ <span class="info">
88
+ <%= Spree.t(:info_product_has_multiple_skus, count: @product.variants.count) %>
89
+ <ul class="text_list">
90
+ <% @product.variants.first(5).each do |variant| %>
91
+ <li><%= link_to variant.sku, spree.edit_admin_product_variant_path(@product, variant) %></li>
92
+ <% end %>
93
+ </ul>
94
+ <% if @product.variants.count > 5 %>
95
+ <%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.count - 5) %>
86
96
  <% end %>
87
- </ul>
88
- <% if @product.variants.count > 5 %>
89
- <%= Spree.t(:info_number_of_skus_not_shown, count: @product.variants.count - 5) %>
97
+ </span>
98
+ <div class="info-actions">
99
+ <% if can?(:admin, Spree::Variant) %>
100
+ <%= link_to_with_icon 'th-large', Spree.t(:manage_variants), admin_product_variants_url(@product) %>
101
+ <% end %>
102
+ </div>
103
+ </div>
104
+ <% else %>
105
+ <div data-hook="admin_product_form_sku">
106
+ <%= f.field_container :sku do %>
107
+ <%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %>
108
+ <%= f.text_field :sku, :size => 16 %>
90
109
  <% end %>
91
- </span>
92
- <div class="info-actions">
93
- <% if can?(:admin, Spree::Variant) %>
94
- <%= link_to_with_icon 'th-large', Spree.t(:manage_variants), admin_product_variants_url(@product) %>
110
+ </div>
111
+
112
+ <div id="shipping_specs" class="row">
113
+ <% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
114
+ <div id="shipping_specs_<%= field %>_field" class="col-xs-6">
115
+ <div class="field">
116
+ <%= f.label field %>
117
+ <%= f.text_field field, value: number_with_precision(@product.send(field), precision: 2) %>
118
+ </div>
119
+ </div>
95
120
  <% end %>
96
121
  </div>
97
- </div>
98
- <% else %>
99
- <div data-hook="admin_product_form_sku">
100
- <%= f.field_container :sku do %>
101
- <%= f.label :sku, Spree::Variant.human_attribute_name(:sku) %>
102
- <%= f.text_field :sku, :size => 16 %>
122
+
123
+ <% end %>
124
+
125
+ <div data-hook="admin_product_form_shipping_categories">
126
+ <%= f.field_container :shipping_categories do %>
127
+ <%= f.label :shipping_category_id, Spree::ShippingCategory.model_name.human %>
128
+ <%= f.field_hint :shipping_category %>
129
+ <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
130
+ <%= f.error_message_on :shipping_category %>
103
131
  <% end %>
104
132
  </div>
105
133
 
106
- <div id="shipping_specs">
107
- <% [:height, :width, :depth, :weight].each_with_index do |field, index| %>
108
- <div id="shipping_specs_<%= field %>_field" class="field two columns <%= index.even? ? 'alpha' : 'omega' %>">
109
- <%= f.label field %>
110
- <%= f.text_field field, value: number_with_precision(@product.send(field), precision: 2) %>
111
- </div>
134
+ <div data-hook="admin_product_form_tax_category">
135
+ <%= f.field_container :tax_category do %>
136
+ <%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
137
+ <%= f.field_hint :tax_category %>
138
+ <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
139
+ <%= f.error_message_on :tax_category %>
112
140
  <% end %>
113
141
  </div>
114
- <% end %>
115
-
116
- <div data-hook="admin_product_form_shipping_categories">
117
- <%= f.field_container :shipping_categories do %>
118
- <%= f.label :shipping_category_id, Spree::ShippingCategory.model_name.human %>
119
- <%= f.field_hint :shipping_category %>
120
- <%= f.collection_select(:shipping_category_id, @shipping_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
121
- <%= f.error_message_on :shipping_category %>
122
- <% end %>
123
142
  </div>
124
143
 
125
- <div data-hook="admin_product_form_tax_category">
126
- <%= f.field_container :tax_category do %>
127
- <%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
128
- <%= f.field_hint :tax_category %>
129
- <%= f.collection_select(:tax_category_id, @tax_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2' }) %>
130
- <%= f.error_message_on :tax_category %>
131
- <% end %>
132
- </div>
133
144
  </div>
134
145
 
135
- <div class="twelve columns alpha omega">
136
- <div data-hook="admin_product_form_taxons">
137
- <%= f.field_container :taxons do %>
138
- <%= f.label :taxon_ids, plural_resource_name(Spree::Taxon) %><br />
139
- <%= f.hidden_field :taxon_ids, :value => @product.taxon_ids.join(',') %>
140
- <% end %>
141
- </div>
146
+ <div class="row">
142
147
 
143
- <div data-hook="admin_product_form_option_types">
144
- <%= f.field_container :option_types do %>
145
- <%= f.label :option_type_ids, plural_resource_name(Spree::OptionType) %>
146
- <%= f.hidden_field :option_type_ids, :value => @product.option_type_ids.join(',') %>
147
- <% end %>
148
- </div>
149
- </div>
148
+ <div class="col-xs-9">
149
+ <div data-hook="admin_product_form_taxons">
150
+ <%= f.field_container :taxons do %>
151
+ <%= f.label :taxon_ids, plural_resource_name(Spree::Taxon) %><br />
152
+ <%= f.hidden_field :taxon_ids, :value => @product.taxon_ids.join(',') %>
153
+ <% end %>
154
+ </div>
150
155
 
151
- <div data-hook="admin_product_form_meta" class="alpha omega twelve columns">
152
- <div data-hook="admin_product_form_meta_title">
153
- <%= f.field_container :meta_title do %>
154
- <%= f.label :meta_title %>
155
- <%= f.text_field :meta_title, :class => 'fullwidth' %>
156
- <% end %>
157
- </div>
156
+ <div data-hook="admin_product_form_option_types">
157
+ <%= f.field_container :option_types do %>
158
+ <%= f.label :option_type_ids, plural_resource_name(Spree::OptionType) %>
159
+ <%= f.hidden_field :option_type_ids, :value => @product.option_type_ids.join(',') %>
160
+ <% end %>
161
+ </div>
158
162
 
159
- <div data-hook="admin_product_form_meta_keywords">
160
- <%= f.field_container :meta_keywords do %>
161
- <%= f.label :meta_keywords %>
162
- <%= f.text_field :meta_keywords, :class => 'fullwidth' %>
163
- <% end %>
164
- </div>
163
+ <div data-hook="admin_product_form_meta">
164
+ <div data-hook="admin_product_form_meta_title">
165
+ <%= f.field_container :meta_title do %>
166
+ <%= f.label :meta_title %>
167
+ <%= f.text_field :meta_title, :class => 'fullwidth' %>
168
+ <% end %>
169
+ </div>
165
170
 
166
- <div data-hook="admin_product_form_meta_description">
167
- <%= f.field_container :meta_description do %>
168
- <%= f.label :meta_description %>
169
- <%= f.text_field :meta_description, :class => 'fullwidth' %>
170
- <% end %>
171
+ <div data-hook="admin_product_form_meta_keywords">
172
+ <%= f.field_container :meta_keywords do %>
173
+ <%= f.label :meta_keywords %>
174
+ <%= f.text_field :meta_keywords, :class => 'fullwidth' %>
175
+ <% end %>
176
+ </div>
177
+
178
+ <div data-hook="admin_product_form_meta_description">
179
+ <%= f.field_container :meta_description do %>
180
+ <%= f.label :meta_description %>
181
+ <%= f.text_field :meta_description, :class => 'fullwidth' %>
182
+ <% end %>
183
+ </div>
184
+ </div>
171
185
  </div>
186
+
172
187
  </div>
173
188
 
174
189
  <div class="clear"></div>
@@ -177,9 +192,3 @@
177
192
 
178
193
  <div class="clear"></div>
179
194
  </div>
180
-
181
- <% unless Rails.env.test? %>
182
- <script>
183
- $('.select2-container').css({width: '20em'})
184
- </script>
185
- <% end %>
@@ -11,7 +11,7 @@
11
11
 
12
12
  <% admin_breadcrumb(Spree.t(:product_details)) %>
13
13
 
14
- <%= form_for [:admin, @product], :method => :put, :html => { :multipart => true } do |f| %>
14
+ <%= form_for [:admin, @product], :html => { :multipart => true } do |f| %>
15
15
  <fieldset class="no-border-top">
16
16
  <%= render :partial => 'form', :locals => { :f => f } %>
17
17
  <% if can?(:update, @product) %>
@@ -16,22 +16,28 @@
16
16
  <div data-hook="admin_products_sidebar">
17
17
  <%= search_form_for [:admin, @search] do |f| %>
18
18
  <%- locals = {:f => f} %>
19
- <div data-hook="admin_products_index_search">
20
- <div class="product-search-field-name field">
21
- <%= f.label :name_cont, Spree::Product.human_attribute_name(:name) %>
22
- <%= f.text_field :name_cont, :size => 15 %>
19
+ <div class="row" data-hook="admin_products_index_search" >
20
+ <div class="col-xs-6">
21
+ <div class="field">
22
+ <%= f.label :name_cont, Spree::Product.human_attribute_name(:name) %>
23
+ <%= f.text_field :name_cont, :size => 15 %>
24
+ </div>
23
25
  </div>
24
26
 
25
- <div class="product-search-field-sku field">
26
- <%= f.label :variants_including_master_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
27
- <%= f.text_field :variants_including_master_sku_cont, :size => 15 %>
27
+ <div class="col-xs-4">
28
+ <div class="field">
29
+ <%= f.label :variants_including_master_sku_cont, Spree::Variant.human_attribute_name(:sku) %>
30
+ <%= f.text_field :variants_including_master_sku_cont, :size => 15 %>
31
+ </div>
28
32
  </div>
29
33
 
30
- <div class="product-search-field-show-deleted field checkbox">
31
- <label>
32
- <%= f.check_box :deleted_at_null, {:checked => params[:q][:deleted_at_null] == '0'}, '0', '1' %>
33
- <%= Spree.t(:show_deleted) %>
34
- </label>
34
+ <div class="col-xs-2">
35
+ <div class="field checkbox">
36
+ <label>
37
+ <%= f.check_box :deleted_at_null, {:checked => params[:q][:deleted_at_null] == '0'}, '0', '1' %>
38
+ <%= Spree.t(:show_deleted) %>
39
+ </label>
40
+ </div>
35
41
  </div>
36
42
  </div>
37
43
 
@@ -82,7 +88,7 @@
82
88
  </tbody>
83
89
  </table>
84
90
  <% else %>
85
- <div class="alpha twelve columns no-objects-found">
91
+ <div class="col-xs-9 no-objects-found">
86
92
  <%= render 'spree/admin/shared/no_objects_found',
87
93
  resource: Spree::Product,
88
94
  new_resource_url: new_object_url %>
@@ -14,7 +14,7 @@
14
14
 
15
15
  <div data-hook="new_product_attrs" class="row">
16
16
  <% unless @product.has_variants? %>
17
- <div data-hook="new_product_sku" class="alpha four columns">
17
+ <div data-hook="new_product_sku" class="col-xs-3">
18
18
  <%= f.field_container :sku do %>
19
19
  <%= f.label :sku, Spree.t(:sku) %><br />
20
20
  <%= f.text_field :sku, :size => 16, :class => 'fullwidth' %>
@@ -23,14 +23,7 @@
23
23
  </div>
24
24
  <% end %>
25
25
 
26
- <div data-hook="new_product_prototype" class="four columns">
27
- <%= f.field_container :prototype do %>
28
- <%= f.label :prototype_id, Spree::Prototype.model_name.human %><br />
29
- <%= f.collection_select :prototype_id, Spree::Prototype.all, :id, :name, {:include_blank => true}, {:class => 'select2 fullwidth'} %>
30
- <% end %>
31
- </div>
32
-
33
- <div data-hook="new_product_price" class="four columns">
26
+ <div data-hook="new_product_price" class="col-xs-3">
34
27
  <%= f.field_container :price do %>
35
28
  <%= f.label :price, class: 'required' %><br />
36
29
  <%= f.text_field :price, :value => number_to_currency(@product.price, :unit => ''), :class => 'fullwidth', :required => true %>
@@ -38,7 +31,7 @@
38
31
  <% end %>
39
32
  </div>
40
33
 
41
- <div data-hook="new_product_available_on" class="omega four columns">
34
+ <div data-hook="new_product_available_on" class="col-xs-3">
42
35
  <%= f.field_container :available_on do %>
43
36
  <%= f.label :available_on %>
44
37
  <%= f.error_message_on :available_on %>
@@ -49,7 +42,7 @@
49
42
  </div>
50
43
 
51
44
  <div class='row'>
52
- <div data-hook="new_product_shipping_category" class="alpha field four columns">
45
+ <div data-hook="new_product_shipping_category" class="col-xs-3">
53
46
  <%= f.field_container :shipping_category do %>
54
47
  <%= f.label :shipping_category_id, Spree::ShippingCategory.
55
48
  model_name.human, class: 'required' %>
@@ -59,7 +52,7 @@
59
52
  <% end %>
60
53
  </div>
61
54
 
62
- <div data-hook="new_product_tax_category" class="field four columns">
55
+ <div data-hook="new_product_tax_category" class="col-xs-3">
63
56
  <%= f.field_container :tax_category do %>
64
57
  <%= f.label :tax_category_id, Spree::TaxCategory.model_name.human %>
65
58
  <%= f.field_hint :tax_category %>
@@ -69,33 +62,7 @@
69
62
  </div>
70
63
  </div>
71
64
 
72
- <div class="clearfix" data-hook="product-from-prototype" id="product-from-prototype">
73
- <%= render :file => 'spree/admin/prototypes/show' if @prototype %>
74
- </div>
75
-
76
65
  <%= render :partial => 'spree/admin/shared/new_resource_links' %>
77
66
 
78
67
  </fieldset>
79
68
  <% end %>
80
-
81
- <script type="text/javascript">
82
- //<![CDATA[
83
- (function($){
84
- var base_url = "<%= admin_prototypes_url %>";
85
- var prototype_select = $('#product_prototype_id');
86
- prototype_select.change(function() {
87
- var id = prototype_select.val();
88
- if (id.length) {
89
- var url = new Uri(base_url);
90
- url.setPath(url.path() + '/' + id);
91
- $('#product-from-prototype').load(url.toString());
92
- } else {
93
- $('#product-from-prototype').empty();
94
- }
95
- })
96
- if (prototype_select.html() == "") {
97
- prototype_select.change();
98
- }
99
- })(jQuery);
100
- //]]>
101
- </script>
@@ -1,7 +1,7 @@
1
1
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @promotion } %>
2
2
 
3
3
  <div class='row'>
4
- <div class='alpha six columns'>
4
+ <div class='col-xs-4'>
5
5
  <%= f.field_container :name do %>
6
6
  <%= f.label :name %>
7
7
  <%= f.text_field :name, :class => 'fullwidth' %>
@@ -5,6 +5,12 @@ $('.product_picker').productAutocomplete();
5
5
  $('.user_picker').userAutocomplete();
6
6
  $('.taxon_picker').taxonAutocomplete();
7
7
 
8
+ $('select.select2').select2({
9
+ allowClear: true,
10
+ dropdownAutoWidth: true,
11
+ minimumResultsForSearch: 8
12
+ });
13
+
8
14
  $('#promotion_rule_type').html('<%= escape_javascript options_for_promotion_rule_types(@promotion) %>');
9
15
  $('#promotion_rule_type').select2();
10
16
 
@@ -1,4 +1,4 @@
1
- <fieldset id="action_fields" class="eight columns omega no-border-top">
1
+ <fieldset id="action_fields" class="no-border-top">
2
2
 
3
3
  <%= form_tag spree.admin_promotion_promotion_actions_path(@promotion), :remote => true, :id => 'new_promotion_action_form' do %>
4
4
  <% options = options_for_select( Rails.application.config.spree.promotions.actions.map(&:name).map {|name| [ Spree.t("promotion_action_types.#{name.demodulize.underscore}.name"), name] } ) %>
@@ -1,59 +1,61 @@
1
1
  <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @promotion } %>
2
2
  <div class="row">
3
- <div id="general_fields" class="alpha thirteen columns">
4
- <div class="alpha four columns">
5
- <%= f.field_container :name do %>
6
- <%= f.label :name %>
7
- <%= f.text_field :name, :class => 'fullwidth' %>
8
- <% end %>
9
-
10
- <%= fields_for :promotion_builder do |bf| %>
11
- <%= bf.field_container :base_code do %>
12
- <%= bf.label :base_code %>
13
- <%= bf.text_field :base_code, :readonly => !@promotion.new_record?, :class => 'fullwidth' %>
3
+ <div id="general_fields" class="col-xs-9">
4
+ <div class="row">
5
+ <div class="col-xs-3">
6
+ <%= f.field_container :name do %>
7
+ <%= f.label :name %>
8
+ <%= f.text_field :name, :class => 'fullwidth' %>
14
9
  <% end %>
15
10
 
16
- <%= bf.field_container :number_of_codes do %>
17
- <%= bf.label :number_of_codes %>
18
- <%= bf.text_field :number_of_codes, :readonly => !@promotion.new_record?, class: 'fullwidth' %>
11
+ <%= fields_for :promotion_builder do |bf| %>
12
+ <%= bf.field_container :base_code do %>
13
+ <%= bf.label :base_code %>
14
+ <%= bf.text_field :base_code, :readonly => !@promotion.new_record?, :class => 'fullwidth' %>
15
+ <% end %>
16
+
17
+ <%= bf.field_container :number_of_codes do %>
18
+ <%= bf.label :number_of_codes %>
19
+ <%= bf.text_field :number_of_codes, :readonly => !@promotion.new_record?, class: 'fullwidth' %>
20
+ <% end %>
19
21
  <% end %>
20
- <% end %>
21
22
 
22
- <%= f.field_container :per_code_usage_limit do %>
23
- <%= f.label :per_code_usage_limit %>
24
- <%= f.text_field :per_code_usage_limit, class: 'fullwidth' %>
25
- <% end %>
23
+ <%= f.field_container :per_code_usage_limit do %>
24
+ <%= f.label :per_code_usage_limit %>
25
+ <%= f.text_field :per_code_usage_limit, class: 'fullwidth' %>
26
+ <% end %>
26
27
 
27
- <%= f.field_container :path do %>
28
- <%= f.label :path %>
29
- <%= f.text_field :path, :class => 'fullwidth' %>
30
- <% end %>
28
+ <%= f.field_container :path do %>
29
+ <%= f.label :path %>
30
+ <%= f.text_field :path, :class => 'fullwidth' %>
31
+ <% end %>
31
32
 
32
- <%= f.field_container :advertise do %>
33
- <%= f.check_box :advertise %>
34
- <%= f.label :advertise %>
35
- <% end %>
33
+ <%= f.field_container :advertise do %>
34
+ <%= f.check_box :advertise %>
35
+ <%= f.label :advertise %>
36
+ <% end %>
36
37
 
37
- <%= f.field_container :apply_automatically do %>
38
- <%= f.check_box :apply_automatically %>
39
- <%= f.label :apply_automatically %>
40
- <% end %>
41
- </div>
38
+ <%= f.field_container :apply_automatically do %>
39
+ <%= f.check_box :apply_automatically %>
40
+ <%= f.label :apply_automatically %>
41
+ <% end %>
42
+ </div>
42
43
 
43
- <div class="omega nine columns">
44
- <%= f.field_container :description do %>
45
- <%= f.label :description %><br />
46
- <%= f.text_area :description, :rows => 7, :class => 'fullwidth' %>
47
- <% end %>
44
+ <div class="col-xs-9">
45
+ <%= f.field_container :description do %>
46
+ <%= f.label :description %><br />
47
+ <%= f.text_area :description, :rows => 7, :class => 'fullwidth' %>
48
+ <% end %>
48
49
 
49
- <%= f.field_container :category do %>
50
- <%= f.label :promotion_category_id, Spree::PromotionCategory.model_name.human %><br />
51
- <%= f.collection_select(:promotion_category_id, @promotion_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
52
- <% end %>
50
+ <%= f.field_container :category do %>
51
+ <%= f.label :promotion_category_id, Spree::PromotionCategory.model_name.human %><br />
52
+ <%= f.collection_select(:promotion_category_id, @promotion_categories, :id, :name, { :include_blank => Spree.t('match_choices.none') }, { :class => 'select2 fullwidth' }) %>
53
+ <% end %>
54
+ </div>
53
55
  </div>
54
56
  </div>
55
57
 
56
- <div id="expiry_fields" class="three columns omega">
58
+ <div id="expiry_fields" class="col-xs-3">
57
59
  <%= f.field_container :overall_usage_limit do %>
58
60
  <%= f.label :usage_limit %><br />
59
61
  <%= f.number_field :usage_limit, :min => 0, :class => 'fullwidth' %><br>
@@ -64,12 +66,14 @@
64
66
 
65
67
  <div id="starts_at_field" class="field">
66
68
  <%= f.label :starts_at %>
67
- <%= f.text_field :starts_at, :value => datepicker_field_value(@promotion.starts_at), :class => 'datepicker datepicker-from fullwidth' %>
69
+ <%= f.field_hint :starts_at %>
70
+ <%= f.text_field :starts_at, :value => datepicker_field_value(@promotion.starts_at), :placeholder => t(".starts_at_placeholder"), :class => 'datepicker datepicker-from fullwidth' %>
68
71
  </div>
69
72
 
70
73
  <div id="expires_at_field" class="field">
71
74
  <%= f.label :expires_at %>
72
- <%= f.text_field :expires_at, :value => datepicker_field_value(@promotion.expires_at), :class => 'datepicker datepicker-to fullwidth' %>
75
+ <%= f.field_hint :expires_at %>
76
+ <%= f.text_field :expires_at, :value => datepicker_field_value(@promotion.expires_at), :placeholder => t(".expires_at_placeholder"), :class => 'datepicker datepicker-to fullwidth' %>
73
77
  </div>
74
78
  </div>
75
79
  </div>