happy_seed 0.0.19 → 0.0.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (190) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -69
  3. data/bin/rails +12 -0
  4. data/bin/rspec +16 -0
  5. data/happy_seed.rb +5 -1
  6. data/happy_seed.txt +25 -18
  7. data/lib/generators/happy_seed/admin/admin_generator.rb +40 -5
  8. data/lib/generators/happy_seed/admin/templates/app/admin/campaigns.rb +10 -14
  9. data/lib/generators/happy_seed/admin/templates/app/admin/newsletter.rb +2 -2
  10. data/lib/generators/happy_seed/admin/templates/app/admin/user.rb +4 -1
  11. data/lib/generators/happy_seed/admin/templates/app/controllers/admin/stats_controller.rb +1 -1
  12. data/lib/generators/happy_seed/admin/templates/docs/README.07.admin.rdoc +33 -4
  13. data/lib/generators/happy_seed/angular_view/templates/docs/README.11.angular_view.rdoc +2 -4
  14. data/lib/generators/happy_seed/api/api_generator.rb +38 -39
  15. data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/base_controller.rb +4 -5
  16. data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/model_hash.rb +3 -20
  17. data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/user_tokens_controller.rb +13 -36
  18. data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/users_controller.rb +14 -40
  19. data/lib/generators/happy_seed/api/templates/config/initializers/apitome.rb +1 -1
  20. data/lib/generators/happy_seed/api/templates/docs/README.01.api.rdoc +4 -1
  21. data/lib/generators/happy_seed/api/templates/docs/api.md +2 -2
  22. data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/user_tokens_spec.rb +10 -53
  23. data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/users_spec.rb +17 -61
  24. data/lib/generators/happy_seed/base/base_generator.rb +47 -19
  25. data/lib/generators/happy_seed/base/templates/app/controllers/setup_controller.rb +1 -1
  26. data/lib/generators/happy_seed/base/templates/app/views/setup/index.html.haml +6 -3
  27. data/lib/generators/happy_seed/base/templates/application_controller.rb +1 -1
  28. data/lib/generators/happy_seed/base/templates/docs/README.00.base.rdoc +3 -3
  29. data/lib/generators/happy_seed/bootstrap/bootstrap_generator.rb +5 -2
  30. data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/application.scss +5 -1
  31. data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_profile_panels.scss +62 -0
  32. data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/components/_slideup_header.scss +51 -0
  33. data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/shared/_grid.scss +0 -12
  34. data/lib/generators/happy_seed/bootstrap/templates/app/views/application/_javascripts.html.haml +7 -4
  35. data/lib/generators/happy_seed/bootstrap/templates/docs/README.01.bootstrap.rdoc +3 -0
  36. data/lib/generators/happy_seed/ckeditor/ckeditor_generator.rb +31 -0
  37. data/lib/generators/happy_seed/ckeditor/templates/docs/README.01.ckeditor.rdoc +35 -0
  38. data/lib/generators/happy_seed/devise/devise_generator.rb +12 -19
  39. data/lib/generators/happy_seed/devise/templates/app/views/devise/confirmations/new.html.haml +17 -0
  40. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.html.erb +14 -0
  41. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/confirmation_instructions.text.rhtml +7 -0
  42. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/password_change.html.erb +3 -0
  43. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.html.erb +15 -0
  44. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/reset_password_instructions.text.erb +11 -0
  45. data/lib/generators/happy_seed/devise/templates/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  46. data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/edit.html.haml +14 -13
  47. data/lib/generators/happy_seed/devise/templates/app/views/devise/passwords/new.html.haml +12 -16
  48. data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/edit.html.haml +28 -40
  49. data/lib/generators/happy_seed/devise/templates/app/views/devise/registrations/new.html.haml +16 -24
  50. data/lib/generators/happy_seed/devise/templates/app/views/devise/sessions/new.html.haml +13 -18
  51. data/lib/generators/happy_seed/devise/templates/app/views/devise/shared/_links.html.erb +25 -0
  52. data/lib/generators/happy_seed/devise/templates/app/views/devise/unlocks/new.html.erb +16 -0
  53. data/lib/generators/happy_seed/devise/templates/docs/README.03.devise.rdoc +2 -2
  54. data/lib/generators/happy_seed/devise/templates/spec/factories/users.rb +5 -4
  55. data/lib/generators/happy_seed/devise/templates/spec/features/registration_spec.rb +149 -0
  56. data/lib/generators/happy_seed/devise/templates/spec/mailers/previews/devise_preview.rb +28 -0
  57. data/lib/generators/happy_seed/devise_confirmable/devise_confirmable_generator.rb +45 -0
  58. data/lib/generators/happy_seed/devise_confirmable/templates/add_confirmable_to_devise.rb +24 -0
  59. data/lib/generators/happy_seed/devise_confirmable/templates/app/controllers/confirmations_controller.rb +10 -0
  60. data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/edit.html.haml +22 -0
  61. data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/invitations/new.html.haml +20 -0
  62. data/lib/generators/happy_seed/devise_confirmable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
  63. data/lib/generators/happy_seed/devise_confirmable/templates/docs/README.03.devise_confirmable.rdoc +23 -0
  64. data/lib/generators/happy_seed/devise_invitable/devise_invitable_generator.rb +3 -1
  65. data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/edit.html.haml +3 -2
  66. data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/invitations/new.html.haml +3 -2
  67. data/lib/generators/happy_seed/devise_invitable/templates/app/views/devise/mailer/invitation_instructions.html.erb +20 -0
  68. data/lib/generators/happy_seed/devise_invitable/templates/spec/features/invitations_spec.rb +61 -0
  69. data/lib/generators/happy_seed/facebook/facebook_generator.rb +2 -0
  70. data/lib/generators/happy_seed/facebook/templates/spec/features/facebook_registration_spec.rb +72 -0
  71. data/lib/generators/happy_seed/googleoauth/googleoauth_generator.rb +1 -1
  72. data/lib/generators/happy_seed/happy_seed_generator.rb +1 -3
  73. data/lib/generators/happy_seed/html_email/html_email_generator.rb +32 -0
  74. data/lib/generators/happy_seed/html_email/templates/app/views/layouts/mailer.html.erb +244 -0
  75. data/lib/generators/happy_seed/html_email/templates/docs/README.01.html_email.rdoc +25 -0
  76. data/lib/generators/happy_seed/omniauth/omniauth_generator.rb +4 -2
  77. data/lib/generators/happy_seed/omniauth/templates/app/controllers/omniauth_callbacks_controller.rb +3 -13
  78. data/lib/generators/happy_seed/omniauth/templates/app/models/identity.rb +13 -9
  79. data/lib/generators/happy_seed/omniauth/templates/docs/README.04.omniauth.rdoc +5 -5
  80. data/lib/generators/happy_seed/omniauth/templates/spec/factories/oauth.rb +6 -1
  81. data/lib/generators/happy_seed/omniauth/templates/spec/features/oauth_registration_spec.rb +80 -0
  82. data/lib/generators/happy_seed/omniauth/templates/spec/models/identity_spec.rb +39 -12
  83. data/lib/generators/happy_seed/omniauth/templates/{app/models/form_user.rb → user.rb} +4 -5
  84. data/lib/generators/happy_seed/plugin/plugin_generator.rb +13 -11
  85. data/lib/generators/happy_seed/react/react_generator.rb +36 -0
  86. data/lib/generators/happy_seed/react/templates/docs/README.10.react.rdoc +20 -0
  87. data/lib/generators/happy_seed/roles/roles_generator.rb +38 -0
  88. data/lib/generators/happy_seed/roles/templates/ability.rb +9 -0
  89. data/lib/generators/happy_seed/roles/templates/docs/README.03.roles.rdoc +23 -0
  90. data/lib/generators/happy_seed/simple_cms/simple_cms_generator.rb +41 -0
  91. data/lib/generators/happy_seed/simple_cms/templates/app/admin/simple_content.rb +42 -0
  92. data/lib/generators/happy_seed/simple_cms/templates/app/controllers/simple_content_controller.rb +7 -0
  93. data/lib/generators/happy_seed/simple_cms/templates/app/models/simple_content.rb +5 -0
  94. data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/faq.html.haml +13 -0
  95. data/lib/generators/happy_seed/simple_cms/templates/app/views/splash/index.html.haml +79 -0
  96. data/lib/generators/happy_seed/simple_cms/templates/application_helper.rb +18 -0
  97. data/lib/generators/happy_seed/simple_cms/templates/create_simple_contents.rb +14 -0
  98. data/lib/generators/happy_seed/simple_cms/templates/docs/README.04.simple_cms.rdoc +32 -0
  99. data/lib/generators/happy_seed/simple_cms/templates/spec/factories/oauth.rb +10 -0
  100. data/lib/generators/happy_seed/simple_cms/templates/spec/features/oauth_registration_spec.rb +80 -0
  101. data/lib/generators/happy_seed/simple_cms/templates/spec/models/identity_spec.rb +49 -0
  102. data/lib/generators/happy_seed/splash/templates/app/assets/stylesheets/splash.css.scss +119 -84
  103. data/lib/generators/happy_seed/splash/templates/app/controllers/splash_controller.rb +1 -1
  104. data/lib/generators/happy_seed/splash/templates/app/views/layouts/splash.html.haml +15 -18
  105. data/lib/generators/happy_seed/splash/templates/app/views/splash/index.html.haml +54 -92
  106. data/lib/generators/happy_seed/splash/templates/docs/README.02.splash.rdoc +2 -2
  107. data/lib/generators/happy_seed/splash/templates/spec/controllers/splash_controller_spec.rb +11 -3
  108. data/lib/generators/happy_seed/static/templates/source/stylesheets/application.css.scss +1 -1
  109. data/lib/generators/happy_seed/static_blog/templates/Gemfile.lock +45 -49
  110. data/lib/generators/happy_seed/twitter/templates/spec/features/twitter_oauth_registration_spec.rb +57 -0
  111. data/lib/generators/happy_seed/twitter/twitter_generator.rb +2 -1
  112. data/lib/happy_seed/cli.rb +1 -1
  113. data/lib/happy_seed/engine.rb +12 -0
  114. data/lib/happy_seed/version.rb +1 -1
  115. data/lib/tasks/seed.rake +56 -0
  116. data/{test → spec}/dummy/Rakefile +0 -0
  117. data/spec/dummy/app/assets/config/manifest.js +5 -0
  118. data/{test → spec}/dummy/app/assets/javascripts/application.js +3 -3
  119. data/spec/dummy/app/assets/javascripts/cable.coffee +11 -0
  120. data/{test → spec}/dummy/app/assets/stylesheets/application.css +4 -4
  121. data/spec/dummy/app/channels/application_cable/channel.rb +5 -0
  122. data/spec/dummy/app/channels/application_cable/connection.rb +5 -0
  123. data/{test → spec}/dummy/app/controllers/application_controller.rb +0 -0
  124. data/{test → spec}/dummy/app/helpers/application_helper.rb +0 -0
  125. data/spec/dummy/app/jobs/application_job.rb +2 -0
  126. data/spec/dummy/app/mailers/application_mailer.rb +4 -0
  127. data/spec/dummy/app/models/application_record.rb +3 -0
  128. data/spec/dummy/app/views/layouts/application.html.erb +15 -0
  129. data/spec/dummy/app/views/layouts/mailer.html.erb +13 -0
  130. data/spec/dummy/app/views/layouts/mailer.text.erb +1 -0
  131. data/{test → spec}/dummy/bin/bundle +0 -0
  132. data/{test → spec}/dummy/bin/rails +1 -1
  133. data/{test → spec}/dummy/bin/rake +0 -0
  134. data/spec/dummy/bin/setup +34 -0
  135. data/spec/dummy/bin/update +29 -0
  136. data/spec/dummy/config.ru +8 -0
  137. data/spec/dummy/config/application.rb +21 -0
  138. data/{test → spec}/dummy/config/boot.rb +0 -0
  139. data/spec/dummy/config/cable.yml +10 -0
  140. data/{test → spec}/dummy/config/database.yml +0 -0
  141. data/{test → spec}/dummy/config/environment.rb +0 -0
  142. data/{test → spec}/dummy/config/environments/development.rb +28 -3
  143. data/{test → spec}/dummy/config/environments/production.rb +29 -24
  144. data/{test → spec}/dummy/config/environments/test.rb +6 -3
  145. data/spec/dummy/config/initializers/active_record_belongs_to_required_by_default.rb +6 -0
  146. data/spec/dummy/config/initializers/application_controller_renderer.rb +6 -0
  147. data/{test → spec}/dummy/config/initializers/assets.rb +3 -0
  148. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  149. data/spec/dummy/config/initializers/callback_terminator.rb +6 -0
  150. data/{test → spec}/dummy/config/initializers/cookies_serializer.rb +3 -1
  151. data/{test → spec}/dummy/config/initializers/filter_parameter_logging.rb +0 -0
  152. data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
  153. data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
  154. data/spec/dummy/config/initializers/per_form_csrf_tokens.rb +4 -0
  155. data/spec/dummy/config/initializers/request_forgery_protection.rb +4 -0
  156. data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
  157. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +2 -2
  158. data/{test → spec}/dummy/config/locales/en.yml +0 -0
  159. data/spec/dummy/config/puma.rb +47 -0
  160. data/spec/dummy/config/routes.rb +3 -0
  161. data/{test → spec}/dummy/config/secrets.yml +3 -3
  162. data/spec/dummy/db/schema.rb +16 -0
  163. data/{test → spec}/dummy/public/404.html +0 -0
  164. data/{test → spec}/dummy/public/422.html +0 -0
  165. data/{test → spec}/dummy/public/500.html +0 -0
  166. data/{test/dummy/public/favicon.ico → spec/dummy/public/apple-touch-icon-precomposed.png} +0 -0
  167. data/spec/dummy/public/apple-touch-icon.png +0 -0
  168. data/spec/dummy/public/favicon.ico +0 -0
  169. data/spec/rails_helper.rb +58 -0
  170. data/spec/spec_helper.rb +91 -0
  171. metadata +195 -89
  172. data/lib/generators/happy_seed/api/templates/app/controllers/api/v1/configurations_controller.rb +0 -11
  173. data/lib/generators/happy_seed/api/templates/spec/acceptance/api/v1/configurations_spec.rb +0 -21
  174. data/lib/generators/happy_seed/base/templates/config/puma.rb +0 -15
  175. data/lib/generators/happy_seed/base/templates/spec/support/controller_helpers.rb +0 -12
  176. data/lib/generators/happy_seed/bootstrap/templates/app/assets/stylesheets/sections/_profile_page.scss +0 -9
  177. data/lib/generators/happy_seed/bootstrap/templates/lib/templates/haml/scaffold/_form.html.haml +0 -5
  178. data/lib/generators/happy_seed/devise/templates/spec/features/forgot_password_spec.rb +0 -54
  179. data/lib/generators/happy_seed/devise/templates/test/mailers/previews/devise_preview.rb +0 -13
  180. data/lib/generators/happy_seed/omniauth/templates/spec/features/registration_spec.rb +0 -81
  181. data/lib/generators/happy_seed/static/templates/Gemfile.lock +0 -158
  182. data/lib/tasks/seed_tasks.rake +0 -4
  183. data/test/dummy/README.rdoc +0 -28
  184. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  185. data/test/dummy/config.ru +0 -4
  186. data/test/dummy/config/application.rb +0 -23
  187. data/test/dummy/config/initializers/jazz_hands.rb +0 -5
  188. data/test/dummy/config/routes.rb +0 -56
  189. data/test/seed_test.rb +0 -7
  190. data/test/test_helper.rb +0 -15
