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
@@ -11,57 +11,65 @@
11
11
 
12
12
  <div id="images" data-hook></div>
13
13
 
14
- <% unless @product.images.any? || @product.variant_images.any? %>
15
- <div class="no-objects-found">
16
- <%= Spree.t(:no_images_found) %>.
14
+ <fieldset>
15
+ <legend align="center"><%= t(".upload_images") %></legend>
16
+
17
+ <div id="upload-zone">
18
+ <%= form_for [:admin, @product, Spree::Image.new],
19
+ :html => { :multipart => true, id: 'upload-form' } do |f| %>
20
+ <label class="upload">
21
+ <i class="fa fa-5x fa-cloud-upload"></i>
22
+ <p>
23
+ <span class="button"><%= t(".choose_files") %></span>
24
+ </p>
25
+ <p>
26
+ <%= t(".drag_and_drop") %>
27
+ </p>
28
+
29
+ <%= f.file_field :attachment, multiple: '', class: 'hidden' %>
30
+ <%= f.hidden_field :viewable_id, value: @product.master.id %>
31
+ </label>
32
+ <% end %>
17
33
  </div>
18
- <% else %>
19
- <table class="index sortable" data-hook="images_table" data-sortable-link="<%= update_positions_admin_product_images_url(@product) %>">
20
- <colgroup>
21
- <col style="width: 5%">
22
- <col style="width: 10%">
34
+
35
+
36
+ <p id="filereader">File API &amp; FileReader API not supported</p>
37
+ <p id="formdata">XHR2's FormData is not supported</p>
38
+ <p id="progress">XHR2's upload progress isn't supported</p>
39
+
40
+ <div id="progress-zone" class="row"></div>
41
+ </fieldset>
42
+
43
+ <% no_images = @product.images.empty? && @product.variant_images.empty? %>
44
+
45
+ <table class="index sortable <%= 'hidden' if no_images %>" id="images-table" data-hook="images_table" data-sortable-link="<%= update_positions_admin_product_images_url(@product) %>">
46
+ <colgroup>
47
+ <col style="width: 5%">
48
+ <col style="width: 10%">
49
+ <% if @product.has_variants? %>
50
+ <col style="width: 25%">
51
+ <% end %>
52
+ <col style="width: 45%">
53
+ <col style="width: 15%">
54
+ </colgroup>
55
+ <thead>
56
+ <tr data-hook="images_header">
57
+ <th colspan="2"><%= Spree.t(:thumbnail) %></th>
23
58
  <% if @product.has_variants? %>
24
- <col style="width: 25%">
59
+ <th><%= Spree::Variant.model_name.human %></th>
25
60
  <% end %>
26
- <col style="width: 45%">
27
- <col style="width: 15%">
28
- </colgroup>
29
- <thead>
30
- <tr data-hook="images_header">
31
- <th colspan="2"><%= Spree.t(:thumbnail) %></th>
32
- <% if @product.has_variants? %>
33
- <th><%= Spree::Variant.model_name.human %></th>
34
- <% end %>
35
- <th><%= Spree::Image.human_attribute_name(:alt) %></th>
36
- <th class="actions"></th>
37
- </tr>
38
- </thead>
61
+ <th><%= Spree::Image.human_attribute_name(:alt) %></th>
62
+ <th class="actions"></th>
63
+ </tr>
64
+ </thead>
39
65
 
40
- <tbody>
41
- <% (@product.variant_images).each do |image| %>
42
- <tr id="<%= spree_dom_id image %>" data-hook="images_row" class="<%= cycle('odd', 'even')%>">
43
- <td class="no-border">
44
- <% if can?(:update_positions, Spree::Image) %>
45
- <span class="handle"></span>
46
- <% end %>
47
- </td>
48
- <td>
49
- <%= link_to image_tag(image.attachment.url(:mini)), image.attachment.url(:product) %>
50
- </td>
51
- <% if @product.has_variants? %>
52
- <td><%= options_text_for(image) %></td>
53
- <% end %>
54
- <td><%= image.alt %></td>
55
- <td class="actions">
56
- <% if can?(:update, image) %>
57
- <%= link_to_with_icon 'edit', Spree.t('actions.edit'), edit_admin_product_image_url(@product, image), :no_text => true, :data => {:action => 'edit'} %>
58
- <% end %>
59
- <% if can?(:destroy, image) %>
60
- <%= link_to_delete image, { :url => admin_product_image_url(@product, image), :no_text => true } %>
61
- <% end %>
62
- </td>
63
- </tr>
64
- <% end %>
65
- </tbody>
66
- </table>
66
+ <tbody>
67
+ <%= render partial: 'image_row', collection: @product.variant_images, as: :image %>
68
+ </tbody>
69
+ </table>
70
+
71
+ <% if no_images %>
72
+ <div class="no-objects-found">
73
+ <%= Spree.t(:no_images_found) %>.
74
+ </div>
67
75
  <% end %>
