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
@@ -7,8 +7,14 @@ module Spree
7
7
  params[:q] ||= {}
8
8
 
9
9
  @search = @product.prices.accessible_by(current_ability, :index).ransack(params[:q])
10
- @prices = @search.result
10
+ @master_prices = @search.result
11
11
  .currently_valid
12
+ .for_master
13
+ .order(:variant_id, :country_iso, :currency)
14
+ .page(params[:page]).per(Spree::Config.admin_variants_per_page)
15
+ @variant_prices = @search.result
16
+ .currently_valid
17
+ .for_variant
12
18
  .order(:variant_id, :country_iso, :currency)
13
19
  .page(params[:page]).per(Spree::Config.admin_variants_per_page)
14
20
  end
@@ -4,7 +4,6 @@ module Spree
4
4
  helper 'spree/products'
5
5
 
6
6
  before_action :load_data, except: [:index]
7
- create.before :create_before
8
7
  update.before :update_before
9
8
  helper_method :clone_object_url
10
9
 
@@ -115,11 +114,6 @@ module Spree
115
114
  @collection
116
115
  end
117
116
 
118
- def create_before
119
- return if params[:product][:prototype_id].blank?
120
- @prototype = Spree::Prototype.find(params[:product][:prototype_id])
121
- end
122
-
123
117
  def update_before
124
118
  # note: we only reset the product properties if we're receiving a post
125
119
  # from the form on that tab
@@ -4,8 +4,6 @@ module Spree
4
4
  before_action :load_data
5
5
  before_action :load_bulk_code_information, only: [:edit]
6
6
 
7
- create.before :build_promotion_codes
8
-
9
7
  helper 'spree/promotion_rules'
10
8
 
11
9
  def create
@@ -29,6 +29,7 @@ module Spree
29
29
  load_roles
30
30
  load_stock_locations
31
31
 
32
+ flash.now[:error] = @user.errors.full_messages.join(", ")
32
33
  render :new, status: :unprocessable_entity
33
34
  end
34
35
  end
@@ -37,12 +38,14 @@ module Spree
37
38
  if @user.update_attributes(user_params)
38
39
  set_roles
39
40
  set_stock_locations
41
+
40
42
  flash[:success] = Spree.t(:account_updated)
41
43
  redirect_to edit_admin_user_url(@user)
42
44
  else
43
45
  load_roles
44
46
  load_stock_locations
45
47
 
48
+ flash.now[:error] = @user.errors.full_messages.join(", ")
46
49
  render :edit, status: :unprocessable_entity
47
50
  end
48
51
  end
@@ -24,7 +24,7 @@ module Spree
24
24
  parts = []
25
25
  parts << variant.product.name
26
26
  parts << "(#{variant.options_text})" if variant.options_text.present?
27
- parts << line_item.display_total
27
+ parts << line_item.display_amount
28
28
  safe_join(parts, "<br />".html_safe)
29
29
  end
30
30
 
@@ -34,41 +34,6 @@ module Spree
34
34
  end
35
35
  end
36
36
 
37
- # This method demonstrates the use of the :child_index option to render a
38
- # form partial for, for instance, client side addition of new nested
39
- # records.
40
- #
41
- # This specific example creates a link which uses javascript to add a new
42
- # form partial to the DOM.
43
- #
44
- # <%= form_for @project do |project_form| %>
45
- # <div id="tasks">
46
- # <%= project_form.fields_for :tasks do |task_form| %>
47
- # <%= render :partial => 'task', :locals => { :f => task_form } %>
48
- # <% end %>
49
- # </div>
50
- # <% end %>
51
- def generate_html(form_builder, method, options = {})
52
- options[:object] ||= form_builder.object.class.reflect_on_association(method).klass.new
53
- options[:partial] ||= method.to_s.singularize
54
- options[:form_builder_local] ||= :f
55
-
56
- form_builder.fields_for(method, options[:object], child_index: 'NEW_RECORD') do |f|
57
- render(partial: options[:partial], locals: { options[:form_builder_local] => f })
58
- end
59
- end
60
-
61
- def generate_template(form_builder, method, options = {})
62
- escape_javascript generate_html(form_builder, method, options)
63
- end
64
-
65
- def remove_nested(fields)
66
- out = ''
67
- out << fields.hidden_field(:_destroy) unless fields.object.new_record?
68
- out << (link_to icon('remove'), "#", class: 'remove')
69
- out.html_safe
70
- end
71
-
72
37
  def preference_field_tag(name, value, options)
