solidus_auth_devise 2.2.0 → 2.5.2
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of solidus_auth_devise might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/.gem_release.yml +3 -8
- data/.github/stale.yml +17 -0
- data/.gitignore +12 -8
- data/.rubocop.yml +2 -0
- data/CHANGELOG.md +350 -163
- data/Gemfile +20 -22
- data/{LICENSE.md → LICENSE} +2 -2
- data/README.md +4 -28
- data/Rakefile +2 -0
- data/app/mailers/spree/user_mailer.rb +4 -2
- data/app/models/spree/user.rb +21 -19
- data/app/overrides/spree/admin/users/edit/_add_reset_password_form.html.erb.deface +20 -0
- data/bin/console +17 -0
- data/bin/rails +12 -4
- data/bin/setup +8 -0
- data/config/initializers/devise.rb +11 -3
- data/config/initializers/warden.rb +4 -2
- data/config/locales/en.yml +3 -1
- data/config/locales/it.yml +4 -4
- data/config/routes.rb +5 -11
- data/db/default/users.rb +10 -8
- data/db/migrate/20101026184949_create_users.rb +9 -7
- data/db/migrate/20101026184950_rename_columns_for_devise.rb +3 -0
- data/db/migrate/20101214150824_convert_user_remember_field.rb +2 -0
- data/db/migrate/20120203010234_add_reset_password_sent_at_to_spree_users.rb +2 -0
- data/db/migrate/20120605211305_make_users_email_index_unique.rb +4 -2
- data/db/migrate/20140904000425_add_deleted_at_to_users.rb +2 -0
- data/db/migrate/20141002154641_add_confirmable_to_users.rb +2 -0
- data/db/migrate/20190125170630_add_reset_password_token_index_to_spree_users.rb +4 -2
- data/db/migrate/20200417153503_add_unconfirmed_email_to_spree_users.rb +7 -0
- data/db/seeds.rb +2 -0
- data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +5 -3
- data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +11 -8
- data/lib/controllers/frontend/spree/user_confirmations_controller.rb +2 -0
- data/lib/controllers/frontend/spree/user_passwords_controller.rb +4 -1
- data/lib/controllers/frontend/spree/user_registrations_controller.rb +4 -0
- data/lib/controllers/frontend/spree/user_sessions_controller.rb +2 -0
- data/lib/controllers/frontend/spree/users_controller.rb +17 -14
- data/lib/decorators/backend/controllers/spree/admin/base_controller_decorator.rb +20 -0
- data/lib/decorators/backend/controllers/spree/admin/orders/customer_details_controller_decorator.rb +22 -0
- data/lib/{controllers/frontend → decorators/frontend/controllers}/spree/checkout_controller_decorator.rb +29 -19
- data/lib/generators/solidus/auth/install/install_generator.rb +16 -4
- data/lib/generators/solidus/auth/install/templates/config/initializers/devise.rb +2 -0
- data/lib/solidus/auth.rb +2 -0
- data/lib/solidus_auth_devise.rb +12 -12
- data/lib/spree/auth/devise.rb +2 -7
- data/lib/spree/auth/engine.rb +51 -36
- data/lib/spree/auth/version.rb +1 -1
- data/{app/models → lib}/spree/auth_configuration.rb +2 -0
- data/lib/spree/authentication_helpers.rb +5 -11
- data/lib/tasks/auth.rake +3 -1
- data/lib/views/backend/spree/admin/shared/_navigation_footer.html.erb +3 -3
- data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +4 -4
- data/lib/views/backend/spree/admin/user_passwords/new.html.erb +5 -7
- data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +1 -1
- data/lib/views/backend/spree/admin/user_sessions/new.html.erb +9 -9
- data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +4 -4
- data/lib/views/frontend/spree/checkout/registration.html.erb +4 -4
- data/lib/views/frontend/spree/shared/_login.html.erb +4 -4
- data/lib/views/frontend/spree/shared/_login_bar_items.html.erb +3 -3
- data/lib/views/frontend/spree/shared/_user_form.html.erb +3 -3
- data/lib/views/frontend/spree/user_passwords/edit.html.erb +4 -4
- data/lib/views/frontend/spree/user_passwords/new.html.erb +5 -7
- data/lib/views/frontend/spree/user_registrations/new.html.erb +3 -3
- data/lib/views/frontend/spree/user_sessions/authorization_failure.html.erb +1 -1
- data/lib/views/frontend/spree/user_sessions/new.html.erb +2 -2
- data/lib/views/frontend/spree/users/edit.html.erb +2 -2
- data/lib/views/frontend/spree/users/show.html.erb +13 -13
- data/solidus_auth_devise.gemspec +40 -35
- data/spec/controllers/spree/admin/base_controller_spec.rb +53 -0
- data/spec/controllers/spree/admin/user_passwords_controller_spec.rb +2 -0
- data/spec/controllers/spree/base_controller_spec.rb +53 -0
- data/spec/controllers/spree/checkout_controller_spec.rb +5 -9
- data/spec/controllers/spree/products_controller_spec.rb +5 -8
- data/spec/controllers/spree/user_passwords_controller_spec.rb +4 -3
- data/spec/controllers/spree/user_registrations_controller_spec.rb +3 -2
- data/spec/controllers/spree/user_sessions_controller_spec.rb +14 -0
- data/spec/controllers/spree/users_controller_spec.rb +2 -2
- data/spec/factories/confirmed_user.rb +5 -3
- data/spec/features/account_spec.rb +4 -3
- data/spec/features/admin/password_reset_spec.rb +66 -10
- data/spec/features/admin/products_spec.rb +2 -1
- data/spec/features/admin/sign_in_spec.rb +2 -1
- data/spec/features/admin/sign_out_spec.rb +2 -1
- data/spec/features/admin_permissions_spec.rb +2 -1
- data/spec/features/change_email_spec.rb +3 -2
- data/spec/features/checkout_spec.rb +14 -37
- data/spec/features/confirmation_spec.rb +4 -3
- data/spec/features/order_spec.rb +2 -1
- data/spec/features/password_reset_spec.rb +23 -10
- data/spec/features/sign_in_spec.rb +2 -1
- data/spec/features/sign_out_spec.rb +4 -3
- data/spec/features/sign_up_spec.rb +2 -1
- data/spec/mailers/user_mailer_spec.rb +2 -1
- data/spec/models/order_spec.rb +2 -1
- data/spec/models/user_spec.rb +15 -9
- data/spec/spec_helper.rb +13 -9
- data/spec/support/ability.rb +3 -1
- data/spec/support/authentication_helpers.rb +2 -0
- data/spec/support/confirm_helpers.rb +21 -10
- data/spec/support/email.rb +2 -0
- data/spec/support/features/fill_addresses_fields.rb +29 -0
- data/spec/support/preferences.rb +10 -2
- data/spec/support/spree.rb +2 -0
- metadata +305 -212
- data/.travis.yml +0 -18
- data/app/overrides/auth_admin_login_navigation_bar.rb +0 -10
- data/app/overrides/auth_shared_login_bar.rb +0 -10
- data/lib/assets/javascripts/spree/backend/solidus_auth.js +0 -1
- data/lib/assets/javascripts/spree/frontend/solidus_auth.js +0 -1
- data/lib/assets/stylesheets/spree/backend/solidus_auth.css +0 -3
- data/lib/assets/stylesheets/spree/frontend/solidus_auth.css +0 -3
- data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +0 -11
- data/lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb +0 -15
- data/spec/features/admin/orders_spec.rb +0 -30
data/lib/solidus/auth.rb
CHANGED
data/lib/solidus_auth_devise.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
|
2
|
-
require "solidus_support"
|
3
|
-
require "spree/auth/devise"
|
4
|
-
require "spree/authentication_helpers"
|
1
|
+
# frozen_string_literal: true
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
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'
|
data/lib/spree/auth/devise.rb
CHANGED
@@ -1,14 +1,9 @@
|
|
1
|
-
|
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
|
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'
|
data/lib/spree/auth/engine.rb
CHANGED
@@ -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 |
|
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
|
-
|
25
|
+
Spree::Auth::Engine.prepare_backend if SolidusSupport.backend_available?
|
26
|
+
Spree::Auth::Engine.prepare_frontend if SolidusSupport.frontend_available?
|
20
27
|
|
21
|
-
|
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.
|
28
|
-
|
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
|
-
|
34
|
-
|
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
52
|
flash[:error] = I18n.t('spree.authorization_failure')
|
40
|
-
|
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
|
-
|
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
75
|
flash[:error] = I18n.t('spree.authorization_failure')
|
61
|
-
|
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
|
-
|
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
|
data/lib/spree/auth/version.rb
CHANGED
@@ -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
|
-
|
21
|
-
|
22
|
-
|
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
|
data/lib/tasks/auth.rake
CHANGED
@@ -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 :
|
6
|
+
task create: :environment do
|
5
7
|
require File.join(File.dirname(__FILE__), '..', '..', 'db', 'default', 'users.rb')
|
6
8
|
puts "Done!"
|
7
9
|
end
|
@@ -14,9 +14,9 @@
|
|
14
14
|
<% end %>
|
15
15
|
</li>
|
16
16
|
<li data-hook="user-logout-link">
|
17
|
-
<%= link_to spree.admin_logout_path do %>
|
17
|
+
<%= link_to spree.admin_logout_path, method: Devise.sign_out_via do %>
|
18
18
|
<i class='fa fa-sign-out'></i>
|
19
|
-
<%=
|
19
|
+
<%= t('spree.logout') %>
|
20
20
|
<% end %>
|
21
21
|
</li>
|
22
22
|
|
@@ -24,7 +24,7 @@
|
|
24
24
|
<li data-hook="store-frontend-link">
|
25
25
|
<%= link_to spree.root_path, target: '_blank' do %>
|
26
26
|
<i class='fa fa-external-link'></i>
|
27
|
-
<%=
|
27
|
+
<%= t('spree.back_to_store') %>
|
28
28
|
<% end %>
|
29
29
|
</li>
|
30
30
|
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
2
|
-
<h2><%=
|
2
|
+
<h2><%= 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,
|
6
|
+
<%= f.label :password, t('spree.password') %><br />
|
7
7
|
<%= f.password_field :password %><br />
|
8
8
|
</p>
|
9
9
|
<p>
|
10
|
-
<%= f.label :password_confirmation,
|
10
|
+
<%= f.label :password_confirmation, 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
|
14
|
+
<%= f.submit 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><%=
|
2
|
+
<h6><%= t('spree.forgot_password') %></h6>
|
5
3
|
|
6
|
-
<p><%=
|
4
|
+
<p><%= 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,
|
11
|
-
<%= f.email_field :email %>
|
8
|
+
<%= f.label :email, t('spree.email') %><br />
|
9
|
+
<%= f.email_field :email, required: true %>
|
12
10
|
</p>
|
13
11
|
<p>
|
14
|
-
<%= f.submit
|
12
|
+
<%= f.submit t('spree.reset_password'), class: 'button primary' %>
|
15
13
|
</p>
|
16
14
|
<% end %>
|
17
15
|
</div>
|
@@ -4,28 +4,28 @@
|
|
4
4
|
|
5
5
|
<% @body_id = 'login' %>
|
6
6
|
<div id="existing-customer">
|
7
|
-
<h6><%=
|
7
|
+
<h6><%= 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,
|
13
|
-
<%= f.email_field :email, class: 'title', tabindex: 1 %>
|
12
|
+
<%= f.label :email, 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,
|
17
|
-
<%= f.password_field :password, class: 'title', tabindex: 2 %>
|
16
|
+
<%= f.label :password, 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,
|
22
|
+
<%= f.label :remember_me, t('spree.remember_me') %>
|
23
23
|
</p>
|
24
24
|
|
25
|
-
<p><%= f.submit
|
25
|
+
<p><%= f.submit t('spree.login'), class: 'btn btn-primary', tabindex: 4 %></p>
|
26
26
|
<% end %>
|
27
|
-
<%=
|
28
|
-
<%= link_to
|
27
|
+
<%= t('spree.or') %>
|
28
|
+
<%= link_to 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"><%=
|
4
|
-
<li data-hook="user-account-link" class='fa fa-user'><%= link_to
|
5
|
-
<li data-hook="user-logout-link" class='fa fa-sign-out'><%= link_to
|
3
|
+
<li data-hook="user-logged-in-as"><%= t('spree.logged_in_as') %>: <%= spree_current_user.email %></li>
|
4
|
+
<li data-hook="user-account-link" class='fa fa-user'><%= link_to 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 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
|
9
|
+
<%= link_to 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><%=
|
2
|
+
<h1><%= 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><%=
|
9
|
+
<h6><%= 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,
|
15
|
+
<%= f.label :email, t('spree.email') %><br />
|
16
16
|
<%= f.email_field :email, class: 'title' %>
|
17
17
|
</p>
|
18
|
-
<p><%= f.submit
|
18
|
+
<p><%= f.submit t('spree.continue'), class: 'button primary' %></p>
|
19
19
|
<% end %>
|
20
20
|
</div>
|
21
21
|
<% end %>
|
@@ -1,18 +1,18 @@
|
|
1
1
|
<%= form_for Spree::User.new, as: :spree_user, url: spree.create_new_session_path do |f| %>
|
2
2
|
<div id="password-credentials">
|
3
3
|
<p>
|
4
|
-
<%= f.label :email,
|
4
|
+
<%= f.label :email, t('spree.email') %><br />
|
5
5
|
<%= f.email_field :email, class: 'title', tabindex: 1, autofocus: true %>
|
6
6
|
</p>
|
7
7
|
<p>
|
8
|
-
<%= f.label :password,
|
8
|
+
<%= f.label :password, t('spree.password') %><br />
|
9
9
|
<%= f.password_field :password, class: 'title', tabindex: 2 %>
|
10
10
|
</p>
|
11
11
|
</div>
|
12
12
|
<p>
|
13
13
|
<%= f.check_box :remember_me, tabindex: 3 %>
|
14
|
-
<%= f.label :remember_me,
|
14
|
+
<%= f.label :remember_me, t('spree.remember_me') %>
|
15
15
|
</p>
|
16
16
|
|
17
|
-
<p><%= f.submit
|
17
|
+
<p><%= f.submit t('spree.login'), class: 'button primary', tabindex: 4 %></p>
|
18
18
|
<% end %>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<% if spree_current_user %>
|
2
|
-
<li><%= link_to
|
3
|
-
<li><%= link_to
|
2
|
+
<li><%= link_to t('spree.my_account'), spree.account_path %></li>
|
3
|
+
<li><%= link_to t('spree.logout'), spree.logout_path, method: Devise.sign_out_via %></li>
|
4
4
|
<% else %>
|
5
|
-
<li id="link-to-login"><%= link_to
|
5
|
+
<li id="link-to-login"><%= link_to t('spree.login'), spree.login_path %></li>
|
6
6
|
<% end %>
|
@@ -1,15 +1,15 @@
|
|
1
1
|
<p>
|
2
|
-
<%= f.label :email,
|
2
|
+
<%= f.label :email, t('spree.email') %><br />
|
3
3
|
<%= f.email_field :email, class: 'title' %>
|
4
4
|
</p>
|
5
5
|
<div id="password-credentials">
|
6
6
|
<p>
|
7
|
-
<%= f.label :password,
|
7
|
+
<%= f.label :password, t('spree.password') %><br />
|
8
8
|
<%= f.password_field :password, class: 'title' %>
|
9
9
|
</p>
|
10
10
|
|
11
11
|
<p>
|
12
|
-
<%= f.label :password_confirmation,
|
12
|
+
<%= f.label :password_confirmation, t('spree.confirm_password') %><br />
|
13
13
|
<%= f.password_field :password_confirmation, class: 'title' %>
|
14
14
|
</p>
|
15
15
|
</div>
|
@@ -1,17 +1,17 @@
|
|
1
1
|
<%= render partial: 'spree/shared/error_messages', locals: { target: @spree_user } %>
|
2
2
|
<div id="change-password">
|
3
|
-
<h6><%=
|
3
|
+
<h6><%= t('spree.change_my_password') %></h6>
|
4
4
|
|
5
5
|
<%= form_for @spree_user, as: :spree_user, url: spree.update_password_path, method: :put do |f| %>
|
6
6
|
<p>
|
7
|
-
<%= f.label :password,
|
7
|
+
<%= f.label :password, t('spree.password') %><br />
|
8
8
|
<%= f.password_field :password %><br />
|
9
9
|
</p>
|
10
10
|
<p>
|
11
|
-
<%= f.label :password_confirmation,
|
11
|
+
<%= f.label :password_confirmation, t('spree.confirm_password') %><br />
|
12
12
|
<%= f.password_field :password_confirmation %><br />
|
13
13
|
</p>
|
14
14
|
<%= f.hidden_field :reset_password_token %>
|
15
|
-
<%= f.submit
|
15
|
+
<%= f.submit t('spree.update'), class: 'button primary' %>
|
16
16
|
<% end %>
|
17
17
|
</div>
|