spree_backend 3.3.6 → 3.4.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/spree/backend/checkouts/edit.js +1 -8
  3. data/app/assets/javascripts/spree/backend/handlebar_extensions.js +3 -0
  4. data/app/assets/javascripts/spree/backend/returns/return_item_selection.js +1 -1
  5. data/app/assets/javascripts/spree/backend/shipments.js +8 -25
  6. data/app/assets/javascripts/spree/backend/taxons.js.coffee +1 -6
  7. data/app/assets/stylesheets/spree/backend/sections/_account.scss +8 -4
  8. data/app/controllers/spree/admin/adjustments_controller.rb +0 -2
  9. data/app/controllers/spree/admin/base_controller.rb +5 -5
  10. data/app/controllers/spree/admin/countries_controller.rb +1 -2
  11. data/app/controllers/spree/admin/customer_returns_controller.rb +4 -5
  12. data/app/controllers/spree/admin/general_settings_controller.rb +1 -0
  13. data/app/controllers/spree/admin/log_entries_controller.rb +0 -1
  14. data/app/controllers/spree/admin/option_types_controller.rb +10 -10
  15. data/app/controllers/spree/admin/orders_controller.rb +30 -21
  16. data/app/controllers/spree/admin/payment_methods_controller.rb +5 -7
  17. data/app/controllers/spree/admin/payments_controller.rb +3 -3
  18. data/app/controllers/spree/admin/product_properties_controller.rb +7 -6
  19. data/app/controllers/spree/admin/products_controller.rb +8 -9
  20. data/app/controllers/spree/admin/promotion_actions_controller.rb +4 -4
  21. data/app/controllers/spree/admin/promotion_rules_controller.rb +4 -4
  22. data/app/controllers/spree/admin/promotions_controller.rb +22 -21
  23. data/app/controllers/spree/admin/properties_controller.rb +2 -2
  24. data/app/controllers/spree/admin/prototypes_controller.rb +0 -1
  25. data/app/controllers/spree/admin/reports_controller.rb +17 -10
  26. data/app/controllers/spree/admin/resource_controller.rb +6 -15
  27. data/app/controllers/spree/admin/shipping_methods_controller.rb +5 -5
  28. data/app/controllers/spree/admin/states_controller.rb +9 -9
  29. data/app/controllers/spree/admin/stock_items_controller.rb +10 -9
  30. data/app/controllers/spree/admin/stock_movements_controller.rb +2 -2
  31. data/app/controllers/spree/admin/stock_transfers_controller.rb +20 -15
  32. data/app/controllers/spree/admin/store_credits_controller.rb +1 -1
  33. data/app/controllers/spree/admin/taxons_controller.rb +9 -18
  34. data/app/controllers/spree/admin/users_controller.rb +7 -7
  35. data/app/controllers/spree/admin/variants_controller.rb +1 -1
  36. data/app/controllers/spree/admin/variants_including_master_controller.rb +2 -3
  37. data/app/controllers/spree/admin/zones_controller.rb +11 -11
  38. data/app/helpers/spree/admin/adjustments_helper.rb +8 -10
  39. data/app/helpers/spree/admin/base_helper.rb +43 -49
  40. data/app/helpers/spree/admin/general_settings_helper.rb +1 -1
  41. data/app/helpers/spree/admin/images_helper.rb +0 -1
  42. data/app/helpers/spree/admin/navigation_helper.rb +39 -45
  43. data/app/helpers/spree/admin/orders_helper.rb +42 -43
  44. data/app/helpers/spree/admin/payments_helper.rb +1 -1
  45. data/app/helpers/spree/admin/promotion_rules_helper.rb +2 -2
  46. data/app/helpers/spree/admin/stock_locations_helper.rb +1 -1
  47. data/app/helpers/spree/admin/stock_movements_helper.rb +1 -1
  48. data/app/helpers/spree/admin/taxons_helper.rb +1 -1
  49. data/app/models/spree/admin/resource.rb +4 -4
  50. data/app/views/spree/admin/products/_autocomplete.js.erb +1 -1
  51. data/app/views/spree/admin/return_authorizations/_form.html.erb +1 -1
  52. data/app/views/spree/admin/shared/_account_nav.html.erb +59 -0
  53. data/app/views/spree/admin/shared/_header.html.erb +3 -1
  54. data/app/views/spree/admin/shared/_main_menu.html.erb +0 -6
  55. data/app/views/spree/admin/shared/_version.html.erb +5 -0
  56. data/app/views/spree/admin/stock_transfers/new.html.erb +1 -1
  57. data/app/views/spree/admin/stock_transfers/show.html.erb +1 -1
  58. data/app/views/spree/admin/users/index.html.erb +1 -1
  59. data/app/views/spree/layouts/admin.html.erb +2 -0
  60. data/config/initializers/assets.rb +1 -1
  61. data/config/initializers/form_builder.rb +2 -3
  62. data/config/routes.rb +5 -5
  63. data/lib/spree/backend/action_callbacks.rb +0 -1
  64. data/lib/spree/backend/callbacks.rb +3 -5
  65. data/lib/spree/backend/engine.rb +4 -4
  66. metadata +11 -9