@@ -1,5 +1,6 @@
1
1
  require 'generators/happy_seed/happy_seed_generator'
2
2
  require 'generators/happy_seed/bootstrap/bootstrap_generator'
3
+ require 'generators/happy_seed/html_email/html_email_generator'
3
4
 
4
5
  module HappySeed
5
6
  module Generators
@@ -14,8 +15,9 @@ module HappySeed
14
15
  return if already_installed
15
16
 
16
17
  require_generator BootstrapGenerator
18
+ require_generator HtmlEmailGenerator
17
19
 
18
- gem 'devise', '~> 3.4'
20
+ gem 'devise', '~> 4.2'
19
21
 
20
22
  Bundler.with_clean_env do
21
23
  run "bundle install --without production"
@@ -23,14 +25,12 @@ module HappySeed
23
25
 
24
26
  run 'bin/spring stop'
25
27
 
26
- puts "Devise: #{self.class.fingerprint}"
27
-
28
28
  Bundler.with_clean_env do
29
29
  run 'rails generate devise:install'
30
30
  run 'rails generate devise User'
31
31
  run 'rails generate devise:views'
32
32
  end
33
-
33
+
34
34
  if gem_available?( "haml-rails" )
35
35
  remove_file 'app/views/devise/registrations/new.html.erb'
