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
@@ -1,8 +0,0 @@
1
- <% if spree_current_user %>
2
- <ul id="login-nav" class="inline-menu">
3
- <li data-hook="user-logged-in-as"><%= t(:logged_in_as) %>: <%= spree_current_user.email %></li>
4
- <li data-hook="user-account-link"><i class="icon-user"></i><%= link_to t(:account), spree.edit_user_path(spree_current_user) %></li>
5
- <li data-hook="user-logout-link"><i class="icon-signout"></i><%= link_to t(:logout), spree.destroy_user_session_path %></li>
6
- <li data-hook="store-frontend-link"><i class="icon-external-link"></i><%= link_to t(:store), spree.products_path, :target => '_blank' %></li>
7
- </ul>
8
- <% end %>
@@ -1,20 +0,0 @@
1
- <%= form_for :user, :url => spree.user_session_path do |f| %>
2
- <div id="password-credentials">
3
- <p>
4
- <%= f.label :email, t(:email) %><br />
5
- <%= f.email_field :email, :class => 'title', :tabindex => 1 %>
6
- </p>
7
- <p>
8
- <%= f.label :password, t(:password) %><br />
9
- <%= f.password_field :password, :class => 'title', :tabindex => 2 %>
10
- </p>
11
- </div>
12
- <p>
13
- <label>
14
- <%= f.check_box :remember_me %>
15
- <%= f.label :remember_me, t(:remember_me) %>
16
- </label>
17
- </p>
18
-
19
- <p><%= f.submit t(:login), :class => 'button primary', :tabindex => 3 %></p>
20
- <% end %>
@@ -1,6 +0,0 @@
1
- <% if spree_current_user %>
2
- <li><%= link_to t(:my_account), spree.account_path %></li>
3
- <li><%= link_to t(:logout), spree.destroy_user_session_path %></li>
4
- <% else %>
5
- <li id="link-to-login"><%= link_to t(:login), spree.login_path %></li>
6
- <% end %>
@@ -1,17 +0,0 @@
1
- <p>
2
- <%= f.label :email, t(:email) %><br />
3
- <%= f.email_field :email, :class => 'title' %>
4
- </p>
5
- <div id="password-credentials">
6
- <p>
7
- <%= f.label :password, t(:password) %><br />
8
- <%= f.password_field :password, :class => 'title' %>
9
- </p>
10
-
11
- <p>
12
- <%= f.label :password_confirmation, t(:confirm_password) %><br />
13
- <%= f.password_field :password_confirmation, :class => 'title' %>
14
- </p>
15
- </div>
16
-
17
- <div data-hook="signup_below_password_fields"></div>
@@ -1,10 +0,0 @@
1
- A request to reset your password has been made.
2
- If you did not make this request, simply ignore this email.
3
-
4
- If you did make this request just click the link below:
5
-
6
- <%= @edit_password_reset_url %>
7
-
8
- If the above URL does not work try copying and pasting it into your browser.
9
- If you continue to have problem please feel free to contact us.
10
-
@@ -1,15 +0,0 @@
1
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
2
- <h2><%= t(:change_my_password) %></h2>
3
-
4
- <%= form_for @user, :url => spree.user_password_path, :method => :put do |f| %>
5
- <p>
6
- <%= f.label :password, t(:password) %><br />
7
- <%= f.password_field :password %><br />
8
- </p>
9
- <p>
10
- <%= f.label :password_confirmation, t(:password_confirmation) %><br />
11
- <%= f.password_field :password_confirmation %><br />
12
- </p>
13
- <%= f.hidden_field :reset_password_token %>
14
- <%= f.submit t(:update_password), :class => 'button primary' %>
15
- <% end %>
@@ -1,15 +0,0 @@
1
- <div id="forgot-password">
2
- <h6><%= t(:forgot_password) %></h6>
3
-
4
- <p><%= t(:instructions_to_reset_password) %></p>
5
-
6
- <%= form_for Spree::User.new, :as => :user, :url => spree.user_password_path do |f| %>
7
- <p>
8
- <%= f.label :email, t(:email) %><br />
9
- <%= f.email_field :email %>
10
- </p>
11
- <p>
12
- <%= f.submit t(:reset_password), :class => 'button primary' %>
13
- </p>
14
- <% end %>
15
- </div>
@@ -1,22 +0,0 @@
1
- <% @body_id = 'signup' %>
2
-
3
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
4
-
5
- <div id="new-customer">
6
- <h6><%= t(:new_customer) %></h6>
7
-
8
- <div data-hook="signup">
9
-
10
- <%= form_for :user, :url => spree.user_registration_path(@user) do |f| %>
11
- <div data-hook="signup_inside_form">
12
- <%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
13
- <p><%= f.submit t(:create), :class => 'button primary' %></p>
14
- </div>
15
- <% end %>
16
- <%= t(:or) %> <%= link_to t(:login_as_existing), spree.login_path %>
17
-
18
- </div>
19
-
20
- </div>
21
-
22
- <div data-hook="login_extras"></div>
@@ -1,4 +0,0 @@
1
- <div style="height:50px; padding-top:20px;">
2
- <strong><%= t(:authorization_failure) %></strong>
3
- </div>
4
- <!-- Add your own custom access denied message here if you like -->
@@ -1,13 +0,0 @@
1
- <% if flash[:alert] %>
2
- <div class="flash errors"><%= flash[:alert] %></div>
3
- <% end %>
4
-
5
- <% @body_id = 'login' %>
6
- <div id="existing-customer">
7
- <h6><%= t(:login_as_existing) %></h6>
8
- <div data-hook="login">
9
- <%= render :partial => 'spree/shared/login' %>
10
- <%= t(:or) %> <%= link_to t(:create_a_new_account), spree.signup_path %> | <%= link_to t(:forgot_password), spree.new_user_password_path %>
11
- </div>
12
- </div>
13
- <div data-hook="login_extras"></div>
@@ -1,11 +0,0 @@
1
- <%= render :partial => 'spree/shared/error_messages', :locals => { :target => @user } %>
2
-
3
- <h1><%= t(:editing_user) %></h1>
4
-
5
- <%= form_for @user, :url => spree.user_path(@user), :method => :put do |f| %>
6
- <%= render :partial => 'spree/shared/user_form', :locals => { :f => f } %>
7
- <p>
8
- <%= f.submit t(:update), :class => 'button primary' %>
9
- </p>
10
- <% end %>
11
-
@@ -1,43 +0,0 @@
1
- <h1><%= accurate_title %></h1>
2
-
3
- <div data-hook="account_summary" class="account-summary">
4
- <dl id="user-info">
5
- <dt><%= t(:email) %></dt>
6
- <dd><%= @user.email %> (<%= link_to t(:edit), spree.edit_account_path %>)</dd>
7
- </dl>
8
- </div>
9
-
10
- <div data-hook="account_my_orders" class="account-my-orders">
11
-
12
- <h3><%= t(:my_orders) %></h3>
13
- <% if @orders.present? %>
14
- <table class="order-summary">
15
- <thead>
16
- <tr>
17
- <th class="order-number"><%= t(:order_number) %></th>
18
- <th class="order-date"><%= t(:order_date) %></th>
19
- <th class="order-status"><%= t(:status) %></th>
20
- <th class="order-payment-state"><%= t(:payment_state) %></th>
21
- <th class="order-shipment-state"><%= t(:shipment_state) %></th>
22
- <th class="order-total"><%= t(:total) %></th>
23
- </tr>
24
- </thead>
25
- <tbody>
26
- <% @orders.each do |order| %>
27
- <tr class="<%= cycle('even', 'odd') %>">
28
- <td class="order-number"><%= link_to order.number, order_url(order) %></td>
29
- <td class="order-date"><%= l order.created_at.to_date %></td>
30
- <td class="order-status"><%= t(order.state).titleize %></td>
31
- <td class="order-payment-state"><%= t("payment_states.#{order.payment_state}") if order.payment_state %></td>
32
- <td class="order-shipment-state"><%= t("shipment_states.#{order.shipment_state}") if order.shipment_state %></td>
33
- <td class="order-total"><%= money order.total %></td>
34
- </tr>
35
- <% end %>
36
- </tbody>
37
- </table>
38
- <% else %>
39
- <p><%= t(:you_have_no_orders_yet) %></p>
40
- <% end %>
41
- <br />
42
-
43
- </div>
@@ -1 +0,0 @@
1
- Spree.user_class = "Spree::User"