73
38
  case options[:type]
74
39
  when :integer
@@ -20,6 +20,20 @@ module Spree
20
20
  def stock_transfer_status(stock_transfer)
21
21
  stock_transfer.closed? ? Spree.t(:closed) : Spree.t(:open)
22
22
  end
23
+
24
+ def deleted_variant_admin_hint(variant)
25
+ newer_variant_with_same_sku = Spree::Variant.find_by(sku: variant.sku)
26
+ hint_type = newer_variant_with_same_sku ? :deleted_explanation_with_replacement : :deleted_explanation
27
+ hint_text = I18n.t(
28
+ hint_type,
29
+ scope: [:spree, :hints, "spree/variant"],
30
+ date: variant.deleted_at
31
+ )
32
+ admin_hint(
33
+ I18n.t(:deleted, scope: [:spree, :hints, "spree/variant"]),
34
+ hint_text
35
+ )
36
+ end
23
37
  end
24
38
  end
25
39
  end
@@ -5,14 +5,14 @@ module Spree
5
5
  ORDER_TABS ||= [:orders, :payments, :creditcard_payments,
6
6
  :shipments, :credit_cards, :return_authorizations,
7
7
  :customer_returns, :adjustments, :customer_details]
8
- PRODUCT_TABS ||= [:products, :option_types, :properties, :prototypes,
8
+ PRODUCT_TABS ||= [:products, :option_types, :properties,
9
9
  :variants, :product_properties, :taxonomies,
10
10
  :taxons]
11
11
  REPORT_TABS ||= [:reports]
12
12
  CONFIGURATION_TABS ||= [:configurations, :general_settings, :tax_categories,
13
13
  :tax_rates, :zones, :countries, :states,
14
14
  :payment_methods, :shipping_methods,
15
- :shipping_categories, :stock_locations, :trackers,
15
+ :shipping_categories, :stock_locations,
16
16
  :refund_reasons, :reimbursement_types, :return_authorization_reasons]
17
17
  PROMOTION_TABS ||= [:promotions, :promotion_categories]
18
18
  STOCK_TABS ||= [:stock_items, :stock_transfers]
@@ -43,7 +43,7 @@
43
43
  </tbody>
44
44
  </table>
45
45
  <% else %>
46
- <div class="alpha twelve columns no-objects-found">
46
+ <div class="col-xs-9 no-objects-found">
47
47
  <%= render 'spree/admin/shared/no_objects_found',
48
48
  resource: Spree::AdjustmentReason,
49
49
  new_resource_url: new_object_url %>
@@ -1,22 +1,20 @@
1
1
  <div data-hook="admin_adjustment_reason_form_fields" class="row">
2
- <div class="row">
3
- <div class="alpha four columns">
4
- <%= f.field_container :name do %>
5
- <%= f.label :name, class: 'required' %><br />
6
- <%= f.text_field :name, :class => 'fullwidth' %>
7
- <% end %>
2
+ <div class="col-xs-3">
3
+ <%= f.field_container :name do %>
4
+ <%= f.label :name, class: 'required' %><br />
5
+ <%= f.text_field :name, :class => 'fullwidth' %>
6
+ <% end %>
8
7
 
9
- <%= f.field_container :code do %>
10
- <%= f.label :code, class: 'required' %><br />
11
- <%= f.text_field :code, :class => 'fullwidth' %>
12
- <% end %>
8
+ <%= f.field_container :code do %>
9
+ <%= f.label :code, class: 'required' %><br />
10
+ <%= f.text_field :code, :class => 'fullwidth' %>
11
+ <% end %>
13
12
 
14
- <div class="checkbox">
15
- <label>
16
- <%= f.check_box :active %>
17
- <%= Spree::AdjustmentReason.human_attribute_name(:active) %>
18
- </label>
19
- </div>
13
+ <div class="checkbox">
14
+ <label>
15
+ <%= f.check_box :active %>
16
+ <%= Spree::AdjustmentReason.human_attribute_name(:active) %>
17
+ </label>
20
18
  </div>
21
19
  </div>
22
20
  </div>
@@ -2,7 +2,10 @@
2
2
  @edit_url = edit_admin_order_adjustment_path(@order, adjustment)
3
3
  @delete_url = admin_order_adjustment_path(@order, adjustment)
4
4
  %>
5
- <tr id="<%= spree_dom_id(adjustment) %>" data-hook="adjustment_row" class="<%= cycle('odd', 'even')%>">
5
+ <tr id="<%= spree_dom_id(adjustment) %>"
6
+ data-hook="adjustment_row"
7
+ class="<%= cycle('odd', 'even')%> <%= "adjustment-ineligible" if !adjustment.eligible? %>"
8
+ >
6
9
  <td class="align-center"><%= display_adjustable(adjustment.adjustable) %></td>
7
10
  <td class="align-center"><%= adjustment.label %></td>
8
11
  <td class="align-center"><%= adjustment.display_amount.to_html %></td>
@@ -1,24 +1,28 @@
1
- <div data-hook="admin_adjustment_form_fields" class="row">
2
- <div class="alpha three columns">
3
- <%= f.field_container :amount do %>
4
- <%= f.label :amount, class: 'required' %>
5
- <%= text_field :adjustment, :amount, class: 'fullwidth' %>
6
- <%= f.error_message_on :amount %>
7
- <% end %>
8
- </div>
1
+ <div data-hook="admin_adjustment_form_fields">
2
+ <div class="row">
9
3
 
10
- <div class="six columns">
11
- <%= f.field_container :label do %>
12
- <%= f.label :label, class: 'required' %>
13
- <%= text_field :adjustment, :label, class: 'fullwidth' %>
14
- <%= f.error_message_on :label %>
15
- <% end %>
16
- </div>
4
+ <div class="col-xs-3">
5
+ <%= f.field_container :amount do %>
6
+ <%= f.label :amount, class: 'required' %>
7
+ <%= text_field :adjustment, :amount, class: 'fullwidth' %>
8
+ <%= f.error_message_on :amount %>
9
+ <% end %>
10
+ </div>
11
+
12
+ <div class="col-xs-6">
13
+ <%= f.field_container :label do %>
14
+ <%= f.label :label, class: 'required' %>
15
+ <%= text_field :adjustment, :label, class: 'fullwidth' %>
16
+ <%= f.error_message_on :label %>
17
+ <% end %>
18
+ </div>
19
+
20
+ <div class="col-xs-3">
21
+ <%= f.field_container :label do %>
22
+ <%= f.label :adjustment_reason_id %><br/>
23
+ <%= f.collection_select(:adjustment_reason_id, reasons_for(@adjustment), :id, :name, {include_blank: true}, {"data-placeholder" => Spree.t(:select_a_reason), class: 'select2 fullwidth'}) %>
24
+ <% end %>
25
+ </div>
17
26
 
18
- <div class="omega three columns">
19
- <%= f.field_container :label do %>
20
- <%= f.label :adjustment_reason_id %><br/>
21
- <%= f.collection_select(:adjustment_reason_id, reasons_for(@adjustment), :id, :name, {include_blank: true}, {"data-placeholder" => Spree.t(:select_a_reason), class: 'select2 fullwidth'}) %>
22
- <% end %>
23
27
  </div>
24
28
  </div>
@@ -1,7 +1,6 @@
1
- <% admin_breadcrumb(link_to plural_resource_name(Spree::Order), spree.admin_orders_path) %>
2
- <% admin_breadcrumb(link_to "##{@order.number}", spree.edit_admin_order_path(@order)) %>
3
- <% admin_breadcrumb(Spree.t(:cancel_inventory)) %>
1
+ <%= render partial: 'spree/admin/shared/order_tabs', locals: {current: 'Cancel Inventory'} %>
4
2
 
3
+ <% admin_breadcrumb(Spree.t(:cancel_inventory)) %>
5
4
 
6
5
  <table class="stock-contents index">
7
6
  <colgroup>
@@ -1,17 +1,17 @@
1
1
  <div data-hook="admin_country_form_fields" class="row">
2
- <div class="alpha four columns">
2
+ <div class="col-xs-5">
3
3
  <div data-hook="name" class="field">
4
4
  <%= f.label :name %>
5
5
  <%= f.text_field :name, :class => 'fullwidth' %>
6
6
  </div>
7
7
  </div>
8
- <div class="four columns">
8
+ <div class="col-xs-5">
9
9
  <div data-hook="iso_name" class="field">
10
10
  <%= f.label :iso_name %>
11
11
  <%= f.text_field :iso_name, :class => 'fullwidth' %>
12
12
  </div>
13
13
  </div>
14
- <div class="omega four columns">
14
+ <div class="col-xs-2">
15
15
  <div data-hook="states_required" class="field checkbox">
16
16
  <label>
17
17
  <%= f.check_box :states_required %>
@@ -19,4 +19,4 @@
19
19
  </label>
20
20
  </div>
21
21
  </div>
22
- </div>
22
+ </div>
@@ -44,7 +44,7 @@
44
44
  </tbody>
45
45
  </table>
46
46
  <% else %>
47
- <div class="alpha twelve columns no-objects-found">
47
+ <div class="col-xs-9 no-objects-found">
48
48
  <%= render 'spree/admin/shared/no_objects_found',
49
49
  resource: Spree::CustomerReturn,
50
50
  new_resource_url: new_object_url %>
@@ -18,7 +18,7 @@
18
18
  <% if @rma_return_items.any? %>
19
19
  <%= render partial: 'return_item_selection', locals: {f: f, return_items: @rma_return_items} %>
20
20
  <% else %>
21
- <div class="alpha twelve columns no-objects-found"><%= Spree.t(:none) %></div>
21
+ <div class="col-xs-9 no-objects-found"><%= Spree.t(:none) %></div>
22
22
  <% end %>
23
23
  </fieldset>
24
24
 
@@ -27,7 +27,7 @@
27
27
  <% if @new_return_items.any? %>
28
28
  <%= render partial: 'return_item_selection', locals: {f: f, return_items: @new_return_items} %>
29
29
  <% else %>
30
- <div class="alpha twelve columns no-objects-found"><%= Spree.t(:none) %></div>
30
+ <div class="col-xs-9 no-objects-found"><%= Spree.t(:none) %></div>
31
31
  <% end %>
32
32
  </fieldset>
33
33
 
@@ -48,11 +48,9 @@
48
48
 
49
49
  <% else %>
50
50
 
51
- <div class="twelve columns">
52
- <div class="alpha twelve columns no-objects-found">
53
- <%= Spree.t(:all_items_have_been_returned) %>,
54
- <%= link_to Spree.t(:back_to_customer_return_list), spree.admin_order_customer_returns_path(@order) %>.
55
- </div>
51
+ <div class="col-xs-9 no-objects-found">
52
+ <%= Spree.t(:all_items_have_been_returned) %>,
53
+ <%= link_to Spree.t(:back_to_customer_return_list), spree.admin_order_customer_returns_path(@order) %>.
56
54
  </div>
57
55
 
58
56
  <% end %>
@@ -2,61 +2,70 @@
2
2
 
3
3
  <% admin_breadcrumb(Spree.t(:settings)) %>
4
4
  <% admin_breadcrumb(Spree.t(:general_settings)) %>
5
-
6
- <%= form_tag admin_general_settings_path, method: :put do %>
5
+ <%= form_for @store, url: admin_general_settings_path do |f| %>
7
6
  <div id="preferences" data-hook>
8
7
 
9
8
  <fieldset class="general no-border-top">
10
9
 
11
- <%= fields_for :store do |f| %>
12
- <div data-hook="admin_general_setting_input_name">
13
- <%= f.field_container :name do %>
14
- <%= f.label :name %>
15
- <%= f.text_field :name, class: 'fullwidth' %>
16
- <%= f.error_message_on :name %>
17
- <% end %>
18
- </div>
10
+ <div data-hook="admin_general_setting_input_name">
11
+ <%= f.field_container :name do %>
12
+ <%= f.label :name %>
13
+ <%= f.text_field :name, class: 'fullwidth' %>
14
+ <%= f.error_message_on :name %>
15
+ <% end %>
16
+ </div>
19
17
 
20
- <div data-hook="admin_general_setting_input_seo_title">
21
- <%= f.field_container :seo_title do %>
22
- <%= f.label :seo_title %>
23
- <%= f.text_field :seo_title, class: 'fullwidth' %>
24
- <%= f.error_message_on :seo_title %>
25
- <% end %>
26
- </div>
18
+ <div data-hook="admin_general_setting_input_seo_title">
19
+ <%= f.field_container :seo_title do %>
20
+ <%= f.label :seo_title %>
21
+ <%= f.text_field :seo_title, class: 'fullwidth' %>
22
+ <%= f.error_message_on :seo_title %>
23
+ <% end %>
24
+ </div>
27
25
 
28
- <div data-hook="admin_general_setting_input_meta_keywords">
29
- <%= f.field_container :meta_keywords do %>
30
- <%= f.label :meta_keywords %>
31
- <%= f.text_field :meta_keywords, class: 'fullwidth' %>
32
- <%= f.error_message_on :meta_keywords %>
33
- <% end %>
34
- </div>
26
+ <div data-hook="admin_general_setting_input_meta_keywords">
27
+ <%= f.field_container :meta_keywords do %>
28
+ <%= f.label :meta_keywords %>
29
+ <%= f.text_field :meta_keywords, class: 'fullwidth' %>
30
+ <%= f.error_message_on :meta_keywords %>
31
+ <% end %>
32
+ </div>
35
33
 
36
- <div data-hook="admin_general_setting_input_meta_description">
37
- <%= f.field_container :meta_description do %>
38
- <%= f.label :meta_description %>
39
- <%= f.text_field :meta_description, class: 'fullwidth' %>
40
- <%= f.error_message_on :meta_description %>
41
- <% end %>
42
- </div>
34
+ <div data-hook="admin_general_setting_input_meta_description">
35
+ <%= f.field_container :meta_description do %>
36
+ <%= f.label :meta_description %>
37
+ <%= f.text_field :meta_description, class: 'fullwidth' %>
38
+ <%= f.error_message_on :meta_description %>
39
+ <% end %>
40
+ </div>
43
41
 
44
- <div data-hook="admin_general_setting_input_url">
45
- <%= f.field_container :url do %>
46
- <%= f.label :url %>
47
- <%= f.text_field :url, class: 'fullwidth' %>
48
- <%= f.error_message_on :url %>
49
- <% end %>
50
- </div>
42
+ <div data-hook="admin_general_setting_input_url">
43
+ <%= f.field_container :url do %>
44
+ <%= f.label :url %>
45
+ <%= f.text_field :url, class: 'fullwidth' %>
46
+ <%= f.error_message_on :url %>
47
+ <% end %>
48
+ </div>
51
49
 
52
- <div data-hook="admin_general_setting_mail_from_address">
53
- <%= f.field_container :mail_from_address do %>
54
- <%= f.label :mail_from_address %>
55
- <%= f.text_field :mail_from_address, class: 'fullwidth' %>
56
- <%= f.error_message_on :mail_from_address %>
57
- <% end %>
58
- </div>
59
- <% end %>
50
+ <div data-hook="admin_general_setting_mail_from_address">
51
+ <%= f.field_container :mail_from_address do %>
52
+ <%= f.label :mail_from_address %>
53
+ <%= f.text_field :mail_from_address, class: 'fullwidth' %>
54
+ <%= f.error_message_on :mail_from_address %>
55
+ <% end %>
56
+ </div>
57
+
58
+ <div data-hook="admin_general_setting_default_tax_country">
59
+ <%= f.field_container :cart_tax_country_iso do %>
60
+ <%= f.field_hint :cart_tax_country_iso %>
61
+ <%= f.label :cart_tax_country_iso %>
62
+ <%= f.select :cart_tax_country_iso,
63
+ Spree::Country.all.map { |c| [c.name, c.iso] },
64
+ { include_blank: t(".no_cart_tax_country") },
65
+ { class: "select2 fullwidth" } %>
66
+ <%= f.error_message_on :cart_tax_country_iso %>
67
+ <% end %>
68
+ </div>
60
69
 
61
70
  <% if can? :update, :general_settings %>
62
71
  <div class="form-buttons filter-actions actions" data-hook="buttons">
@@ -1,18 +1,20 @@
1
1
  <div data-hook="admin_image_form_fields">
2
- <div class="four columns alpha">
3
- <div data-hook="file" class="field">
4
- <%= f.label :attachment %><br>
5
- <%= f.file_field :attachment %>
2
+ <div class="row">
3
+ <div class="col-xs-3">
4
+ <div data-hook="file" class="field">
5
+ <%= f.label :attachment %><br>
6
+ <%= f.file_field :attachment %>
7
+ </div>
8
+ <div data-hook="variant" class="field">
9
+ <%= f.label :viewable_id, Spree::Variant.model_name.human %><br>
10
+ <%= f.select :viewable_id, @variants, {}, { class: 'select2 fullwidth' } %>
11
+ </div>
6
12
  </div>
7
- <div data-hook="variant" class="field">
8
- <%= f.label :viewable_id, Spree::Variant.model_name.human %><br>
9
- <%= f.select :viewable_id, @variants, {}, { class: 'select2 fullwidth' } %>
13
+ <div data-hook="alt_text" class="field col-xs-4">
14
+ <%= f.label :alt %><br>
15
+ <%= f.text_area :alt, rows: 4, class: 'fullwidth' %>
10
16
  </div>
11
17
  </div>
12
- <div data-hook="alt_text" class="field omega five columns">
13
- <%= f.label :alt %><br>
14
- <%= f.text_area :alt, rows: 4, class: 'fullwidth' %>
15
- </div>
16
18
  </div>
17
19
 
18
20
  <div class="clear"></div>
@@ -0,0 +1,22 @@
1
+ <tr id="<%= spree_dom_id image %>" data-hook="images_row" class="<%= cycle('odd', 'even')%>">
2
+ <td class="no-border">
3
+ <% if can?(:update_positions, Spree::Image) %>
4
+ <span class="handle"></span>
5
+ <% end %>
6
+ </td>
7
+ <td>
8
+ <%= link_to image_tag(image.attachment.url(:mini)), image.attachment.url(:product) %>
9
+ </td>
10
+ <% if @product.has_variants? %>
11
+ <td><%= options_text_for(image) %></td>
12
+ <% end %>
13
+ <td><%= image.alt %></td>
14
+ <td class="actions">
15
+ <% if can?(:update, image) %>
16
+ <%= link_to_with_icon 'edit', Spree.t('actions.edit'), edit_admin_product_image_url(@product, image), :no_text => true, :data => {:action => 'edit'} %>
17
+ <% end %>
18
+ <% if can?(:destroy, image) %>
19
+ <%= link_to_delete image, { :url => admin_product_image_url(@product, image), :no_text => true } %>
20
+ <% end %>
21
+ </td>
22
+ </tr>
@@ -0,0 +1,9 @@
1
+ var uploadedRow = $('[data-upload-id="<%= params[:upload_id] %>"]');
2
+
3
+ <% if @image.persisted? %>
4
+ uploadedRow.trigger('clear');
5
+ $('#images-table').removeClass('hidden').find('tbody').append('<%= j render partial: "image_row", locals: {image: @image } %>');
6
+ $('.no-objects-found').hide();
7
+ <% else %>
8
+ uploadedRow.find('error').removeClass('hidden').html('<%= j @image.errors.full_messages.join("<br>").html_safe %>');
9
+ <% end %>
@@ -13,17 +13,21 @@
13
13
  <%= form_for [:admin, @product, @image], :html => { :multipart => true } do |f| %>
14
14
  <fieldset data-hook="edit_image">
15
15
  <legend align="center"><%= @image.attachment_file_name%></legend>
16
- <div data-hook="thumbnail" class="field alpha three columns align-center">
17
- <%= f.label Spree.t(:thumbnail) %><br>
18
- <%= link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:product) %>
19
- </div>
20
- <div class="nine columns omega">
21
- <%= render :partial => 'form', :locals => { :f => f } %>
16
+
17
+ <div class="row">
18
+ <div data-hook="thumbnail" class="field col-xs-2 align-center">
19
+ <%= f.label Spree.t(:thumbnail) %><br>
20
+ <%= link_to image_tag(@image.attachment.url(:small)), @image.attachment.url(:product) %>
21
+ </div>
22
+ <div class="col-xs-10">
23
+ <%= render :partial => 'form', :locals => { :f => f } %>
24
+ </div>
25
+ <div class="clear"></div>
22
26
  </div>
23
- <div class="clear"></div>
27
+
24
28
  <div class="form-buttons filter-actions actions" data-hook="buttons">
25
29
  <%= button Spree.t('actions.update') %>
26
- <%= link_to Spree.t('actions.cancel'), admin_product_images_url(@product), :id => 'cancel_link', :class => 'button remove' %>
30
+ <%= link_to Spree.t('actions.cancel'), admin_product_images_url(@product), :id => 'cancel_link', :class => 'button' %>
27
31
  </div>
28
32
  </fieldset>
29
33
  <% end %>