36
36
  remove_file 'app/views/devise/registrations/edit.html.erb'
@@ -39,31 +39,20 @@ module HappySeed
39
39
  remove_file 'app/views/devise/passwords/new.html.erb'
40
40
  end
41
41
 
42
+ remove_file 'app/views/devise/mailer/reset_password_instructions.html.erb'
43
+ remove_file 'app/views/devise/mailer/confirmation_instructions.html.erb'
44
+
42
45
  remove_file "spec/factories/users.rb"
43
46
 
44
47
  begin
45
48
  prepend_to_file 'spec/spec_helper.rb', "require 'devise'\n"
46
- prepend_to_file 'spec/spec_helper.rb', "require_relative 'support/controller_helpers'\n"
47
- inject_into_file 'spec/spec_helper.rb', "\n config.include Devise::TestHelpers, type: :controller\n", :before => "\nend\n"
48
- inject_into_file 'spec/spec_helper.rb', "\n config.include Warden::Test::Helpers, type: :feature\n config.include ControllerHelpers, type: :controller\n Warden.test_mode!\n", :before => "\nend\n"
49
49
  rescue
50
50
  say_status :spec, "Unable to add devise helpers to spec_helper.rb", :red
51
51
  end
52
52
 
53
- begin
54
- inject_into_file 'spec/rails_helper.rb', "\n config.include Devise::TestHelpers, type: :controller\n config.include Warden::Test::Helpers, type: :feature\n", :after => "FactoryGirl::Syntax::Methods\n"
55
- rescue
56
- say_status :spec, "Unable to add devise helpers to rails_helper.rb", :red
57
- end
58
-
59
- append_to_file "features/support/env.rb", "
60
- Warden.test_mode!
61
- World(Warden::Test::Helpers)
62
- After{ Warden.test_reset! }"
63
-
64
53
  directory 'app'
