bootstrap_views_generator 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +6 -0
  3. data/bin/console +2 -2
  4. data/bootstrap_views_generator.gemspec +1 -0
  5. data/lib/bootstrap_views_generator/version.rb +1 -1
  6. data/lib/generators/bootstrap/devise_generator.rb +61 -0
  7. data/lib/generators/bootstrap/install_generator.rb +7 -1
  8. data/lib/generators/bootstrap/templates/devise/erb/confirmations/new.html.erb.tt +22 -0
  9. data/lib/generators/bootstrap/templates/devise/erb/mailer/confirmation_instructions.html.erb +5 -0
  10. data/lib/generators/bootstrap/templates/devise/erb/mailer/email_changed.html.erb +7 -0
  11. data/lib/generators/bootstrap/templates/devise/erb/mailer/password_change.html.erb +3 -0
  12. data/lib/generators/bootstrap/templates/devise/erb/mailer/reset_password_instructions.html.erb +8 -0
  13. data/lib/generators/bootstrap/templates/devise/erb/mailer/unlock_instructions.html.erb +7 -0
  14. data/lib/generators/bootstrap/templates/devise/erb/passwords/edit.html.erb.tt +27 -0
  15. data/lib/generators/bootstrap/templates/devise/erb/passwords/new.html.erb.tt +25 -0
  16. data/lib/generators/bootstrap/templates/devise/erb/registrations/edit.html.erb.tt +42 -0
  17. data/lib/generators/bootstrap/templates/devise/erb/registrations/new.html.erb.tt +28 -0
  18. data/lib/generators/bootstrap/templates/devise/erb/sessions/new.html.erb.tt +34 -0
  19. data/lib/generators/bootstrap/templates/devise/erb/shared/_error_messages.html.erb +15 -0
  20. data/lib/generators/bootstrap/templates/devise/erb/shared/_links.html.erb +25 -0
  21. data/lib/generators/bootstrap/templates/devise/erb/unlocks/new.html.erb.tt +18 -0
  22. data/lib/generators/bootstrap/templates/devise/haml/confirmations/new.html.haml.tt +17 -0
  23. data/lib/generators/bootstrap/templates/devise/haml/mailer/confirmation_instructions.html.haml +3 -0
  24. data/lib/generators/bootstrap/templates/devise/haml/mailer/email_changed.html.haml +7 -0
  25. data/lib/generators/bootstrap/templates/devise/haml/mailer/password_change.html.haml +2 -0
  26. data/lib/generators/bootstrap/templates/devise/haml/mailer/reset_password_instructions.html.haml +5 -0
  27. data/lib/generators/bootstrap/templates/devise/haml/mailer/unlock_instructions.html.haml +4 -0
  28. data/lib/generators/bootstrap/templates/devise/haml/passwords/edit.html.haml.tt +23 -0
  29. data/lib/generators/bootstrap/templates/devise/haml/passwords/new.html.haml.tt +17 -0
  30. data/lib/generators/bootstrap/templates/devise/haml/registrations/edit.html.haml.tt +39 -0
  31. data/lib/generators/bootstrap/templates/devise/haml/registrations/new.html.haml.tt +19 -0
  32. data/lib/generators/bootstrap/templates/devise/haml/sessions/new.html.haml.tt +21 -0
  33. data/lib/generators/bootstrap/templates/devise/haml/shared/_error_messages.html.haml +7 -0
  34. data/lib/generators/bootstrap/templates/devise/haml/shared/_links.html.haml +19 -0
  35. data/lib/generators/bootstrap/templates/devise/haml/unlocks/new.html.haml.tt +14 -0
  36. data/lib/generators/bootstrap/templates/devise/simple_form/erb/confirmations/new.html.erb.tt +22 -0
  37. data/lib/generators/bootstrap/templates/devise/simple_form/erb/passwords/edit.html.erb.tt +18 -0
  38. data/lib/generators/bootstrap/templates/devise/simple_form/erb/passwords/new.html.erb.tt +21 -0
  39. data/lib/generators/bootstrap/templates/devise/simple_form/erb/registrations/edit.html.erb.tt +30 -0
  40. data/lib/generators/bootstrap/templates/devise/simple_form/erb/registrations/new.html.erb.tt +20 -0
  41. data/lib/generators/bootstrap/templates/devise/simple_form/erb/sessions/new.html.erb.tt +22 -0
  42. data/lib/generators/bootstrap/templates/devise/simple_form/erb/unlocks/new.html.erb.tt +16 -0
  43. data/lib/generators/bootstrap/templates/devise/simple_form/haml/confirmations/new.html.haml.tt +16 -0
  44. data/lib/generators/bootstrap/templates/devise/simple_form/haml/passwords/edit.html.haml.tt +15 -0
  45. data/lib/generators/bootstrap/templates/devise/simple_form/haml/passwords/new.html.haml.tt +15 -0
  46. data/lib/generators/bootstrap/templates/devise/simple_form/haml/registrations/edit.html.haml.tt +26 -0
  47. data/lib/generators/bootstrap/templates/devise/simple_form/haml/registrations/new.html.haml.tt +17 -0
  48. data/lib/generators/bootstrap/templates/devise/simple_form/haml/sessions/new.html.haml.tt +16 -0
  49. data/lib/generators/bootstrap/templates/devise/simple_form/haml/unlocks/new.html.haml.tt +13 -0
  50. data/lib/generators/bootstrap/templates/devise/simple_form/slim/confirmations/new.html.slim.tt +16 -0
  51. data/lib/generators/bootstrap/templates/devise/simple_form/slim/passwords/edit.html.slim.tt +15 -0
  52. data/lib/generators/bootstrap/templates/devise/simple_form/slim/passwords/new.html.slim.tt +15 -0
  53. data/lib/generators/bootstrap/templates/devise/simple_form/slim/registrations/edit.html.slim.tt +26 -0
  54. data/lib/generators/bootstrap/templates/devise/simple_form/slim/registrations/new.html.slim.tt +17 -0
  55. data/lib/generators/bootstrap/templates/devise/simple_form/slim/sessions/new.html.slim.tt +16 -0
  56. data/lib/generators/bootstrap/templates/devise/simple_form/slim/unlocks/new.html.slim.tt +13 -0
  57. data/lib/generators/bootstrap/templates/devise/slim/confirmations/new.html.slim.tt +17 -0
  58. data/lib/generators/bootstrap/templates/devise/slim/mailer/confirmation_instructions.html.slim +3 -0
  59. data/lib/generators/bootstrap/templates/devise/slim/mailer/email_changed.html.slim +5 -0
  60. data/lib/generators/bootstrap/templates/devise/slim/mailer/password_change.html.slim +2 -0
  61. data/lib/generators/bootstrap/templates/devise/slim/mailer/reset_password_instructions.html.slim +5 -0
  62. data/lib/generators/bootstrap/templates/devise/slim/mailer/unlock_instructions.html.slim +4 -0
  63. data/lib/generators/bootstrap/templates/devise/slim/passwords/edit.html.slim.tt +22 -0
  64. data/lib/generators/bootstrap/templates/devise/slim/passwords/new.html.slim.tt +17 -0
  65. data/lib/generators/bootstrap/templates/devise/slim/registrations/edit.html.slim.tt +39 -0
  66. data/lib/generators/bootstrap/templates/devise/slim/registrations/new.html.slim.tt +19 -0
  67. data/lib/generators/bootstrap/templates/devise/slim/sessions/new.html.slim.tt +21 -0
  68. data/lib/generators/bootstrap/templates/devise/slim/shared/_error_messages.html.slim +7 -0
  69. data/lib/generators/bootstrap/templates/devise/slim/shared/_links.html.slim +19 -0
  70. data/lib/generators/bootstrap/templates/devise/slim/unlocks/new.html.slim.tt +14 -0
  71. metadata +66 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e973e3926bdfd81497bd96490b99c57bd5dd6a9fe092aa4ac3bec53d3433b99a
