spree_backend 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/admin/address_states.js +19 -15
  3. data/app/assets/javascripts/admin/admin.js.erb +1 -5
  4. data/app/assets/javascripts/admin/nested-attribute.js +15 -11
  5. data/app/assets/javascripts/admin/option_type_autocomplete.js.erb +20 -16
  6. data/app/assets/javascripts/admin/orders/edit.js +17 -12
  7. data/app/assets/javascripts/admin/orders/edit_form.js +16 -12
  8. data/app/assets/javascripts/admin/product_picker.js +22 -16
  9. data/app/assets/javascripts/admin/promotions.js +34 -35
  10. data/app/assets/javascripts/admin/shipments.js.erb +35 -27
  11. data/app/assets/javascripts/admin/spree-select2.js.erb +2 -1
  12. data/app/assets/javascripts/admin/spree_backend.js +0 -1
  13. data/app/assets/javascripts/admin/states.js +10 -8
  14. data/app/assets/javascripts/admin/stock_management.js.coffee +2 -2
  15. data/app/assets/javascripts/admin/taxon_autocomplete.js.erb +32 -19
  16. data/app/assets/javascripts/admin/user_picker.js +21 -13
  17. data/app/assets/javascripts/admin/variant_autocomplete.js.erb +16 -4
  18. data/app/assets/stylesheets/admin/plugins/_select2.scss +5 -3
  19. data/app/assets/stylesheets/admin/sections/_alerts.scss +27 -0
  20. data/app/assets/stylesheets/admin/spree_admin.scss +1 -0
  21. data/app/controllers/spree/admin/base_controller.rb +11 -13
  22. data/app/controllers/spree/admin/images_controller.rb +4 -5
  23. data/app/controllers/spree/admin/mail_methods_controller.rb +1 -1
  24. data/app/controllers/spree/admin/orders/customer_details_controller.rb +1 -1
  25. data/app/controllers/spree/admin/orders_controller.rb +3 -7
  26. data/app/controllers/spree/admin/payments_controller.rb +1 -1
  27. data/app/controllers/spree/admin/resource_controller.rb +6 -2
  28. data/app/helpers/spree/admin/navigation_helper.rb +4 -2
  29. data/app/helpers/spree/admin/stock_locations_helper.rb +15 -0
  30. data/app/views/spree/admin/countries/index.html.erb +2 -2
  31. data/app/views/spree/admin/general_settings/edit.html.erb +3 -3
  32. data/app/views/spree/admin/option_types/index.html.erb +15 -5
  33. data/app/views/spree/admin/orders/_shipment.html.erb +2 -2
  34. data/app/views/spree/admin/orders/customer_details/_form.html.erb +8 -8
  35. data/app/views/spree/admin/orders/index.html.erb +4 -3
  36. data/app/views/spree/admin/payment_methods/index.html.erb +7 -4
  37. data/app/views/spree/admin/payments/_form.html.erb +1 -1
  38. data/app/views/spree/admin/payments/show.html.erb +2 -2
  39. data/app/views/spree/admin/product_properties/_product_property_fields.html.erb +1 -1
  40. data/app/views/spree/admin/product_properties/index.html.erb +9 -13
  41. data/app/views/spree/admin/products/index.html.erb +3 -3
  42. data/app/views/spree/admin/products/stock.html.erb +10 -8
  43. data/app/views/spree/admin/promotions/index.html.erb +6 -6
  44. data/app/views/spree/admin/properties/index.html.erb +12 -5
  45. data/app/views/spree/admin/prototypes/_form.html.erb +1 -1
  46. data/app/views/spree/admin/prototypes/index.html.erb +9 -2
  47. data/app/views/spree/admin/reports/index.html.erb +2 -3
  48. data/app/views/spree/admin/shared/_address_form.html.erb +11 -11
  49. data/app/views/spree/admin/shared/_alert.html.erb +3 -3
  50. data/app/views/spree/admin/shared/_routes.html.erb +1 -0
  51. data/app/views/spree/admin/shared/_tabs.html.erb +2 -2
  52. data/app/views/spree/admin/shared/_translations.html.erb +3 -0
  53. data/app/views/spree/admin/shipping_categories/index.html.erb +9 -2
  54. data/app/views/spree/admin/shipping_methods/_form.html.erb +10 -0
  55. data/app/views/spree/admin/shipping_methods/index.html.erb +9 -5
  56. data/app/views/spree/admin/stock_locations/_form.html.erb +15 -11
  57. data/app/views/spree/admin/stock_locations/index.html.erb +9 -6
  58. data/app/views/spree/admin/stock_movements/index.html.erb +7 -0
  59. data/app/views/spree/admin/stock_transfers/index.html.erb +19 -18
  60. data/app/views/spree/admin/stock_transfers/new.html.erb +24 -21
  61. data/app/views/spree/admin/stock_transfers/show.html.erb +13 -9
  62. data/app/views/spree/admin/tax_categories/index.html.erb +12 -8
  63. data/app/views/spree/admin/tax_rates/_form.html.erb +8 -8
  64. data/app/views/spree/admin/tax_rates/index.html.erb +12 -11
  65. data/app/views/spree/admin/taxonomies/_list.html.erb +5 -5
  66. data/app/views/spree/admin/taxonomies/index.html.erb +11 -4
  67. data/app/views/spree/admin/taxons/_form.html.erb +6 -5
  68. data/app/views/spree/admin/taxons/edit.html.erb +17 -2
  69. data/app/views/spree/admin/trackers/index.html.erb +10 -10
  70. data/app/views/spree/admin/variants/_autocomplete.js.erb +3 -3
  71. data/app/views/spree/admin/variants/index.html.erb +9 -7
  72. data/app/views/spree/admin/zones/_country_members.html.erb +10 -0
  73. data/app/views/spree/admin/zones/_form.html.erb +4 -1
  74. data/app/views/spree/admin/zones/_state_members.html.erb +10 -0
  75. data/app/views/spree/admin/zones/edit.html.erb +3 -7
  76. data/app/views/spree/admin/zones/index.html.erb +11 -10
  77. data/vendor/assets/javascripts/trunk8.js +362 -226
  78. metadata +11 -11
  79. data/app/views/spree/admin/zones/_country_member.html.erb +0 -5
  80. data/app/views/spree/admin/zones/_member_type.html.erb +0 -19
  81. data/app/views/spree/admin/zones/_state_member.html.erb +0 -5
  82. data/vendor/assets/javascripts/jquery.horizontalNav.js +0 -141