65
54
  directory 'docs'
66
- directory 'test'
55
+ # directory 'test'
67
56
  directory 'spec'
68
57
 
69
58
  application(nil, env: "development") do
@@ -79,6 +68,10 @@ After{ Warden.test_reset! }"
79
68
  else
80
69
  say_status :gsub_file, "Can't find application/_header.html.haml, skipping"
81
70
  end
71
+
72
+ gsub_file "config/initializers/devise.rb", "# config.parent_mailer = 'ActionMailer::Base'", "config.parent_mailer = 'ApplicationMailer'"
73
+
74
+ gsub_file 'config/routes.rb', "devise_for :users", "devise_for :users, :controllers => { }"
82
75
  end
83
76
 
84
77
  private
@@ -0,0 +1,17 @@
1
+ .container
2
+ .row
3
+ .profile.center
4
+ = panel title: 'Resend confirmation instructions', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes, boolean: :horizontal_boolean } ) do |f|
6
+ .panel-body
7
+ = f.error_notification
8
+ = f.full_error :confirmation_token
9
+
10
+ .form-inputs
11
+ = f.input :email, required: true, autofocus: true
12
+ .panel-footer
13
+ .buttons
14
+ = f.button :submit, "Resend confirmation instructions", class: "btn-primary"
15
+
16
+ .links
17
+ = render "devise/shared/links"
@@ -0,0 +1,14 @@
1
+ <p class="center">Welcome <%= @resource.email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <!-- button -->
6
+ <table class="btn-primary center" cellpadding="0" cellspacing="0" border="0">
7
+ <tr>
8
+ <td>
9
+ <a href="<%= confirmation_url(@resource, confirmation_token: @token) %>">Confirm my account</a>
10
+ </td>
11
+ </tr>
12
+ </table>
13
+ <!-- /button -->
14
+ <p>Thanks, have a lovely day.</p>
@@ -0,0 +1,7 @@
1
+ Welcome <%= @email %>!
2
+
3
+ You can confirm your account email through the link below:
4
+
5
+ <%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %>
6
+
7
+ Thanks!
@@ -0,0 +1,3 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>We're contacting you to notify you that your password has been changed.</p>
@@ -0,0 +1,15 @@
1
+ <p class="center">Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this
4
+ through the link below:</p>
5
+
6
+ <!-- button -->
7
+ <table class="btn-primary center" cellpadding="0" cellspacing="0" border="0">
8
+ <tr>
9
+ <td>
10
+ <a href="<%= edit_password_url(@resource, reset_password_token: @token) %>">Click here to reset your password</a>
11
+ </td>
12
+ </tr>
13
+ </table>
14
+ <!-- /button -->
15
+ <p>Thanks, have a lovely day.</p>
@@ -0,0 +1,11 @@
1
+ Hello <%= @resource.email %>!
2
+
3
+ Someone has requested a link to change your password. You can do this
4
+ through the link below:
5
+
6
+ <%= edit_password_url(@resource, reset_password_token: @token) %>
7
+
8
+ If you didn't request this, please ignore this email.
9
+
10
+ Your password won't change until you access the link above and
11
+ create a new one.
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
4
+
5
+ <p>Click the link below to unlock your account:</p>
6
+
7
+ <p><%= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token) %></p>
@@ -1,19 +1,20 @@
1
1
  .container
