solidus_auth_devise 2.1.0 → 2.5.1

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 (120) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +35 -0
  3. data/.gem_release.yml +5 -0
  4. data/.github/stale.yml +17 -0
  5. data/.gitignore +12 -8
  6. data/.rubocop.yml +2 -0
  7. data/CHANGELOG.md +315 -138
  8. data/Gemfile +21 -15
  9. data/{LICENSE.md → LICENSE} +2 -2
  10. data/README.md +47 -3
  11. data/Rakefile +2 -0
  12. data/app/mailers/spree/user_mailer.rb +4 -2
  13. data/app/models/spree/user.rb +25 -19
  14. data/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface +20 -0
  15. data/bin/console +17 -0
  16. data/bin/rails +12 -4
  17. data/bin/setup +8 -0
  18. data/config/initializers/devise.rb +11 -6
  19. data/config/initializers/warden.rb +4 -2
  20. data/config/locales/en.yml +4 -1
  21. data/config/locales/fr.yml +1 -1
  22. data/config/locales/it.yml +4 -4
  23. data/config/routes.rb +8 -12
  24. data/db/default/users.rb +10 -8
  25. data/db/migrate/20101026184949_create_users.rb +9 -7
  26. data/db/migrate/20101026184950_rename_columns_for_devise.rb +3 -1
  27. data/db/migrate/20101214150824_convert_user_remember_field.rb +2 -0
  28. data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +2 -0
  29. data/db/migrate/20120605211305_make_users_email_index_unique.rb +4 -2
  30. data/db/migrate/20140904000425_add_deleted_at_to_users.rb +2 -0
  31. data/db/migrate/20141002154641_add_confirmable_to_users.rb +2 -0
  32. data/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb +34 -0
  33. data/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb +7 -0
  34. data/db/seeds.rb +2 -0
  35. data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +7 -3
  36. data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +12 -9
  37. data/lib/controllers/frontend/spree/user_confirmations_controller.rb +2 -0
  38. data/lib/controllers/frontend/spree/user_passwords_controller.rb +4 -1
  39. data/lib/controllers/frontend/spree/user_registrations_controller.rb +4 -0
  40. data/lib/controllers/frontend/spree/user_sessions_controller.rb +4 -2
  41. data/lib/controllers/frontend/spree/users_controller.rb +20 -15
  42. data/lib/decorators/backend/controllers/spree/admin/base_controller_decorator.rb +20 -0
  43. data/lib/decorators/backend/controllers/spree/admin/orders/customer_details_controller_decorator.rb +22 -0
  44. data/lib/{controllers/frontend → decorators/frontend/controllers}/spree/checkout_controller_decorator.rb +29 -19
  45. data/lib/generators/solidus/auth/install/install_generator.rb +16 -4
  46. data/lib/generators/solidus/auth/install/templates/config/initializers/devise.rb +3 -1
  47. data/lib/solidus/auth.rb +2 -0
  48. data/lib/solidus_auth_devise.rb +12 -12
  49. data/lib/spree/auth/devise.rb +2 -7
  50. data/lib/spree/auth/engine.rb +53 -38
  51. data/lib/spree/auth/version.rb +7 -0
  52. data/{app/models → lib}/spree/auth_configuration.rb +2 -0
  53. data/lib/spree/authentication_helpers.rb +5 -11
  54. data/lib/tasks/auth.rake +3 -1
  55. data/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb +13 -6
  56. data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +4 -4
  57. data/lib/views/backend/spree/admin/user_passwords/new.html.erb +5 -7
  58. data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +1 -1
  59. data/lib/views/backend/spree/admin/user_sessions/new.html.erb +9 -9
  60. data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +4 -4
  61. data/lib/views/frontend/spree/checkout/registration.html.erb +4 -4
  62. data/lib/views/frontend/spree/shared/_login.html.erb +4 -4
  63. data/lib/views/frontend/spree/shared/_login_bar_items.html.erb +3 -3
  64. data/lib/views/frontend/spree/shared/_user_form.html.erb +3 -3
  65. data/lib/views/frontend/spree/user_passwords/edit.html.erb +4 -4
  66. data/lib/views/frontend/spree/user_passwords/new.html.erb +5 -7
  67. data/lib/views/frontend/spree/user_registrations/new.html.erb +3 -3
  68. data/lib/views/frontend/spree/user_sessions/authorization_failure.html.erb +1 -1
  69. data/lib/views/frontend/spree/user_sessions/new.html.erb +2 -2
  70. data/lib/views/frontend/spree/users/edit.html.erb +2 -2
  71. data/lib/views/frontend/spree/users/show.html.erb +12 -12
  72. data/solidus_auth_devise.gemspec +37 -29
  73. data/spec/controllers/spree/admin/base_controller_spec.rb +53 -0
  74. data/spec/controllers/spree/admin/user_passwords_controller_spec.rb +14 -0
  75. data/spec/controllers/spree/base_controller_spec.rb +53 -0
  76. data/spec/controllers/spree/checkout_controller_spec.rb +6 -10
  77. data/spec/controllers/spree/products_controller_spec.rb +5 -8
  78. data/spec/controllers/spree/user_passwords_controller_spec.rb +4 -3
  79. data/spec/controllers/spree/user_registrations_controller_spec.rb +3 -2
  80. data/spec/controllers/spree/user_sessions_controller_spec.rb +14 -0
  81. data/spec/controllers/spree/users_controller_spec.rb +26 -8
  82. data/spec/factories/confirmed_user.rb +6 -4
  83. data/spec/features/account_spec.rb +4 -3
  84. data/spec/features/admin/password_reset_spec.rb +66 -10
  85. data/spec/features/admin/products_spec.rb +2 -1
  86. data/spec/features/admin/sign_in_spec.rb +2 -1
  87. data/spec/features/admin/sign_out_spec.rb +2 -1
  88. data/spec/features/admin_permissions_spec.rb +2 -1
  89. data/spec/features/change_email_spec.rb +3 -2
  90. data/spec/features/checkout_spec.rb +14 -37
  91. data/spec/features/confirmation_spec.rb +6 -10
  92. data/spec/features/order_spec.rb +2 -1
  93. data/spec/features/password_reset_spec.rb +23 -10
  94. data/spec/features/sign_in_spec.rb +2 -1
  95. data/spec/features/sign_out_spec.rb +4 -3
  96. data/spec/features/sign_up_spec.rb +2 -1
  97. data/spec/mailers/user_mailer_spec.rb +2 -1
  98. data/spec/models/order_spec.rb +2 -1
  99. data/spec/models/user_spec.rb +15 -11
  100. data/spec/spec_helper.rb +13 -9
  101. data/spec/support/ability.rb +3 -1
  102. data/spec/support/authentication_helpers.rb +2 -0
  103. data/spec/support/confirm_helpers.rb +23 -10
  104. data/spec/support/email.rb +2 -0
  105. data/spec/support/features/fill_addresses_fields.rb +29 -0
  106. data/spec/support/preferences.rb +10 -2
  107. data/spec/support/spree.rb +2 -0
  108. metadata +309 -212
  109. data/.travis.yml +0 -24
  110. data/app/overrides/auth_admin_login_navigation_bar.rb +0 -10
  111. data/app/overrides/auth_shared_login_bar.rb +0 -10
  112. data/circle.yml +0 -6
  113. data/lib/assets/javascripts/spree/backend/solidus_auth.js +0 -1
  114. data/lib/assets/javascripts/spree/frontend/solidus_auth.js +0 -1
  115. data/lib/assets/stylesheets/spree/backend/solidus_auth.css +0 -3
  116. data/lib/assets/stylesheets/spree/frontend/solidus_auth.css +0 -3
  117. data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +0 -11
  118. data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +0 -20
  119. data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +0 -15
  120. data/spec/features/admin/orders_spec.rb +0 -30
