spree_auth_devise 1.3.1 → 3.0.5

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of spree_auth_devise might be problematic. Click here for more details.

Files changed (144) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +11 -0
  5. data/Gemfile +5 -0
  6. data/{LICENSE → LICENSE.md} +1 -1
  7. data/README.md +86 -10
  8. data/Rakefile +15 -0
  9. data/Versionfile +5 -0
  10. data/app/controllers/metal_decorator.rb +6 -0
  11. data/app/mailers/spree/user_mailer.rb +12 -5
  12. data/app/models/spree/auth_configuration.rb +1 -0
  13. data/app/models/spree/user.rb +17 -50
  14. data/app/overrides/spree/admin/shared/_header/auth_admin_login_navigation_bar.html.erb.deface +4 -0
  15. data/bin/rails +7 -0
  16. data/circle.yml +11 -0
  17. data/config.ru +4 -0
  18. data/config/initializers/devise.rb +3 -8
  19. data/config/initializers/warden.rb +14 -0
  20. data/config/locales/de.yml +40 -37
  21. data/config/locales/en.yml +48 -39
  22. data/config/locales/es.yml +49 -0
  23. data/config/locales/fr.yml +49 -0
  24. data/config/locales/it.yml +76 -0
  25. data/config/locales/nl.yml +41 -46
  26. data/config/locales/pt-BR.yml +51 -0
  27. data/config/locales/tr.yml +49 -0
  28. data/config/routes.rb +32 -15
  29. data/db/default/users.rb +13 -6
  30. data/db/migrate/20140904000425_add_deleted_at_to_users.rb +6 -0
  31. data/db/migrate/20141002154641_add_confirmable_to_users.rb +7 -0
  32. data/lib/assets/javascripts/spree/backend/spree_auth.js.erb +1 -0
  33. data/lib/assets/javascripts/spree/frontend/spree_auth.js.erb +1 -0
  34. data/lib/assets/stylesheets/spree/backend/spree_auth.css.erb +3 -0
  35. data/lib/assets/stylesheets/spree/frontend/spree_auth.css.erb +3 -0
  36. data/lib/controllers/backend/spree/admin/admin_controller_decorator.rb +26 -0
  37. data/lib/controllers/backend/spree/admin/admin_orders_controller_decorator.rb +20 -0
  38. data/{app/controllers → lib/controllers/backend}/spree/admin/admin_resource_controller_decorator.rb +0 -0
  39. data/{app/controllers/spree/admin/admin_orders_controller_decorator.rb → lib/controllers/backend/spree/admin/orders/customer_details_controller_decorator.rb} +3 -2
  40. data/lib/controllers/backend/spree/admin/user_passwords_controller.rb +42 -0
  41. data/lib/controllers/backend/spree/admin/user_sessions_controller.rb +53 -0
  42. data/{app/controllers → lib/controllers/frontend}/spree/checkout_controller_decorator.rb +8 -15
  43. data/lib/controllers/frontend/spree/user_confirmations_controller.rb +14 -0
  44. data/{app/controllers → lib/controllers/frontend}/spree/user_passwords_controller.rb +10 -9
  45. data/{app/controllers → lib/controllers/frontend}/spree/user_registrations_controller.rb +18 -15
  46. data/lib/controllers/frontend/spree/user_sessions_controller.rb +46 -0
  47. data/{app/controllers → lib/controllers/frontend}/spree/users_controller.rb +13 -9
  48. data/lib/generators/spree/auth/install/install_generator.rb +26 -0
  49. data/lib/generators/spree/auth/install/templates/config/initializers/devise.rb +1 -0
  50. data/lib/spree/auth.rb +2 -1
  51. data/lib/spree/auth/devise.rb +7 -0
  52. data/lib/spree/auth/engine.rb +57 -2
  53. data/lib/spree/authentication_helpers.rb +1 -1
  54. data/lib/spree_auth_devise.rb +3 -0
  55. data/lib/views/backend/spree/admin/user_passwords/edit.html.erb +15 -0
  56. data/lib/views/backend/spree/admin/user_passwords/new.html.erb +17 -0
  57. data/lib/views/backend/spree/admin/user_sessions/authorization_failure.html.erb +4 -0
  58. data/lib/views/backend/spree/admin/user_sessions/new.html.erb +38 -0
  59. data/lib/views/backend/spree/layouts/admin/_login_nav.html.erb +33 -0
  60. data/lib/views/backend/spree/layouts/login.html.erb +25 -0
  61. data/lib/views/frontend/spree/checkout/_new_user.html.erb +20 -0
  62. data/lib/views/frontend/spree/checkout/registration.html.erb +27 -0
  63. data/{app/views → lib/views/frontend}/spree/shared/_flashes.html.erb +0 -0
  64. data/lib/views/frontend/spree/shared/_login.html.erb +18 -0
  65. data/lib/views/frontend/spree/shared/_login_bar.html.erb +6 -0
  66. data/lib/views/frontend/spree/shared/_user_form.html.erb +13 -0
  67. data/lib/views/frontend/spree/user_mailer/confirmation_instructions.text.erb +5 -0
  68. data/lib/views/frontend/spree/user_mailer/reset_password_instructions.text.erb +10 -0
  69. data/lib/views/frontend/spree/user_passwords/edit.html.erb +22 -0
  70. data/lib/views/frontend/spree/user_passwords/new.html.erb +21 -0
  71. data/lib/views/frontend/spree/user_registrations/new.html.erb +22 -0
  72. data/lib/views/frontend/spree/user_sessions/new.html.erb +20 -0
  73. data/lib/views/frontend/spree/users/edit.html.erb +17 -0
  74. data/lib/views/frontend/spree/users/show.html.erb +43 -0
  75. data/spec/controllers/spree/admin/orders_controller_spec.rb +14 -0
  76. data/spec/controllers/spree/checkout_controller_spec.rb +141 -0
  77. data/spec/controllers/spree/products_controller_spec.rb +21 -0
  78. data/spec/controllers/spree/user_passwords_controller_spec.rb +44 -0
  79. data/spec/controllers/spree/user_registrations_controller_spec.rb +13 -0
  80. data/spec/controllers/spree/user_sessions_controller_spec.rb +56 -0
  81. data/spec/controllers/spree/users_controller_spec.rb +38 -0
  82. data/spec/factories/confirmed_user.rb +7 -0
  83. data/spec/features/account_spec.rb +58 -0
  84. data/spec/features/admin/orders_spec.rb +28 -0
  85. data/spec/features/admin/password_reset_spec.rb +24 -0
  86. data/spec/features/admin/products_spec.rb +9 -0
  87. data/spec/features/admin/sign_in_spec.rb +45 -0
  88. data/spec/features/admin/sign_out_spec.rb +22 -0
  89. data/spec/features/admin_permissions_spec.rb +46 -0
  90. data/spec/features/change_email_spec.rb +24 -0
  91. data/spec/features/checkout_spec.rb +160 -0
  92. data/spec/features/confirmation_spec.rb +28 -0
  93. data/spec/features/order_spec.rb +62 -0
  94. data/spec/features/password_reset_spec.rb +24 -0
  95. data/spec/features/sign_in_spec.rb +54 -0
  96. data/spec/features/sign_out_spec.rb +25 -0
  97. data/spec/features/sign_up_spec.rb +30 -0
  98. data/spec/mailers/user_mailer_spec.rb +46 -0
  99. data/spec/models/order_spec.rb +26 -0
  100. data/spec/models/user_spec.rb +58 -0
  101. data/spec/spec_helper.rb +24 -0
  102. data/spec/support/ability.rb +15 -0
  103. data/spec/support/authentication_helpers.rb +14 -0
  104. data/spec/support/capybara.rb +7 -0
  105. data/spec/support/confirm_helpers.rb +11 -0
  106. data/spec/support/database_cleaner.rb +18 -0
  107. data/spec/support/email.rb +5 -0
  108. data/spec/support/factory_girl.rb +5 -0
  109. data/spec/support/spree.rb +26 -0
  110. data/spree_auth_devise.gemspec +48 -0
  111. metadata +441 -79
  112. data/app/assets/javascripts/admin/spree_auth.js +0 -1
  113. data/app/assets/javascripts/store/spree_auth.js +0 -1
  114. data/app/assets/stylesheets/admin/spree_auth.css +0 -3
  115. data/app/assets/stylesheets/store/spree_auth.css +0 -3
  116. data/app/controllers/spree/admin/admin_controller_decorator.rb +0 -7
  117. data/app/controllers/spree/admin/admin_users_controller_decorator.rb +0 -21
  118. data/app/controllers/spree/admin/users_controller.rb +0 -77
  119. data/app/controllers/spree/base_controller_decorator.rb +0 -18
  120. data/app/controllers/spree/orders_controller_decorator.rb +0 -15
  121. data/app/controllers/spree/user_sessions_controller.rb +0 -54
  122. data/app/helpers/spree/users_helper.rb +0 -15
  123. data/app/models/spree/current_order_decorator.rb +0 -12
  124. data/app/overrides/admin_tab.rb +0 -6
  125. data/app/overrides/auth_admin_login_navigation_bar.rb +0 -5
  126. data/app/overrides/auth_user_login_form.rb +0 -6
  127. data/app/views/spree/admin/users/_form.html.erb +0 -37
  128. data/app/views/spree/admin/users/edit.html.erb +0 -28
  129. data/app/views/spree/admin/users/index.html.erb +0 -53
  130. data/app/views/spree/admin/users/new.html.erb +0 -23
  131. data/app/views/spree/admin/users/show.html.erb +0 -21
  132. data/app/views/spree/layouts/admin/_login_nav.html.erb +0 -8
  133. data/app/views/spree/shared/_login.html.erb +0 -20
  134. data/app/views/spree/shared/_login_bar.html.erb +0 -6
  135. data/app/views/spree/shared/_user_form.html.erb +0 -17
  136. data/app/views/spree/user_mailer/reset_password_instructions.text.erb +0 -10
  137. data/app/views/spree/user_passwords/edit.html.erb +0 -15
  138. data/app/views/spree/user_passwords/new.html.erb +0 -15
  139. data/app/views/spree/user_registrations/new.html.erb +0 -22
  140. data/app/views/spree/user_sessions/authorization_failure.html.erb +0 -4
  141. data/app/views/spree/user_sessions/new.html.erb +0 -13
  142. data/app/views/spree/users/edit.html.erb +0 -11
  143. data/app/views/spree/users/show.html.erb +0 -43
  144. data/config/initializers/spree.rb +0 -1