2
2
  .row
3
- .center_panel
4
- .panel.panel-default.only
3
+ .profile.center
4
+ = panel title: 'Change your password', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes, boolean: :horizontal_boolean } ) do |f|
6
+ .panel-body
7
+ = f.error_notification
5
8
 
6
- .panel-heading
7
- Change your password
9
+ = f.input :reset_password_token, as: :hidden
10
+ = f.full_error :reset_password_token
8
11
 
9
- .panel-body
12
+ = f.input :password, label: "New password", required: true, autofocus: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
13
+ = f.input :password_confirmation, label: "Confirm your new password", required: true
10
14
 
11
- = form_for(resource, as: resource_name, url: password_path(resource_name), layout: :horizontal, method: 'put') do |f|
15
+ .panel-footer
16
+ .buttons
17
+ = f.button :submit, "Change my password", class: "btn-primary"
12
18
 
13
- / = devise_error_messages!
14
- = f.hidden_field :reset_password_token
15
-
16
- = f.password_field :password, autocomplete: "off", autofocus: true
17
- = f.password_field :password_confirmation, autocomplete: "off"
18
-
19
- = f.submit "Change my password", :class=>'btn btn-primary form-control'
19
+ .links
20
+ = render "devise/shared/links"
@@ -1,20 +1,16 @@
1
1
  .container