@@ -1,5 +1,5 @@
1
1
  <div data-hook="admin_option_type_form_fields" class="align-center row">
2
- <div class="alpha eight columns">
2
+ <div class="col-xs-6">
3
3
  <%= f.field_container :name do %>
4
4
  <%= f.label :name, class: 'required' %><br />
5
5
  <%= f.text_field :name, :class => "fullwidth" %>
@@ -7,7 +7,7 @@
7
7
  <% end %>
8
8
  </div>
9
9
 
10
- <div class="omega eight columns">
10
+ <div class="col-xs-6">
11
11
  <%= f.field_container :presentation do %>
12
12
  <%= f.label :presentation, class: 'required' %><br />
13
13
  <%= f.text_field :presentation, :class => "fullwidth" %>
@@ -47,7 +47,7 @@
47
47
  </tbody>
48
48
  </table>
49
49
  <% else %>
50
- <div class="alpha twelve columns no-objects-found">
50
+ <div class="col-xs-9 no-objects-found">
51
51
  <%= render 'spree/admin/shared/no_objects_found',
52
52
  resource: Spree::OptionType,
53
53
  new_resource_url: new_object_url %>
@@ -2,9 +2,11 @@
2
2
  <fieldset class="no-border-bottom">
3
3
  <legend align="center"><%= Spree.t(:add_product) %></legend>
4
4
 
5
- <div data-hook="add_product_name" class="field twelve columns alpha">
6
- <%= label_tag :add_line_item_variant_id, Spree.t(:name_or_sku) %>
7
- <%= text_field_tag :add_line_item_variant_id, "", :class => "variant_autocomplete fullwidth" %>
5
+ <div class="col-xs-9">
6
+ <div data-hook="add_product_name" class="field">
7
+ <%= label_tag :add_line_item_variant_id, Spree.t(:name_or_sku) %>
8
+ <%= text_field_tag :add_line_item_variant_id, "", :class => "variant_autocomplete fullwidth" %>
9
+ </div>
8
10
  </div>
9
11
 
10
12
  </fieldset>
@@ -2,9 +2,11 @@
2
2
  <fieldset class="no-border-bottom">
3
3
  <legend align="center"><%= Spree.t(:add_product) %></legend>
4
4
 
5
- <div data-hook="add_product_name" class="field twelve columns alpha">
6
- <%= label_tag :add_variant_id, Spree.t(:name_or_sku) %>
7
- <%= text_field_tag :add_variant_id, "", :class => "variant_autocomplete fullwidth" %>
5
+ <div class="col-xs-9">
6
+ <div data-hook="add_product_name" class="field">
7
+ <%= label_tag :add_variant_id, Spree.t(:name_or_sku) %>
8
+ <%= text_field_tag :add_variant_id, "", :class => "variant_autocomplete fullwidth" %>
9
+ </div>
8
10
  </div>
9
11
 
10
12
  </fieldset>
@@ -1,7 +1,11 @@
1
1
  <% admin_breadcrumb(plural_resource_name(Spree::Shipment)) %>
2
2
 
3
3
 
4
- <% manifest_items = Spree::ShippingManifest.new(inventory_units: shipment.inventory_units.where(carton_id: nil)).items %>
4
+ <%
5
+ manifest_items = Spree::ShippingManifest.new(
6
+ inventory_units: shipment.inventory_units.where(carton_id: nil),
7
+ ).items.sort_by { |item| item.line_item.created_at }
8
+ %>
5
9
 
6
10
  <div id="<%= "shipment_#{shipment.id}" %>" class="js-shipment-edit" data-hook="admin_shipment_form">