@@ -0,0 +1,46 @@
1
+ class Spree::UserSessionsController < Devise::SessionsController
2
+ helper 'spree/base'
3
+
4
+ include Spree::Core::ControllerHelpers::Auth
5
+ include Spree::Core::ControllerHelpers::Common
6
+ include Spree::Core::ControllerHelpers::Order
7
+ include Spree::Core::ControllerHelpers::Store
8
+
9
+ def create
10
+ authenticate_spree_user!
11
+
12
+ if spree_user_signed_in?
13
+ respond_to do |format|
14
+ format.html {
15
+ flash[:success] = Spree.t(:logged_in_succesfully)
16
+ redirect_back_or_default(after_sign_in_path_for(spree_current_user))
17
+ }
18
+ format.js {
19
+ render :json => {:user => spree_current_user,
20
+ :ship_address => spree_current_user.ship_address,
21
+ :bill_address => spree_current_user.bill_address}.to_json
22
+ }
23
+ end
24
+ else
25
+ respond_to do |format|
26
+ format.html {
27
+ flash.now[:error] = t('devise.failure.invalid')
28
+ render :new
29
+ }
30
+ format.js {
31
+ render :json => { error: t('devise.failure.invalid') }, status: :unprocessable_entity
32
+ }
33
+ end
34
+ end
35
+ end
36
+
37
+ private
38
+ def accurate_title
39
+ Spree.t(:login)
40
+ end
41
+
42
+ def redirect_back_or_default(default)
43
+ redirect_to(session["spree_user_return_to"] || default)
44
+ session["spree_user_return_to"] = nil
45
+ end
46
+ end
@@ -1,16 +1,16 @@
1
- class Spree::UsersController < Spree::BaseController
2
- include Spree::Core::ControllerHelpers::Order
3
-
4
- ssl_required
1
+ class Spree::UsersController < Spree::StoreController
2
+ skip_before_filter :set_current_order, :only => :show
5
3
  prepend_before_filter :load_object, :only => [:show, :edit, :update]