2
2
  .row
3
- .center_panel
4
- .panel.panel-default.only
3
+ .profile.center
4
+ = panel title: 'Forgot your password?', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes, boolean: :horizontal_boolean } ) do |f|
6
+ .panel-body
7
+ = f.error_notification
5
8
 
6
- .panel-heading
7
- Forgot your password?
9
+ .form-inputs
10
+ = f.input :email, required: true, autofocus: true
11
+ .panel-footer
12
+ .buttons
13
+ = f.button :submit, "Send me reset password instructions", class: "btn-primary"
8
14
 
9
- .panel-body
10
-
11
- = form_for(resource, as: resource_name, url: password_path(resource_name), layout: :horizontal) do |f|
12
-
13
- / = devise_error_messages!
14
-
15
- = f.email_field :email, autofocus: true
16
-
17
- = f.submit "Send me reset password instructions"
18
-
19
- %p.text-right
20
- = render partial: "devise/shared/links"
15
+ .links
16
+ = render "devise/shared/links"
@@ -1,50 +1,38 @@
1
- - @title = "Edit #{resource_name.to_s.humanize}"
2
1
  .container
3
2
  .row
4
- .center_panel
5
- .panel.panel-default.only
6
-
7
- .panel-heading
8
- = @title
9
-
10
- .panel-body
11
-
12
- = form_for resource, as: resource_name, url: registration_path(resource_name), layout: :horizontal do |f|
13
-
14
- / = devise_error_messages!
15
-
16
- = f.email_field :email, autofocus: true
3
+ .profile.large_panel
4
+ = panel title: 'Edit Profile', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
6
+ .panel-body
7
+ = f.error_notification
17
8
 
