devise-tailwinded 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +12 -0
- data/.rspec +3 -0
- data/.travis.yml +7 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/app/.DS_Store +0 -0
- data/app/views/.DS_Store +0 -0
- data/app/views/devise/confirmations/new.html.erb +23 -0
- data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/devise/mailer/email_changed.html.erb +7 -0
- data/app/views/devise/mailer/password_change.html.erb +3 -0
- data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/devise/passwords/edit.html.erb +31 -0
- data/app/views/devise/passwords/new.html.erb +23 -0
- data/app/views/devise/registrations/edit.html.erb +56 -0
- data/app/views/devise/registrations/new.html.erb +34 -0
- data/app/views/devise/sessions/new.html.erb +25 -0
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +28 -0
- data/app/views/devise/unlocks/new.html.erb +24 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/devise-tailwinded.gemspec +42 -0
- data/lib/devise/generators/tailwinded_generator.rb +15 -0
- data/lib/devise/tailwinded.rb +9 -0
- data/lib/devise/tailwinded/version.rb +5 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3b9023d85fc2fc706ecf8385d28ec86f9ccbbd958d8f98888b2f934b2a7f2ee0
|
4
|
+
data.tar.gz: 48fb1f4727480c71777b39c2b3cb65119eb68f7e4e90ac93b1d7cb5181d63a32
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8c968395c3c33d7e9082183dac30dfbab448cea5f0ab2252cd0a877bf3f8f7d1f9eb8830dda4b4e957e540b64302afa65937720a21da7c1f0010b24298e40b09
|
7
|
+
data.tar.gz: 65f52e664a59d157e0ee83e8ac5f335ce1f8af3c150230a096712a285acd77cb1288caa5ddb48945abf4e84bbcef58de70c420cbf0911f5f58ec990afbbdf9e6
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team at david.esmale@gmail.com. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [http://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: http://contributor-covenant.org
|
74
|
+
[version]: http://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2020 David Hill
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Devise::Tailwinded
|
2
|
+
|
3
|
+
Based on the Devise Bootstrapped gem (https://github.com/king601/devise-bootstrapped), this gem tries to give you a nicer place to start with your Devise-based views when using Tailwind CSS.
|
4
|
+
|
5
|
+
All you need to do is run `rails g devise:views:tailwinded` instead of the normal devise:views.
|
6
|
+
|
7
|
+
If you want to switch back to the basic Devise views, just remove the devise views folder and run the normal Devise generator command.
|
8
|
+
|
9
|
+
## Installation
|
10
|
+
|
11
|
+
Add this line to your application's Gemfile:
|
12
|
+
|
13
|
+
```ruby
|
14
|
+
gem 'devise-tailwinded'
|
15
|
+
```
|
16
|
+
|
17
|
+
And then execute:
|
18
|
+
|
19
|
+
$ bundle
|
20
|
+
|
21
|
+
Or install it yourself as:
|
22
|
+
|
23
|
+
$ gem install devise-tailwinded
|
24
|
+
|
25
|
+
You will also need to have Tailwind CSS installed and set up in your application for this gem to have the desired effect.
|
26
|
+
|
27
|
+
## Contributing
|
28
|
+
|
29
|
+
Bug reports and pull requests are welcome. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
30
|
+
|
31
|
+
## License
|
32
|
+
|
33
|
+
The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
|
34
|
+
|
35
|
+
## Code of Conduct
|
36
|
+
|
37
|
+
Everyone interacting in the Devise::Tailwinded project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/esmale/devise-tailwinded/blob/master/CODE_OF_CONDUCT.md).
|
data/Rakefile
ADDED
data/app/.DS_Store
ADDED
Binary file
|
data/app/views/.DS_Store
ADDED
Binary file
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post, class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4' }) do |f| %>
|
3
|
+
<h2 class="text-center">Resend confirmation instructions</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="mb-4">
|
12
|
+
<%= f.label :email, "Email", class: label_classes %>
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes,
|
14
|
+
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<div class="flex items-center justify-between content-end">
|
18
|
+
<%= f.submit "Resend confirmation instructions",
|
19
|
+
class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6rounded focus:outline-none focus:shadow-outline" %>
|
20
|
+
<%= render "devise/shared/links" %>
|
21
|
+
</div>
|
22
|
+
<% end %>
|
23
|
+
</div>
|
@@ -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,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,31 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put, class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4' }) do |f| %>
|
3
|
+
<h2 class="text-center">Change your password</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<%
|
8
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
9
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
10
|
+
%>
|
11
|
+
|
12
|
+
<div class="mb-4">
|
13
|
+
<%= f.label :password, "New password", class: label_classes %>
|
14
|
+
<% if @minimum_password_length %>
|
15
|
+
<em class="block text-sm font-normal mb-2 text-gray-900">(<%= @minimum_password_length %> characters minimum)</em>
|
16
|
+
<% end %>
|
17
|
+
<%= f.password_field :password, autofocus: true, autocomplete: "new-password", class: input_classes %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="mb-4">
|
21
|
+
<%= f.label :password_confirmation, "Confirm new password", class: label_classes %>
|
22
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: input_classes %>
|
23
|
+
</div>
|
24
|
+
|
25
|
+
<div class="flex items-center justify-between content-end">
|
26
|
+
<%= f.submit "Change my password", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
27
|
+
<%= render "devise/shared/links" %>
|
28
|
+
</div>
|
29
|
+
<% end %>
|
30
|
+
</div>
|
31
|
+
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post, class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4' }) do |f| %>
|
3
|
+
<h2 class="text-center">Forgot your password?</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="mb-4">
|
12
|
+
<%= f.label :email, "Email", class: label_classes %>
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="flex items-center justify-between content-end">
|
17
|
+
<%= f.submit "Send me reset password instructions",
|
18
|
+
class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
19
|
+
<%= render "devise/shared/links" %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
</div>
|
23
|
+
|
@@ -0,0 +1,56 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4' }) do |f| %>
|
3
|
+
<h2 class="text-center">Edit <%= resource_name.to_s.humanize %></h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="mb-4">
|
12
|
+
<%= f.label :email, "Email", class: label_classes %>
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
17
|
+
<div class="block text-sm font-normal mb-2 text-gray-500">Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
18
|
+
<% end %>
|
19
|
+
|
20
|
+
<div class="mb-4">
|
21
|
+
<%= f.label :password, "Password", class: label_classes %>
|
22
|
+
<i class="block text-sm font-normal mb-2 text-gray-900">(leave blank if you don't want to change it)</i>
|
23
|
+
<%= f.password_field :password, autocomplete: "new-password", class: input_classes %>
|
24
|
+
<% if @minimum_password_length %>
|
25
|
+
<em class="block text-sm font-normal mb-2 text-gray-900"><%= @minimum_password_length %> characters minimum</em>
|
26
|
+
<% end %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="mb-4">
|
30
|
+
<%= f.label :password_confirmation, "Confirm Password", class: label_classes %>
|
31
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: input_classes %>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div class="mb-4">
|
35
|
+
<%= f.label :current_password, "Current Password", class: label_classes %>
|
36
|
+
<i class="block text-sm font-normal mb-2 text-gray-900">(we need your current password to confirm your changes)</i>
|
37
|
+
<%= f.password_field :current_password, autocomplete: "current-password", class: input_classes %>
|
38
|
+
</div>
|
39
|
+
|
40
|
+
<div class="flex items-center justify-between content-end">
|
41
|
+
<%= f.submit "Update", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
42
|
+
<%= link_to "Back", :back, class: "font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline border border-gray-500" %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
</div>
|
46
|
+
|
47
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
48
|
+
<div class="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4">
|
49
|
+
<h3 class="text-center">Cancel my account</h3>
|
50
|
+
|
51
|
+
<div class="mb-4">
|
52
|
+
Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), data: { confirm: "Are you sure?" }, method: :delete, class: "bg-red-700 hover:bg-red-900 text-white font-bold py-2 px-4 rounded focus:outline-none focus:shadow-outline" %>
|
53
|
+
</div>
|
54
|
+
</div>
|
55
|
+
</div>
|
56
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4'}) do |f| %>
|
3
|
+
<h2>Register</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="mb-4">
|
12
|
+
<%= f.label :email, "Email", class: label_classes %>
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="mb-4">
|
17
|
+
<%= f.label :password, "Password", class: label_classes %>
|
18
|
+
<% if @minimum_password_length %>
|
19
|
+
<em class="block text-sm font-normal mb-2 text-gray-900">(<%= @minimum_password_length %> characters minimum)</em>
|
20
|
+
<% end %>
|
21
|
+
<%= f.password_field :password, autocomplete: "new-password", class: input_classes %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="mb-4">
|
25
|
+
<%= f.label :password_confirmation, "Confirm password", class: label_classes %>
|
26
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: input_classes %>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="flex items-center justify-between content-end">
|
30
|
+
<%= f.submit "Register", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
31
|
+
<%= render "devise/shared/links" %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name), html: { class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4'}) do |f| %>
|
3
|
+
<h2 class="text-center">Log in</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
<div class="mb-4">
|
11
|
+
<%= f.label :email, "Email", class: label_classes %>
|
12
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes %>
|
13
|
+
</div>
|
14
|
+
|
15
|
+
<div class="mb-4">
|
16
|
+
<%= f.label :password, "Password", class: label_classes %>
|
17
|
+
<%= f.password_field :password, autocomplete: "current-password", class: input_classes %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="flex items-center justify-between content-end">
|
21
|
+
<%= f.submit "Log in", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
22
|
+
<%= render "devise/shared/links" %>
|
23
|
+
</div>
|
24
|
+
<% end %>
|
25
|
+
</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,28 @@
|
|
1
|
+
<div>
|
2
|
+
<% css_classes = "inline-block align-baseline font-bold text-sm text-blue-500 hover:text-blue-800" %>
|
3
|
+
<%- if controller_name != 'sessions' %>
|
4
|
+
<%= link_to "Log in", new_session_path(resource_name), class: css_classes %>
|
5
|
+
<% end %>
|
6
|
+
|
7
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
8
|
+
<%= link_to "Register", new_registration_path(resource_name), class: css_classes %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
12
|
+
<%= link_to "Forgot password?", new_password_path(resource_name), class: css_classes %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
16
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name), class: css_classes %>
|
17
|
+
<% end %>
|
18
|
+
|
19
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
20
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name), class: css_classes %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<%- if devise_mapping.omniauthable? %>
|
24
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
25
|
+
<%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider) %>
|
26
|
+
<% end %>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="h-full w-full max-w-xs mx-auto align-middle">
|
2
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post, class: 'bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4' }) do |f| %>
|
3
|
+
<h2 class="text-center">Resend unlock instructions</h2>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%
|
7
|
+
label_classes = "block text-sm font-bold mb-2 #{alert ? "text-red-500" : "text-gray-700"}"
|
8
|
+
input_classes = "shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline #{alert ? "border-red-500" : nil}"
|
9
|
+
%>
|
10
|
+
|
11
|
+
<div class="mb-4">
|
12
|
+
<%= f.label :email, "Email", class: label_classes %>
|
13
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: input_classes %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<div class="mb-4">
|
17
|
+
<%= f.submit "Resend unlock instructions", class: "bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 mr-6 rounded focus:outline-none focus:shadow-outline" %>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="mb-4">
|
21
|
+
<%= render "devise/shared/links" %>
|
22
|
+
</div>
|
23
|
+
<% end %>
|
24
|
+
</div>
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "devise/tailwinded"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
@@ -0,0 +1,42 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "devise/tailwinded/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "devise-tailwinded"
|
8
|
+
spec.version = Devise::Tailwinded::VERSION
|
9
|
+
spec.authors = ["David Hill"]
|
10
|
+
spec.email = ["david.esmale@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Generates nicer views for Devise that use Tailwind}
|
13
|
+
spec.description = %q{Generates nicer default views styled with Tailwind CSS so you have a bit of a better starting point for your app.}
|
14
|
+
spec.homepage = "https://github.com/esmale/devise-tailwinded"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
18
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
19
|
+
if spec.respond_to?(:metadata)
|
20
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
21
|
+
|
22
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
23
|
+
spec.metadata["source_code_uri"] = "https://github.com/esmale/devise-tailwinded"
|
24
|
+
spec.metadata["changelog_uri"] = "https://github.com/esmale/devise-tailwinded"
|
25
|
+
else
|
26
|
+
raise "RubyGems 2.0 or newer is required to protect against " \
|
27
|
+
"public gem pushes."
|
28
|
+
end
|
29
|
+
|
30
|
+
# Specify which files should be added to the gem when it is released.
|
31
|
+
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
32
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
33
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
end
|
35
|
+
spec.bindir = "exe"
|
36
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
37
|
+
spec.require_paths = ["lib"]
|
38
|
+
|
39
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
40
|
+
spec.add_development_dependency "rake", "~> 12.3.3"
|
41
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
42
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require 'rails/generators'
|
2
|
+
|
3
|
+
module Devise
|
4
|
+
module Views
|
5
|
+
class TailwindedGenerator < Rails::Generators::Base
|
6
|
+
desc "Copies views styled for TailwindCSS"
|
7
|
+
|
8
|
+
source_root File.expand_path("../../../..", __FILE__)
|
9
|
+
|
10
|
+
def copy_views
|
11
|
+
directory "app/views/devise", "app/views/devise"
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: devise-tailwinded
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- David Hill
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2020-04-10 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '2.0'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '2.0'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: 12.3.3
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: 12.3.3
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: Generates nicer default views styled with Tailwind CSS so you have a
|
56
|
+
bit of a better starting point for your app.
|
57
|
+
email:
|
58
|
+
- david.esmale@gmail.com
|
59
|
+
executables: []
|
60
|
+
extensions: []
|
61
|
+
extra_rdoc_files: []
|
62
|
+
files:
|
63
|
+
- ".gitignore"
|
64
|
+
- ".rspec"
|
65
|
+
- ".travis.yml"
|
66
|
+
- CODE_OF_CONDUCT.md
|
67
|
+
- Gemfile
|
68
|
+
- LICENSE.txt
|
69
|
+
- README.md
|
70
|
+
- Rakefile
|
71
|
+
- app/.DS_Store
|
72
|
+
- app/views/.DS_Store
|
73
|
+
- app/views/devise/confirmations/new.html.erb
|
74
|
+
- app/views/devise/mailer/confirmation_instructions.html.erb
|
75
|
+
- app/views/devise/mailer/email_changed.html.erb
|
76
|
+
- app/views/devise/mailer/password_change.html.erb
|
77
|
+
- app/views/devise/mailer/reset_password_instructions.html.erb
|
78
|
+
- app/views/devise/mailer/unlock_instructions.html.erb
|
79
|
+
- app/views/devise/passwords/edit.html.erb
|
80
|
+
- app/views/devise/passwords/new.html.erb
|
81
|
+
- app/views/devise/registrations/edit.html.erb
|
82
|
+
- app/views/devise/registrations/new.html.erb
|
83
|
+
- app/views/devise/sessions/new.html.erb
|
84
|
+
- app/views/devise/shared/_error_messages.html.erb
|
85
|
+
- app/views/devise/shared/_links.html.erb
|
86
|
+
- app/views/devise/unlocks/new.html.erb
|
87
|
+
- bin/console
|
88
|
+
- bin/setup
|
89
|
+
- devise-tailwinded.gemspec
|
90
|
+
- lib/devise/generators/tailwinded_generator.rb
|
91
|
+
- lib/devise/tailwinded.rb
|
92
|
+
- lib/devise/tailwinded/version.rb
|
93
|
+
homepage: https://github.com/esmale/devise-tailwinded
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata:
|
97
|
+
allowed_push_host: https://rubygems.org
|
98
|
+
homepage_uri: https://github.com/esmale/devise-tailwinded
|
99
|
+
source_code_uri: https://github.com/esmale/devise-tailwinded
|
100
|
+
changelog_uri: https://github.com/esmale/devise-tailwinded
|
101
|
+
post_install_message:
|
102
|
+
rdoc_options: []
|
103
|
+
require_paths:
|
104
|
+
- lib
|
105
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
106
|
+
requirements:
|
107
|
+
- - ">="
|
108
|
+
- !ruby/object:Gem::Version
|
109
|
+
version: '0'
|
110
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
+
requirements:
|
112
|
+
- - ">="
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
requirements: []
|
116
|
+
rubygems_version: 3.0.1
|
117
|
+
signing_key:
|
118
|
+
specification_version: 4
|
119
|
+
summary: Generates nicer views for Devise that use Tailwind
|
120
|
+
test_files: []
|