4
- data.tar.gz: ca2ea8938d63e4cd49439fa0173cdc20a443ecf38f2d220378e02689b60c1fcb
3
+ metadata.gz: 185e70ce73dc0dfc077725fdde0938b53127a4cdbb27e7480f77465733dd15ec
4
+ data.tar.gz: ac4028174ecec96256475d87a77ebd2cbcc76aa4c2552b67a95f16a25f068511
5
5
  SHA512:
6
- metadata.gz: 59e59402b519bbd88362cbb8d919d03e80507494551cc398b2a8bdef0790973041196317f994a4bdea12e0ee033d57c599e3f08d8d08f72dec89f463e5bde310
7
- data.tar.gz: e1aab4fc44557206d7719935e6bfaad27e1a86748b3f6e39f6a7b150b203d5ff393e788490ab432500895cfc7995031bb9cde25ae57c868b41a7cfd73773a2ff
6
+ metadata.gz: ed7c45f77367701ed0c7bdeafbdf8fb475538c1eb9df441e035692679fdf691cf9faea991a9a6ed3c92a69c4828c4bdbebfb4002b49017134f5c5a12c9937756
7
+ data.tar.gz: 886e65054e96476bae62675a25060be2d7f7a1501a3070e4ed8b907319d085dc5a88d7a2bf47f99a786d28af6793357e28438869dc5f7d951571e8a9b371caf2
data/README.md CHANGED
@@ -44,6 +44,8 @@ Options:
44
44
  # Default: false