7
11
  <fieldset class="no-border-bottom">
@@ -48,11 +52,15 @@
48
52
  <% unless shipment.shipped? %>
49
53
  <tr class="edit-method hidden total">
50
54
  <td colspan="5">
51
- <div class="field alpha five columns">
52
- <%= label_tag 'selected_shipping_rate_id', Spree::ShippingMethod.model_name.human %>
53
- <%= select_tag :selected_shipping_rate_id,
54
- options_for_select(shipment.shipping_rates.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
55
- {:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
55
+ <div class="row">
56
+ <div class="col-xs-4">
57
+ <div class="field">
58
+ <%= label_tag 'selected_shipping_rate_id', Spree::ShippingMethod.model_name.human %>
59
+ <%= select_tag :selected_shipping_rate_id,
60
+ options_for_select(shipment.shipping_rates.map {|sr| ["#{sr.name} #{sr.display_price}", sr.id] }, shipment.selected_shipping_rate_id),
61
+ {:class => 'select2 fullwidth', :data => {'shipment-number' => shipment.number } } %>
62
+ </div>
63
+ </div>
56
64
  </div>
57
65
  </td>
58
66
  <td class="actions">
@@ -17,7 +17,7 @@
17
17
  </div>
18
18
 
19
19
  <% if @order.payments.exists? && @order.is_risky? %>
20
- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.order("created_at DESC").first %>
20
+ <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.reorder("created_at DESC").first %>
21
21
  <% end %>
22
22
 
23
23
  <% if can?(:update, @order) && can?(:create, Spree::LineItem) %>
@@ -4,21 +4,23 @@
4
4
  </fieldsset>
5
5
 
6
6
  <fieldset class="no-border-bottom no-border-top">
7
- <div data-hook="bill_address_wrapper" class="alpha six columns">
8
- <fieldset class="no-border-bottom">
9
- <legend align="center"><%= Spree.t(:billing_address) %></legend>
10
- <% if order.bill_address %>
11
- <%= render partial: 'spree/admin/shared/address', locals: {address: order.bill_address} %>
12
- <% end %>
13
- </fieldset>
14
- </div>
7
+ <div class="row">
8
+ <div data-hook="bill_address_wrapper" class="col-xs-6">
9
+ <fieldset class="no-border-bottom">
10
+ <legend align="center"><%= Spree.t(:billing_address) %></legend>
11
+ <% if order.bill_address %>
12
+ <%= render partial: 'spree/admin/shared/address', locals: {address: order.bill_address} %>
13
+ <% end %>
14
+ </fieldset>
15
+ </div>
15
16
 
16
- <div class="omega six columns" data-hook="ship_address_wrapper">
17
- <fieldset class="no-border-bottom">
18
- <legend align="center"><%= Spree.t(:shipping_address) %></legend>
19
- <% if order.ship_address %>
20
- <%= render partial: 'spree/admin/shared/address', locals: {address: order.ship_address} %>
21
- <% end %>
22
- </fieldset>
17
+ <div class="col-xs-6" data-hook="ship_address_wrapper">
18
+ <fieldset class="no-border-bottom">
19
+ <legend align="center"><%= Spree.t(:shipping_address) %></legend>
20
+ <% if order.ship_address %>
21
+ <%= render partial: 'spree/admin/shared/address', locals: {address: order.ship_address} %>
22
+ <% end %>
23
+ </fieldset>
24
+ </div>
23
25
  </div>
24
26
  </fieldset>
@@ -4,13 +4,13 @@
4
4
  <legend align="center"><%= Spree.t(:account) %></legend>
5
5
 
6
6
  <div data-hook="customer_fields" class="row">
7
- <div class="alpha eight columns">
7
+ <div class="col-xs-9">
8
8
  <div class="field">
9
9
  <%= f.label :email %>
10
10
  <%= f.email_field :email, :class => 'fullwidth' %>
11
11
  </div>
12
12
  </div>
13
- <div class="omega four columns">
13
+ <div class="col-xs-3">
14
14
  <div class="field">
15
15
  <%= label_tag nil, Spree.t(:guest_checkout) %>
16
16
  <ul>
@@ -36,34 +36,36 @@
36
36
  </div>
37
37
  </fieldset>
38
38
 
39
- <div class="alpha six columns" data-hook="ship_address_wrapper">
40
- <fieldset class="no-border-bottom">
41
- <legend align="center"><%= Spree.t(:shipping_address) %></legend>
42
- <%= f.fields_for :ship_address do |sa_form| %>
43
- <% if Spree::Config[:order_bill_address_used] %>
44
- <div class="field" style="position: absolute;margin-top: -15px;left: 0;">
45
- <span data-hook="use_billing">
46
- <%= check_box_tag 'order[use_billing]', '1', ((@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address == @order.ship_address) %>
47
- <%= label_tag 'order[use_billing]', Spree.t(:use_billing_address) %>
48
- </span>
49
- </div>
50
- <% end %>
51
-
52
- <%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => sa_form, :type => 'shipping' } %>
53
- <% end %>
54
- </fieldset>
55
- </div>
56
-
57
- <% if Spree::Config[:order_bill_address_used] %>
58
- <div class="omega six columns" data-hook="bill_address_wrapper">
39
+ <div class="row">
40
+ <div class="col-xs-6" data-hook="ship_address_wrapper">
59
41
  <fieldset class="no-border-bottom">
60
- <legend align="center"><%= Spree.t(:billing_address) %></legend>
61
- <%= f.fields_for :bill_address do |ba_form| %>
62
- <%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => ba_form, :type => "billing" } %>
42
+ <legend align="center"><%= Spree.t(:shipping_address) %></legend>
43
+ <%= f.fields_for :ship_address do |sa_form| %>
44
+ <% if Spree::Config[:order_bill_address_used] %>
45
+ <div class="field" style="position: absolute;margin-top: -15px;left: 0;">
46
+ <span data-hook="use_billing">
47
+ <%= check_box_tag 'order[use_billing]', '1', ((@order.bill_address.empty? && @order.ship_address.empty?) && @order.bill_address == @order.ship_address) %>
48
+ <%= label_tag 'order[use_billing]', Spree.t(:use_billing_address) %>
49
+ </span>
50
+ </div>
51
+ <% end %>
52
+
53
+ <%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => sa_form, :type => 'shipping' } %>
63
54
  <% end %>
