devise_materialize 0.0.4.test3 → 0.0.5.alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +18 -0
  3. data/.gitignore +5 -0
  4. data/.rubocop.yml +5 -0
  5. data/.yardopts +1 -0
  6. data/Gemfile +10 -0
  7. data/Gemfile.lock +33 -12
  8. data/README.md +52 -12
  9. data/Rakefile +21 -0
  10. data/circle.yml +21 -0
  11. data/devise_materialize.gemspec +6 -17
  12. data/lib/devise_materialize/version.rb +1 -1
  13. data/lib/generators/devise_materialize/install_generator.rb +17 -31
  14. data/lib/generators/templates/assets/stylesheets/devise.scss +53 -0
  15. data/lib/generators/templates/erb/simple_form/confirmations/new.html.erb +7 -6
  16. data/lib/generators/templates/erb/simple_form/mailer/unlock_instructions.html.erb +8 -1
  17. data/lib/generators/templates/erb/simple_form/passwords/edit.html.erb +36 -0
  18. data/lib/generators/templates/erb/simple_form/passwords/new.html.erb +30 -0
  19. data/lib/generators/templates/erb/simple_form/registrations/edit.html.erb +42 -0
  20. data/lib/generators/templates/erb/simple_form/registrations/new.html.erb +36 -0
  21. data/lib/generators/templates/erb/simple_form/sessions/new.html.erb +34 -0
  22. data/lib/generators/templates/erb/simple_form/shared/_links.html.erb +40 -0
  23. data/lib/generators/templates/erb/simple_form/unlocks/new.html.erb +30 -0
  24. data/lib/generators/templates/haml/simple_form/confirmations/new.html.haml +1 -1
  25. data/lib/generators/templates/haml/simple_form/passwords/edit.html.haml +23 -16
  26. data/lib/generators/templates/haml/simple_form/passwords/new.html.haml +19 -12
  27. data/lib/generators/templates/haml/simple_form/registrations/edit.html.haml +1 -1
  28. data/lib/generators/templates/haml/simple_form/registrations/new.html.haml +23 -16
  29. data/lib/generators/templates/haml/simple_form/sessions/new.html.haml +22 -15
  30. data/lib/generators/templates/haml/simple_form/unlocks/new.html.haml +19 -12
  31. data/lib/generators/templates/helpers/devise_helper.rb +18 -0
  32. data/lib/generators/templates/slim/simple_form/confirmations/new.html.slim +21 -0
  33. data/lib/generators/templates/slim/simple_form/mailer/confirmation_instructions.html.slim +30 -0
  34. data/lib/generators/templates/slim/simple_form/mailer/password_change.html.slim +31 -0
  35. data/lib/generators/templates/slim/simple_form/mailer/reset_password_instructions.html.slim +38 -0
  36. data/lib/generators/templates/slim/simple_form/mailer/unlock_instructions.html.slim +35 -0
  37. data/lib/generators/templates/slim/simple_form/passwords/edit.html.slim +23 -0
  38. data/lib/generators/templates/slim/simple_form/passwords/new.html.slim +20 -0
  39. data/lib/generators/templates/slim/simple_form/registrations/edit.html.slim +30 -0
  40. data/lib/generators/templates/slim/simple_form/registrations/new.html.slim +24 -0
  41. data/lib/generators/templates/slim/simple_form/sessions/new.html.slim +23 -0
  42. data/lib/generators/templates/slim/simple_form/shared/_links.html.slim +29 -0
  43. data/lib/generators/templates/slim/simple_form/unlocks/new.html.slim +20 -0
  44. data/test/devise_materialize_test.rb +5 -0
  45. data/test/lib/install_generator_test.rb +92 -0
  46. data/test/rails_app/Rakefile +8 -0
  47. data/test/rails_app/app/controllers/application_controller.rb +7 -0
  48. data/test/rails_app/app/controllers/home_controller.rb +5 -0
  49. data/test/rails_app/app/helpers/application_helper.rb +4 -0
  50. data/test/rails_app/app/views/home/index.html.erb +1 -0
  51. data/test/rails_app/app/views/layouts/application.html.erb +13 -0
  52. data/test/rails_app/bin/bundle +4 -0
  53. data/test/rails_app/bin/rails +5 -0
  54. data/test/rails_app/bin/rake +5 -0
  55. data/test/rails_app/config.ru +5 -0
  56. data/test/rails_app/config/application.rb +13 -0
  57. data/test/rails_app/config/boot.rb +15 -0
  58. data/test/rails_app/config/database.yml +18 -0
  59. data/test/rails_app/config/environment.rb +6 -0
  60. data/test/rails_app/config/environments/development.rb +31 -0
  61. data/test/rails_app/config/environments/production.rb +87 -0
  62. data/test/rails_app/config/environments/test.rb +46 -0
  63. data/test/rails_app/config/initializers/backtrace_silencers.rb +8 -0
  64. data/test/rails_app/config/initializers/inflections.rb +3 -0
  65. data/test/rails_app/config/initializers/secret_token.rb +4 -0
  66. data/test/rails_app/config/initializers/session_store.rb +2 -0
  67. data/test/rails_app/config/routes.rb +4 -0
  68. data/test/rails_app/log/test.log +288 -0
  69. data/test/rails_app/public/404.html +26 -0
  70. data/test/rails_app/public/422.html +26 -0
  71. data/test/rails_app/public/500.html +26 -0
  72. data/{lib/generators/templates/.keep → test/rails_app/public/favicon.ico} +0 -0
  73. data/test/test_helper.rb +31 -0
  74. metadata +79 -68
  75. data/lib/generators/devise_materialize/USAGE +0 -5