@@ -19,53 +19,49 @@ module Spree
19
19
  options = { label: args.first.to_s }
20
20
 
21
21
  # Return if resource is found and user is not allowed to :admin
22
- return '' if klass = klass_for(options[:label]) and cannot?(:admin, klass)
22
+ return '' if (klass = klass_for(options[:label])) && cannot?(:admin, klass)
23
23
 
24
- if args.last.is_a?(Hash)
25
- options = options.merge(args.pop)
26
- end
27
- options[:route] ||= "admin_#{args.first}"
24
+ options = options.merge(args.pop) if args.last.is_a?(Hash)
25
+ options[:route] ||= "admin_#{args.first}"
28
26
 
29
27
  destination_url = options[:url] || spree.send("#{options[:route]}_path")
30
28
  titleized_label = Spree.t(options[:label], default: options[:label], scope: [:admin, :tab]).titleize
31
29
 
32
30
  css_classes = ['sidebar-menu-item']
33
31
 
34
- if options[:icon]
35
- link = link_to_with_icon(options[:icon], titleized_label, destination_url)
36
- else
37
- link = link_to(titleized_label, destination_url)
38
- end
32
+ link = if options[:icon]
33
+ link_to_with_icon(options[:icon], titleized_label, destination_url)
34
+ else
35
+ link_to(titleized_label, destination_url)
36
+ end
39
37
 
40
38
  selected = if options[:match_path].is_a? Regexp
41
- request.fullpath =~ options[:match_path]
42
- elsif options[:match_path]
43
- request.fullpath.starts_with?("#{spree.admin_path}#{options[:match_path]}")
44
- else
45
- args.include?(controller.controller_name.to_sym)
39
+ request.fullpath =~ options[:match_path]
40
+ elsif options[:match_path]
41
+ request.fullpath.starts_with?("#{spree.admin_path}#{options[:match_path]}")
42
+ else
43
+ args.include?(controller.controller_name.to_sym)
46
44
  end
47
45
  css_classes << 'selected' if selected
48
46
 
49
- if options[:css_class]
50
- css_classes << options[:css_class]
51
- end
47
+ css_classes << options[:css_class] if options[:css_class]
52
48
  content_tag('li', link, class: css_classes.join(' '))
53
49
  end
54
50
 
55
51
  # Single main menu item
56
- def main_menu_item text, url: nil, icon: nil
57
- link_to url, :'data-toggle' => "collapse", :'data-parent' => '#sidebar' do
52
+ def main_menu_item(text, url: nil, icon: nil)
53
+ link_to url, 'data-toggle': 'collapse', 'data-parent': '#sidebar' do
58
54
  content_tag(:span, nil, class: "icon icon-#{icon}") +
59
- content_tag(:span, " #{text}", class: 'text') +
60
- content_tag(:span, nil, class: "icon icon-chevron-left pull-right")
55
+ content_tag(:span, " #{text}", class: 'text') +
56
+ content_tag(:span, nil, class: 'icon icon-chevron-left pull-right')
61
57
  end
62
58
  end
63
59
 
64
60
  # Main menu tree menu
65
- def main_menu_tree text, icon: nil, sub_menu: nil, url: '#'
61
+ def main_menu_tree(text, icon: nil, sub_menu: nil, url: '#')
66
62
  content_tag :li, class: 'sidebar-menu-item' do
67
63
  main_menu_item(text, url: url, icon: icon) +
68
- render(partial: "spree/admin/shared/sub_menu/#{sub_menu}")
64
+ render(partial: "spree/admin/shared/sub_menu/#{sub_menu}")
69
65
  end
70
66
  end