6
4
  prepend_before_filter :authorize_actions, :only => :new
7
5
 
6
+ include Spree::Core::ControllerHelpers
7
+
8
8
  def show
9
- @orders = @user.orders.complete
9
+ @orders = @user.orders.complete.order('completed_at desc')
10
10
  end
11
11
 
12
12
  def create
13
- @user = Spree::User.new(params[:user])
13
+ @user = Spree::User.new(user_params)
14
14
  if @user.save
15
15
 
16
16
  if current_order
@@ -24,19 +24,23 @@ class Spree::UsersController < Spree::BaseController
24
24
  end
25
25
 
26
26
  def update
27
- if @user.update_attributes(params[:user])
27
+ if @user.update_attributes(user_params)
28
28
  if params[:user][:password].present?
29
29
  # this logic needed b/c devise wants to log us out after password changes
30
30
  user = Spree::User.reset_password_by_token(params[:user])
31
31
  sign_in(@user, :event => :authentication, :bypass => !Spree::Auth::Config[:signout_after_password_change])
32
32
  end
33
- redirect_to spree.account_url, :notice => t(:account_updated)
33
+ redirect_to spree.account_url, :notice => Spree.t(:account_updated)
34
34
  else
35
35
  render :edit
36
36
  end
37
37
  end
38
38
 