45
45
  --layout # Over-write your application layout file with a bootstrap based layout
46
46
  # Default: false
47
+ --devise # If you want to generate bootstrap based devise views
48
+ # Default: false
47
49
  ```
48
50
 
49
51
  ## Options
@@ -106,6 +108,10 @@ Generate bootstrap views with slim and using simple_form
106
108
  rails g bootstrap:install --template_engine=slim --simpleform
107
109
  ```
108
110
 
111
+ Generate bootstrap scaffolds, devise views, while using simpleform, metatags, and slim template engine.
112
+ ```shell
113
+ rails g bootstrap:install --devise --simpleform --metatags --template_engine=slim
114
+ ```
109
115
  ### Extras
110
116
 
111
117
  * If you like to use the [meta-tags](https://github.com/kpumuk/meta-tags) gem to add page titles based on the views.
data/bin/console CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
 
3
- require "bundler/setup"
4
- require "bootstrap_views_generator"
3
+ require 'bundler/setup'
4
+ require 'bootstrap_views_generator'
5
5
 
6
6
  # You can add fixtures and/or initialization code here to make experimenting
7
7
  # with your gem easier. You can also use a different console, if you like.
@@ -29,6 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
30
30
  `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
31
31
  end
32
+ # spec.files = Dir.glob("{bin,lib}/**/*") # Used when building the gem locally (before commiting and pushing the gem publically)
32
33
  spec.bindir = 'exe'
33
34
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
34
35
  spec.require_paths = ['lib']
@@ -1,3 +1,3 @@
1
1
  module BootstrapViewsGenerator
2
- VERSION = '0.1.2'.freeze
2
+ VERSION = '0.1.3'.freeze
3
3
  end
@@ -0,0 +1,61 @@
1
+ require 'rails/generators'
2
+
3
+ module Bootstrap
4
+ module Generators
5
+ class DeviseGenerator < ::Rails::Generators::Base
6
+ hide!
7
+ desc 'Overwrite default devise views'
8
+ source_root ::File.expand_path('../templates/devise', __FILE__)
9
+
10
+ class_option :template_engine, type: :string, default: 'erb', aliases: '-t', desc: 'Set template engine to generate the views with'
11
+ class_option :metatags, type: :boolean, default: false, aliases: "-m", desc: 'If views will assign pages title using metatags gem'
12
+ class_option :simpleform, type: :boolean, default: false, aliases: '-sf', desc: 'Enable SimpleForms for the form generating'
13
+
14
+ def copy_confirmation
15
+ template "#{file_template_location('confirmations/new')}.tt", "app/views/devise/confirmations/new.html.#{options[:template_engine]}"
16
+ end
17
+
18
+ def copy_mailers
19
+ directory "#{options[:template_engine]}/mailer", 'app/views/devise/mailer'
20
+ end
21
+
22
+ def copy_passwords
23
+ %i[edit new].map do |file|
24
+ template "#{file_template_location("passwords/#{file}")}.tt", "app/views/devise/passwords/#{file}.html.#{options[:template_engine]}"
25
+ end
26
+ end
27
+
28
+ def copy_registrations
29
+ %i[edit new].map do |file|
30
+ template "#{file_template_location("registrations/#{file}")}.tt", "app/views/devise/registrations/#{file}.html.#{options[:template_engine]}"
31
+ end
32
+ end
33
+
34
+ def copy_sessions
35
+ template "#{file_template_location('sessions/new')}.tt", "app/views/devise/sessions/new.html.#{options[:template_engine]}"
36
+ end
37
+
38
+ def copy_unlock
39
+ template "#{options[:template_engine]}/unlocks/new.html.#{options[:template_engine]}.tt", "app/views/devise/unlocks/new.html.#{options[:template_engine]}"
40
+ end
41
+
42
+ # Copy shared files that have no meta-tags or template associated with them
43
+ def copy_shared
44
+ directory "#{options[:template_engine]}/shared", 'app/views/devise/shared'
45
+ end
46
+
47
+ private
48
+ def file_template_location(file_location = '')
49
+ return '' if file_location.blank?
50
+ # Dpending if simpleform is to be used, it will return a path similar to one of the following:
51
+ # => slim/unlocks/new.html.slim || simple_form/slim/unlocks/new.html.slim
52
+ "#{simple_path}#{options[:template_engine]}/#{file_location}.html.#{options[:template_engine]}"
53
+ end
54
+
55
+ # If simpleform is going ot be used with the forms return a simple_form path
56
+ def simple_path
57
+ options[:simpleform] ? 'simple_form/' : ''
58
+ end
59
+ end
60
+ end
61
+ end
@@ -1,4 +1,5 @@
1
1
  require 'rails/generators'
2
+ require_relative 'devise_generator'
2
3
 
3
4
  module Bootstrap
4
5
  module Generators
@@ -8,6 +9,7 @@ module Bootstrap
8
9
 
9
10
  class_option :template_engine, type: :string, default: 'erb', aliases: '-t', desc: 'Set template engine to generate the views with'
10
11
  # Boolean flags that can be flagged by adding to the generator call ie: --pagination or --metag_tags
12
+ class_option :devise, type: :boolean, default: false, desc: 'If views for devise will be required by the generator'
11
13
  class_option :layout, type: :boolean, default: false, aliases: "-l", desc: 'Over-write your application layout file with a bootstrap based layout'
12
14
  class_option :metatags, type: :boolean, default: false, aliases: "-m", desc: 'If views will assign pages title using metatags gem'
13
15
  class_option :pagination, type: :boolean, default: false, aliases: '-p', desc: 'Toggle if pagination will be used with the index view/controller (based off of Pagy)'
@@ -74,9 +76,13 @@ module Bootstrap
74
76
  end
75
77
  end
76
78
  HELPER
77
-
78
79
  inject_into_file 'app/helpers/application_helper.rb', helper_str, after: "module ApplicationHelper\n"
79
80
  end
81
+
82
+ def invoke_devise_generator
83
+ # Generate bootstrap based devise views if devise is being used
84
+ invoke('bootstrap:devise') if options[:devise]
85
+ end
80
86
  end
81
87
  end
82
88
  end
@@ -0,0 +1,22 @@
1
+ <div class="row">
2
+ <div class="col-lg-4 col-md-6 ml-auto mr-auto">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center"><%%= title('Resend confirmation instructions') %></h2>
5
+ <% else -%>
6
+ <h2 class="text-center">Resend confirmation instructions</h2>
7
+ <%- end %>
8
+ <%%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
9
+ <%%= render 'devise/shared/error_messages', resource: resource %>
10
+ <div class="form-group">
11
+ <%%= f.label :email %><br />
12
+ <%%= f.email_field :email, autofocus: true, class: 'form-control', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
13
+ </div>
14
+ <div class="form-group">
15
+ <%%= f.submit "Resend confirmation instructions", class: 'btn btn-primary btn-lg btn-block' %>
16
+ </div>
17
+ <%% end %>
18
+ <div class="text-center">
19
+ <%%= render 'devise/shared/links' %>
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,5 @@
1
+ <p>Welcome <%= @email %>!</p>
2
+
3
+ <p>You can confirm your account email through the link below:</p>
4
+
5
+ <p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
@@ -0,0 +1,7 @@
1
+ <p>Hello <%= @email %>!</p>
2
+
3
+ <% if @resource.try(:unconfirmed_email?) %>
4
+ <p>We're contacting you to notify you that your email is being changed to <%= @resource.unconfirmed_email %>.</p>
5
+ <% else %>
6
+ <p>We're contacting you to notify you that your email has been changed to <%= @resource.email %>.</p>
7
+ <% end %>
@@ -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,8 @@
1
+ <p>Hello <%= @resource.email %>!</p>
2
+
3
+ <p>Someone has requested a link to change your password. You can do this through the link below.</p>
4
+
5
+ <p><%= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token) %></p>
6
+
7
+ <p>If you didn't request this, please ignore this email.</p>
8
+ <p>Your password won't change until you access the link above and create a new one.</p>
@@ -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>
@@ -0,0 +1,27 @@
1
+ <%- if options[:metatags] %>
2
+ <h2 class="text-center"><%%= title('Change your password') %></h2>
3
+ <% else -%>
4
+ <h2 class="text-center">Change your password</h2>
5
+ <%- end %>
6
+ <%%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
7
+ <%%= render "devise/shared/error_messages", resource: resource %>
8
+ <%%= f.hidden_field :reset_password_token %>
9
+
10
+ <div class="field">
11
+ <%%= f.label :password, "New password" %><br />
12
+ <%% if @minimum_password_length %>
13
+ <em>(<%%= @minimum_password_length %> characters minimum)</em><br />
14
+ <%% end %>
15
+ <%%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
16
+ </div>
17
+
18
+ <div class="field">
19
+ <%%= f.label :password_confirmation, "Confirm new password" %><br />
20
+ <%%= f.password_field :password_confirmation, autocomplete: "off" %>
21
+ </div>
22
+
23
+ <div class="form-group">
24
+ <%%= f.submit "Change my password" %>
25
+ </div>
26
+ <%% end %>
27
+ <%%= render "devise/shared/links" %>
@@ -0,0 +1,25 @@
1
+ <div class="row">
2
+ <div class="col-lg-4 col-md-6 ml-auto mr-auto">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center"><%%= title('Forgot your password?') %></h2>
5
+ <% else -%>
6
+ <h2 class="text-center">Forgot your password?</h2>
7
+ <%- end %>
8
+
9
+ <%%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
10
+ <%%= render "devise/shared/error_messages", resource: resource %>
11
+ <br>
12
+ <p class="text-left">Please enter your email address and we will send you a link to reset your password.</p>
13
+ <div class="form-group">
14
+ <%%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
15
+ </div>
16
+
17
+ <div class="form-group">
18
+ <%%= f.submit 'Send me reset password instructions', class: 'btn btn-primary btn-block btn-lg' %>
19
+ </div>
20
+ <%% end %>
21
+ <div class="text-center">
22
+ <%%= render 'devise/shared/links' %>
23
+ </div>
24
+ </div>
25
+ </div>
@@ -0,0 +1,42 @@
1
+ <div class="row">
2
+ <div class="col-lg-4 col-md-6 ml-auto mr-auto">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center"><%%= title("Edit #{resource_name.to_s.humanize}") %></h2>
5
+ <% else -%>
6
+ <h2 class="text-center">Edit <%%= resource_name.to_s.humanize %></h2>
7
+ <%- end %>
8
+ <hr>
9
+ <%%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
10
+ <%%= render "devise/shared/error_messages", resource: resource %>
11
+ <div class="form-group">
12
+ <%%= f.label :email %><br />
13
+ <%%= f.email_field :email, class: 'form-control' %>
14
+ </div>
15
+
16
+ <%% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
17
+ <div>Currently waiting confirmation for: <%%= resource.unconfirmed_email %></div>
18
+ <%% end %>
19
+
20
+ <div class="form-group">
21
+ <%%= f.label :password %> <i>(Leave blank if you don't want to change it)</i><br />
22
+ <%%= f.password_field :password, autocomplete: 'off', class: 'form-control' %>
23
+ </div>
24
+ <div class="form-group">
25
+ <%%= f.label :password_confirmation %><br />
26
+ <%%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
27
+ </div>
28
+ <div class="form-group">
29
+ <%%= f.label :current_password %> <i>(We need your current password to confirm your changes)</i><br />
30
+ <%%= f.password_field :current_password, autocomplete: 'off', class: 'form-control' %>
31
+ </div>
32
+ <div class="form-group">
33
+ <%%= f.submit "Update", class: 'btn btn-lg btn-block btn-primary' %>
34
+ </div>
35
+ <%% end %>
36
+ <hr>
37
+ <h2>Cancel my account</h2>
38
+ <p>Unhappy? <%%= button_to 'Cancel my account', registration_path(resource_name), class: 'btn btn-danger', data: { confirm: 'Are you sure? You cannot undo this.' }, method: :delete %></p>
39
+ <%%= link_to "Back", :back %>
40
+ <hr>
41
+ </div>
42
+ </div>
@@ -0,0 +1,28 @@
1
+ <div class="row">
2
+ <div class="col-lg-4 col-md-6 ml-auto mr-auto">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center"><%%= title('Sign Up') %></h2>
5
+ <% else -%>
6
+ <h2 class="text-center">Sign Up</h2>
7
+ <%- end %>
8
+
9
+ <%%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
10
+ <%%= render 'devise/shared/error_messages', resource: resource %>
11
+ <div class="form-group">
12
+ <%%= f.email_field :email, autofocus: false, class: 'form-control', placeholder: 'Email Address' %>
13
+ </div>
14
+ <div class="form-group">
15
+ <%%= f.password_field :password, autocomplete: 'off', class: 'form-control', placeholder: 'Password' %>
16
+ </div>
17
+ <div class="form-group">
18
+ <%%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control', placeholder: 'Confirm Password' %>
19
+ </div>
20
+ <div class="form-group">
21
+ <%%= f.submit 'Sign up', class: 'btn btn-primary btn-block btn-lg' %>
22
+ </div>
23
+ <%% end %>
24
+ <div class="text-center">
25
+ <%%= render 'devise/shared/links' %>
26
+ </div>
27
+ </div>
28
+ </div>
@@ -0,0 +1,34 @@
1
+ <div class="row">
2
+ <div class="col-lg-4 col-md-6 ml-auto mr-auto">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center"><%%= title('Log In') %></h2>
5
+ <% else -%>
6
+ <h2 class="text-center">Log in</h2>
7
+ <%- end %>
8
+ <%%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
9
+ <div class="form-group">
10
+ <%%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
11
+ </div>
12
+
13
+ <div class="form-group">
14
+ <%%= f.password_field :password, autocomplete: 'off', placeholder: 'Password', class: 'form-control' %>
15
+ </div>
16
+
17
+ <%% if devise_mapping.rememberable? -%>
18
+ <div class="form-check">
19
+ <label class="form-check-label">
20
+ <%%= f.check_box :remember_me, class: 'form-check-input' %>
21
+ Remember me
22
+ </label>
23
+ </div>
24
+ <%% end -%>
25
+
26
+ <div class="form-group">
27
+ <%%= f.submit 'Log in', class: 'btn btn-primary btn-block btn-lg' %>
28
+ </div>
29
+ <%% end %>
30
+ <div class="text-center">
31
+ <%%= render "devise/shared/links" %>
32
+ </div>
33
+ </div>
34
+ </div>
@@ -0,0 +1,15 @@
1
+ <% if resource.errors.any? %>
2
+ <div id="error_explanation">
3
+ <h2>
4
+ <%= I18n.t("errors.messages.not_saved",
5
+ count: resource.errors.count,
6
+ resource: resource.class.model_name.human.downcase)
7
+ %>
8
+ </h2>
9
+ <ul>
10
+ <% resource.errors.full_messages.each do |message| %>
11
+ <li><%= message %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
@@ -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,18 @@
1
+ <%- if options[:metatags] %>
2
+ <h2 class="text-center"><%%= title("Resend unlock instructions") %></h2>
3
+ <% else -%>
4
+ <h2 class="text-center">Resend unlock instructions</h2>
5
+ <%- end %>
6
+ <%%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
7
+ <%%= render "devise/shared/error_messages", resource: resource %>
8
+
9
+ <div class="field">
10
+ <%%= f.label :email %><br />
11
+ <%%= f.email_field :email, autofocus: true, autocomplete: "email" %>
12
+ </div>
13
+
14
+ <div class="form-group">
15
+ <%%= f.submit "Resend unlock instructions" %>
16
+ </div>
17
+ <%% end %>
18
+ <%%= render "devise/shared/links" %>
@@ -0,0 +1,17 @@
1
+ .row
2
+ .col-lg-4.col-md-6.ml-auto.mr-auto
3
+ <%- if options[:metatags] %>
4
+ %h2.text-center= title('Resend confirmation instructions')
5
+ <% else -%>
6
+ %h2.text-center Resend confirmation instructions
7
+ <%- end %>
8
+ = form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
9
+ = render "devise/shared/error_messages", resource: resource
10
+ .form-group
11
+ = f.label :email
12
+ %br
13
+ = f.email_field :email, autofocus: true, class: 'form-control', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
14
+ .form-group
15
+ = f.submit "Resend confirmation instructions", class: 'btn btn-primary btn-lg btn-block'
16
+ .text-center
17
+ = render "devise/shared/links"
@@ -0,0 +1,3 @@
1
+ %p Welcome #{@email}!
2
+ %p You can confirm your account email through the link below:
3
+ %p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token)
@@ -0,0 +1,7 @@
1
+ %p Hello #{@email}!
2
+ - if @resource.try(:unconfirmed_email?)
3
+ %p
4
+ We're contacting you to notify you that your email is being changed to #{@resource.unconfirmed_email}.
5
+ - else
6
+ %p
7
+ We're contacting you to notify you that your email has been changed to #{@resource.email}.
@@ -0,0 +1,2 @@
1
+ %p Hello #{@resource.email}!
2
+ %p We're contacting you to notify you that your password has been changed.
@@ -0,0 +1,5 @@
1
+ %p Hello #{@resource.email}!
2
+ %p Someone has requested a link to change your password. You can do this through the link below.
3
+ %p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @token)
4
+ %p If you didn't request this, please ignore this email.
5
+ %p Your password won't change until you access the link above and create a new one.
@@ -0,0 +1,4 @@
1
+ %p Hello #{@resource.email}!
2
+ %p Your account has been locked due to an excessive number of unsuccessful sign in attempts.
3
+ %p Click the link below to unlock your account:
4
+ %p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @token)
@@ -0,0 +1,23 @@
1
+ <%- if options[:metatags] %>
2
+ %h2.text-center= title('Change your password')
3
+ <% else -%>
4
+ %h2.text-center Change your password
5
+ <%- end %>
6
+ = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
7
+ = render 'devise/shared/error_messages', resource: resource
8
+ = f.hidden_field :reset_password_token
9
+ .field
10
+ = f.label :password, 'New password'
11
+ %br
12
+ - if @minimum_password_length
13
+ %em
14
+ (#{@minimum_password_length} characters minimum)
15
+ %br
16
+ = f.password_field :password, autofocus: true, autocomplete: 'new-password'
17
+ .field
18
+ = f.label :password_confirmation, 'Confirm new password'
19
+ %br
20
+ = f.password_field :password_confirmation, autocomplete: 'off'
21
+ .form-group
22
+ = f.submit 'Change my password'
23
+ = render 'devise/shared/links'
@@ -0,0 +1,17 @@
1
+ .row
2
+ .col-lg-4.col-md-6.ml-auto.mr-auto
3
+ <%- if options[:metatags] %>
4
+ %h2.text-center= title('Forgot your password?')
5
+ <% else -%>
6
+ %h2.text-center Forgot your password?
7
+ <%- end %>
8
+ = form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
9
+ = render 'devise/shared/error_messages', resource: resource
10
+ %br
11
+ %p.text-left Please enter your email address and we will send you a link to reset your password.
12
+ .form-group
13
+ = f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control'
14
+ .form-group
15
+ = f.submit 'Send me reset password instructions', class: 'btn btn-primary btn-block btn-lg'
16
+ .text-center
17
+ = render 'devise/shared/links'
@@ -0,0 +1,39 @@
1
+ .row
2
+ .col-lg-4.col-md-6.ml-auto.mr-auto
3
+ <%- if options[:metatags] %>
4
+ %h2.text-center= title("Edit #{resource_name.to_s.humanize}")
5
+ <% else -%>
6
+ %h2.text-center Edit #{resource_name.to_s.humanize}
7
+ <%- end %>
8
+ %hr
9
+ = form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f|
10
+ = render "devise/shared/error_messages", resource: resource
11
+ .form-group
12
+ = f.label :email
13
+ %br
14
+ = f.email_field :email, class: 'form-control'
15
+ - if devise_mapping.confirmable? && resource.pending_reconfirmation?
16
+ %div
17
+ Currently waiting confirmation for: #{resource.unconfirmed_email}
18
+ .form-group
19
+ = f.label :password
20
+ %i (Leave blank if you don't want to change it)
21
+ %br
22
+ = f.password_field :password, autocomplete: "off", class: 'form-control'
23
+ .form-group
24
+ = f.label :password_confirmation
25
+ %br
26
+ = f.password_field :password_confirmation, autocomplete: "off", class: 'form-control'
27
+ .form-group
28
+ = f.label :current_password
29
+ %i (We need your current password to confirm your changes)
30
+ %br
31
+ = f.password_field :current_password, autocomplete: "off", class: 'form-control'
32
+ .form-group
33
+ = f.submit "Update", class: 'btn btn-lg btn-block btn-primary'
34
+ %hr
35
+ %h2 Cancel my account
36
+ %p
37
+ Unhappy? #{button_to "Cancel my account", registration_path(resource_name), class: "btn btn-danger", data: { confirm: "Are you sure? You cannot undo this." }, method: :delete}
38
+ = link_to "Back", :back
39
+ %hr
@@ -0,0 +1,19 @@
1
+ .row
2
+ .col-lg-4.col-md-6.ml-auto.mr-auto
3
+ <%- if options[:metatags] %>
4
+ %h2.text-center= title("Sign Up")
5
+ <% else -%>
6
+ %h2.text-center Sign Up
7
+ <%- end %>
8
+ = form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
9
+ = render 'devise/shared/error_messages', resource: resource
10
+ .form-group
11
+ = f.email_field :email, autofocus: false, class: 'form-control', placeholder: 'Email Address'
12
+ .form-group
13
+ = f.password_field :password, autocomplete: 'off', class: 'form-control', placeholder: 'Password'
14
+ .form-group
15
+ = f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control', placeholder: 'Confirm Password'
16
+ .form-group
17
+ = f.submit 'Sign up', class: 'btn btn-primary btn-block btn-lg'
18
+ .text-center
19
+ = render 'devise/shared/links'
@@ -0,0 +1,21 @@
1
+ .row
2
+ .col-lg-4.col-md-6.ml-auto.mr-auto
3
+ <%- if options[:metatags] %>
4
+ %h2.text-center= title("Log in")
5
+ <% else -%>
6
+ %h2.text-center Log in
7
+ <%- end %>
8
+ = form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
9
+ .form-group
10
+ = f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control'
11
+ .form-group
12
+ = f.password_field :password, autocomplete: 'off', placeholder: 'Password', class: 'form-control'
13
+ - if devise_mapping.rememberable?
14
+ .form-check
15
+ %label.form-check-label
16
+ = f.check_box :remember_me, class: 'form-check-input'
17
+ Remember me
18
+ .form-group
19
+ = f.submit 'Log in', class: 'btn btn-primary btn-block btn-lg'
20
+ .text-center
21
+ = render 'devise/shared/links'
@@ -0,0 +1,7 @@
1
+ - if resource.errors.any?
2
+ #error_explanation
3
+ %h2
4
+ = I18n.t('errors.messages.not_saved', count: resource.errors.count, resource: resource.class.model_name.human.downcase)
5
+ %ul
6
+ - resource.errors.full_messages.each do |message|
7
+ %li= message