71
67
 
@@ -110,36 +106,34 @@ module Spree
110
106
  def klass_for(name)
111
107
  model_name = name.to_s
112
108
 
113
- ["Spree::#{model_name.classify}", model_name.classify, model_name.gsub('_', '/').classify].find do |t|
114
- t.safe_constantize
115
- end.try(:safe_constantize)
109
+ ["Spree::#{model_name.classify}", model_name.classify, model_name.tr('_', '/').classify].find(&:safe_constantize).try(:safe_constantize)
116
110
  end
117
111
 
118
- def link_to_clone(resource, options={})
119
- options[:data] = { action: 'clone', :'original-title' => Spree.t(:clone) }
120
- options[:class] = "btn btn-primary btn-sm with-tip"
112
+ def link_to_clone(resource, options = {})
113
+ options[:data] = { action: 'clone', 'original-title': Spree.t(:clone) }
114
+ options[:class] = 'btn btn-primary btn-sm with-tip'
121
115
  options[:method] = :post
122
116
  options[:icon] = :clone
123
117
  button_link_to '', clone_object_url(resource), options
124
118
  end
125
119
 
126
- def link_to_edit(resource, options={})
120
+ def link_to_edit(resource, options = {})
127
121
  url = options[:url] || edit_object_url(resource)
128
122
  options[:data] = { action: 'edit' }
129
- options[:class] = "btn btn-primary btn-sm"
123
+ options[:class] = 'btn btn-primary btn-sm'
130
124
  link_to_with_icon('edit', Spree.t(:edit), url, options)
131
125
  end
132
126
 
133
- def link_to_edit_url(url, options={})
127
+ def link_to_edit_url(url, options = {})
134
128
  options[:data] = { action: 'edit' }
135
- options[:class] = "btn btn-primary btn-sm"
129
+ options[:class] = 'btn btn-primary btn-sm'
136
130
  link_to_with_icon('edit', Spree.t(:edit), url, options)
137
131
  end
138
132
 
139
- def link_to_delete(resource, options={})
133
+ def link_to_delete(resource, options = {})
140
134
  url = options[:url] || object_url(resource)
141
135
  name = options[:name] || Spree.t(:delete)
142
- options[:class] = "btn btn-danger btn-sm delete-resource"
136
+ options[:class] = 'btn btn-danger btn-sm delete-resource'
143
137
  options[:data] = { confirm: Spree.t(:are_you_sure), action: 'remove' }
144
138
  link_to_with_icon 'delete', name, url, options
145
139
  end
@@ -161,19 +155,19 @@ module Spree
161
155
  icon_name ? content_tag(:i, '', class: icon_name) : ''
162
156
  end
163
157
 
164
- #Override: Add disable_with option to prevent multiple request on consecutive clicks
165
- def button(text, icon_name = nil, button_type = 'submit', options={})
158
+ # Override: Add disable_with option to prevent multiple request on consecutive clicks
159
+ def button(text, icon_name = nil, button_type = 'submit', options = {})
166
160
  if icon_name
167
161
  icon = content_tag(:span, '', class: "icon icon-#{icon_name}")
168
162
  text.insert(0, icon + ' ')
169
163
  end
170
- button_tag(text.html_safe, options.merge(type: button_type, class: "btn btn-primary #{options[:class]}", 'data-disable-with' => "#{ Spree.t(:saving) }..."))
164
+ button_tag(text.html_safe, options.merge(type: button_type, class: "btn btn-primary #{options[:class]}", 'data-disable-with' => "#{Spree.t(:saving)}..."))
171
165
  end
172
166
 
173
167
  def button_link_to(text, url, html_options = {})
174
- if (html_options[:method] &&
175
- html_options[:method].to_s.downcase != 'get' &&
176
- !html_options[:remote])
168
+ if html_options[:method] &&
169
+ !html_options[:method].to_s.casecmp('get').zero? &&
170
+ !html_options[:remote]
177
171
  form_tag(url, method: html_options.delete(:method), class: 'display-inline') do
178
172
  button(text, html_options.delete(:icon), nil, html_options)
179
173
  end
@@ -185,7 +179,7 @@ module Spree
185
179
 
186
180
  html_options.delete('data-update') unless html_options['data-update']
187
181
 
188
- html_options[:class] = html_options[:class] ? "btn #{html_options[:class]}" : "btn btn-default"
182
+ html_options[:class] = html_options[:class] ? "btn #{html_options[:class]}" : 'btn btn-default'
189
183
 