39
39
  private
40
+ def user_params
41
+ params.require(:user).permit(Spree::PermittedAttributes.user_attributes)
42
+ end
43
+
40
44
  def load_object
41
45
  @user ||= spree_current_user
42
46
  authorize! params[:action].to_sym, @user
@@ -47,6 +51,6 @@ class Spree::UsersController < Spree::BaseController
47
51
  end
48
52
 
49
53
  def accurate_title
50
- t(:my_account)
54
+ Spree.t(:my_account)
51
55
  end
52
56
  end
@@ -0,0 +1,26 @@
1
+ module Spree
2
+ module Auth
3
+ module Generators
4
+ class InstallGenerator < Rails::Generators::Base
5
+ def self.source_paths
6
+ paths = self.superclass.source_paths
7
+ paths << File.expand_path('../templates', __FILE__)
8
+ paths.flatten
9
+ end
10
+
11
+ def generate_devise_key
12
+ return if ENV['CI']
13
+ template 'config/initializers/devise.rb', 'config/initializers/devise.rb'
14
+ end
15
+
16
+ def add_migrations
17
+ run 'bundle exec rake railties:install:migrations FROM=spree_auth_devise'
18
+ end
19
+
20
+ def run_migrations
21
+ run 'bundle exec rake db:migrate'
22
+ end
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1 @@
1
+ Devise.secret_key = <%= SecureRandom.hex(50).inspect %>
data/lib/spree/auth.rb CHANGED
@@ -1 +1,2 @@
1
- require 'spree/auth/devise'
1
+ # This file is required by the dummy app's config/environment
2
+ require 'spree_auth_devise'
@@ -1,13 +1,20 @@
1
1
  require 'spree/core'
2
2
  require 'devise'
3
+ require 'devise-encryptable'
3
4
  require 'cancan'
4
5
 
6
+ Devise.secret_key = SecureRandom.hex(50)
7
+
5
8
  module Spree
6
9
  module Auth
10
+ mattr_accessor :default_secret_key
11
+
7
12
  def self.config(&block)
8
13
  yield(Spree::Auth::Config)
9
14
  end
10
15
  end
11
16
  end
12
17
 
18
+ Spree::Auth.default_secret_key = Devise.secret_key
19
+
13
20
  require 'spree/auth/engine'