@@ -1,10 +1,15 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Solidus
2
4
  module Auth
3
5
  module Generators
4
6
  class InstallGenerator < Rails::Generators::Base
7
+ class_option :auto_run_migrations, type: :boolean, default: false
8
+ class_option :skip_migrations, type: :boolean, default: false
9
+
5
10
  def self.source_paths
6
- paths = self.superclass.source_paths
7
- paths << File.expand_path('../templates', __FILE__)
11
+ paths = superclass.source_paths
12
+ paths << File.expand_path('templates', __dir__)
8
13
  paths.flatten
9
14
  end
10
15
 
@@ -13,11 +18,18 @@ module Solidus
13
18
  end
14
19
 
15
20
  def add_migrations
16
- run 'bundle exec rake railties:install:migrations FROM=solidus_auth_devise'
21
+ run 'bundle exec rake railties:install:migrations FROM=solidus_auth'
17
22
  end
18
23
 
19
24
  def run_migrations
20
- run 'bundle exec rake db:migrate'
25
+ return if options[:skip_migrations]
26
+
27
+ run_migrations = options[:auto_run_migrations] || ['', 'y', 'Y'].include?(ask('Would you like to run the migrations now? [Y/n]'))
28
+ if run_migrations
29
+ run 'bundle exec rake db:migrate'
30
+ else
31
+ puts 'Skipping rake db:migrate, don\'t forget to run it!' # rubocop:disable Rails/Output
32
+ end
21
33
  end