@@ -1,32 +1,45 @@
1
- $(document).ready(function() {
2
- if ($("#product_taxon_ids").length > 0) {
3
- $("#product_taxon_ids").select2({
1
+ $(document).ready(function () {
2
+ 'use strict';
3
+
4
+ if ($('#product_taxon_ids').length > 0) {
5
+ $('#product_taxon_ids').select2({
4
6
  placeholder: Spree.translations.taxon_placeholder,
5
7
  multiple: true,
6
- initSelection: function(element, callback) {
7
- url = Spree.url(Spree.routes.taxons_search, { ids: element.val() })
8
- return $.getJSON(url, null, function(data) {
9
- return callback(data);
10
- })
8
+ initSelection: function (element, callback) {
9
+ var url = Spree.url(Spree.routes.taxons_search, {
10
+ ids: element.val()
11
+ });
12
+ return $.getJSON(url, null, function (data) {
13
+ return callback(data['taxons']);
14
+ });
11
15
  },
12
16
  ajax: {
13
17
  url: Spree.routes.taxons_search,
14
18
  datatype: 'json',
15
- data: function(term, page) {
16
- return { q:
17
- { name_cont: term }
18
- }
19
+ data: function (term, page) {
20
+ return {
21
+ per_page: 50,
22
+ page: page,
23
+ q: {
24
+ name_cont: term
25
+ }
26
+ };
19
27
  },
20
28
  results: function (data, page) {
21
- return { results: data }
29
+ var more = page < data.pages;
30
+ console.log(more)
31
+ return {
32
+ results: data['taxons'],
33
+ more: more
34
+ };
22
35
  }
23
36
  },
24
- formatResult: function(taxon) {
25
- return taxon.pretty_name
37
+ formatResult: function (taxon) {
38
+ return taxon.pretty_name;
26
39
  },
27
- formatSelection: function(taxon) {
28
- return taxon.pretty_name
40
+ formatSelection: function (taxon) {
41
+ return taxon.pretty_name;
29
42
  }
30
- })
43
+ });
31
44
  }
32
- })
45
+ });
@@ -1,31 +1,39 @@
1
- $.fn.userAutocomplete = function() {
1
+ $.fn.userAutocomplete = function () {
2
+ 'use strict';
3
+
2
4
  this.select2({
3
5
  minimumInputLength: 1,
4
6
  multiple: true,
5
- initSelection: function(element, callback) {
6
- $.get(Spree.routes.user_search, { ids: element.val() }, function(data) {
7
- callback(data)
8
- })
7
+ initSelection: function (element, callback) {
8
+ $.get(Spree.routes.user_search, {
9
+ ids: element.val()
10
+ }, function (data) {
11
+ callback(data);
12
+ });
9
13
  },
10
14
  ajax: {
11
15
  url: Spree.routes.user_search,
12
16
  datatype: 'json',
13
- data: function(term, page) {
14
- return { q: term }
17
+ data: function (term) {
18
+ return {
19
+ q: term
20
+ };
15
21
  },
16
- results: function(data, page) {
17
- return { results: data }
22
+ results: function (data) {
23
+ return {
24
+ results: data
25
+ };
18
26
  }
19
27
  },
20
- formatResult: function(user) {
28
+ formatResult: function (user) {
21
29
  return user.email;
22
30
  },
23
- formatSelection: function(user) {
31
+ formatSelection: function (user) {
24
32
  return user.email;
25
33
  }
26
34
  });
27
- }
35
+ };
28
36
 
29
37
  $(document).ready(function () {
30
38
  $('.user_picker').userAutocomplete();
31
- })
39
+ });
@@ -88,7 +88,7 @@ adjustItems = function(shipment_number, variant_id, quantity){
88
88
  url: Spree.url(url),
89
89
  data: { variant_id: variant_id, quantity: new_quantity }
90
90
  }).done(function( msg ) {
91
- window.location.reload();
91
+ advanceOrder();
92
92
  });
93
93
  }
94
94
  }
@@ -180,8 +180,6 @@ completeItemSplit = function(event) {
180
180
  async: false,
181
181
  url: Spree.url(Spree.routes.orders_api + "/" + order_number + "/shipments/" + original_shipment_number + "/remove.json"),
182
182
  data: { variant_id: variant_id, quantity: quantity }
183
- }).done(function(msg) {
184
- window.location.reload();
185
183
  });
186
184
 
187
185
  if (new_shipment != undefined) {
@@ -190,6 +188,8 @@ completeItemSplit = function(event) {
190
188
  async: false,
191
189
  url: Spree.url(Spree.routes.orders_api + "/" + order_number + "/shipments.json"),
192
190
  data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id }
191
+ }).done(function(msg) {
192
+ advanceOrder();
193
193
  });
194
194
  } else {
195
195
  $.ajax({
@@ -197,11 +197,23 @@ completeItemSplit = function(event) {
197
197
  async: false,
198
198
  url: Spree.url(Spree.routes.orders_api + "/" + order_number + "/shipments/" + target_shipment_number + "/add.json"),
199
199
  data: { variant_id: variant_id, quantity: quantity }
200
+ }).done(function(msg) {
201
+ advanceOrder();
200
202
  });
201
203
  }
202
204
  }
203
205
  }
204
206
 
207
+ advanceOrder = function() {
208
+ $.ajax({
209
+ type: "PUT",
210
+ async: false,
211
+ url: Spree.url(Spree.routes.checkouts_api + "/" + order_number + "/advance")
212
+ }).done(function() {
213
+ window.location.reload();
214
+ });
215
+ }
216
+
205
217
  cancelItemSplit = function(event) {
206
218
  event.preventDefault();
207
219
  var link = $(this);
@@ -229,7 +241,7 @@ addVariantFromStockLocation = function() {
229
241
  url: Spree.url(Spree.routes.orders_api + "/" + order_number + "/shipments.json"),
230
242
  data: { variant_id: variant_id, quantity: quantity, stock_location_id: stock_location_id }
231
243
  }).done(function( msg ) {
232
- window.location.reload();
244
+ advanceOrder();
233
245
  }).error(function( msg ) {
234
246
  console.log(msg);
235
247
  });
@@ -40,10 +40,12 @@
40
40
  }