64
55
  </fieldset>
65
56
  </div>
66
- <% end %>
57
+
58
+ <% if Spree::Config[:order_bill_address_used] %>
59
+ <div class="col-xs-6" data-hook="bill_address_wrapper">
60
+ <fieldset class="no-border-bottom">
61
+ <legend align="center"><%= Spree.t(:billing_address) %></legend>
62
+ <%= f.fields_for :bill_address do |ba_form| %>
63
+ <%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => ba_form, :type => "billing" } %>
64
+ <% end %>
65
+ </fieldset>
66
+ </div>
67
+ <% end %>
68
+ </div>
67
69
 
68
70
  <div class="clear"></div>
69
71
 
@@ -8,7 +8,7 @@
8
8
  <% end %>
9
9
 
10
10
 
11
- <main class="alpha eight columns">
11
+ <main class="col-xs-5">
12
12
  <section>
13
13
  <%= content_tag :h4, Spree.t(:account) %>
14
14
  <%= Spree.t(:email) %>: <%= @order.email %><br>
@@ -14,7 +14,7 @@
14
14
  </div>
15
15
 
16
16
  <% if @order.payments.exists? && @order.is_risky? %>
17
- <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.order("created_at DESC").first %>
17
+ <%= render 'spree/admin/orders/risk_analysis', latest_payment: @order.payments.reorder("created_at DESC").first %>
18
18
  <% end %>
19
19
 
20
20
  <% if can?(:update, Spree::Shipment) && can?(:update, @order) && @order.shipment_state != "shipped" %>
@@ -14,81 +14,88 @@
14
14
  <% content_for :table_filter do %>
15
15
  <div data-hook="admin_orders_index_search">
16
16
  <%= search_form_for [:admin, @search] do |f| %>