22
34
  end
23
35
  end
@@ -1 +1,3 @@
1
- Devise.secret_key = <%= SecureRandom.hex(50).inspect %>
1
+ # frozen_string_literal: true
2
+
3
+ Devise.secret_key = SecureRandom.hex(50).inspect
@@ -1,2 +1,4 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # This file is required by the dummy app's config/environment
2
4
  require "solidus_auth_devise"
@@ -1,13 +1,13 @@
1
- require "spree_core"
2
- require "solidus_support"
3
- require "spree/auth/devise"
4
- require "spree/authentication_helpers"
1
+ # frozen_string_literal: true
5
2
 
6
- if SolidusSupport.solidus_gem_version < Gem::Version.new('2.5.x')
7
- begin
8
- require "deface"
9
- rescue LoadError
10
- warn "deface is required to run solidus_auth_devise with solidus versions < 2.5. Please add deface to your Gemfile"
11
- raise
12
- end
13
- end
3
+ require 'solidus_core'
4
+ require 'solidus_support'
5
+ require 'deface'
6
+ require 'devise'
7
+ require 'devise-encryptable'
8
+ require 'cancan'
9
+
10
+ require 'spree/auth/devise'
11
+ require 'spree/auth/version'
12
+ require 'spree/auth/engine'
13
+ require 'spree/authentication_helpers'
@@ -1,14 +1,9 @@
1
- require 'spree/core'
2
- require 'devise'
3
- require 'devise-encryptable'
4
- require 'cancan'
1
+ # frozen_string_literal: true
5
2
 
6
3
  module Spree
7
4
  module Auth
8
- def self.config(&block)
5
+ def self.config
9
6
  yield(Spree::Auth::Config)
10
7
  end
11
8
  end
12
9
  end
13
-
14
- require 'spree/auth/engine'
@@ -1,13 +1,19 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'devise'
2
4
  require 'devise-encryptable'
3
5
 
4
6
  module Spree
5
7
  module Auth
6
8
  class Engine < Rails::Engine
9
+ include SolidusSupport::EngineExtensions
10
+
7
11
  isolate_namespace Spree
8
12
  engine_name 'solidus_auth'
9
13
 
10
- initializer "spree.auth.environment", before: :load_config_initializers do |app|
14
+ initializer "spree.auth.environment", before: :load_config_initializers do |_app|
15
+ require 'spree/auth_configuration'
16
+
11
17
  Spree::Auth::Config = Spree::AuthConfiguration.new