190
184
  if html_options[:icon]
191
185
  icon = content_tag(:span, '', class: "icon icon-#{html_options[:icon]}")
@@ -198,8 +192,8 @@ module Spree
198
192
 
199
193
  def configurations_sidebar_menu_item(link_text, url, options = {})
200
194
  is_selected = url.ends_with?(controller.controller_name) ||
201
- url.ends_with?("#{controller.controller_name}/edit") ||
202
- url.ends_with?("#{controller.controller_name.singularize}/edit")
195
+ url.ends_with?("#{controller.controller_name}/edit") ||
196
+ url.ends_with?("#{controller.controller_name.singularize}/edit")
203
197
 
204
198
  options[:class] = 'sidebar-menu-item'
205
199
  options[:class] << ' selected' if is_selected
@@ -5,63 +5,62 @@ module Spree
5
5
  def event_links(order, events)
6
6
  links = []
7
7
  events.sort.each do |event|
8
- if order.send("can_#{event}?")
9
- label = Spree.t(event, scope: 'admin.order.events', default: Spree.t(event))
10
- links << button_link_to(
11
- label.capitalize,
12
- [event, :admin, order],
13
- method: :put,
14
- icon: "#{event}",
15
- data: { confirm: Spree.t(:order_sure_want_to, event: label) }
16
- )
17
- end
8
+ next unless order.send("can_#{event}?")
9
+ label = Spree.t(event, scope: 'admin.order.events', default: Spree.t(event))
10
+ links << button_link_to(
11
+ label.capitalize,
12
+ [event, :admin, order],
13
+ method: :put,
14
+ icon: event.to_s,
15
+ data: { confirm: Spree.t(:order_sure_want_to, event: label) }
16
+ )
18
17
  end
19
18
  safe_join(links, '&nbsp;'.html_safe)
20
19
  end
21
20
 
22
21
  def line_item_shipment_price(line_item, quantity)
23
- Spree::Money.new(line_item.price * quantity, { currency: line_item.currency })
22
+ Spree::Money.new(line_item.price * quantity, currency: line_item.currency)
24
23
  end
25
24
 
26
25
  def avs_response_code
27
26
  {
28
- "A" => "Street address matches, but 5-digit and 9-digit postal code do not match.",
29
- "B" => "Street address matches, but postal code not verified.",
30
- "C" => "Street address and postal code do not match.",
31
- "D" => "Street address and postal code match. ",
32
- "E" => "AVS data is invalid or AVS is not allowed for this card type.",
33
- "F" => "Card member's name does not match, but billing postal code matches.",
34
- "G" => "Non-U.S. issuing bank does not support AVS.",
35
- "H" => "Card member's name does not match. Street address and postal code match.",
36
- "I" => "Address not verified.",
37
- "J" => "Card member's name, billing address, and postal code match.",
38
- "K" => "Card member's name matches but billing address and billing postal code do not match.",
39
- "L" => "Card member's name and billing postal code match, but billing address does not match.",
40
- "M" => "Street address and postal code match. ",
41
- "N" => "Street address and postal code do not match.",
42
- "O" => "Card member's name and billing address match, but billing postal code does not match.",
43
- "P" => "Postal code matches, but street address not verified.",
44
- "Q" => "Card member's name, billing address, and postal code match.",
45
- "R" => "System unavailable.",
46
- "S" => "Bank does not support AVS.",
47
- "T" => "Card member's name does not match, but street address matches.",
48
- "U" => "Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly.",
49
- "V" => "Card member's name, billing address, and billing postal code match.",
50
- "W" => "Street address does not match, but 9-digit postal code matches.",
51
- "X" => "Street address and 9-digit postal code match.",
52
- "Y" => "Street address and 5-digit postal code match.",
53
- "Z" => "Street address does not match, but 5-digit postal code matches."
27
+ 'A' => 'Street address matches, but 5-digit and 9-digit postal code do not match.',
28
+ 'B' => 'Street address matches, but postal code not verified.',
29
+ 'C' => 'Street address and postal code do not match.',
30
+ 'D' => 'Street address and postal code match. ',
31
+ 'E' => 'AVS data is invalid or AVS is not allowed for this card type.',
32
+ 'F' => "Card member's name does not match, but billing postal code matches.",
33
+ 'G' => 'Non-U.S. issuing bank does not support AVS.',
34
+ 'H' => "Card member's name does not match. Street address and postal code match.",
35
+ 'I' => 'Address not verified.',
36
+ 'J' => "Card member's name, billing address, and postal code match.",
37
+ 'K' => "Card member's name matches but billing address and billing postal code do not match.",
38
+ 'L' => "Card member's name and billing postal code match, but billing address does not match.",
39
+ 'M' => 'Street address and postal code match. ',
40
+ 'N' => 'Street address and postal code do not match.',
41
+ 'O' => "Card member's name and billing address match, but billing postal code does not match.",
42
+ 'P' => 'Postal code matches, but street address not verified.',
43
+ 'Q' => "Card member's name, billing address, and postal code match.",
44
+ 'R' => 'System unavailable.',
45
+ 'S' => 'Bank does not support AVS.',
46
+ 'T' => "Card member's name does not match, but street address matches.",
47
+ 'U' => 'Address information unavailable. Returned if the U.S. bank does not support non-U.S. AVS or if the AVS in a U.S. bank is not functioning properly.',
48
+ 'V' => "Card member's name, billing address, and billing postal code match.",
49
+ 'W' => 'Street address does not match, but 9-digit postal code matches.',
50
+ 'X' => 'Street address and 9-digit postal code match.',
51
+ 'Y' => 'Street address and 5-digit postal code match.',
52
+ 'Z' => 'Street address does not match, but 5-digit postal code matches.'
54
53
  }