17
- <div class="field-block alpha four columns">
18
- <div class="date-range-filter field">
19
- <%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
20
- <div class="date-range-fields">
21
- <%= f.text_field :created_at_gt, :class => 'datepicker datepicker-from', :value => params[:q][:created_at_gt], :placeholder => Spree.t(:start) %>
22
-
23
- <span class="range-divider">
24
- <i class="fa fa-arrow-right"></i>
25
- </span>
26
-
27
- <%= f.text_field :created_at_lt, :class => 'datepicker datepicker-to', :value => params[:q][:created_at_lt], :placeholder => Spree.t(:stop) %>
17
+ <div class="row">
18
+ <div class="field-block col-xs-3">
19
+ <div class="date-range-filter field">
20
+ <%= label_tag :q_created_at_gt, Spree.t(:date_range) %>
21
+ <div class="date-range-fields">
22
+ <%= f.text_field :created_at_gt, :class => 'datepicker datepicker-from', :value => params[:q][:created_at_gt], :placeholder => Spree.t(:start) %>
23
+
24
+ <span class="range-divider">
25
+ <i class="fa fa-arrow-right"></i>
26
+ </span>
27
+
28
+ <%= f.text_field :created_at_lt, :class => 'datepicker datepicker-to', :value => params[:q][:created_at_lt], :placeholder => Spree.t(:stop) %>
29
+ </div>
28
30
  </div>
29
- </div>
30
31
 
31
- <div class="field">
32
- <%= label_tag :q_state_eq, Spree.t(:status) %>
33
- <%= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [Spree.t("order_state.#{s.name}"), s.value]}, {:include_blank => true}, :class => 'select2' %>
34
- </div>
35
-
36
- <div class="field">
37
- <%= label_tag nil, Spree.t(:promotion) %>
38
- <%= f.text_field :promotions_codes_value_cont, :size => 25 %>
39
- </div>
32
+ <div class="field">
33
+ <%= label_tag :q_state_eq, Spree.t(:status) %>
34
+ <%= f.select :state_eq, Spree::Order.state_machines[:state].states.collect {|s| [Spree.t("order_state.#{s.name}"), s.value]}, {:include_blank => true}, :class => 'select2' %>
35
+ </div>
40
36
 
41
- <div class="field">
42
- <%= label_tag nil, Spree.t(:shipment_number) %>
43
- <%= f.text_field :shipments_number_cont %>
44
- </div>
37
+ <div class="field">
38
+ <%= label_tag nil, Spree.t(:promotion) %>
39
+ <%= f.text_field :promotions_codes_value_cont, :size => 25 %>
40
+ </div>
45
41
 
46
- </div>
42
+ <div class="field">
43
+ <%= label_tag nil, Spree.t(:shipment_number) %>
44
+ <%= f.text_field :shipments_number_cont %>
45
+ </div>
47
46
 
48
- <div class="four columns">
49
- <div class="field">
50
- <%= label_tag :q_number_cont, Spree.t(:order_number, :number => '') %>
51
- <%= f.text_field :number_cont %>
52
47
  </div>
53
48
 
54
- <div class="field">
55
- <%= label_tag :q_email_cont, Spree.t(:email) %>
56
- <%= f.text_field :email_cont %>
49
+ <div class="col-xs-6">
50
+ <div class="row">
51
+ <div class="col-xs-6">
52
+ <div class="field">
53
+ <%= label_tag :q_number_cont, Spree.t(:order_number, :number => '') %>
54
+ <%= f.text_field :number_cont %>
55
+ </div>
56
+
57
+ <div class="field">
58
+ <%= label_tag :q_email_cont, Spree.t(:email) %>
59
+ <%= f.text_field :email_cont %>
60
+ </div>
61
+ </div>
62
+
63
+ <div class="col-xs-6">
64
+ <div class="field">
65
+ <%= label_tag :q_bill_address_firstname_start, Spree.t(:first_name_begins_with) %>
66
+ <%= f.text_field :bill_address_firstname_start, :size => 25 %>
67
+ </div>
68
+ <div class="field">
69
+ <%= label_tag :q_bill_address_lastname_start, Spree.t(:last_name_begins_with) %>
70
+ <%= f.text_field :bill_address_lastname_start, :size => 25%>
71
+ </div>
72
+ </div>
73
+
74
+ <div class="col-xs-12">
75
+ <div class="field" data-hook="sku-select">
76
+ <%= label_tag :q_line_items_variant_id_in, Spree.t(:variant) %>
77
+ <%= f.text_field :line_items_variant_id_in, class: "variant_autocomplete fullwidth" %>
78
+ </div>
79
+ </div>
80
+ </div>
57
81
  </div>