12
18
  end
13
19
 
@@ -16,65 +22,74 @@ module Spree
16
22
  end
17
23
 
18
24
  config.to_prepare do
19
- auth = Spree::Auth::Engine
25
+ Spree::Auth::Engine.prepare_backend if SolidusSupport.backend_available?
26
+ Spree::Auth::Engine.prepare_frontend if SolidusSupport.frontend_available?
20
27
 
21
- auth.prepare_backend if SolidusSupport.backend_available?
22
- auth.prepare_frontend if SolidusSupport.frontend_available?
23
-
24
- ApplicationController.send :include, Spree::AuthenticationHelpers
28
+ ApplicationController.include Spree::AuthenticationHelpers
25
29
  end
26
30
 
27
- def self.prepare_backend
28
- Rails.application.config.assets.precompile += %w[
29
- lib/assets/javascripts/spree/backend/solidus_auth.js
30
- lib/assets/javascripts/spree/backend/solidus_auth.css
31
- ]
31
+ def self.redirect_back_on_unauthorized?
32
+ return false unless Spree::Config.respond_to?(:redirect_back_on_unauthorized)
32
33
 
33
- Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/backend/*/*/*_decorator*.rb")) do |c|
34
- Rails.configuration.cache_classes ? require(c) : load(c)
34
+ if Spree::Config.redirect_back_on_unauthorized
35
+ true
36
+ else
37
+ Spree::Deprecation.warn <<-WARN.strip_heredoc, caller
38
+ Having Spree::Config.redirect_back_on_unauthorized set
39
+ to `false` is deprecated and will not be supported in Solidus 3.0.
40
+ Please change this configuration to `true` and be sure that your
41
+ application does not break trying to redirect back when there is
42
+ an unauthorized access.
43
+ WARN
44
+
45
+ false
35
46
  end
47
+ end
36
48
 
49
+ def self.prepare_backend
37
50
  Spree::Admin::BaseController.unauthorized_redirect = -> do
38
51
  if try_spree_current_user
39
- flash[:error] = Spree.t(:authorization_failure)
40
- redirect_to spree.admin_unauthorized_path
52
+ flash[:error] = I18n.t('spree.authorization_failure')
53
+
54
+ if Spree::Auth::Engine.redirect_back_on_unauthorized?
55
+ redirect_back(fallback_location: spree.admin_unauthorized_path)
56
+ else
57
+ redirect_to spree.admin_unauthorized_path
58
+ end
41
59
  else
42
60
  store_location
43
- redirect_to spree.admin_login_path
61
+
62
+ if Spree::Auth::Engine.redirect_back_on_unauthorized?
63
+ redirect_back(fallback_location: spree.admin_login_path)
64
+ else
65
+ redirect_to spree.admin_login_path
66
+ end
44
67
  end
45
68
  end
46
69
  end
47
70
 