55
54
  end
56
55
 
57
56
  def cvv_response_code
58
57
  {
59
- "M" => "CVV2 Match",
60
- "N" => "CVV2 No Match",
61
- "P" => "Not Processed",
62
- "S" => "Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card",
63
- "U" => "Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys",
64
- "" => "Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered"
58
+ 'M' => 'CVV2 Match',
59
+ 'N' => 'CVV2 No Match',
60
+ 'P' => 'Not Processed',
61
+ 'S' => 'Issuer indicates that CVV2 data should be present on the card, but the merchant has indicated data is not present on the card',
62
+ 'U' => 'Issuer has not certified for CVV2 or Issuer has not provided Visa with the CVV2 encryption keys',
63
+ '' => 'Transaction failed because wrong CVV2 number was entered or no CVV2 number was entered'
65
64
  }
66
65
  end
67
66
  end
@@ -2,7 +2,7 @@ module Spree
2
2
  module Admin
3
3
  module PaymentsHelper
4
4
  def payment_method_name(payment)
5
- # hack to allow us to retrieve the name of a "deleted" payment method
5
+ # HACK: to allow us to retrieve the name of a "deleted" payment method
6
6
  id = payment.payment_method_id
7
7
  Spree::PaymentMethod.find_with_destroyed(id).name
8
8
  end
@@ -3,8 +3,8 @@ module Spree
3
3
  module PromotionRulesHelper
4
4
  def options_for_promotion_rule_types(promotion)
5
5
  existing = promotion.rules.map { |rule| rule.class.name }
6
- rule_names = Rails.application.config.spree.promotions.rules.map(&:name).reject{ |r| existing.include? r }
7
- options = rule_names.map { |name| [ Spree.t("promotion_rule_types.#{name.demodulize.underscore}.name"), name] }
6
+ rule_names = Rails.application.config.spree.promotions.rules.map(&:name).reject { |r| existing.include? r }
7
+ options = rule_names.map { |name| [Spree.t("promotion_rule_types.#{name.demodulize.underscore}.name"), name] }
8
8
  options_for_select(options)
9
9
  end
10
10
  end
@@ -12,4 +12,4 @@ module Spree
12
12
  end
13
13
  end
14
14
  end
15
- end
15
+ end
@@ -9,7 +9,7 @@ module Spree
9
9
  stock_movement.originator.number
10
10
  end
11
11
  else
12
- ""
12
+ ''
13
13
  end
14
14
  end
15
15
 
@@ -2,7 +2,7 @@ module Spree
2
2
  module Admin
3
3
  module TaxonsHelper
4
4
  def taxon_path(taxon)
5
- taxon.ancestors.reverse.collect { |ancestor| ancestor.name }.join( " >> ")
5
+ taxon.ancestors.reverse.collect(&:name).join(' >> ')
6
6
  end
7
7
  end
8
8
  end
@@ -13,21 +13,21 @@ module Spree
13
13
  end