18
- - if devise_mapping.confirmable? && resource.pending_reconfirmation?
19
- %p
20
- Currently waiting confirmation for:
21
- = resource.unconfirmed_email
9
+ .form-inputs
10
+ = f.input :email, required: true, autofocus: true
22
11
 
23
- = f.password_field :current_password
24
- = f.password_field :password, autocomplete: "off"
25
- = f.password_field :password_confirmation, autocomplete: "off"
12
+ = if devise_mapping.confirmable? && resource.pending_reconfirmation?
13
+ %p
14
+ Currently waiting confirmation for:
15
+ = resource.unconfirmed_email
26
16
 
27
- = f.submit "Update"
17
+ = f.input :password, autocomplete: "off", hint: "leave it blank if you don't want to change it", required: false
18
+ = f.input :password_confirmation, required: false
19
+ = f.input :current_password, hint: "we need your current password to confirm your changes", required: true
20
+ .panel-footer
21
+ .form-actions
22
+ = f.button :submit, "Update", class: "btn-primary"
28
23
 
29
24
  - if devise_mapping.omniauthable?
30
- .panel.panel-default.only
31
- .panel-heading
32
- Connect your accounts
33
-
25
+ = panel title: 'Connect your accounts', context: :primary do
34
26
  .panel-body
35
- %ul
36
- - resource_class.omniauth_providers.each do |provider|
37
- - if resource.identities.where( :provider => provider ).first
38
- %li= link_to "Reconnect with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-primary"
39
- - else
40
- %li= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-primary"
41
-
42
- .panel.panel-default.only
43
-
44
- .panel-heading
45
- Cancel my account
46
-
27
+ - resource_class.omniauth_providers.each do |provider|
28
+ - if resource.identities.where( :provider => provider ).first
29
+ %p= link_to "Reconnect with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-default"
30
+ - else
31
+ %p= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), class: "btn btn-default"
32
+
33
+ .profile.sidebar
34
+ = panel title: "Cancel my Account", context: :danger do
47
35
  .panel-body
48
36
  %p
49
- Unhappy?
50
- = button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger"
37
+ Unhappy?
38
+ = link_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "btn btn-danger"
@@ -1,26 +1,18 @@
1
- - @title = "Sign Up"
2
1
  .container
3
2
  .row