48
- def self.prepare_frontend
49
- Rails.application.config.assets.precompile += %w[
50
- lib/assets/javascripts/spree/frontend/solidus_auth.js
51
- lib/assets/javascripts/spree/frontend/solidus_auth.css
52
- ]
53
-
54
- Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/frontend/*/*_decorator*.rb")) do |c|
55
- Rails.configuration.cache_classes ? require(c) : load(c)
56
- end
57
71
 
72
+ def self.prepare_frontend
58
73
  Spree::BaseController.unauthorized_redirect = -> do
59
74
  if try_spree_current_user
60
- flash[:error] = Spree.t(:authorization_failure)
61
- redirect_to spree.unauthorized_path
75
+ flash[:error] = I18n.t('spree.authorization_failure')
76
+
77
+ if Spree::Auth::Engine.redirect_back_on_unauthorized?
78
+ redirect_back(fallback_location: spree.unauthorized_path)
79
+ else
80
+ redirect_to spree.unauthorized_path
81
+ end
62
82
  else
63
83
  store_location
64
- redirect_to spree.login_path
84
+
85
+ if Spree::Auth::Engine.redirect_back_on_unauthorized?
86
+ redirect_back(fallback_location: spree.login_path)
87
+ else
88
+ redirect_to spree.login_path
89
+ end
65
90
  end
66
91
  end
67
92
  end
68
-
69
- if SolidusSupport.backend_available?
70
- paths["app/controllers"] << "lib/controllers/backend"
71
- paths["app/views"] << "lib/views/backend"
72
- end
73
-
74
- if SolidusSupport.frontend_available?
75
- paths["app/controllers"] << "lib/controllers/frontend"
76
- paths["app/views"] << "lib/views/frontend"
77
- end
78
93
  end
79
94
  end
80
95
  end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Spree
4
+ module Auth
5
+ VERSION = '2.5.1'
6
+ end
7
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  class AuthConfiguration < Preferences::Configuration
3
5
  preference :registration_step, :boolean, default: true
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Spree
2
4
  module AuthenticationHelpers
3
5
  def self.included(receiver)
@@ -17,17 +19,9 @@ module Spree
17
19
  end
18
20
 
19
21
  if SolidusSupport.frontend_available?
20
- def spree_login_path
21
- spree.login_path
22
- end
23
-
24
- def spree_signup_path
25
- spree.signup_path
26
- end
27
-
28
- def spree_logout_path
29
- spree.logout_path
30
- end
22
+ delegate :login_path, :signup_path, :logout_path,
23
+ to: :spree,
24
+ prefix: :spree
31
25
  end
32
26
  end
33
27
  end
@@ -1,7 +1,9 @@
1
+ # frozen_string_literal: true
2
+
1
3
  namespace :spree_auth do
2
4
  namespace :admin do
3
5
  desc "Create admin username and password"
4
- task :create => :environment do
6
+ task create: :environment do
5
7
  require File.join(File.dirname(__FILE__), '..', '..', 'db', 'default', 'users.rb')
6
8
  puts "Done!"
7
9
  end
@@ -1,15 +1,22 @@
1
1
  <% if spree_current_user %>
2
2
  <ul id="login-nav" class="admin-login-nav">
3
3
  <li data-hook="user-account-link">
4
- <%= link_to spree.edit_admin_user_path(spree_current_user) do %>
5
- <i class='fa fa-user'></i>
6
- <%= spree_current_user.email %>
4
+ <% if can?(:admin, try_spree_current_user) %>
5
+ <%= link_to spree.edit_admin_user_path(try_spree_current_user) do %>
6
+ <i class='fa fa-user'></i>
7
+ <%= try_spree_current_user.email %>
8
+ <% end %>
9
+ <% else %>
10
+ <a>
11
+ <i class='fa fa-user'></i>
12
+ <%= try_spree_current_user.email %>
13
+ </a>
7
14
  <% end %>
8
15
  </li>
9
16
  <li data-hook="user-logout-link">
10
- <%= link_to spree.admin_logout_path do %>
17
+ <%= link_to spree.admin_logout_path, method: Devise.sign_out_via do %>
11
18
  <i class='fa fa-sign-out'></i>
12
- <%= Spree.t(:logout) %>
19
+ <%= I18n.t('spree.logout') %>
13
20
  <% end %>
14
21
  </li>
15
22
 
@@ -17,7 +24,7 @@
17
24
  <li data-hook="store-frontend-link">
18
25
  <%= link_to spree.root_path, target: '_blank' do %>
19
26
  <i class='fa fa-external-link'></i>
20
- <%= Spree.t(:back_to_store) %>
27
+ <%= I18n.t('spree.back_to_store') %>
21
28
  <% end %>
22
29
  </li>
23
30
  <% end %>
@@ -1,15 +1,15 @@
1
1
  <%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
2
- <h2><%= Spree.t(:change_my_password) %></h2>
2
+ <h2><%= I18n.t('spree.change_my_password') %></h2>
3
3
 
4
4
  <%= form_for @spree_user, as: :spree_user, url: spree.update_password_path, method: :put do |f| %>
5
5
  <p>
6
- <%= f.label :password, Spree.t(:password) %><br />
6
+ <%= f.label :password, I18n.t('spree.password') %><br />
7
7
  <%= f.password_field :password %><br />
8
8
  </p>
9
9
  <p>
10
- <%= f.label :password_confirmation, Spree.t(:confirm_password) %><br />
10
+ <%= f.label :password_confirmation, I18n.t('spree.confirm_password') %><br />
11
11
  <%= f.password_field :password_confirmation %><br />
12
12
  </p>
13
13
  <%= f.hidden_field :reset_password_token %>
14
- <%= f.submit Spree.t(:update), class: 'button primary' %>
14
+ <%= f.submit I18n.t('spree.update'), class: 'button primary' %>
15
15
  <% end %>
@@ -1,17 +1,15 @@
1
- <%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
2
-
3
1
  <div id="forgot-password">
4
- <h6><%= Spree.t(:forgot_password) %></h6>
2
+ <h6><%= I18n.t('spree.forgot_password') %></h6>
5
3
 
6
- <p><%= Spree.t(:instructions_to_reset_password) %></p>
4
+ <p><%= I18n.t('spree.instructions_to_reset_password') %></p>
7
5
 
8
6
  <%= form_for Spree::User.new, as: :spree_user, url: spree.admin_reset_password_path do |f| %>
9
7
  <p>
10
- <%= f.label :email, Spree.t(:email) %><br />
11
- <%= f.email_field :email %>
8
+ <%= f.label :email, I18n.t('spree.email') %><br />
9
+ <%= f.email_field :email, required: true %>
12
10
  </p>
13
11
  <p>
14
- <%= f.submit Spree.t(:reset_password), class: 'button primary' %>
12
+ <%= f.submit I18n.t('spree.reset_password'), class: 'button primary' %>
15
13
  </p>
16
14
  <% end %>
17
15
  </div>
@@ -1,4 +1,4 @@
1
1
  <div style="height:50px; padding-top:20px;">
2
- <strong><%= Spree.t(:authorization_failure) %></strong>
2
+ <strong><%= I18n.t('spree.authorization_failure') %></strong>
3
3
  </div>
4
4
  <!-- Add your own custom access denied message here if you like -->
@@ -4,28 +4,28 @@
4
4
 
5
5
  <% @body_id = 'login' %>
6
6
  <div id="existing-customer">
7
- <h6><%= Spree.t(:admin_login) %></h6>
7
+ <h6><%= I18n.t('spree.admin_login') %></h6>
8
8
  <div data-hook="login">
9
9
  <%= form_for Spree::User.new, as: :spree_user, url: spree.admin_create_new_session_path do |f| %>
10
10
  <div id="password-credentials">
11
11
  <p>
12
- <%= f.label :email, Spree.t(:email) %><br />
13
- <%= f.email_field :email, class: 'title', tabindex: 1 %>
12
+ <%= f.label :email, I18n.t('spree.email') %><br />
13
+ <%= f.email_field :email, class: 'title', tabindex: 1, autocomplete: 'username' %>
14
14
  </p>
15
15
  <p>
16
- <%= f.label :password, Spree.t(:password) %><br />
17
- <%= f.password_field :password, class: 'title', tabindex: 2 %>
16
+ <%= f.label :password, I18n.t('spree.password') %><br />
17
+ <%= f.password_field :password, class: 'title', tabindex: 2, autocomplete: 'current-password' %>
18
18
  </p>
19
19
  </div>
20
20
  <p>
21
21
  <%= f.check_box :remember_me, tabindex: 3 %>
22
- <%= f.label :remember_me, Spree.t(:remember_me) %>
22
+ <%= f.label :remember_me, I18n.t('spree.remember_me') %>
23
23
  </p>
24
24
 
25
- <p><%= f.submit Spree.t(:login), class: 'button primary', tabindex: 4 %></p>
25
+ <p><%= f.submit I18n.t('spree.login'), class: 'btn btn-primary', tabindex: 4 %></p>
26
26
  <% end %>
27
- <%= Spree.t(:or) %>
28
- <%= link_to Spree.t(:forgot_password), spree.admin_recover_password_path %>
27
+ <%= I18n.t('spree.or') %>
28
+ <%= link_to I18n.t('spree.forgot_password'), spree.admin_recover_password_path %>
29
29
  </div>
30
30
  </div>
31
31
  <div data-hook="login_extras"></div>
@@ -1,12 +1,12 @@
1
1
  <% if spree_current_user %>
2
2
  <ul id="login-nav" class="inline-menu">
3
- <li data-hook="user-logged-in-as"><%= Spree.t(:logged_in_as) %>: <%= spree_current_user.email %></li>
4
- <li data-hook="user-account-link" class='fa fa-user'><%= link_to Spree.t(:account), spree.edit_admin_user_path(spree_current_user) %></li>
5
- <li data-hook="user-logout-link" class='fa fa-sign-out'><%= link_to Spree.t(:logout), spree.admin_logout_path %></li>
3
+ <li data-hook="user-logged-in-as"><%= I18n.t('spree.logged_in_as') %>: <%= spree_current_user.email %></li>
4
+ <li data-hook="user-account-link" class='fa fa-user'><%= link_to I18n.t('spree.account'), spree.edit_admin_user_path(spree_current_user) %></li>
5
+ <li data-hook="user-logout-link" class='fa fa-sign-out'><%= link_to I18n.t('spree.logout'), spree.admin_logout_path %></li>
6
6
 
7
7
  <% if spree.respond_to? :root_path %>
8
8
  <li data-hook="store-frontend-link" class='fa fa-external-link'>
9
- <%= link_to Spree.t(:back_to_store), spree.root_path, target: '_blank' %>
9
+ <%= link_to I18n.t('spree.back_to_store'), spree.root_path, target: '_blank' %>
10
10
  </li>
11
11
  <% end %>
12
12
  </ul>
@@ -1,21 +1,21 @@
1
1
  <%= render partial: 'spree/shared/error_messages', locals: { target: @user } %>
2
- <h1><%= Spree.t(:registration) %></h1>
2
+ <h1><%= I18n.t('spree.registration') %></h1>
3
3
  <div id="registration" data-hook>
4
4
  <div id="account" class="columns alpha eight">
5
5
  <%= render template: 'spree/user_sessions/new' %>
6
6
  </div>
7
7
  <% if Spree::Config[:allow_guest_checkout] %>
8
8
  <div id="guest_checkout" data-hook class="columns omega eight">
9
- <h6><%= Spree.t(:guest_user_account) %></h6>
9
+ <h6><%= I18n.t('spree.guest_user_account') %></h6>
10
10
  <% if flash[:registration_error] %>
11
11
  <div class='flash error'><%= flash[:registration_error] %></div>
12
12
  <% end %>
13
13
  <%= form_for @order, url: update_checkout_registration_path, method: :put, html: { id: 'checkout_form_registration' } do |f| %>
14
14
  <p>
15
- <%= f.label :email, Spree.t(:email) %><br />
15
+ <%= f.label :email, I18n.t('spree.email') %><br />
16
16
  <%= f.email_field :email, class: 'title' %>
17
17
  </p>
18
- <p><%= f.submit Spree.t(:continue), class: 'button primary' %></p>
18
+ <p><%= f.submit I18n.t('spree.continue'), class: 'button primary' %></p>
19
19
  <% end %>
20
20
  </div>
21
21
  <% end %>