58
- </div>
59
82
 
60
- <div class="four columns">
61
- <div class="field">
62
- <%= label_tag :q_bill_address_firstname_start, Spree.t(:first_name_begins_with) %>
63
- <%= f.text_field :bill_address_firstname_start, :size => 25 %>
64
- </div>
65
- <div class="field">
66
- <%= label_tag :q_bill_address_lastname_start, Spree.t(:last_name_begins_with) %>
67
- <%= f.text_field :bill_address_lastname_start, :size => 25%>
68
- </div>
69
- </div>
83
+ <div class="col-xs-3">
84
+ <% if Spree::Store.count > 1 %>
85
+ <div class="field">
86
+ <%= label_tag nil, Spree.t(:store) %>
87
+ <%= f.select :store_id_eq, Spree::Store.all.map { |s| [s.name, s.id] }, { include_blank: true }, { class: "select2" } %>
88
+ </div>
89
+ <% end %>
70
90
 
71
- <div class="omega four columns">
72
- <% if Spree::Store.count > 1 %>
73
- <div class="field">
74
- <%= label_tag nil, Spree.t(:store) %>
75
- <%= f.select :store_id_eq, Spree::Store.all.map { |s| [s.name, s.id] }, { include_blank: true }, { class: "select2" } %>
91
+ <div class="field checkbox">
92
+ <label>
93
+ <%= f.check_box :completed_at_not_null, {:checked => @show_only_completed}, '1', '0' %>
94
+ <%= Spree.t(:show_only_complete_orders) %>
95
+ </label>
76
96
  </div>
77
- <% end %>
78
-
79
- <div class="field checkbox">
80
- <label>
81
- <%= f.check_box :completed_at_not_null, {:checked => @show_only_completed}, '1', '0' %>
82
- <%= Spree.t(:show_only_complete_orders) %>
83
- </label>
84
97
  </div>
85
- </div>
86
98
 
87
- <div class="omega eight columns">
88
- <div class="field" data-hook="sku-select">
89
- <%= label_tag :q_line_items_variant_id_in, Spree.t(:variant) %>
90
- <%= f.text_field :line_items_variant_id_in, class: "variant_autocomplete fullwidth" %>
91
- </div>
92
99
  </div>
93
100
 
94
101
  <div class="clearfix"></div>
@@ -162,7 +169,7 @@
162
169
  </tbody>
163
170
  </table>
164
171
  <% else %>
165
- <div class="alpha twelve columns no-objects-found">
172
+ <div class="col-xs-9 no-objects-found">
166
173
  <%= render 'spree/admin/shared/no_objects_found',
167
174
  resource: Spree::Order,
168
175
  new_resource_url: spree.new_admin_order_path %>
@@ -2,59 +2,65 @@
2
2
 
3
3
  <div data-hook="payment_method">
4
4
 
5
- <div class="alpha four columns">
6
- <div id="preference-settings">
7
- <div class="field">
8
- <%= f.label :type %>
9
- <%= collection_select(:payment_method, :type, @providers, :to_s, :name, {}, {:id => 'gtwy-type', :class => 'select2 fullwidth js-gateway-type'}) %>
10
- </div>
5
+ <div class="row">
6
+ <div class="col-xs-3">
7
+ <div id="preference-settings">
8
+ <div class="field">
9
+ <%= f.label :type %>
10
+ <%= collection_select(:payment_method, :type, @providers, :to_s, :name, {}, {:id => 'gtwy-type', :class => 'select2 fullwidth js-gateway-type'}) %>
11
+ </div>
11
12
 
12
- <div class="field js-preference-source-wrapper">
13
- <%= f.label :preference_source %>
14
- <%= f.select(:preference_source, [[Spree.t(:preference_source_none), nil]] + @object.class.available_preference_sources, {}, class: 'select2 fullwidth js-preference-source') %>
15
- </div>
13
+ <div class="field js-preference-source-wrapper">
14
+ <%= f.label :preference_source %>
15
+ <%= f.select(:preference_source, [[Spree.t(:preference_source_none), nil]] + @object.class.available_preference_sources, {}, class: 'select2 fullwidth js-preference-source') %>
16
+ </div>
16
17
 