41
41
  }
42
42
 
43
- .select2-drop {
44
- border-color: $color-sel-hover-bg;
43
+ .select2-drop {
45
44
  box-shadow: none !important;
46
45
  z-index: 1000000;
46
+ max-width: auto !important;
47
+ border-top: 1px solid;
48
+ border-color: $color-sel-hover-bg;
47
49
 
48
50
  &.select2-drop-above {
49
51
  border-color: $color-sel-hover-bg;
@@ -87,7 +89,7 @@
87
89
  display: block;
88
90
  width: 100%;
89
91
  height: 100%;
90
- background: none;
92
+ background: none !important;
91
93
  font-family: FontAwesome;
92
94
  font-weight: 200 !important;
93
95
 
@@ -0,0 +1,27 @@
1
+ .alert {
2
+ padding: 10px;
3
+ color: white;
4
+ font-weight: bold;
5
+ font-size: 125%;
6
+
7
+ &.security {
8
+ background: #cc0000;
9
+ border-bottom: 3px solid darken(#cc0000, 10);
10
+ a {
11
+ color: lighten($color-3, 20);
12
+ }
13
+ }
14
+
15
+ &.release, &.news {
16
+ background: $color-2;
17
+ border-bottom: 3px solid darken($color-2, 10);
18
+ a {
19
+ color: darken($color-3, 10);
20
+ }
21
+ }
22
+
23
+ .dismiss {
24
+ float: right;
25
+ color: white !important;
26
+ }
27
+ }
@@ -26,6 +26,7 @@
26
26
  @import 'plugins/token-input';
27
27
  @import 'plugins/jstree';
28
28
 
29
+ @import 'sections/alerts';
29
30
  @import 'sections/image_settings';
30
31
  @import 'sections/orders';
31
32
  @import 'sections/overview';
@@ -28,24 +28,17 @@ module Spree
28
28
  # Need to generate an API key for a user due to some backend actions
29
29
  # requiring authentication to the Spree API
30
30
  def generate_admin_api_key
31
- if user = try_spree_current_user
32
- if user.spree_api_key.blank?
33
- user.generate_spree_api_key!
34
- end
31
+ if (user = try_spree_current_user) && user.spree_api_key.blank?
32
+ user.generate_spree_api_key!
35
33
  end
36
34
  end
37
35
 
38
36
  def check_alerts
39
37
  return unless should_check_alerts?
40
-
41
38
  unless session.has_key? :alerts
42
- begin
43
- session[:alerts] = Spree::Alert.current(request.host)
44
- filter_dismissed_alerts
45
- Spree::Config.set :last_check_for_spree_alerts => DateTime.now.to_s
46
- rescue
47
- session[:alerts] = nil
48
- end
39
+ session[:alerts] = Spree::Alert.current(request.host)
40
+ filter_dismissed_alerts
41
+ Spree::Config.set :last_check_for_spree_alerts => DateTime.now.to_s
49
42
  end
50
43
  end
51
44
 
@@ -81,7 +74,12 @@ module Spree
81
74
  def filter_dismissed_alerts
82
75
  return unless session[:alerts]
83
76
  dismissed = (Spree::Config[:dismissed_spree_alerts] || '').split(',')
84
- session[:alerts].reject! { |a| dismissed.include? a["id"].to_s }
77
+ # If it's a string, something has gone wrong with the alerts service. Ignore it.
78
+ if session[:alerts].is_a?(String)
79
+ session[:alerts] = nil
80
+ else
81
+ session[:alerts].reject! { |a| dismissed.include? a["id"].to_s }
82
+ end
85
83
  end
86
84
 
87
85
  def config_locale
@@ -5,10 +5,13 @@ module Spree
5
5
 
6
6
  create.before :set_viewable
7
7
  update.before :set_viewable
8
- destroy.before :destroy_before
9
8
 
10
9
  private
11
10
 
11
+ def location_after_destroy
12
+ admin_product_images_url(@product)
13
+ end
14
+
12
15
  def location_after_save
13
16
  admin_product_images_url(@product)
14
17
  end
@@ -26,10 +29,6 @@ module Spree
26
29
  @image.viewable_id = params[:image][:viewable_id]
27
30
  end
28
31
 
29
- def destroy_before
30
- @viewable = @image.viewable
31
- end
32
-
33
32
  end
34
33
  end
35
34
  end
@@ -18,7 +18,7 @@ module Spree
18
18
  end
19
19
 
20
20
  def testmail
21
- if TestMailer.test_email(try_spree_current_user).deliver
21
+ if TestMailer.test_email(try_spree_current_user.id).deliver
22
22
  flash[:success] = Spree.t('admin.mail_methods.testmail.delivery_success')
23
23
  else
24
24
  flash[:error] = Spree.t('admin.mail_methods.testmail.delivery_error')
@@ -22,7 +22,7 @@ module Spree
22
22
  end
23
23
  while @order.next; end
24
24
 
25
- @order.shipments.map &:refresh_rates
25
+ @order.refresh_shipment_rates
26
26
  flash[:success] = Spree.t('customer_details_updated')
27
27
  redirect_to admin_order_customer_path(@order)
28
28
  else
@@ -52,13 +52,9 @@ module Spree
52
52
  end
53
53
 
54
54
  def edit
55
- @order.shipments.map &:refresh_rates
56
- # Transition as far as we can go
57
- while @order.next; end
58
- # The payment step shows an error of 'No pending payments'
59
- # Clearing the errors from the order object will stop this error
60
- # appearing on the edit page where we don't want it to.
61
- @order.errors.clear
55
+ unless @order.complete?
56
+ @order.refresh_shipment_rates
57
+ end
62
58
  end
63
59
 
64
60
  def update
@@ -92,7 +92,7 @@ module Spree
92
92
  #
93
93
  # Otherwise redirect user to that step
94
94
  def can_transition_to_payment
95
- unless @order.payment? || @order.complete?
95
+ unless @order.billing_address.present?
96
96
  flash[:notice] = Spree.t(:fill_in_customer_info)
97
97
  redirect_to edit_admin_order_customer_url(@order)
98
98
  end
@@ -70,13 +70,13 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
70
70
  invoke_callbacks(:destroy, :after)
71
71
  flash[:success] = flash_message_for(@object, :successfully_removed)
72
72
  respond_with(@object) do |format|
73
- format.html { redirect_to collection_url }
73
+ format.html { redirect_to location_after_destroy }
74
74
  format.js { render :partial => "spree/admin/shared/destroy" }
75
75
  end
76
76
  else
77
77
  invoke_callbacks(:destroy, :fails)
78
78
  respond_with(@object) do |format|
79
- format.html { redirect_to collection_url }
79
+ format.html { redirect_to location_after_destroy }
80
80
  end
81
81
  end
82
82
  end
@@ -198,6 +198,10 @@ class Spree::Admin::ResourceController < Spree::Admin::BaseController
198
198
  end
199
199
  end
200
200
 
201
+ def location_after_destroy
202
+ collection_url
203
+ end
204
+
201
205
  def location_after_save
202
206
  collection_url
203
207
  end
@@ -30,7 +30,7 @@ module Spree
30
30
  end
31
31
 
32
32
  selected = if options[:match_path]
33
- request.fullpath.starts_with?("#{spree.root_path}admin#{options[:match_path]}")
33
+ request.fullpath.starts_with?("#{admin_path}#{options[:match_path]}")
34
34
  else
35
35
  args.include?(controller.controller_name.to_sym)
36
36
  end
@@ -142,7 +142,9 @@ module Spree
142
142
  end
143
143
 
144
144
  def configurations_sidebar_menu_item(link_text, url, options = {})
145
- is_active = url.ends_with?(controller.controller_name) || url.ends_with?( "#{controller.controller_name}/edit")
145
+ is_active = url.ends_with?(controller.controller_name) ||
146
+ url.ends_with?("#{controller.controller_name}/edit") ||
147
+ url.ends_with?("#{controller.controller_name.singularize}/edit")
146
148
  options.merge!(:class => is_active ? 'active' : nil)
147
149
  content_tag(:li, options) do
148
150
  link_to(link_text, url)
@@ -0,0 +1,15 @@
1
+ module Spree
2
+ module Admin
3
+ module StockLocationsHelper
4
+ def display_name(stock_location)
5
+ name_parts = [stock_location.admin_name, stock_location.name]
6
+ name_parts.delete_if(&:blank?)
7
+ name_parts.join(' / ')
8
+ end
9
+
10
+ def state(stock_location)
11
+ stock_location.active? ? 'active' : 'inactive'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -1,4 +1,4 @@
1
- <%= render :partial => 'spree/admin/shared/configuration_menu' %>
1
+ <%= render 'spree/admin/shared/configuration_menu' %>
2
2
 
3
3
  <% content_for :page_title do %>
4
4
  <%= Spree.t(:listing_countries) %>
@@ -24,7 +24,7 @@
24
24
  <tr id="<%= spree_dom_id country %>" data-hook="country_row" class="<%= cycle('odd', 'even')%>">
25
25
  <td><%= country.name %></td>
26
26
  <td><%= country.iso_name %></td>
27
- <td class="align-center"><%= country.states_required.to_s.titleize %></td>
27
+ <td class="align-center"><%= country.states_required? ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
28
28
  <td class="actions">
29
29
  <%= link_to_edit country, :no_text => true %>
30
30
  </td>
@@ -11,7 +11,7 @@
11
11
  <% @preferences_general.each do |key|
12
12
  type = Spree::Config.preference_type(key) %>
13
13
  <div class="field">
14
- <%= label_tag(key, Spree.t(key) + ': ') + tag(:br) if type != :boolean %>
14
+ <%= label_tag(key, Spree.t(key)) + tag(:br) if type != :boolean %>
15
15
  <%= preference_field_tag(key, Spree::Config[key], :type => type) %>
16
16
  <%= label_tag(key, Spree.t(key)) + tag(:br) if type == :boolean %>
17
17
  </div>
@@ -25,7 +25,7 @@
25
25
  <% @preferences_security.each do |key|
26
26
  type = Spree::Config.preference_type(key) %>
27
27
  <div class="field">
28
- <%= label_tag(key, Spree.t(key) + ': ') + tag(:br) if type != :boolean %>
28
+ <%= label_tag(key, Spree.t(key)) + tag(:br) if type != :boolean %>
29
29
  <%= preference_field_tag(key, Spree::Config[key], :type => type) %>
30
30
  <%= label_tag(key, Spree.t(key)) + tag(:br) if type == :boolean %>
31
31
  </div>
@@ -38,7 +38,7 @@
38
38
  <% @preferences_currency.each do |key|
39
39
  type = Spree::Config.preference_type(key) %>
40
40
  <div class="field">
41
- <%= label_tag(key, Spree.t(key) + ': ') + tag(:br) if type != :boolean %>
41
+ <%= label_tag(key, Spree.t(key)) + tag(:br) if type != :boolean %>
42
42
  <%= preference_field_tag(key, Spree::Config[key], :type => type) %>
43
43
  <%= label_tag(key, Spree.t(key)) + tag(:br) if type == :boolean %>
44
44
  </div>
@@ -12,14 +12,17 @@
12
12
 
13
13
  <div id="new_option_type"></div>
14
14
 
15
+ <% if @option_types.any? %>
15
16
  <table class="index sortable" id="listing_option_types" data-hook data-sortable-link="<%= update_positions_admin_option_types_url %>">
16
17
  <colgroup>
17
- <col style="width: 44%">
18
- <col style="width: 44%">
19
- <col style="width: 12%">
18
+ <col style="width: 10%">
19
+ <col style="width: 35%">
20
+ <col style="width: 40%">
21
+ <col style="width: 15%">
20
22
  </colgroup>
21
23
  <thead>
22
24
  <tr data-hook="option_header">
25
+ <th class="no-border"></th>
23
26
  <th><%= Spree.t(:name) %></th>
24
27
  <th><%= Spree.t(:presentation) %></th>
25
28
  <th class="actions"></th>
@@ -28,8 +31,9 @@
28
31
  <tbody>
29
32
  <% @option_types.each do |option_type| %>
30
33
  <tr class="spree_option_type <%= cycle('odd', 'even')%>" id="<%= spree_dom_id option_type %>" data-hook="option_row">
31
- <td><span class="handle"></span> <%= option_type.name %></td>
32
- <td class="presentation"><%= option_type.presentation %></td>
34
+ <td class="no-border"><span class="handle"></span></td>
35
+ <td class="align-center"><%= option_type.name %></td>
36
+ <td class="align-center presentation"><%= option_type.presentation %></td>
33
37
  <td class="actions">
34
38
  <%= link_to_edit(option_type, :class => 'admin_edit_option_type', :no_text => true) %>
35
39
  <%= link_to_delete(option_type, :no_text => true) %>
@@ -38,3 +42,9 @@
38
42
  <% end %>
39
43
  </tbody>
40
44
  </table>
45
+ <% else %>
46
+ <div class="alpha twelve columns no-objects-found">
47
+ <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/option_type')) %>,
48
+ <%= link_to Spree.t(:add_one), spree.new_admin_option_type_path %>!
49
+ </div>
50
+ <% end %>
@@ -49,8 +49,8 @@
49
49
  <div class="field omega four columns">
50
50
  <label><%= Spree.t(:associated_adjustment_closed) %></label>
51
51
  <ul>
52
- <li><%= radio_button_tag :open_adjustment, 'yes', false, :data => {'shipment-number' => shipment.number } %> Yes</li>
53
- <li><%= radio_button_tag :open_adjustment, 'no', true, :data => {'shipment-number' => shipment.number } %> No</li>
52
+ <li><%= radio_button_tag :open_adjustment, 'yes', false, data: { 'shipment-number' => shipment.number } %> <%= Spree.t(:say_yes) %></li>
53
+ <li><%= radio_button_tag :open_adjustment, 'no', true, data: { 'shipment-number' => shipment.number } %> <%= Spree.t(:say_no) %></li>
54
54
  </ul>
55
55
  </div>
56
56
  <% end %>
@@ -1,18 +1,18 @@
1
1
  <fieldset data-hook="admin_customer_detail_form_fields" class="no-border-top">
2
-
2
+
3
3
  <fieldset class="index no-border-bottom" data-hook="customer_guest">
4
4
  <legend align="center"><%= Spree.t(:account) %></legend>
5
-
5
+
6
6
  <div data-hook="customer_fields" class="row">
7
7
  <div class="alpha eight columns">
8
8
  <div class="field">
9
- <%= f.label :email, Spree.t(:email) + ':' %>
9
+ <%= f.label :email, Spree.t(:email) %>
10
10
  <%= f.email_field :email, :class => 'fullwidth' %>
11
11
  </div>
12
12
  </div>
13
13
  <div class="omega four columns">
14
14
  <div class="field">
15
- <%= label_tag nil, Spree.t(:guest_checkout) %>:
15
+ <%= label_tag nil, Spree.t(:guest_checkout) %>
16
16
  <ul>
17
17
  <% if @order.completed? %>
18
18
  <li>
@@ -26,8 +26,8 @@
26
26
  </li>
27
27
  <li>
28
28
  <%= radio_button_tag :guest_checkout, false, !guest, :disabled => @order.cart? %>
29
- <%= Spree.t(:say_no) %>
30
- </li>
29
+ <%= Spree.t(:say_no) %>
30
+ </li>
31
31
  <%= hidden_field_tag :user_id, @order.user_id %>
32
32
  <% end %>
33
33
  </ul>
@@ -44,13 +44,13 @@
44
44
  <% end %>
45
45
  </fieldset>
46
46
  </div>
47
-
47
+
48
48
  <div class="omega six columns" data-hook="ship_address_wrapper">
49
49
  <fieldset class="no-border-bottom">
50
50
  <legend align="center"><%= Spree.t(:shipping_address) %></legend>
51
51
  <%= f.fields_for :ship_address do |sa_form| %>
52
52
  <%= render :partial => 'spree/admin/shared/address_form', :locals => { :f => sa_form, :name => Spree.t(:shipping_address), :use_billing => true } %>
53
- <% end %>
53
+ <% end %>
54
54
  </fieldset>
55
55
  </div>
56
56
 
@@ -80,7 +80,7 @@
80
80
 
81
81
  <%= paginate @orders %>
82
82
 
83
- <% unless @orders.empty? %>
83
+ <% if @orders.any? %>
84
84
  <table class="index responsive" id="listing_orders" data-hook>
85
85
  <colgroup>
86
86
  <col style="width: 13%;">
@@ -126,8 +126,9 @@
126
126
  </tbody>
127
127
  </table>
128
128
  <% else %>
129
- <div class="no-objects-found">
130
- <%= Spree.t(:no_orders_found)%>
129
+ <div class="alpha twelve columns no-objects-found">
130
+ <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/order')) %>,
131
+ <%= link_to Spree.t(:add_one), spree.new_admin_order_path %>!
131
132
  </div>
132
133
  <% end %>
133
134
 
@@ -1,4 +1,4 @@
1
- <%= render :partial => 'spree/admin/shared/configuration_menu' %>
1
+ <%= render 'spree/admin/shared/configuration_menu' %>
2
2
 
3
3
  <% content_for :page_title do %>
4
4
  <%= Spree.t(:payment_methods) %>
@@ -28,13 +28,13 @@
28
28
  <th><%= Spree.t(:display) %></th>
29
29
  <th><%= Spree.t(:active) %></th>
30
30
  <th data-hook="admin_payment_methods_index_header_actions" class="actions"></th>
31
- </tr>
31
+ </tr>
32
32
  </thead>
33
33
  <tbody>
34
34
  <% @payment_methods.each do |method|%>
35
35
  <tr id="<%= spree_dom_id method %>" data-hook="admin_payment_methods_index_rows" class="<%= cycle('odd', 'even')%>">
36
36
  <td class="align-center"><%= method.name %></td>
37
- <td><%= method.type %></td>
37
+ <td class="align-center"><%= method.type %></td>
38
38
  <td class="align-center"><%= method.environment.to_s.titleize %></td>
39
39
  <td class="align-center"><%= method.display_on.blank? ? Spree.t(:both) : Spree.t(method.display_on) %></td>
40
40
  <td class="align-center"><%= method.active ? Spree.t(:say_yes) : Spree.t(:say_no) %></td>
@@ -47,6 +47,9 @@
47
47
  </tbody>
48
48
  </table>
49
49
  <% else %>
50
- <div class="alpha twelve columns no-objects-found"><%= Spree.t(:no_payment_methods_found) %></div>
50
+ <div class="alpha twelve columns no-objects-found">
51
+ <%= Spree.t(:no_resource_found, resource: I18n.t(:other, scope: 'activerecord.models.spree/payment_method')) %>,
52
+ <%= link_to Spree.t(:add_one), spree.new_admin_payment_method_path %>!
53
+ </div>
51
54
  <% end %>
52
55
 
@@ -8,7 +8,7 @@
8
8
  <div class="omega nine columns">
9
9
  <div class="field">
10
10
  <label><%= Spree.t(:payment_method) %></label>
11
- <ul>
11
+ <ul id='payment-methods'>
12
12
  <% @payment_methods.each do |method| %>
13
13
  <li>
14
14
  <label data-hook="payment_method_field">
@@ -2,7 +2,7 @@
2
2
 
3
3
  <% content_for :page_title do %>
4
4
  <i class="icon-arrow-right"></i>
5
- <%= Spree.t("activerecord.models.#{@payment.class.to_s.underscore}.one") %>
5
+ <%= I18n.t("activerecord.models.#{@payment.class.to_s.underscore}.one") %>
6
6
  <i class="icon-arrow-right"></i>
7
7
  <%= payment_method_name(@payment) %>
8
8
  <% end %>
@@ -14,5 +14,5 @@
14
14
  <%= render :partial => "spree/admin/payments/source_views/#{@payment.payment_method.method_type}", :locals => { :payment => @payment.source.is_a?(Spree::Payment) ? @payment.source : @payment } %>
15
15
 
16
16
  <div data-hook="amount" class="align-center">
17
- <h5><%= label_tag nil, Spree.t(:amount) %>: <span class="green"><%= @payment.amount %></span> </h5>
17
+ <h5><%= label_tag nil, Spree.t(:amount) %>: <span class="green"><%= @payment.display_amount %></span> </h5>
18
18
  </div>