@@ -1,3 +1,6 @@
1
+ require 'devise'
2
+ require 'devise-encryptable'
3
+
1
4
  module Spree
2
5
  module Auth
3
6
  class Engine < Rails::Engine
@@ -8,14 +11,66 @@ module Spree
8
11
  Spree::Auth::Config = Spree::AuthConfiguration.new
9
12
  end
10
13
 
14
+ initializer "spree_auth_devise.set_user_class", :after => :load_config_initializers do
15
+ Spree.user_class = "Spree::User"
16
+ end
17
+
18
+ initializer "spree_auth_devise.check_secret_token" do
19
+ if Spree::Auth.default_secret_key == Devise.secret_key
20
+ puts "[WARNING] You are not setting Devise.secret_key within your application!"
21
+ puts "You must set this in config/initializers/devise.rb. Here's an example:"
22
+ puts " "
23
+ puts %Q{Devise.secret_key = "#{SecureRandom.hex(50)}"}
24
+ end
25
+ end
26
+
11
27
  def self.activate
12
- Dir.glob(File.join(File.dirname(__FILE__), "../../../app/**/*_decorator*.rb")) do |c|
28
+ Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
13
29
  Rails.configuration.cache_classes ? require(c) : load(c)
14
30
  end
15
-
31
+ if Spree::Auth::Engine.backend_available?
32
+ Rails.application.config.assets.precompile += [
33
+ 'lib/assets/javascripts/spree/backend/spree_auth.js',
34
+ 'lib/assets/javascripts/spree/backend/spree_auth.css'
35
+ ]
36
+ Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/backend/*/*/*_decorator*.rb")) do |c|
37
+ Rails.configuration.cache_classes ? require(c) : load(c)
38
+ end
39
+ end
40
+ if Spree::Auth::Engine.frontend_available?
41
+ Rails.application.config.assets.precompile += [
42
+ 'lib/assets/javascripts/spree/frontend/spree_auth.js',
43
+ 'lib/assets/javascripts/spree/frontend/spree_auth.css'
44
+ ]
45
+ Dir.glob(File.join(File.dirname(__FILE__), "../../controllers/frontend/*/*_decorator*.rb")) do |c|
46
+ Rails.configuration.cache_classes ? require(c) : load(c)
47
+ end
48
+ end
16
49
  ApplicationController.send :include, Spree::AuthenticationHelpers
17
50
  end
18
51
 
52
+ def self.backend_available?
53
+ @@backend_available ||= ::Rails::Engine.subclasses.map(&:instance).map{ |e| e.class.to_s }.include?('Spree::Backend::Engine')
54
+ end
55
+
56
+ def self.dash_available?
57
+ @@dash_available ||= ::Rails::Engine.subclasses.map(&:instance).map{ |e| e.class.to_s }.include?('Spree::Dash::Engine')
58
+ end
59
+
60
+ def self.frontend_available?
61
+ @@frontend_available ||= ::Rails::Engine.subclasses.map(&:instance).map{ |e| e.class.to_s }.include?('Spree::Frontend::Engine')
62
+ end
63
+
64
+ if self.backend_available?
65
+ paths["app/controllers"] << "lib/controllers/backend"
66
+ paths["app/views"] << "lib/views/backend"
67
+ end
68
+
69
+ if self.frontend_available?
70
+ paths["app/controllers"] << "lib/controllers/frontend"
71
+ paths["app/views"] << "lib/views/frontend"
72
+ end
73
+
19
74
  config.to_prepare &method(:activate).to_proc
20
75
  end
21
76
  end
@@ -8,7 +8,7 @@ module Spree
8
8
  end
9
9
 
10
10
  def spree_current_user
11
- current_user
11
+ current_spree_user
12
12
  end
13
13
 
14
14
  def spree_login_path
@@ -1,2 +1,5 @@
1
+ require 'spree_core'
1
2
  require 'spree/auth/devise'
2
3
  require 'spree/authentication_helpers'