@@ -1,16 +1,23 @@
1
- %span.card-title.center Sign Up
2
- .divider
3
- = simple_form_for resource, as: resource_name,
4
- url: registration_path(resource_name) do |f|
5
- - if devise_error_messages? || alert
6
- .form-errors.red.lighten-1
7
- = devise_error_messages!
8
- = alert
9
- .form-inputs.row
10
- = f.input :email, autofocus: true, required: true
11
- = f.input :password, autocomplete: "off", required: true, icon: "lock",
12
- label_html: { data: { hint: "#{@minimum_password_length} Characters Minimum" } }
13
- = f.input :password_confirmation, autocomplete: "off", required: true,
14
- icon: "lock"
15
- .form-actions.center
16
- = f.button :submit, "Sign Up"
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ %span.card-title.center Sign Up
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ url: registration_path(resource_name) do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, autofocus: true, required: true
15
+ = f.input :password, autocomplete: "off", required: true, icon: "lock",
16
+ label_html: { data: { hint: "#{@minimum_password_length} Characters Minimum" } }
17
+ = f.input :password_confirmation, autocomplete: "off", required: true,
18
+ icon: "lock"
19
+ .form-actions.center
20
+ = f.button :submit, "Sign Up"
21
+ .card-action
22
+ .devise-links
23
+ = render "<%= namespace.downcase %>/shared/links"
@@ -1,15 +1,22 @@
1
- %span.card-title.center Log In
2
- .divider
3
- = simple_form_for resource, as: resource_name,
4
- url: session_path(resource_name) do |f|
5
- - if devise_error_messages? || alert
6
- .form-errors.red.lighten-1
7
- = devise_error_messages!
8
- = alert
9
- .form-inputs.row
10
- = f.input :email, required: true, autofocus: true
11
- = f.input :password, required: true, autocomplete: "off", icon: "lock",
12
- hint: false
13
- = f.input :remember_me, as: :boolean if devise_mapping.rememberable?
14
- .form-actions.center
15
- = f.button :submit, "Log In"
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ %span.card-title.center Log In
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ url: session_path(resource_name) do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, required: true, autofocus: true
15
+ = f.input :password, required: true, autocomplete: "off", icon: "lock",
16
+ hint: false
17
+ = f.input :remember_me, as: :boolean if devise_mapping.rememberable?
18
+ .form-actions.center
19
+ = f.button :submit, "Log In"
20
+ .card-action
21
+ .devise-links
22
+ = render "<%= namespace.downcase %>/shared/links"
@@ -1,12 +1,19 @@
1
- %span.card-title.center Resend Unlock Instructions
2
- .divider
3
- = simple_form_for resource, as: resource_name, url: unlock_path(resource_name),
4
- html: { method: :post } do |f|
5
- - if devise_error_messages? || alert
6
- .form-errors.red.lighten-1
7
- = devise_error_messages!
8
- = alert
9
- .form-inputs.row
10
- = f.input :email, autofocus: true, required: true
11
- .form-actions.center
12
- = f.button :submit, "Resend Unlock Instructions"
1
+ .row.login-form
2
+ .col.s12.offset-m3
3
+ .card.hoverable
4
+ .card-content
5
+ %span.card-title.center Resend Unlock Instructions
6
+ .divider
7
+ = simple_form_for resource, as: resource_name, url: unlock_path(resource_name),
8
+ html: { method: :post } do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, autofocus: true, required: true
15
+ .form-actions.center
16
+ = f.button :submit, "Resend Unlock Instructions"
17
+ .card-action
18
+ .devise-links
19
+ = render "<%= namespace.downcase %>/shared/links"
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+ module DeviseHelper
3
+ def devise_error_messages!
4
+ return "" unless devise_error_messages?
5
+
6
+ err = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
7
+
8
+ html = <<-HTML
9
+ <ul>#{err}</ul>
10
+ HTML
11
+
12
+ html.html_safe
13
+ end
14
+
15
+ def devise_error_messages?
16
+ !resource.errors.empty?
17
+ end
18
+ end
@@ -0,0 +1,21 @@
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center
6
+ | Resend Confirmation Instructions
7
+ .divider
8
+ = simple_form_for resource, as: resource_name,
9
+ - url: confirmation_path(resource_name), html: { method: :post } do |f|
10
+ - if devise_error_messages? || alert
11
+ .form-errors.red.lighten-1
12
+ = devise_error_messages!
13
+ = alert
14
+ .form-inputs.row
15
+ = f.input :email, autofocus: true, required: true,
16
+ - value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
17
+ .form-actions.center
18
+ = f.button :submit, "Resend Confirmation Instructions"
19
+ .card-action
20
+ .devise-links
21
+ = render "<%= namespace.downcase %>/shared/links"
@@ -0,0 +1,30 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta content=("text/html; charset=utf-8") http-equiv="Content-Type" /
5
+ link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css" rel="stylesheet" /
6
+ script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
7
+ script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"
8
+ style type="text/scss"
9
+ cdata:
10
+ | \.form {
11
+ | max-width: 650px;
12
+ | margin: auto;
13
+ | }
14
+
15
+ | \.btn {
16
+ | margin-top: 20px;
17
+ | }
18
+ body.blue-grey
19
+ .row.form
20
+ .col.s12
21
+ .card.hoverable
22
+ .card-content
23
+ span.card-title.center
24
+ | Welcome #{@resource.email}!
25
+ .divider
26
+ .center
27
+ p You can confirm your account email through the link below:
28
+ = link_to 'Confirm my Account', class: 'btn waves-effect cyan', \
29
+ confirmation_url(@resource, confirmation_token: @token) \
30
+
@@ -0,0 +1,31 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta content=("text/html; charset=utf-8") http-equiv="Content-Type" /
5
+ link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css" rel="stylesheet" /
6
+ script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
7
+ script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"
8
+ style type="text/scss"
9
+ cdata:
10
+ | \.form {
11
+ | max-width: 650px;
12
+ | margin: auto;
13
+ | }
14
+
15
+ | \.btn {
16
+ | margin-bottom: 20px;
17
+ | margin-top: 20px;
18
+ | }
19
+ body.blue-grey
20
+ .row.form
21
+ .col.s12
22
+ .card.hoverable
23
+ .card-content
24
+ span.card-title.center
25
+ | Hello #{@resource.email}!
26
+ div
27
+ .center
28
+ p
29
+ | We're contacting you to notify you that your password has
30
+ | been changed.
31
+
@@ -0,0 +1,38 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta content=("text/html; charset=utf-8") http-equiv="Content-Type" /
5
+ link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css" rel="stylesheet" /
6
+ script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
7
+ script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"
8
+ style type="text/scss"
9
+ cdata:
10
+ | \.form {
11
+ | max-width: 650px;
12
+ | margin: auto;
13
+ | }
14
+
15
+ | \.btn {
16
+ | margin-bottom: 20px;
17
+ | margin-top: 20px;
18
+ | }
19
+ body.blue-grey
20
+ .row.form
21
+ .col.s12
22
+ .card.hoverable
23
+ .card-content
24
+ span.card-title.center
25
+ | Hello #{@resource.email}!
26
+ div
27
+ .center
28
+ p
29
+ | Someone has requested a link to change your password. You can
30
+ | do this through the link below.
31
+ | \= link_to 'Change my Password', class: 'btn waves-effect cyan',
32
+ | edit_password_url(@resource, reset_password_token: @token)
33
+ p If you didn't request this, please ignore this email.
34
+ p
35
+ | \%p
36
+ | Your password won't change until you access the link above and
37
+ | create a new one.
38
+
@@ -0,0 +1,35 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta content=("text/html; charset=utf-8") http-equiv="Content-Type" /
5
+ link href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/css/materialize.min.css" rel="stylesheet" /
6
+ script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"
7
+ script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.98.0/js/materialize.min.js"
8
+ style type="text/scss"
9
+ cdata:
10
+ | \.form {
11
+ | max-width: 650px;
12
+ | margin: auto;
13
+ | }
14
+
15
+ | \.btn {
16
+ | margin-bottom: 20px;
17
+ | margin-top: 20px;
18
+ | }
19
+ body.blue-grey
20
+ .row.form
21
+ .col.s12
22
+ .card.hoverable
23
+ .card-content
24
+ span.card-title.center
25
+ | Hello #{@resource.email}!
26
+ div
27
+ .center
28
+ p
29
+ | Your account has been locked due to an excessive number of
30
+ | unsuccessful sign in attempts.
31
+ p
32
+ | Click the link below to unlock your account:
33
+ | \#{link_to 'Unlock my Account', class: 'btn waves-effect cyan',
34
+ unlock_url(@resource, unlock_token: @token)}
35
+
@@ -0,0 +1,23 @@
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center Change your Password
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ | url: password_path(resource_name), html: { method: :put } do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.hidden_field :reset_password_token
15
+ = f.input :password, autofocus: true, required: true, autocomplete: false,
16
+ | hint: "\#{@minimum_password_length} Characters Minimum"
17
+ | \#{f.input :password_confirmation, autofocus: true, required: true,}
18
+ | autocomplete: false
19
+ .form-actions.center
20
+ = f.button :submit, "Change my Password"
21
+ .card-action
22
+ .devise-links
23
+ = render "<%= namespace.downcase %>/shared/links"
@@ -0,0 +1,20 @@
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center Forgot your Password?
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ | url: password_path(resource_name), html: { method: :post } do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, autofocus: true, required: true
15
+ .form-actions.center
16
+ = f.button :submit, "Send Me Reset Instructions"
17
+ .card-action
18
+ .devise-links
19
+ = render "<%= namespace.downcase %>/shared/links"
20
+
@@ -0,0 +1,30 @@
1
+ .row.login-form
2
+ .col.s12.offset-m3
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center
6
+ | Edit
7
+ | \#{resource_name.to_s.humanize}
8
+ .divider
9
+ = simple_form_for resource, as: resource_name,
10
+ | url: registration_path(resource_name), html: { method: :put } do |f|
11
+ - if devise_error_messages? || alert || (devise_mapping.confirmable? && resource.pending_reconfirmation?)
12
+ .form-errors.red.lighten-1
13
+ = devise_error_messages!
14
+ = alert
15
+ | Currently waiting confirmation for:
16
+ | \#{resource.unconfirmed_email}
17
+ .form-inputs.row
18
+ = f.input :email, autofocus: true
19
+ = f.input :password,
20
+ | label: "Password (Leave Blank if you don't want to change it)",
21
+ | autocomplete: "off",
22
+ | hint: "\#{@minimum_password_length} Characters Minimum"
23
+ | \#{f.input :password_confirmation, autocomplete: "off"}
24
+ | \#{f.input :current_password, autocomplete: "off",}
25
+ | hint: "we need your current password to confirm your changes"
26
+ .form-actions.center
27
+ = f.button :submit, "Update"
28
+ .card-action.center
29
+ = render "<%= namespace.downcase %>/shared/links"
30
+
@@ -0,0 +1,24 @@
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center Sign Up
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ | url: registration_path(resource_name) do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, autofocus: true, required: true
15
+ = f.input :password, autocomplete: "off", required: true, icon: "lock",
16
+ | label_html: { data: { hint: "\#{@minimum_password_length} Characters Minimum" } }
17
+ | \#{f.input :password_confirmation, autocomplete: "off", required: true,}
18
+ | icon: "lock"
19
+ .form-actions.center
20
+ = f.button :submit, "Sign Up"
21
+ .card-action
22
+ .devise-links
23
+ = render "<%= namespace.downcase %>/shared/links"
24
+
@@ -0,0 +1,23 @@
1
+ .row.login-form
2
+ .col.s12
3
+ .card.hoverable
4
+ .card-content
5
+ span.card-title.center Log In
6
+ .divider
7
+ = simple_form_for resource, as: resource_name,
8
+ | url: session_path(resource_name) do |f|
9
+ - if devise_error_messages? || alert
10
+ .form-errors.red.lighten-1
11
+ = devise_error_messages!
12
+ = alert
13
+ .form-inputs.row
14
+ = f.input :email, required: true, autofocus: true
15
+ = f.input :password, required: true, autocomplete: "off", icon: "lock",
16
+ | hint: false
17
+ | \#{f.input :remember_me, as: :boolean if devise_mapping.rememberable?}
18
+ .form-actions.center
19
+ = f.button :submit, "Log In"
20
+ .card-action
21
+ .devise-links
22
+ = render "<%= namespace.downcase %>/shared/links"
23
+
@@ -0,0 +1,29 @@
1
+ - if controller_name != 'sessions' && !current_user.present?
2
+ | Already a Member?
3
+ | \#{link_to "Log In", new_session_path(resource_name)}
4
+ br/
5
+ - if devise_mapping.registerable? && controller_name != 'registrations'
6
+ | Not A Member?
7
+ | \#{link_to "Sign Up", new_registration_path(resource_name)}
8
+ br/
9
+ - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
10
+ | Forgot
11
+ | \#{link_to "Password?", new_password_path(resource_name)}
12
+ br/
13
+ - if devise_mapping.confirmable? && controller_name != 'confirmations'
14
+ = link_to "Didn't Receive Confirmation Instructions?",
15
+ | new_confirmation_path(resource_name)
16
+ br/
17
+ - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
18
+ = link_to "Didn't Receive Unlock Instructions?",
19
+ | new_unlock_path(resource_name)
20
+ br/
21
+ - if devise_mapping.omniauthable?
22
+ - resource_class.omniauth_providers.each do |provider|
23
+ = link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}",
24
+ | omniauth_authorize_path(resource_name, provider)
25
+ - if controller_name == 'registrations' && current_user.present?
26
+ = link_to "Cancel My Account", registration_path(resource_name),
27
+ | data: { confirm: "Are You Sure you want to Delete Your Account?",
28
+ | method: :delete }, class: "btn waves-effect red"
29
+