17
- <div class="gateway-settings js-gateway-settings">
18
- <% if @object.preference_source.present? %>
19
- <%= Spree.t :preference_source_using, name: @object.preference_source %>
20
- <% elsif !@object.new_record? %>
21
- <%= preference_fields(@object, f) %>
22
- <% end %>
23
- </div>
18
+ <div class="gateway-settings js-gateway-settings">
19
+ <% if @object.preference_source.present? %>
20
+ <%= Spree.t :preference_source_using, name: @object.preference_source %>
21
+ <% elsif !@object.new_record? %>
22
+ <%= preference_fields(@object, f) %>
23
+ <% end %>
24
+ </div>
24
25
 
25
- <div class="info warning js-gateway-settings-warning"><%= Spree.t(:provider_settings_warning) %></div>
26
- </div>
27
- <div data-hook="display" class="field">
28
- <%= f.label :display_on %>
29
- <%= select(:payment_method, :display_on, Spree::PaymentMethod::DISPLAY.collect { |display| [Spree.t(display), display == :both ? nil : display.to_s] }, {}, {:class => 'select2 fullwidth'}) %>
30
- </div>
31
- <div data-hook="auto_capture" class="field">
32
- <%= f.label :auto_capture %>
33
- <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {:class => 'select2 fullwidth'}) %>
34
- </div>
35
- <div data-hook="active" class="field">
36
- <%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:active) %>
37
- <ul>
38
- <li>
39
- <%= radio_button :payment_method, :active, true %>
40
- <%= label_tag :payment_method_active_true, Spree.t(:say_yes) %>
41
- </li>
42
- <li>
43
- <%= radio_button :payment_method, :active, false %>
44
- <%= label_tag :payment_method_active_false, Spree.t(:say_no) %>
45
- </li>
46
- </ul>
26
+ <div class="info warning js-gateway-settings-warning"><%= Spree.t(:provider_settings_warning) %></div>
27
+ </div>
28
+ <div data-hook="available_to_user" class="field">
29
+ <%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:available_to_users) %>
30
+ <%= f.check_box :available_to_users %>
31
+ </div>
32
+ <div data-hook="available_to_user" class="field">
33
+ <%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:available_to_admin) %>
34
+ <%= f.check_box :available_to_admin %>
35
+ </div>
36
+ <div data-hook="auto_capture" class="field">
37
+ <%= f.label :auto_capture %>
38
+ <%= select(:payment_method, :auto_capture, [["#{Spree.t(:use_app_default)} (#{Spree::Config[:auto_capture]})", ''], [Spree.t(:say_yes), true], [Spree.t(:say_no), false]], {}, {:class => 'select2 fullwidth'}) %>
39
+ </div>
40
+ <div data-hook="active" class="field">
41
+ <%= label_tag nil, Spree::PaymentMethod.human_attribute_name(:active) %>
42
+ <ul>
43
+ <li>
44
+ <%= radio_button :payment_method, :active, true %>
45
+ <%= label_tag :payment_method_active_true, Spree.t(:say_yes) %>
46
+ </li>
47
+ <li>
48
+ <%= radio_button :payment_method, :active, false %>
49
+ <%= label_tag :payment_method_active_false, Spree.t(:say_no) %>
50
+ </li>
51
+ </ul>
52
+ </div>
47
53
  </div>
48
- </div>
49
54
 
50
- <div class="omega eight columns">
51
- <div data-hook="name" class="field">
52
- <%= f.label :name %>
53
- <%= f.text_field :name, :class => 'fullwidth' %>
54
- </div>
55
- <div data-hook="description" class="field">
56
- <%= f.label :description %>
57
- <%= f.text_area :description, {:cols => 60, :rows => 6, :class => 'fullwidth'} %>
55
+ <div class="col-xs-6">
56
+ <div data-hook="name" class="field">
57
+ <%= f.label :name %>
58
+ <%= f.text_field :name, :class => 'fullwidth' %>
59
+ </div>
60
+ <div data-hook="description" class="field">
61
+ <%= f.label :description %>
62
+ <%= f.text_area :description, {:cols => 60, :rows => 6, :class => 'fullwidth'} %>
63
+ </div>
58
64
  </div>
59
65
  </div>
60
66
  </div>