4
+ require 'sass/rails'
5
+ require 'coffee_script'
@@ -0,0 +1,15 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @spree_user } %>
2
+ <h2><%= Spree.t(:change_my_password) %></h2>
3
+
4
+ <%= form_for @spree_user, :as => :spree_user, :url => spree.update_password_path, :method => :put do |f| %>
5
+ <p>
6
+ <%= f.label :password, Spree.t(:password) %><br />
7
+ <%= f.password_field :password %><br />
8
+ </p>
9
+ <p>
10
+ <%= f.label :password_confirmation, Spree.t(:confirm_password) %><br />
11
+ <%= f.password_field :password_confirmation %><br />
12
+ </p>
13
+ <%= f.hidden_field :reset_password_token %>
14
+ <%= f.submit Spree.t(:update), :class => 'button primary' %>
15
+ <% end %>
@@ -0,0 +1,17 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @spree_user } %>
2
+
3
+ <div id="forgot-password">
4
+ <h6><%= Spree.t(:forgot_password) %></h6>
5
+
6
+ <p><%= Spree.t(:instructions_to_reset_password) %></p>
7
+
8
+ <%= form_for Spree::User.new, :as => :spree_user, :url => spree.reset_password_path do |f| %>
9
+ <p>
10
+ <%= f.label :email, Spree.t(:email) %><br />
11
+ <%= f.email_field :email %>
12
+ </p>
13
+ <p>
14
+ <%= f.submit Spree.t(:reset_password), :class => 'button primary' %>
15
+ </p>
16
+ <% end %>
17
+ </div>
@@ -0,0 +1,4 @@
1
+ <div class="alert alert-danger">
2
+ <%= Spree.t(:authorization_failure) %>
3
+ </div>
4
+ <!-- Add your own custom access denied message here if you like -->
@@ -0,0 +1,38 @@
1
+ <% if flash[:alert] %>
2
+ <div class="alert alert-danger"><%= flash[:alert] %></div>
3
+ <% end %>
4
+
5
+ <div data-hook="login" class="panel">
6
+ <div class="panel-body">
7
+ <%= form_for Spree::User.new, :as => :spree_user, :url => spree.admin_create_new_session_path do |f| %>
8
+ <div id="password-credentials">
9
+ <div class="form-group text-center">
10
+ <%= f.label :email, Spree.t(:email) %>
11
+ <%= f.email_field :email, class: 'form-control', tabindex: 1, placeholder: Spree.t(:email) %>
12
+ </div>
13
+ <div class="form-group text-center">
14
+ <%= f.label :password, Spree.t(:password) %>
15
+ <%= f.password_field :password, :class => 'form-control', :tabindex => 2, placeholder: Spree.t(:password) %>
16
+ </div>
17
+ </div>
18
+ <div class="checkbox form-group">
19
+ <div class="row">
20
+ <div class="col-md-6">
21
+ <%= f.label :remember_me do %>
22
+ <%= f.check_box :remember_me, :tabindex => 3 %>
23
+ <%= Spree.t(:remember_me) %>
24
+ <% end %>
25
+ </div>
26
+ <div class="col-md-6 text-right">
27
+ <%= link_to Spree.t(:forgot_password), spree.recover_password_path %>
28
+ </div>
29
+ </div>
30
+ </div>
31
+ <div class="form-group">
32
+ <%= f.submit Spree.t(:login), :class => 'btn btn-primary btn-block', :tabindex => 4 %>
33
+ </div>
34
+ <% end %>
35
+ </div>
36
+ </div>
37
+
38
+ <div data-hook="login_extras"></div>
@@ -0,0 +1,33 @@
1
+ <% if 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><%= spree_current_user.email %> <i class="caret"></i></span>
7
+ </a>
8
+ <ul class="dropdown-menu">
9
+ <li class="user-header bg-light-blue">
10
+ <p>
11
+ <%= spree_current_user.email %>
12
+ </p>
13
+ </li>
14
+ <% if spree.respond_to? :root_path %>
15
+ <li class="user-body">
16
+ <div class="col-xs-12 text-center" data-hook="store-frontend-link">
17
+ <%= link_to Spree.t(:back_to_store), spree.root_path, :target => '_blank' %>
18
+ </div>
19
+ </li>
20
+ <% end %>
21
+
22
+ <li class="user-footer" id="login-nav">
23
+ <div class="pull-left" data-hook="user-account-link">
24
+ <%= link_to Spree.t(:account), spree.edit_user_path(spree_current_user), class: "btn btn-default btn-flat" %>
25
+ </div>
26
+ <div class="pull-right" data-hook="user-logout-link">
27
+ <%= link_to Spree.t(:logout), spree.admin_logout_path, class: "btn btn-default btn-flat" %>
28
+ </div>
29
+ </li>
30
+ </ul>
31
+ </li>
32
+ </ul>
33
+ <% end %>
@@ -0,0 +1,25 @@
1
+ <!doctype html>
2
+ <!--[if lt IE 7 ]> <html class="ie ie6" lang="<%= I18n.locale %>"> <![endif]-->
3
+ <!--[if IE 7 ]> <html class="ie ie7" lang="<%= I18n.locale %>"> <![endif]-->
4
+ <!--[if IE 8 ]> <html class="ie ie8" lang="<%= I18n.locale %>"> <![endif]-->
5
+ <!--[if IE 9 ]> <html class="ie ie9" lang="<%= I18n.locale %>"> <![endif]-->
6
+ <!--[if gt IE 9]><!--><html lang="<%= I18n.locale %>"><!--<![endif]-->
7
+ <head data-hook="admin_inside_head">
8
+ <%= render partial: 'spree/admin/shared/head' %>
9
+ </head>
10
+
11
+ <body>
12
+ <div class="container">
13
+
14
+ <div class="row">
15
+ <div class="col-md-4 col-md-offset-4">
16
+ <%= render partial: 'spree/admin/shared/header' %>
17
+
18
+ <%= flash_alert(flash) %>
19
+
20
+ <%= yield %>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </body>
25
+ </html>
@@ -0,0 +1,20 @@
1
+ <div class="col-md-6">
2
+ <div class="panel panel-default">
3
+ <div class="panel-heading">
4
+ <h3 class="panel-title"><%= Spree.t(:create_a_new_account) %></h3>
5
+ </div>
6
+ <div id="new-customer" class="panel-body" data-hook="login">
7
+ <%= form_for @user, :as => :spree_user, :url => spree.registration_path(@user) do |f| %>
8
+ <div data-hook="signup_inside_form">
9
+ <%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
10
+ <p><%= f.submit Spree.t(:create), :class => 'btn btn-lg btn-success btn-block' %></p>
11
+ </div>
12
+ <% end %>
13
+ <div class="text-center">
14
+ <%= Spree.t(:or) %>
15
+ <%= link_to Spree.t(:login_as_existing), spree.login_path %>
16
+ </div>
17
+ <div data-hook="login_extras"></div>
18
+ </div>
19
+ </div>
20
+ </div>
@@ -0,0 +1,27 @@
1
+ <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
2
+ <h1><%= Spree.t(:registration) %></h1>
3
+ <div id="registration" class="row" data-hook>
4
+ <div id="account">
5
+ <%= render :partial => 'new_user' %>
6
+ </div>
7
+ <% if Spree::Config[:allow_guest_checkout] %>
8
+ <div class="col-md-6">
9
+ <div class="panel panel-default">
10
+ <div class="panel-heading">
11
+ <h3 class="panel-title"><%= Spree.t(:guest_user_account) %></h3>
12
+ </div>
13
+ <div id="guest_checkout" class="panel-body" data-hook>
14
+ <% if flash[:registration_error] %>
15
+ <div class='flash error'><%= flash[:registration_error] %></div>
16
+ <% end %>
17
+ <%= form_for @order, :url => update_checkout_registration_path, :method => :put, :html => { :id => 'checkout_form_registration' } do |f| %>
18
+ <p>
19
+ <%= f.email_field :email, :class => 'form-control title', :placeholder => Spree.t(:email) %>
20
+ </p>
21
+ <p><%= f.submit Spree.t(:continue), :class => 'btn btn-lg btn-success btn-block' %></p>
22
+ <% end %>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <% end %>
27
+ </div>