14
14
 
15
15
  def model_class
16
- sub_namespace = sub_namespace_parts.map { |s| s.capitalize }.join('::')
17
- sub_namespace = "#{sub_namespace}::" if sub_namespace.length > 0
16
+ sub_namespace = sub_namespace_parts.map(&:capitalize).join('::')
17
+ sub_namespace = "#{sub_namespace}::" unless sub_namespace.empty?
18
18
  "Spree::#{sub_namespace}#{@controller_name.classify}".constantize
19
19
  end
20
20
 
21
21
  def model_name
22
22
  sub_namespace = sub_namespace_parts.join('/')
23
- sub_namespace = "#{sub_namespace}/" if sub_namespace.length > 0
23
+ sub_namespace = "#{sub_namespace}/" unless sub_namespace.empty?
24
24
  @parent_model.gsub("spree/#{sub_namespace}", '')
25
25
  end
26
26
 
27
27
  def object_name
28
28
  return @object_name if @object_name
29
29
  sub_namespace = sub_namespace_parts.join('_')
30
- sub_namespace = "#{sub_namespace}_" if sub_namespace.length > 0
30
+ sub_namespace = "#{sub_namespace}_" unless sub_namespace.empty?
31
31
  "#{sub_namespace}#{@controller_name.singularize}"
32
32
  end
33
33
  end
@@ -6,7 +6,7 @@
6
6
  <span class="caret"></span>
7
7
  </button>
8
8
  <ul class="dropdown-menu" role="menu" data-hook="taxon_product_dropdown">
9
- <li><a href="javascript:;" class="edit-product js-edit-product"><%= Spree.t(:edit) %></a></li>
9
+ <li><a href="{{ edit_product_url product.id }}" class="edit-product js-edit-product"><%= Spree.t(:edit) %></a></li>
10
10
  <li><a href="javascript:;" class="delete-product js-delete-product"><%= Spree.t(:delete_from_taxon) %></a></li>
11
11
  </ul>
12
12
  </div>
@@ -44,7 +44,7 @@
44
44
  </td>
45
45
  <td>
46
46
  <% if editable %>
47
- <%= item_fields.number_field :return_quantity, { class: 'refund-quantity-input form-control' } %>
47
+ <%= item_fields.number_field :return_quantity, { class: 'refund-quantity-input form-control', min: 0, max: return_item.return_quantity } %>
48
48
  <% else %>
49
49
  <%= return_item.return_quantity %>
50
50
  <% end %>
@@ -0,0 +1,59 @@
1
+ <% if try_spree_current_user %>
2
+ <ul class="nav navbar-nav">
3
+ <li class="dropdown user user-menu">
4
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">
5
+ <i class="glyphicon glyphicon-user"></i>
6
+ <span><%= try_spree_current_user.email %> <i class="caret"></i></span>
7
+ </a>
8
+ <ul class="dropdown-menu">
9
+ <% if spree.respond_to? :root_path %>
10
+ <li>
11
+ <%= link_to spree.root_path, target: :blank do %>
12
+ <i class="glyphicon glyphicon-new-window"></i>
13
+ &nbsp;
14
+ <%= Spree.t(:back_to_store) %>
15
+ <% end %>
16
+ </li>
17
+ <% end %>
18
+ <li>
19
+ <%= link_to spree.edit_admin_user_path(try_spree_current_user) do %>
20
+ <i class="glyphicon glyphicon-user"></i>
21
+ &nbsp;
22
+ <%= Spree.t(:account) %>
23
+ <% end %>
24
+ </li>
25
+ <% if spree.respond_to? :admin_logout_path %>
26
+ <li>
27
+ <%= link_to spree.admin_logout_path do %>
28
+ <i class="glyphicon glyphicon-log-out"></i>
29
+ &nbsp;
30
+ <%= Spree.t(:logout) %>
31
+ <% end %>
32
+ </li>
33
+ <% end %>
34
+ <hr />
35
+ <li>
36
+ <%= link_to 'http://guides.spreecommerce.org', target: :blank do %>
37
+ <i class="glyphicon glyphicon-info-sign"></i>
38
+ &nbsp;
39
+ <%= Spree.t(:help_center) %>
40
+ <% end %>
41
+ </li>
42
+ <li>
43
+ <%= link_to 'http://slack.spreecommerce.org', target: :blank do %>
44
+ <i class="glyphicon glyphicon-comment"></i>
45
+ &nbsp;
46
+ <%= Spree.t(:join_slack) %>
47
+ <% end %>
48
+ </li>
49
+ <li>
50
+ <%= link_to 'https://github.com/spree-contrib', target: :blank do %>
51
+ <i class="glyphicon glyphicon-download"></i>
52
+ &nbsp;
53
+ <%= Spree.t(:extensions_directory) %>
54
+ <% end %>
55
+ </li>
56
+ </ul>
57
+ </li>
58
+ </ul>
59
+ <% end %>
@@ -16,7 +16,9 @@
16
16
  </span>