4
- .center_panel
5
- .panel.panel-default.only
6
-
7
- .panel-heading
8
- Sign up
9
-
10
- .panel-body
11
-
12
- = form_for resource, as: resource_name, url: registration_path(resource_name), layout: :horizontal do |f|
13
-
14
- / = devise_error_messages!
15
-
16
- = f.email_field :email, autofocus: true
17
- = f.password_field :password, autocomplete: "off"
18
- = f.password_field :password_confirmation, autocomplete: "off"
19
-
20
- - if devise_mapping.rememberable?
21
- = f.check_box :remember_me
22
-
23
- = f.submit "Sign Up"
24
-
25
- %p.text-right
26
- = render partial: "devise/shared/links"
3
+ .profile.center
4
+ = panel title: 'Signup', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes, boolean: :horizontal_boolean } ) do |f|
6
+ .panel-body
7
+ = f.error_notification
8
+
9
+ .form-inputs
10
+ = f.input :email, required: true, autofocus: true
11
+ = f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
12
+ = f.input :password_confirmation, required: true
13
+ .panel-footer
14
+ .buttons
15
+ = f.button :submit, "Sign up", class: "btn-primary"
16
+
17
+ .links
18
+ = render "devise/shared/links"
@@ -1,22 +1,17 @@
1
- - @title = "Sign In"
2
1
  .container
3
2
  .row
4
- .center_panel
5
- .panel.panel-default.only
6
- .panel-heading
7
- Sign in
3
+ .profile.center
4
+ = panel title: 'Log in', context: :primary do
5
+ = simple_form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { check_boxes: :horizontal_radio_and_checkboxes, boolean: :horizontal_boolean } ) do |f|
6
+ .panel-body
7
+ = f.error_notification
8
8
 
9
- .panel-body
9
+ = f.input :email, required: true, autofocus: true
10
+ = f.input :password, required: true, hint: ("#{@minimum_password_length} characters minimum" if @minimum_password_length)
11
+ = f.input :remember_me, as: :boolean if devise_mapping.rememberable?
12
+ .panel-footer
13
+ .buttons
14
+ = f.button :submit, "Log in", class: "btn-primary"
10
15
 
11
- = form_for resource, as: resource_name, url: session_path(resource_name), layout: :horizontal do |f|
12
-
13
- = f.email_field :email, autofocus: true
14
- = f.password_field :password, autocomplete: "off"
15
-
16
- - if devise_mapping.rememberable?
17
- = f.check_box :remember_me
18
-
19
- = f.submit "Sign in", :class=>'btn btn-primary form-control'
20
-
21
- %p.text-right
22
- = render partial: "devise/shared/links"
16
+ .links
17
+ = render "devise/shared/links"
@@ -0,0 +1,25 @@
1
+ <%- if controller_name != 'sessions' %>
2
+ <%= link_to "Log in", new_session_path(resource_name) %><br />
3
+ <% end -%>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "Sign up", new_registration_path(resource_name) %><br />
7
+ <% end -%>
8
+
9
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
10
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
11
+ <% end -%>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
15
+ <% end -%>
16
+
17
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
18
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
19
+ <% end -%>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %><br />
24
+ <% end -%>
25
+ <% end -%>
@@ -0,0 +1,16 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :unlock_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email, required: true, autofocus: true %>
9
+ </div>
10
+
11
+ <div class="form-actions">
12
+ <%= f.button :submit, "Resend unlock instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -10,6 +10,7 @@ The happy_seed:devise generator
10
10
  * Copies over devise views
11
11
  * Gives them bootstrap views
12
12
  * Installs MailPreview for the device mailer.
13
+ * HTML Emails
13
14
 
14
15
  ### Why do you want this?
15
16
 
@@ -25,5 +26,4 @@ Take a look at the user model to see if you want to configure any other features
25
26
 
26
27
  Once you feel good about it run "rake db:migrate" and you should be good to go.
27
28
 
28
- ## Writing tests
29
-
29
+ For more information on devise please consult the docs [here.](https://github.com/plataformatec/devise)