devise-bootstrap5 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +21 -0
- data/README.md +52 -0
- data/app/views/devise/confirmations/new.html.erb +20 -0
- data/app/views/devise/passwords/edit.html.erb +31 -0
- data/app/views/devise/passwords/new.html.erb +20 -0
- data/app/views/devise/registrations/edit.html.erb +50 -0
- data/app/views/devise/registrations/new.html.erb +36 -0
- data/app/views/devise/sessions/new.html.erb +30 -0
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +20 -0
- data/lib/devise-bootstrap5.rb +6 -0
- data/lib/generators/devise/views/bootstrap_generator.rb +11 -0
- data/lib/version.rb +5 -0
- metadata +59 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 8caf62078c9e664e1c6aef90147c3233a02cc3bc2d8b046693751842d6116d7c
|
4
|
+
data.tar.gz: 1111c79244923ccb53309866644d185b73a3cbbf8489674ae02b51882d0b93b5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d845429e4e72acbdea84bbf653a991a2123bf2882ec241ba2a95a81c22077aabc8a0dd6305ab2071574cb097050394dc312da7fe0f7fdba5afc50213af7a87c8
|
7
|
+
data.tar.gz: 5eb532198444d52963ab6eaddf7b75df376cda9a74791dd7b1450334bc427856b4e1cd25bc270911603ffc9fbc48469d2f6d2410126d05d9078f16917c6f7c98
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2021 Pedro Kroger
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
Add to your `Gemfile`
|
2
|
+
|
3
|
+
gem "devise"
|
4
|
+
gem "devise-i18n"
|
5
|
+
gem "devise-bootstrap"
|
6
|
+
|
7
|
+
You don't need to copy the views
|
8
|
+
|
9
|
+
devise:views:bootstrap
|
10
|
+
|
11
|
+
rails generate devise:views -v mailer
|
12
|
+
rm -rf app/views/devise/shared
|
13
|
+
|
14
|
+
or
|
15
|
+
|
16
|
+
rails generate devise:i18n:views -v mailer
|
17
|
+
|
18
|
+
# Devise::Bootstrap
|
19
|
+
|
20
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/devise/bootstrap`. To experiment with that code, run `bin/console` for an interactive prompt.
|
21
|
+
|
22
|
+
TODO: Delete this and the text above, and describe your gem
|
23
|
+
|
24
|
+
## Installation
|
25
|
+
|
26
|
+
Add this line to your application's Gemfile:
|
27
|
+
|
28
|
+
```ruby
|
29
|
+
gem 'devise-bootstrap'
|
30
|
+
```
|
31
|
+
|
32
|
+
And then execute:
|
33
|
+
|
34
|
+
$ bundle install
|
35
|
+
|
36
|
+
Or install it yourself as:
|
37
|
+
|
38
|
+
$ gem install devise-bootstrap
|
39
|
+
|
40
|
+
## Usage
|
41
|
+
|
42
|
+
TODO: Write usage instructions here
|
43
|
+
|
44
|
+
## Development
|
45
|
+
|
46
|
+
After checking out the repo, run `bin/setup` to install dependencies. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
47
|
+
|
48
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
49
|
+
|
50
|
+
## Contributing
|
51
|
+
|
52
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/devise-bootstrap.
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.resend_confirmation_instructions') %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
6
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
|
+
|
8
|
+
<div class="mb-3">
|
9
|
+
<%= f.label :email, class: "form-label" %>
|
10
|
+
<%= f.email_field :email, autofocus: true, autocomplete: 'email', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email), class: 'form-control' %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="mb-3">
|
14
|
+
<%= f.submit t('.resend_confirmation_instructions'), class: 'btn btn-primary' %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render "devise/shared/links" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
|
4
|
+
<h2 class="pb-4"><%= t('.change_your_password') %></h2>
|
5
|
+
|
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="mb-3">
|
11
|
+
<%= f.label :password, t('.new_password'), class: 'form-label' %>
|
12
|
+
<%= f.password_field :password, autofocus: true, class: 'form-control' %>
|
13
|
+
|
14
|
+
<% if @minimum_password_length %>
|
15
|
+
<div class="form-text"><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></div>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
|
19
|
+
<div class="mb-4">
|
20
|
+
<%= f.label :password_confirmation, t('.confirm_new_password'), class: 'form-label' %>
|
21
|
+
<%= f.password_field :password_confirmation, autocomplete: 'off', class: 'form-control' %>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="mb-4">
|
25
|
+
<%= f.submit t('.change_my_password'), class: 'btn btn-primary' %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
|
29
|
+
<%= render "devise/shared/links" %>
|
30
|
+
</div>
|
31
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.forgot_your_password') %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
6
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
|
+
|
8
|
+
<div class="mb-4">
|
9
|
+
<%= f.label :email, class: "form-label" %>
|
10
|
+
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="mb-4">
|
14
|
+
<%= f.submit t('.send_me_reset_password_instructions'), class: 'btn btn-primary' %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render "devise/shared/links" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,50 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.title', resource: resource.model_name.human) %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
6
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
|
+
|
8
|
+
<div class="mb-3">
|
9
|
+
<%= f.label :email, class: 'form-label' %>
|
10
|
+
<%= f.email_field :email, autocomplete: 'email', class: 'form-control' %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
14
|
+
<div><%= t('.currently_waiting_confirmation_for_email', email: resource.unconfirmed_email) %></div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<div class="mb-3">
|
18
|
+
<%= f.label :current_password, class: 'form-label' %>
|
19
|
+
<%= f.password_field :current_password, autocomplete: 'current-password', class: 'form-control' %>
|
20
|
+
|
21
|
+
<div class="form-text"><%= t('.we_need_your_current_password_to_confirm_your_changes') %></div>
|
22
|
+
</div>
|
23
|
+
|
24
|
+
<div class="row mb-5 mt-5">
|
25
|
+
<h4><%= t('devise.passwords.edit.change_your_password') %></h4>
|
26
|
+
<div class="form-text mb-3"><%= t('.leave_blank_if_you_don_t_want_to_change_it') %></div>
|
27
|
+
|
28
|
+
<div class="col">
|
29
|
+
<%= f.label :password, t('devise.passwords.edit.new_password'), class: 'form-label' %>
|
30
|
+
<%= f.password_field :password, autocomplete: 'new-password', class: 'form-control' %>
|
31
|
+
<% if @minimum_password_length %>
|
32
|
+
<div class="form-text"><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></div>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
<div class="col">
|
36
|
+
<%= f.label :password_confirmation, t('devise.passwords.edit.confirm_new_password'), class: 'form-label' %>
|
37
|
+
<%= f.password_field :password_confirmation, autocomplete: 'new-password', class: 'form-control' %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<div class="mb-3">
|
42
|
+
<%= f.submit t('.update'), class: 'btn btn-primary' %>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<p>
|
47
|
+
<%= link_to t('.cancel_my_account'), registration_path(resource_name), data: { confirm: t('.are_you_sure') }, method: :delete %>.
|
48
|
+
</p>
|
49
|
+
</div>
|
50
|
+
</div>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.sign_up') %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
6
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
|
+
|
8
|
+
<div class="mb-3">
|
9
|
+
<%= f.label :email, class: "form-label" %>
|
10
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control' %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="row mb-4">
|
14
|
+
<div class="col">
|
15
|
+
<%= f.label :password, class: "form-label" %>
|
16
|
+
<%= f.password_field :password, autocomplete: "new-password", class: 'form-control' %>
|
17
|
+
|
18
|
+
<% if @minimum_password_length %>
|
19
|
+
<div class="form-text"><%= t('devise.shared.minimum_password_length', count: @minimum_password_length) %></div>
|
20
|
+
<% end %>
|
21
|
+
</div>
|
22
|
+
|
23
|
+
<div class="col">
|
24
|
+
<%= f.label :password_confirmation, class: "form-label" %>
|
25
|
+
<%= f.password_field :password_confirmation, autocomplete: "new-password", class: 'form-control' %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
|
29
|
+
<div class="mb-3">
|
30
|
+
<%= f.submit t('.sign_up'), class: 'btn btn-primary' %>
|
31
|
+
</div>
|
32
|
+
<% end %>
|
33
|
+
|
34
|
+
<%= render "devise/shared/links" %>
|
35
|
+
</div>
|
36
|
+
</div>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.sign_in') %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
6
|
+
<div class="mb-3">
|
7
|
+
<%= f.label :email, class: "form-label" %>
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email", class: 'form-control' %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="mb-3">
|
12
|
+
<%= f.label :password, class: "form-label" %>
|
13
|
+
<%= f.password_field :password, autocomplete: "current-password", class: 'form-control' %>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<% if devise_mapping.rememberable? %>
|
17
|
+
<div class="mb-3 form-check">
|
18
|
+
<%= f.check_box :remember_me, class: 'form-check-input' %>
|
19
|
+
<%= f.label :remember_me, class: 'form-check-label' %>
|
20
|
+
</div>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<div class="mb-4 mt-4">
|
24
|
+
<%= f.submit t('.sign_in'), class: "btn btn-primary" %>
|
25
|
+
</div>
|
26
|
+
<% end %>
|
27
|
+
|
28
|
+
<%= render "devise/shared/links" %>
|
29
|
+
</div>
|
30
|
+
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if resource.errors.any? %>
|
2
|
+
<div class="alert alert-danger">
|
3
|
+
<h4 class="alert-heading">
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
5
|
+
count: resource.errors.count,
|
6
|
+
resource: resource.class.model_name.human.downcase)
|
7
|
+
%>
|
8
|
+
</h4>
|
9
|
+
<ul class="mb-0">
|
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 t(".sign_in"), new_session_path(resource_name) %><br />
|
3
|
+
<% end %>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to t(".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 t(".forgot_your_password"), new_password_path(resource_name) %><br />
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to t('.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 t('.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 t('.sign_in_with_provider', provider: OmniAuth::Utils.camelize(provider)), omniauth_authorize_path(resource_name, provider), method: :post %><br />
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="row">
|
2
|
+
<div class="col-md-6">
|
3
|
+
<h2 class="pb-4"><%= t('.resend_unlock_instructions') %></h2>
|
4
|
+
|
5
|
+
<%= form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
6
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
|
+
|
8
|
+
<div class="mb-3">
|
9
|
+
<%= f.label :email, class: "form-label" %>
|
10
|
+
<%= f.email_field :email, autofocus: true, autocomplete: 'email', class: 'form-control' %>
|
11
|
+
</div>
|
12
|
+
|
13
|
+
<div class="mb-3">
|
14
|
+
<%= f.submit t('.resend_unlock_instructions'), class: 'btn btn-primary'%>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<%= render "devise/shared/links" %>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
module Devise
|
2
|
+
module Views
|
3
|
+
class BootstrapGenerator < Rails::Generators::Base
|
4
|
+
source_root File.expand_path('../../../../../app/views', __FILE__)
|
5
|
+
|
6
|
+
def copy_views
|
7
|
+
directory('devise', Rails.root.join('app', 'views', 'devise'))
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
data/lib/version.rb
ADDED
metadata
ADDED
@@ -0,0 +1,59 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: devise-bootstrap5
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Pedro Kroger
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2021-07-27 00:00:00.000000000 Z
|
12
|
+
dependencies: []
|
13
|
+
description: Devise views with Bootstrap 5 and i18n support for Rails 6 and above.
|
14
|
+
email:
|
15
|
+
- kroger@pedrokroger.net
|
16
|
+
executables: []
|
17
|
+
extensions: []
|
18
|
+
extra_rdoc_files: []
|
19
|
+
files:
|
20
|
+
- LICENSE
|
21
|
+
- README.md
|
22
|
+
- app/views/devise/confirmations/new.html.erb
|
23
|
+
- app/views/devise/passwords/edit.html.erb
|
24
|
+
- app/views/devise/passwords/new.html.erb
|
25
|
+
- app/views/devise/registrations/edit.html.erb
|
26
|
+
- app/views/devise/registrations/new.html.erb
|
27
|
+
- app/views/devise/sessions/new.html.erb
|
28
|
+
- app/views/devise/shared/_error_messages.html.erb
|
29
|
+
- app/views/devise/shared/_links.html.erb
|
30
|
+
- app/views/devise/unlocks/new.html.erb
|
31
|
+
- lib/devise-bootstrap5.rb
|
32
|
+
- lib/generators/devise/views/bootstrap_generator.rb
|
33
|
+
- lib/version.rb
|
34
|
+
homepage: https://defclass.net/devise-bootstrap5
|
35
|
+
licenses:
|
36
|
+
- MIT
|
37
|
+
metadata:
|
38
|
+
homepage_uri: https://defclass.net/devise-bootstrap5
|
39
|
+
source_code_uri: https://github.com/kroger/devise-bootstrap5
|
40
|
+
post_install_message:
|
41
|
+
rdoc_options: []
|
42
|
+
require_paths:
|
43
|
+
- lib
|
44
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 2.4.0
|
49
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
requirements: []
|
55
|
+
rubygems_version: 3.2.15
|
56
|
+
signing_key:
|
57
|
+
specification_version: 4
|
58
|
+
summary: Devise with Bootstrap 5
|
59
|
+
test_files: []
|