17
17
  </div>
18
18
  <div class="col-xs-9 col-md-10">
19
- <div class="navbar-right" data-hook="admin_login_navigation_bar"></div>
19
+ <div class="navbar-right">
20
+ <%= render partial: 'spree/admin/shared/account_nav' %>
21
+ </div>
20
22
  </div>
21
23
  </div>
22
24
  </div>
@@ -39,9 +39,3 @@
39
39
  <%= main_menu_tree Spree.t(:configurations), icon: "wrench", sub_menu: "configuration", url: "#sidebar-configuration" %>
40
40
  </ul>
41
41
  <% end %>
42
-
43
- <% if can?(:admin, current_store) && Spree::Config[:admin_show_version] %>
44
- <div class="spree-version hidden-xs hidden-sm">
45
- <%= Spree.version %>
46
- </div>
47
- <% end %>
@@ -0,0 +1,5 @@
1
+ <% if can?(:admin, current_store) && Spree::Config[:admin_show_version] %>
2
+ <div class="spree-version hidden-xs hidden-sm">
3
+ <%= Spree.version %>
4
+ </div>
5
+ <% end %>
@@ -73,7 +73,7 @@
73
73
  <div class="form-group" id="stock_movement_quantity_field">
74
74
  <%= label_tag :transfer_variant_quantity, Spree.t(:quantity) %>
75
75
  <div class="input-group">
76
- <%= number_field_tag :transfer_variant_quantity, 1, class: 'form-control', min: 0 %>
76
+ <%= number_field_tag :transfer_variant_quantity, 1, class: 'form-control', min: 1 %>
77
77
  <span class="input-group-btn">
78
78
  <%= button Spree.t(:add), 'plus', 'submit', class: "transfer_add_variant" %>
79
79
  </span>
@@ -8,7 +8,7 @@
8
8
  <% end if can? :create, Spree::StockTransfer %>
9
9
 
10
10
  <fieldset>
11
- <legend><%= Spree.t(:stock_transfer) %></legend>
11
+ <legend><%= Spree.t(:stock_transfer_name) %></legend>
12
12
 
13
13
  <table class="table table-bordered">
14
14
  <tr>
@@ -66,7 +66,7 @@
66
66
  </table>
67
67
  <% else %>
68
68
  <div class="alert alert-info no-objects-found">
69
- <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree::User)) %>,
69
+ <%= Spree.t(:no_resource_found, resource: plural_resource_name(Spree.user_class)) %>,
70
70
  <%= link_to Spree.t(:add_one), new_object_url %>!
71
71
  </div>
72
72
  <% end %>
@@ -32,6 +32,8 @@
32
32
  <%#-------------------------------------------------%>
33
33
  <div class="<%= main_sidebar_classes %>" id="main-sidebar" data-hook="admin_tabs">
34
34
  <%= render partial: 'spree/admin/shared/main_menu' %>
35
+
36
+ <%= render partial: 'spree/admin/shared/version' %>
35
37
  </div>
36
38
 
37
39
  <%#-------------------------------------------------%>
