tailwind_devise 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: dbd819519e2533b45a0403d97f295bbbc2d677fe735e423ca56c6b92ecd437a7
4
+ data.tar.gz: 99e8ca28300c21ff1e351a83b69be3e782e7dbfdfbafd2aa64be485e88b6b4bc
5
+ SHA512:
6
+ metadata.gz: 77962bf0a9ee75e060013d0f9bf73afa340088437ca1f7adbca7197d959a753a3508d9abae188fe465d6895cb5120d1aa47ae9d922d4aafc14ee07c50cb3518e
7
+ data.tar.gz: 50cae3749fc4cffa330d625cc4d1f90d9d93439b787b14d8c687a0f9ee1bb5a09b4f098ac415886a25afb5e06d5311de19ba46e99bc0fe6d22a6f4c8c6120d33
@@ -0,0 +1,16 @@
1
+ <h2>Resend confirmation instructions</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Resend confirmation instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -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,25 @@
1
+ <h2>Change your password</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+ <%= f.hidden_field :reset_password_token %>
6
+
7
+ <div class="field">
8
+ <%= f.label :password, "New password" %><br />
9
+ <% if @minimum_password_length %>
10
+ <em>(<%= @minimum_password_length %> characters minimum)</em><br />
11
+ <% end %>
12
+ <%= f.password_field :password, autofocus: true, autocomplete: "new-password" %>
13
+ </div>
14
+
15
+ <div class="field">
16
+ <%= f.label :password_confirmation, "Confirm new password" %><br />
17
+ <%= f.password_field :password_confirmation, autocomplete: "new-password" %>
18
+ </div>
19
+
20
+ <div class="actions">
21
+ <%= f.submit "Change my password" %>
22
+ </div>
23
+ <% end %>
24
+
25
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,24 @@
1
+ <div class="w-full min-h-[100vh]">
2
+ <div class="max-w-xl w-full mx-auto shadow-lg bg-gray-200 rounded-lg py-8">
3
+ <h2 class="text-xl mb-4 text-center">Forgot your password?</h2>
4
+
5
+ <div class="w-3/4 mx-auto">
6
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
7
+ <%= render "devise/shared/error_messages", resource: resource %>
8
+
9
+ <div class="field mb-4">
10
+ <%= f.label :email, class: "mb-2 text-lg" %><br />
11
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "w-full rounded-lg bg-gray-50" %>
12
+ </div>
13
+
14
+ <div class="actions w-full">
15
+ <%= f.submit "Send me reset password instructions", class: "bg-blue-500 w-full p-2 text-blue-100 rounded-lg cursor-pointer hover:bg-blue-700 hover:text-blue-300" %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <div class="flex flex-col items-center mt-4 gap-4">
20
+ <%= render "devise/shared/links" %>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </div>
@@ -0,0 +1,48 @@
1
+ <div class="w-full min-h-[100vh]">
2
+ <div class="max-w-xl w-full mx-auto shadow-lg bg-gray-200 rounded-lg py-8">
3
+ <h2 class="text-xl mb-4 text-center">Edit <%= resource_name.to_s.humanize %></h2>
4
+
5
+ <div class="w-3/4 mx-auto">
6
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
7
+ <%= render "devise/shared/error_messages", resource: resource %>
8
+
9
+ <div class="field mb-4">
10
+ <%= f.label :email %><br />
11
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "w-full rounded-lg bg-gray-50" %>
12
+ </div>
13
+
14
+ <% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
15
+ <div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
16
+ <% end %>
17
+
18
+ <div class="field mb-4">
19
+ <%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
20
+ <%= f.password_field :password, autocomplete: "new-password", class: "w-full rounded-lg bg-gray-50" %>
21
+ <% if @minimum_password_length %>
22
+ <br />
23
+ <em><%= @minimum_password_length %> characters minimum</em>
24
+ <% end %>
25
+ </div>
26
+
27
+ <div class="field mb-4">
28
+ <%= f.label :password_confirmation %><br />
29
+ <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "w-full rounded-lg bg-gray-50" %>
30
+ </div>
31
+
32
+ <div class="field mb-4">
33
+ <%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
34
+ <%= f.password_field :current_password, autocomplete: "current-password", class: "w-full rounded-lg bg-gray-50" %>
35
+ </div>
36
+
37
+ <div class="actions">
38
+ <%= f.submit "Update", class: "bg-blue-500 w-full p-2 text-blue-100 rounded-lg cursor-pointer hover:bg-blue-700 hover:text-blue-300" %>
39
+ </div>
40
+ <% end %>
41
+ <br/>
42
+
43
+ <%= link_to "Back", :back, class: "text-lg" %>
44
+
45
+ <div class="flex gap-2 items-center mt-8 mx-auto">Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?", turbo_confirm: "Are you sure?" }, method: :delete, class: "bg-red-500 p-2 rounded-lg text-red-100" %></div>
46
+ </div>
47
+ </div>
48
+ </div>
@@ -0,0 +1,37 @@
1
+ <div class="w-full min-h-[100vh]">
2
+ <div class="max-w-xl w-full mx-auto shadow-lg bg-gray-200 rounded-lg py-8">
3
+ <h2 class="text-xl mb-4 text-center">Sign up</h2>
4
+
5
+ <div class="w-3/4 mx-auto">
6
+ <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
7
+ <%= render "devise/shared/error_messages", resource: resource %>
8
+
9
+ <div class="field mb-4">
10
+ <%= f.label :email, class: "mb-2 text-lg" %><br />
11
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "w-full rounded-lg bg-gray-50" %>
12
+ </div>
13
+
14
+ <div class="field mb-4">
15
+ <%= f.label :password, class: "mb-2 text-lg" %>
16
+ <% if @minimum_password_length %>
17
+ <em>(<%= @minimum_password_length %> characters minimum)</em>
18
+ <% end %><br />
19
+ <%= f.password_field :password, autocomplete: "new-password", class: "w-full rounded-lg bg-gray-50" %>
20
+ </div>
21
+
22
+ <div class="field mb-4">
23
+ <%= f.label :password_confirmation, class: "mb-2 text-lg" %><br />
24
+ <%= f.password_field :password_confirmation, autocomplete: "new-password", class: "w-full rounded-lg bg-gray-50" %>
25
+ </div>
26
+
27
+ <div class="actions">
28
+ <%= f.submit "Sign up", class: "bg-blue-500 w-full p-2 text-blue-100 rounded-lg cursor-pointer hover:bg-blue-700 hover:text-blue-300" %>
29
+ </div>
30
+ <% end %>
31
+
32
+ <div class="flex flex-col items-center mt-4 gap-4">
33
+ <%= render "devise/shared/links" %>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
@@ -0,0 +1,33 @@
1
+ <div class="w-full min-h-[100vh]">
2
+ <div class="max-w-xl w-full mx-auto shadow-lg bg-gray-200 rounded-lg py-8">
3
+ <h2 class="text-xl mb-4 text-center">Log in</h2>
4
+
5
+ <div class="w-3/4 mx-auto">
6
+ <%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
7
+ <div class="field mb-4">
8
+ <%= f.label :email, class: "mb-2 text-lg" %><br />
9
+ <%= f.email_field :email, autofocus: true, autocomplete: "email", class: "w-full rounded-lg bg-gray-50" %>
10
+ </div>
11
+
12
+ <div class="field mb-4">
13
+ <%= f.label :password, class: "mb-2 text-lg" %><br />
14
+ <%= f.password_field :password, autocomplete: "current-password", class: "w-full rounded-lg bg-gray-50" %>
15
+ </div>
16
+
17
+ <% if devise_mapping.rememberable? %>
18
+ <div class="field mb-4">
19
+ <%= f.check_box :remember_me %>
20
+ <%= f.label :remember_me %>
21
+ </div>
22
+ <% end %>
23
+
24
+ <div class="actions w-full">
25
+ <%= f.submit "Log in", class: "bg-blue-500 w-full p-2 text-blue-100 rounded-lg cursor-pointer hover:bg-blue-700 hover:text-blue-300" %>
26
+ </div>
27
+ <% end %>
28
+ <div class="flex flex-col items-center mt-4 gap-4">
29
+ <%= render "devise/shared/links" %>
30
+ </div>
31
+ </div>
32
+ </div>
33
+ </div>
@@ -0,0 +1,15 @@
1
+ <% if resource.errors.any? %>
2
+ <div id="error_explanation" data-turbo-cache="false">
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) %>
3
+ <% end %>
4
+
5
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
6
+ <%= link_to "New here? Create an account now", new_registration_path(resource_name) %>
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) %>
11
+ <% end %>
12
+
13
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
14
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %>
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) %>
19
+ <% end %>
20
+
21
+ <%- if devise_mapping.omniauthable? %>
22
+ <%- resource_class.omniauth_providers.each do |provider| %>
23
+ <%= button_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), data: { turbo: false } %><br />
24
+ <% end %>
25
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= render "devise/shared/error_messages", resource: resource %>
5
+
6
+ <div class="field">
7
+ <%= f.label :email %><br />
8
+ <%= f.email_field :email, autofocus: true, autocomplete: "email" %>
9
+ </div>
10
+
11
+ <div class="actions">
12
+ <%= f.submit "Resend unlock instructions" %>
13
+ </div>
14
+ <% end %>
15
+
16
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,15 @@
1
+ require 'rails/generators/base'
2
+
3
+ module TailwindDevise
4
+ class ViewsGenerator < Rails::Generators::Base
5
+ source_root File.expand_path('templates', __dir__)
6
+ desc "This generator adds the devise views styled with Tailwind CSS"
7
+
8
+ def copy_devise_tailwind_files_to_app
9
+ devise_folder_path = "#{Rails.root}/app/views/devise"
10
+ FileUtils.rm_rf(devise_folder_path)
11
+ FileUtils.mkdir_p(devise_folder_path)
12
+ directory 'devise', devise_folder_path
13
+ end
14
+ end
15
+ end
metadata ADDED
@@ -0,0 +1,99 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tailwind_devise
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Indigo
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: railties
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '6.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '6.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: thor
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: 0.20.0
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.20.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: rails
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '6.0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '6.0'
55
+ description: Pretty sign in & sign up pages with Tailwind CSS
56
+ email: indigo@techtutorials.com
57
+ executables: []
58
+ extensions: []
59
+ extra_rdoc_files: []
60
+ files:
61
+ - lib/generators/tailwind_devise/templates/devise/confirmations/new.html.erb
62
+ - lib/generators/tailwind_devise/templates/devise/mailer/confirmation_instructions.html.erb
63
+ - lib/generators/tailwind_devise/templates/devise/mailer/email_changed.html.erb
64
+ - lib/generators/tailwind_devise/templates/devise/mailer/password_change.html.erb
65
+ - lib/generators/tailwind_devise/templates/devise/mailer/reset_password_instructions.html.erb
66
+ - lib/generators/tailwind_devise/templates/devise/mailer/unlock_instructions.html.erb
67
+ - lib/generators/tailwind_devise/templates/devise/passwords/edit.html.erb
68
+ - lib/generators/tailwind_devise/templates/devise/passwords/new.html.erb
69
+ - lib/generators/tailwind_devise/templates/devise/registrations/edit.html.erb
70
+ - lib/generators/tailwind_devise/templates/devise/registrations/new.html.erb
71
+ - lib/generators/tailwind_devise/templates/devise/sessions/new.html.erb
72
+ - lib/generators/tailwind_devise/templates/devise/shared/_error_messages.html.erb
73
+ - lib/generators/tailwind_devise/templates/devise/shared/_links.html.erb
74
+ - lib/generators/tailwind_devise/templates/devise/unlocks/new.html.erb
75
+ - lib/generators/tailwind_devise/views_generator.rb
76
+ homepage: https://rubygems.org/gems/tailwind_devise
77
+ licenses:
78
+ - MIT
79
+ metadata: {}
80
+ post_install_message:
81
+ rdoc_options: []
82
+ require_paths:
83
+ - lib
84
+ required_ruby_version: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ required_rubygems_version: !ruby/object:Gem::Requirement
90
+ requirements:
91
+ - - ">="
92
+ - !ruby/object:Gem::Version
93
+ version: '0'
94
+ requirements: []
95
+ rubygems_version: 3.4.10
96
+ signing_key:
97
+ specification_version: 4
98
+ summary: Creates pretty sign in/signup views for devise
99
+ test_files: []