@@ -1 +1 @@
1
- Rails.application.config.assets.precompile += %w( admin/* credit_cards/credit_card.gif )
1
+ Rails.application.config.assets.precompile += %w(admin/* credit_cards/credit_card.gif)
@@ -3,7 +3,7 @@
3
3
  #
4
4
  class ActionView::Helpers::FormBuilder
5
5
  def field_container(method, options = {}, &block)
6
- @template.field_container(@object_name,method,options,&block)
6
+ @template.field_container(@object_name, method, options, &block)
7
7
  end
8
8
 
9
9
  def error_message_on(method, options = {})
@@ -11,5 +11,4 @@ class ActionView::Helpers::FormBuilder
11
11
  end
12
12
  end
13
13
 
14
- ActionView::Base.field_error_proc = Proc.new{ |html_tag, instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe }
15
-
14
+ ActionView::Base.field_error_proc = proc { |html_tag, _instance| "<span class=\"field_with_errors\">#{html_tag}</span>".html_safe }
data/config/routes.rb CHANGED
@@ -45,7 +45,7 @@ Spree::Core::Engine.add_routes do
45
45
  end
46
46
  end
47
47
 
48
- delete '/option_values/:id', to: "option_values#destroy", as: :option_value
48
+ delete '/option_values/:id', to: 'option_values#destroy', as: :option_value
49
49
 
50
50
  resources :properties do
51
51
  collection do
@@ -53,7 +53,7 @@ Spree::Core::Engine.add_routes do
53
53
  end
54
54
  end
55
55
 
56
- delete '/product_properties/:id', to: "product_properties#destroy", as: :product_property
56
+ delete '/product_properties/:id', to: 'product_properties#destroy', as: :product_property
57
57
 
58
58
  resources :prototypes do
59
59
  member do
@@ -78,7 +78,7 @@ Spree::Core::Engine.add_routes do
78
78
 
79
79
  resources :state_changes, only: [:index]
80
80
 
81
- resource :customer, controller: "orders/customer_details"
81
+ resource :customer, controller: 'orders/customer_details'
82
82
  resources :customer_returns, only: [:index, :new, :edit, :create, :update] do
83
83
  member do
84
84
  put :refund
@@ -107,8 +107,8 @@ Spree::Core::Engine.add_routes do
107
107
  end
108
108
  end
109
109
 
110
- get '/return_authorizations', to: "return_index#return_authorizations", as: :return_authorizations
111
- get '/customer_returns', to: "return_index#customer_returns", as: :customer_returns
110
+ get '/return_authorizations', to: 'return_index#return_authorizations', as: :return_authorizations
111
+ get '/customer_returns', to: 'return_index#customer_returns', as: :customer_returns
112
112
 
113
113
  resource :general_settings do
114
114
  collection do
@@ -21,6 +21,5 @@ module Spree
21
21
  def fails(method)
22
22
  @fails_methods << method
23
23
  end
24
-
25
24
  end
26
25
  end
@@ -4,7 +4,6 @@ module Spree
4
4
  extend ActiveSupport::Concern
5
5
 
6
6
  module ClassMethods
7
-
8
7
  attr_accessor :callbacks
9
8
 
10
9
  protected
@@ -37,12 +36,11 @@ module Spree
37
36
  callbacks = self.class.callbacks || {}
38
37
  return if callbacks[action].nil?
39
38
  case callback_type.to_sym
40
- when :before then callbacks[action].before_methods.each {|method| send method }
41
- when :after then callbacks[action].after_methods.each {|method| send method }
42
- when :fails then callbacks[action].fails_methods.each {|method| send method }
39
+ when :before then callbacks[action].before_methods.each { |method| send method }
40
+ when :after then callbacks[action].after_methods.each { |method| send method }
41
+ when :fails then callbacks[action].fails_methods.each { |method| send method }
43
42
  end
44
43
  end
45
-
46
44
  end
47
45
  end
48
46
  end
@@ -1,19 +1,19 @@
1
1
  module Spree
2
2
  module Backend
3
3
  class Engine < ::Rails::Engine
4
- config.middleware.use "Spree::Backend::Middleware::SeoAssist"
4
+ config.middleware.use 'Spree::Backend::Middleware::SeoAssist'
5
5
 
6
- initializer "spree.backend.environment", before: :load_config_initializers do |app|
6
+ initializer 'spree.backend.environment', before: :load_config_initializers do |_app|
7
7
  Spree::Backend::Config = Spree::BackendConfiguration.new
8
8
  end
9
9
 
10
10
  # filter sensitive information during logging
11
- initializer "spree.params.filter" do |app|
11
+ initializer 'spree.params.filter' do |app|
12
12
  app.config.filter_parameters += [:password, :password_confirmation, :number]
13
13
  end
14
14
 
15
15
  # sets the manifests / assets to be precompiled, even when initialize_on_precompile is false
16
- initializer "spree.assets.precompile", group: :all do |app|
16
+ initializer 'spree.assets.precompile', group: :all do |app|
17
17
  app.config.assets.paths << "#{Rails.root}/app/assets/fonts"
18
18
  app.config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
19
19