devise-bootstrap-form 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 +15 -0
- data/.rspec +2 -0
- data/.rubocop.yml +88 -0
- data/.travis.yml +23 -0
- data/CHANGELOG.md +13 -0
- data/CODE_OF_CONDUCT.md +73 -0
- data/CONTRIBUTING.md +44 -0
- data/Dangerfile +56 -0
- data/Gemfile +13 -0
- data/LICENSE.txt +21 -0
- data/README.md +108 -0
- data/RELEASING.md +30 -0
- data/Rakefile +21 -0
- data/Vagrantfile +72 -0
- data/app/assets/stylesheets/devise_bootstrap_form.scss +14 -0
- data/app/views/devise/confirmations/new.html.erb +23 -0
- data/app/views/devise/invitations/edit.html.erb +19 -0
- data/app/views/devise/invitations/new.html.erb +17 -0
- data/app/views/devise/mailer/invitation_instructions.html.erb +11 -0
- data/app/views/devise/mailer/invitation_instructions.text.erb +11 -0
- data/app/views/devise/passwords/edit.html.erb +29 -0
- data/app/views/devise/passwords/new.html.erb +20 -0
- data/app/views/devise/registrations/edit.html.erb +33 -0
- data/app/views/devise/registrations/new.html.erb +25 -0
- data/app/views/devise/sessions/new.html.erb +24 -0
- data/app/views/devise/shared/_links.html.erb +25 -0
- data/app/views/devise/unlocks/new.html.erb +20 -0
- data/bin/console +15 -0
- data/bin/setup +8 -0
- data/devise-bootstrap-form.gemspec +44 -0
- data/lib/devise/bootstrap_form.rb +6 -0
- data/lib/devise/bootstrap_form/railtie.rb +6 -0
- data/lib/devise/bootstrap_form/version.rb +7 -0
- data/lib/generators/devise/views/bootstrap_form_generator.rb +39 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: eba5fdc6f0531e026e8aca13381f2befd5a99c5b9489aa5ebd3e8b0281ef890d
|
4
|
+
data.tar.gz: 3966109984c9cd2f861a7151c23e0958600babe2c5756f1518d5bfa91f2ef78c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 07e793153c7ad34be04a8da081259d06c89350e7ffe7767ae9faf8fdfa1da097de640b2dfa2bf62c2c3d3a9c261696eaa64410849667afd13d32f58e5af891ed
|
7
|
+
data.tar.gz: a5d4025d26e22fa603600e1ee5146e5d0b53603f3534f20b3200dfb0e456cbaa030f5d73b53e428f5dba830cf2bae397f6a7b709bf22bc69c94de92c8fba9cbf
|
data/.gitignore
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
/.bundle/
|
2
|
+
/.yardoc
|
3
|
+
/Gemfile.lock
|
4
|
+
/_yardoc/
|
5
|
+
/coverage/
|
6
|
+
/doc/
|
7
|
+
/pkg/
|
8
|
+
/tmp/
|
9
|
+
*.gem
|
10
|
+
|
11
|
+
.vagrant/
|
12
|
+
# For some reason, the test cases generate the mailer views in this directory,
|
13
|
+
# as well as the `test/rails_app/app/views/devise/mailer` directory.
|
14
|
+
# TODO: Figure out why and stop it from happening.
|
15
|
+
# app/views/devise/mailer/
|
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,88 @@
|
|
1
|
+
Style/StringLiterals:
|
2
|
+
EnforcedStyle: double_quotes
|
3
|
+
SupportedStyles:
|
4
|
+
- single_quotes
|
5
|
+
- double_quotes
|
6
|
+
# If true, strings which span multiple lines using \ for continuation must
|
7
|
+
# use the same type of quotes on each line.
|
8
|
+
ConsistentQuotesInMultiline: false
|
9
|
+
Exclude:
|
10
|
+
- "test/rails_app/app/mailers/*"
|
11
|
+
|
12
|
+
Layout/AlignParameters:
|
13
|
+
# Alignment of parameters in multi-line method calls.
|
14
|
+
#
|
15
|
+
# The `with_first_parameter` style aligns the following lines along the same
|
16
|
+
# column as the first parameter.
|
17
|
+
#
|
18
|
+
# method_call(a,
|
19
|
+
# b)
|
20
|
+
#
|
21
|
+
# The `with_fixed_indentation` style aligns the following lines with one
|
22
|
+
# level of indentation relative to the start of the line with the method call.
|
23
|
+
#
|
24
|
+
# method_call(a,
|
25
|
+
# b)
|
26
|
+
EnforcedStyle: with_fixed_indentation
|
27
|
+
SupportedStyles:
|
28
|
+
- with_first_parameter
|
29
|
+
- with_fixed_indentation
|
30
|
+
# By default, the indentation width from Style/IndentationWidth is used
|
31
|
+
# But it can be overridden by setting this parameter
|
32
|
+
# IndentationWidth: ~
|
33
|
+
|
34
|
+
Metrics/LineLength:
|
35
|
+
Max: 132
|
36
|
+
# To make it possible to copy or click on URIs in the code, we allow lines
|
37
|
+
# containing a URI to be longer than Max.
|
38
|
+
AllowHeredoc: true
|
39
|
+
AllowURI: true
|
40
|
+
URISchemes:
|
41
|
+
- http
|
42
|
+
- https
|
43
|
+
# The IgnoreCopDirectives option causes the LineLength rule to ignore cop
|
44
|
+
# directives like '# rubocop: enable ...' when calculating a line's length.
|
45
|
+
IgnoreCopDirectives: true
|
46
|
+
# The IgnoredPatterns option is a list of !ruby/regexp and/or string
|
47
|
+
# elements. Strings will be converted to Regexp objects. A line that matches
|
48
|
+
# any regular expression listed in this option will be ignored by LineLength.
|
49
|
+
IgnoredPatterns: []
|
50
|
+
|
51
|
+
# Rails 5 only requires 2.2.2.
|
52
|
+
AllCops:
|
53
|
+
DisplayCopNames: true
|
54
|
+
DisplayStyleGuide: true
|
55
|
+
TargetRubyVersion: 2.2
|
56
|
+
# TargetRubyVersion: <%= RUBY_VERSION[/\d+\.\d+/] %>
|
57
|
+
Exclude:
|
58
|
+
# - "test/rails_app/**/*"
|
59
|
+
- Capfile
|
60
|
+
- Gemfile
|
61
|
+
- "test/rails_app/bin/**/*"
|
62
|
+
- "test/rails_app/config/**/*"
|
63
|
+
- test/rails_app/config.ru
|
64
|
+
- "test/rails_app/db/**/*"
|
65
|
+
- "test/rails_app/log/**/*"
|
66
|
+
- "test/rails_app/tmp/**/*"
|
67
|
+
- "test/rails_app/vendor/**/*"
|
68
|
+
# - test/rails_app/config/boot.rb
|
69
|
+
# - test/rails_app/config/application.rb
|
70
|
+
# - test/rails_app/config/environment.rb
|
71
|
+
# - "test/rails_app/config/environments/*"
|
72
|
+
# - "test/rails_app/config/initializers/*"
|
73
|
+
# - test/rails_app/db/schema.rb
|
74
|
+
- "test/rails_app/node_modules/**/*"
|
75
|
+
- "test/rails_app/bower_components/**/*"
|
76
|
+
- test/rails_app/Gemfile
|
77
|
+
- test/rails_app/Guardfile
|
78
|
+
- test/rails_app/Rakefile
|
79
|
+
|
80
|
+
Metrics/BlockLength:
|
81
|
+
Exclude:
|
82
|
+
- devise-bootstrap-form.gemspec
|
83
|
+
|
84
|
+
# TODO: Remove this when minimum Ruby is 2.3.
|
85
|
+
Layout/IndentHeredoc:
|
86
|
+
Exclude:
|
87
|
+
- Dangerfile
|
88
|
+
- devise-bootstrap-form.gemspec
|
data/.travis.yml
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
language: ruby
|
2
|
+
rvm:
|
3
|
+
- 2.2.9
|
4
|
+
- 2.3.6
|
5
|
+
- 2.4.3
|
6
|
+
# - 2.5.0 The latest version is in the include clause and runs with danger.
|
7
|
+
before_install:
|
8
|
+
- gem update --system
|
9
|
+
- gem install bundler --no-document
|
10
|
+
|
11
|
+
matrix:
|
12
|
+
include:
|
13
|
+
# Bleeding edge
|
14
|
+
- rvm: ruby-head
|
15
|
+
|
16
|
+
# Running one job to execute DANGER bot
|
17
|
+
- rvm: 2.5.0
|
18
|
+
script:
|
19
|
+
- gem install danger
|
20
|
+
- danger
|
21
|
+
|
22
|
+
allow_failures:
|
23
|
+
- rvm: ruby-head
|
data/CHANGELOG.md
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,73 @@
|
|
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, sex characteristics, gender identity and expression,
|
9
|
+
level of experience, education, socio-economic status, nationality, personal
|
10
|
+
appearance, race, religion, or sexual identity and orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behaviour 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 behaviour 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
|
+
behaviour and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behaviour.
|
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 behaviours 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 behaviour may be
|
58
|
+
reported by contacting the project team at lcreid@jadesystems.ca. 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][https://contributor-covenant.org], version 1.4,
|
71
|
+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
72
|
+
|
73
|
+
[homepage]: https://www.contributor-covenant.org
|
data/CONTRIBUTING.md
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
## Contributing
|
2
|
+
If you find a bug or have an idea for a feature:
|
3
|
+
|
4
|
+
1. Search the issues to see if the bug has been found, or the feature has already been requested. If so, feel free to add your constructive input to the existing issue. Otherwise...
|
5
|
+
2. Create an issue describing the bug or feature. We welcome contributions from people like you, so if you want to submit a pull request for the bug or feature, say so in the description of the issue.
|
6
|
+
3. If you want to submit a pull request, we recommend you wait a few days until we respond to the issue. There is a small chance that we might feel that the feature isn't appropriate for this gem.
|
7
|
+
4. If you don't want to submit your own pull request, your issue is still welcome and we'll review it and respond appropriately.
|
8
|
+
|
9
|
+
## Testing
|
10
|
+
### Manual and Exploratory Testing
|
11
|
+
There is a test app in `test/rails_app`.
|
12
|
+
|
13
|
+
To use the `devise-bootstrap-form` gem:
|
14
|
+
|
15
|
+
```
|
16
|
+
cd rails_app
|
17
|
+
# Generate the view in the test app
|
18
|
+
rails g devise:views:bootstrap_form
|
19
|
+
rails s -b 0.0.0.0 &
|
20
|
+
# Navigate to localhost:3000/people/sign_in
|
21
|
+
```
|
22
|
+
|
23
|
+
### Automated Testing
|
24
|
+
|
25
|
+
```
|
26
|
+
rake test
|
27
|
+
```
|
28
|
+
|
29
|
+
## Gotchas
|
30
|
+
To test that the views work for a model other than the default `User`, the test app uses `Person` as the Devise model. It's a bit frustrating to remember that you can't just cut and paste examples that assume the model is `User`.
|
31
|
+
|
32
|
+
## Coding guidelines
|
33
|
+
|
34
|
+
This project uses [RuboCop](https://github.com/bbatsov/rubocop) to enforce standard Ruby coding
|
35
|
+
guidelines. The coding standards are close to the out-of-the-box RuboCop standards. The main differences are:
|
36
|
+
|
37
|
+
* We prefer double-quoted strings
|
38
|
+
* We allow 132 characters per line
|
39
|
+
* We don't lint most of the Rails-generated files in the test application
|
40
|
+
|
41
|
+
Note the Travis build will fail and your PR cannot be merged if the linter finds errors
|
42
|
+
|
43
|
+
* Test that your contributions pass with `rake lint`
|
44
|
+
* The linter is also run as part of the default rake task `rake`
|
data/Dangerfile
ADDED
@@ -0,0 +1,56 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Adapted from https://github.com/ruby-grape/danger/blob/master/Dangerfile
|
4
|
+
# Q: What is a Dangerfile, anyway? A: See http://danger.systems/
|
5
|
+
|
6
|
+
# ------------------------------------------------------------------------------
|
7
|
+
# Additional pull request data
|
8
|
+
# ------------------------------------------------------------------------------
|
9
|
+
project_name = github.pr_json["base"]["repo"]["name"]
|
10
|
+
pr_number = github.pr_json["number"]
|
11
|
+
pr_url = github.pr_json["_links"]["html"]["href"]
|
12
|
+
|
13
|
+
# ------------------------------------------------------------------------------
|
14
|
+
# What changed?
|
15
|
+
# ------------------------------------------------------------------------------
|
16
|
+
has_lib_changes = !git.modified_files.grep(/^lib/).empty?
|
17
|
+
has_test_changes = !git.modified_files.grep(/^test/).empty?
|
18
|
+
has_changelog_changes = git.modified_files.include?("CHANGELOG.md")
|
19
|
+
|
20
|
+
# ------------------------------------------------------------------------------
|
21
|
+
# You've made changes to lib, but didn't write any tests?
|
22
|
+
# ------------------------------------------------------------------------------
|
23
|
+
if has_lib_changes && !has_test_changes
|
24
|
+
warn("There are code changes, but no corresponding tests. "\
|
25
|
+
"Please include tests if this PR introduces any modifications in "\
|
26
|
+
"#{project_name}'s behavior.",
|
27
|
+
sticky: false)
|
28
|
+
end
|
29
|
+
|
30
|
+
# ------------------------------------------------------------------------------
|
31
|
+
# Have you updated CHANGELOG.md?
|
32
|
+
# ------------------------------------------------------------------------------
|
33
|
+
if !has_changelog_changes && has_lib_changes
|
34
|
+
markdown <<-MARKDOWN
|
35
|
+
Here's an example of a CHANGELOG.md entry (place it immediately under the `* Your contribution here!` line):
|
36
|
+
|
37
|
+
```markdown
|
38
|
+
* [##{pr_number}](#{pr_url}): #{github.pr_title} - [@#{github.pr_author}](https://github.com/#{github.pr_author}).
|
39
|
+
```
|
40
|
+
MARKDOWN
|
41
|
+
warn("Please update CHANGELOG.md with a description of your changes. "\
|
42
|
+
"If this PR is not a user-facing change (e.g. just refactoring), "\
|
43
|
+
"you can disregard this.", sticky: false)
|
44
|
+
end
|
45
|
+
|
46
|
+
# ------------------------------------------------------------------------------
|
47
|
+
# Did you remove the CHANGELOG's "Your contribution here!" line?
|
48
|
+
# ------------------------------------------------------------------------------
|
49
|
+
if has_changelog_changes
|
50
|
+
if IO.read("CHANGELOG.md").scan(/^\s*[-\*] Your contribution here/i).count < 3
|
51
|
+
raise(
|
52
|
+
"Please put the `- Your contribution here!` line back into CHANGELOG.md.",
|
53
|
+
sticky: false
|
54
|
+
)
|
55
|
+
end
|
56
|
+
end
|
data/Gemfile
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source "https://rubygems.org"
|
4
|
+
|
5
|
+
# Specify your gem's dependencies in devise-bootstrap-form.gemspec
|
6
|
+
gemspec
|
7
|
+
# eval_gemfile("test/rails_app/Gemfile")
|
8
|
+
|
9
|
+
group :development do
|
10
|
+
gem "chandler", ">= 0.7.0"
|
11
|
+
# gem "htmlbeautifier"
|
12
|
+
gem "rubocop", require: false
|
13
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 Andrew Fomera
|
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,108 @@
|
|
1
|
+
# Devise Bootstrap Form
|
2
|
+
|
3
|
+
This gem gives you a nicer place to start customizing views for your Devise model when you're using the [`bootstrap_form`](https://github.com/bootstrap-ruby/bootstrap_form) gem. The `bootstrap_form` gem makes it easier to generate nice-looking Bootstrap forms in Rails. If you're using `bootstrap_form`, this gem will help make your Devise views look the same as the rest of the forms in your application.
|
4
|
+
|
5
|
+
It also makes the Devise views simpler, because the code to define forms using `bootstrap_form` is simpler than the code for a "raw" Rails form. So any customization you do to the Devise views will be simpler.
|
6
|
+
|
7
|
+
You can find usage information below, but the gist of it is you'll run `rails g devise:views:bootstrap-form` instead of the normal `rails g devise:views`.
|
8
|
+
|
9
|
+
If you want to switch back to what Devise gives you, no problem. Just remove the `app/views/devise` folder. You will then use the default Devise views, or you can run the normal Devise `rails g devise:views` generator command and customize the default Devise views.
|
10
|
+
|
11
|
+
If you're just looking for Bootstrap markup on your Devise views, and don't want to use `bootstrap_form`, then you should look into the [`devise-bootstrapped`](https://github.com/king601/devise-bootstrapped) gem, or one of its forks.
|
12
|
+
|
13
|
+
## Installation
|
14
|
+
|
15
|
+
Add these lines to your application's `Gemfile`:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
gem 'bootstrap', '~> 4.0'
|
19
|
+
gem "bootstrap_form", ">= 4.0.0.alpha1"
|
20
|
+
gem 'devise'
|
21
|
+
gem 'devise-bootstrap-form', github: "lcreid/devise-bootstrap-form"
|
22
|
+
```
|
23
|
+
|
24
|
+
And then execute:
|
25
|
+
```bash
|
26
|
+
bundle install
|
27
|
+
```
|
28
|
+
|
29
|
+
There are additional installation instructions for both [`bootstrap_form`](https://github.com/bootstrap-ruby/bootstrap_form#installation) and [`bootstrap`](https://github.com/twbs/bootstrap-rubygem#a-ruby-on-rails) that yu must complete before using `devise-bootstrap-form`.
|
30
|
+
|
31
|
+
## Usage
|
32
|
+
|
33
|
+
To use the Bootstrap views generator you'll want to have Devise installed per normal installation. Once you've installed Devise and generated your user model you can generate the views with:
|
34
|
+
|
35
|
+
```bash
|
36
|
+
rails generate devise:views:bootstrap-form
|
37
|
+
```
|
38
|
+
|
39
|
+
If you've already generated the Devise views you can use the `-f` argument to force an override, but that will erase any of the changes you've made to the views.
|
40
|
+
|
41
|
+
Generate the mailer views from normal Devise, as they're not included in `devise-bootstrap-form`:
|
42
|
+
|
43
|
+
```bash
|
44
|
+
rails generate devise:views -v mailer
|
45
|
+
```
|
46
|
+
|
47
|
+
## Generated Layout
|
48
|
+
|
49
|
+
Each of the forms in enclosed in the following:
|
50
|
+
|
51
|
+
```
|
52
|
+
<div class="devise-bootstrap-form">
|
53
|
+
<div class="devise-bootstrap-form-row">
|
54
|
+
<div class="devise-bootstrap-form-col">
|
55
|
+
<!-- the form... -->
|
56
|
+
</div>
|
57
|
+
</div>
|
58
|
+
</div>
|
59
|
+
```
|
60
|
+
|
61
|
+
The generator also generates `app/assets/stylesheets/devise_bootstrap_form.scss` that contains the following:
|
62
|
+
|
63
|
+
```
|
64
|
+
.devise-bootstrap-form {
|
65
|
+
@extend .container;
|
66
|
+
}
|
67
|
+
|
68
|
+
.devise-bootstrap-form-col {
|
69
|
+
@extend .col-12;
|
70
|
+
@extend .col-sm-8;
|
71
|
+
@extend .col-lg-6;
|
72
|
+
}
|
73
|
+
|
74
|
+
.devise-bootstrap-form-row {
|
75
|
+
@extend .row;
|
76
|
+
@extend .justify-content-around;
|
77
|
+
}
|
78
|
+
```
|
79
|
+
|
80
|
+
You may want to adjust to your own tastes. For example, if the layout used by your Devise views already wraps the view in a `.container`, you can remove the:
|
81
|
+
|
82
|
+
```
|
83
|
+
.devise-bootstrap-form {
|
84
|
+
@extend .container;
|
85
|
+
}
|
86
|
+
```
|
87
|
+
|
88
|
+
from `app/assets/stylesheets/devise_bootstrap_form.scss` file.
|
89
|
+
|
90
|
+
Of course, you can also modify the views to change the surrounding `div`s to your needs.
|
91
|
+
|
92
|
+
If you don't want the `devise_bootstrap_form`-generated styles at all, remove the following line from `app/asserts/application.scss`:
|
93
|
+
|
94
|
+
```
|
95
|
+
@include "devise_bootstrap_form.scss";
|
96
|
+
```
|
97
|
+
|
98
|
+
## Contributing
|
99
|
+
|
100
|
+
This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Code of Conduct](CODE_OF_CONDUCT.md).
|
101
|
+
|
102
|
+
Refer to the [CONTRIBUTING](devise-bootstrap-form/blob/master/CODE_OF_CONDUCT.md) document for more details.
|
103
|
+
|
104
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/lcreid/devise-bootstrap-form.
|
105
|
+
|
106
|
+
## License
|
107
|
+
|
108
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/RELEASING.md
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# Releasing
|
2
|
+
|
3
|
+
Follow these steps to release a new version of `devise-bootstrap-form` to `rubygems.org`.
|
4
|
+
|
5
|
+
## Prerequisites
|
6
|
+
|
7
|
+
* You must have commit rights to the `devise-bootstrap-form` repository.
|
8
|
+
* You must have push rights for the `devise-bootstrap-form` gem on `rubygems.org`.
|
9
|
+
* You must be using Ruby >= 2.2.
|
10
|
+
* Your GitHub credentials must be available to Chandler via `~/.netrc` or an environment variable, [as explained here](https://github.com/mattbrictson/chandler#2-configure-credentials).
|
11
|
+
|
12
|
+
## How to release
|
13
|
+
|
14
|
+
1. Run `bundle install` to make sure that you have all the gems necessary for testing and releasing.
|
15
|
+
2. **Ensure the tests are passing** by running `rake`.
|
16
|
+
3. Determine which would be the correct next version number according to [semver](http://semver.org/).
|
17
|
+
4. Update the version in `./lib/devise_bootstrap_form/version.rb`.
|
18
|
+
5. Update the `CHANGELOG.md` (for an illustration of these steps, refer to the [bootstrap_form 4.0.0.alpha1 commit](https://github.com/bootstrap-ruby/devise-bootstrap-form/commit/8aac3667931a16537ab68038ec4cebce186bd596#diff-4ac32a78649ca5bdd8e0ba38b7006a1e) as an example):
|
19
|
+
* Add a new Pending Release section at the top of the file with a template for contributors to fill in, including "Your contribution here!" bullets
|
20
|
+
* Rename the Pending Release section to `[version][] (date)` with appropriate values for `version` and `date`
|
21
|
+
* Remove the "Your contribution here!" bullets from the former Pending Release section release notes
|
22
|
+
* Add the appropriate GitHub diff links to the footer of the document
|
23
|
+
|
24
|
+
```
|
25
|
+
[Pending Release]: https://github.com/lcreid/devise-bootstrap-form/compare/.v0.0.1...HEAD
|
26
|
+
[0.0.1]: https://github.com/lcreid/devise-bootstrap-form/compare/...v0.0.1
|
27
|
+
```
|
28
|
+
6. Update the installation instructions in `README.md` to use the new version.
|
29
|
+
7. Commit the CHANGELOG and version changes in a single commit; the message should be "Preparing vX.Y.Z" where `X.Y.Z` is the version being released.
|
30
|
+
8. Run `bundle exec rake release`; this will tag, push to GitHub, publish to `rubygems.org`, and upload the latest CHANGELOG entry to the [GitHub releases page](https://github.com/lcreid/devise-bootstrap-form/releases).
|
data/Rakefile
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "bundler/gem_tasks"
|
4
|
+
require "rake/testtask"
|
5
|
+
require "rubocop/rake_task"
|
6
|
+
|
7
|
+
Rake::TestTask.new(:test) do |t|
|
8
|
+
t.libs << "test"
|
9
|
+
t.pattern = "test/**/*_test.rb"
|
10
|
+
t.verbose = false
|
11
|
+
end
|
12
|
+
|
13
|
+
desc "Run RuboCop lint checks"
|
14
|
+
RuboCop::RakeTask.new(:lint)
|
15
|
+
|
16
|
+
task default: %i[test lint]
|
17
|
+
|
18
|
+
require "chandler/tasks"
|
19
|
+
|
20
|
+
# Add chandler as a prerequisite for `rake release`
|
21
|
+
task "release:rubygem_push" => "chandler:push"
|
data/Vagrantfile
ADDED
@@ -0,0 +1,72 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# -*- mode: ruby -*-
|
4
|
+
# vi: set ft=ruby :
|
5
|
+
|
6
|
+
# All Vagrant configuration is done below. The "2" in Vagrant.configure
|
7
|
+
# configures the configuration version (we support older styles for
|
8
|
+
# backwards compatibility). Please don't change it unless you know what
|
9
|
+
# you're doing.
|
10
|
+
Vagrant.configure("2") do |config|
|
11
|
+
# The most common configuration options are documented and commented below.
|
12
|
+
# For a complete reference, please see the online documentation at
|
13
|
+
# https://docs.vagrantup.com.
|
14
|
+
|
15
|
+
# Every Vagrant development environment requires a box. You can search for
|
16
|
+
# boxes at https://vagrantcloud.com/search.
|
17
|
+
config.vm.box = "jadesystems/rails-5-2"
|
18
|
+
|
19
|
+
# Disable automatic box update checking. If you disable this, then
|
20
|
+
# boxes will only be checked for updates when the user runs
|
21
|
+
# `vagrant box outdated`. This is not recommended.
|
22
|
+
# config.vm.box_check_update = false
|
23
|
+
|
24
|
+
# Create a forwarded port mapping which allows access to a specific port
|
25
|
+
# within the machine from a port on the host machine. In the example below,
|
26
|
+
# accessing "localhost:8080" will access port 80 on the guest machine.
|
27
|
+
# NOTE: This will enable public access to the opened port
|
28
|
+
# config.vm.network "forwarded_port", guest: 80, host: 8080
|
29
|
+
|
30
|
+
# Create a forwarded port mapping which allows access to a specific port
|
31
|
+
# within the machine from a port on the host machine and only allow access
|
32
|
+
# via 127.0.0.1 to disable public access
|
33
|
+
# config.vm.network "forwarded_port", guest: 80, host: 8080, host_ip: "127.0.0.1"
|
34
|
+
|
35
|
+
# Create a private network, which allows host-only access to the machine
|
36
|
+
# using a specific IP.
|
37
|
+
# config.vm.network "private_network", ip: "192.168.33.10"
|
38
|
+
|
39
|
+
# Create a public network, which generally matched to bridged network.
|
40
|
+
# Bridged networks make the machine appear as another physical device on
|
41
|
+
# your network.
|
42
|
+
# config.vm.network "public_network"
|
43
|
+
|
44
|
+
# Share an additional folder to the guest VM. The first argument is
|
45
|
+
# the path on the host to the actual folder. The second argument is
|
46
|
+
# the path on the guest to mount the folder. And the optional third
|
47
|
+
# argument is a set of non-required options.
|
48
|
+
# config.vm.synced_folder "../data", "/vagrant_data"
|
49
|
+
|
50
|
+
# Provider-specific configuration so you can fine-tune various
|
51
|
+
# backing providers for Vagrant. These expose provider-specific options.
|
52
|
+
# Example for VirtualBox:
|
53
|
+
#
|
54
|
+
# config.vm.provider "virtualbox" do |vb|
|
55
|
+
# # Display the VirtualBox GUI when booting the machine
|
56
|
+
# vb.gui = true
|
57
|
+
#
|
58
|
+
# # Customize the amount of memory on the VM:
|
59
|
+
# vb.memory = "1024"
|
60
|
+
# end
|
61
|
+
#
|
62
|
+
# View the documentation for the provider you are using for more
|
63
|
+
# information on available options.
|
64
|
+
|
65
|
+
# Enable provisioning with a shell script. Additional provisioners such as
|
66
|
+
# Puppet, Chef, Ansible, Salt, and Docker are also available. Please see the
|
67
|
+
# documentation for more information about their specific syntax and use.
|
68
|
+
# config.vm.provision "shell", inline: <<-SHELL
|
69
|
+
# apt-get update
|
70
|
+
# apt-get install -y apache2
|
71
|
+
# SHELL
|
72
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Resend confirmation instructions</h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
|
9
|
+
<%= f.email_field :email,
|
10
|
+
autofocus: true,
|
11
|
+
autocomplete: "email",
|
12
|
+
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
13
|
+
<%= f.form_group do %>
|
14
|
+
<%= f.submit "Resend confirmation instructions", class: 'btn btn-primary btn-lg btn-block' %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<div class="text-center">
|
19
|
+
<%= render "devise/shared/links" %>
|
20
|
+
</div>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2><%= t 'devise.invitations.edit.header' %></h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put } do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
<%= f.hidden_field :invitation_token, readonly: true %>
|
9
|
+
|
10
|
+
<% if f.object.class.require_password_on_accepting %>
|
11
|
+
<%= f.password_field :password %>
|
12
|
+
<%= f.password_field :password_confirmation, class: "required" %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<%= f.submit t("devise.invitations.edit.submit_button"), class: "btn btn-primary btn-lg btn-block" %>
|
16
|
+
<% end %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center"><%= t "devise.invitations.new.header" %></h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post} do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
|
9
|
+
<% resource.class.invite_key_fields.each do |field| -%>
|
10
|
+
<%= f.text_field field %>
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%= f.submit t("devise.invitations.new.submit_button"), class: "btn btn-primary btn-lg btn-block" %>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
</div>
|
17
|
+
</div>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<p><%= t("devise.mailer.invitation_instructions.hello", email: @resource.email) %></p>
|
2
|
+
|
3
|
+
<p><%= t("devise.mailer.invitation_instructions.someone_invited_you", url: root_url) %></p>
|
4
|
+
|
5
|
+
<p><%= link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) %></p>
|
6
|
+
|
7
|
+
<% if @resource.invitation_due_at %>
|
8
|
+
<p><%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :'devise.mailer.invitation_instructions.accept_until_format')) %></p>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<p><%= t("devise.mailer.invitation_instructions.ignore") %></p>
|
@@ -0,0 +1,11 @@
|
|
1
|
+
<%= t("devise.mailer.invitation_instructions.hello", email: @resource.email) %>
|
2
|
+
|
3
|
+
<%= t("devise.mailer.invitation_instructions.someone_invited_you", url: root_url) %>
|
4
|
+
|
5
|
+
<%= accept_invitation_url(@resource, :invitation_token => @token) %>
|
6
|
+
|
7
|
+
<% if @resource.invitation_due_at %>
|
8
|
+
<%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :'devise.mailer.invitation_instructions.accept_until_format')) %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%= t("devise.mailer.invitation_instructions.ignore") %>
|
@@ -0,0 +1,29 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Change your password</h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
<%= f.hidden_field :reset_password_token %>
|
9
|
+
|
10
|
+
<%= f.password_field :password,
|
11
|
+
autofocus: true,
|
12
|
+
autocomplete: "new-password",
|
13
|
+
help: "(#{@minimum_password_length} characters minimum)",
|
14
|
+
label: "New password" %>
|
15
|
+
<%= f.password_field :password_confirmation,
|
16
|
+
label: "Confirm new password",
|
17
|
+
autocomplete: "off",
|
18
|
+
class: "required" %>
|
19
|
+
<%= f.form_group do %>
|
20
|
+
<%= f.submit "Change my password", class: 'btn btn-primary btn-block btn-lg' %>
|
21
|
+
<% end %>
|
22
|
+
<% end %>
|
23
|
+
|
24
|
+
<div class="text-center">
|
25
|
+
<%= render "devise/shared/links" %>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</div>
|
29
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Forgot your password?</h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
<br>
|
9
|
+
<p class="text-left">Please enter your email address and we will send you a link to reset your password.</p>
|
10
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
11
|
+
<%= f.form_group do %>
|
12
|
+
<%= f.submit "Send me reset password instructions", class: 'btn btn-primary btn-block btn-lg' %>
|
13
|
+
<% end %>
|
14
|
+
<% end %>
|
15
|
+
<div class="text-center">
|
16
|
+
<%= render "devise/shared/links" %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Edit <%= resource_name.to_s.humanize %></h2>
|
5
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
6
|
+
<%= devise_error_messages! %>
|
7
|
+
|
8
|
+
<%= f.email_field :email %>
|
9
|
+
|
10
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
11
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
12
|
+
<% end %>
|
13
|
+
|
14
|
+
<%= f.password_field :password, autocomplete: "off", help: "leave blank if you don't want to change it" %>
|
15
|
+
<%= f.password_field :password_confirmation, autocomplete: "off", class: "required" %>
|
16
|
+
<%= f.password_field :current_password,
|
17
|
+
autocomplete: "off",
|
18
|
+
class: "required",
|
19
|
+
help: "We need your current password to confirm your changes." %>
|
20
|
+
|
21
|
+
<%= f.form_group do %>
|
22
|
+
<%= f.submit "Update", class: "btn btn-lg btn-block btn-primary" %>
|
23
|
+
<% end %>
|
24
|
+
<% end %>
|
25
|
+
|
26
|
+
<h2>Cancel my account</h2>
|
27
|
+
|
28
|
+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), class: "btn btn-block btn-danger", data: { confirm: "Are you sure? You cannot undo this." }, method: :delete %></p>
|
29
|
+
|
30
|
+
<%= link_to "Back", :back %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Sign up</h2>
|
5
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
6
|
+
<%= devise_error_messages! %>
|
7
|
+
|
8
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
9
|
+
<%= f.password_field :password,
|
10
|
+
autocomplete: "new-password",
|
11
|
+
help: "(#{@minimum_password_length} characters minimum)" %>
|
12
|
+
<%= f.password_field :password_confirmation,
|
13
|
+
autocomplete: "new-password",
|
14
|
+
label_class: "required" %>
|
15
|
+
|
16
|
+
<%= f.form_group do %>
|
17
|
+
<%= f.submit "Sign up", class: "btn btn-primary btn-block btn-lg" %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
<div class="text-center">
|
21
|
+
<%= render "devise/shared/links" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
25
|
+
</div>
|
@@ -0,0 +1,24 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Log in</h2>
|
5
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
6
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
7
|
+
<%= f.password_field :password, autocomplete: "current-password", placeholder: 'Password' %>
|
8
|
+
|
9
|
+
<% if devise_mapping.rememberable? -%>
|
10
|
+
<%= f.form_group do %>
|
11
|
+
<%= f.check_box :remember_me %>
|
12
|
+
<% end %>
|
13
|
+
<% end -%>
|
14
|
+
|
15
|
+
<%= f.form_group do %>
|
16
|
+
<%= f.submit "Log in", class: "btn btn-primary btn-block btn-lg" %>
|
17
|
+
<% end %>
|
18
|
+
<% end %>
|
19
|
+
<div class="text-center">
|
20
|
+
<%= render "devise/shared/links" %>
|
21
|
+
</div>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
</div>
|
@@ -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,20 @@
|
|
1
|
+
<div class="devise-bootstrap-form">
|
2
|
+
<div class="devise-bootstrap-form-row">
|
3
|
+
<div class="devise-bootstrap-form-col">
|
4
|
+
<h2 class="text-center">Resend unlock instructions</h2>
|
5
|
+
|
6
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
7
|
+
<%= devise_error_messages! %>
|
8
|
+
|
9
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
10
|
+
<%= f.form_group do %>
|
11
|
+
<%= f.submit "Resend unlock instructions", class: "btn btn-primary btn-block btn-lg" %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<div class="text-center">
|
16
|
+
<%= render "devise/shared/links" %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
data/bin/console
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
require "bundler/setup"
|
5
|
+
require "devise/bootstrap-form"
|
6
|
+
|
7
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
8
|
+
# with your gem easier. You can also use a different console, if you like.
|
9
|
+
|
10
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
+
# require "pry"
|
12
|
+
# Pry.start
|
13
|
+
|
14
|
+
require "irb"
|
15
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
lib = File.expand_path("lib", __dir__)
|
4
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
+
require "devise/bootstrap_form/version"
|
6
|
+
|
7
|
+
Gem::Specification.new do |spec|
|
8
|
+
spec.name = "devise-bootstrap-form"
|
9
|
+
spec.version = Devise::BootstrapForm::VERSION
|
10
|
+
spec.authors = ["Andrew Fomera", "Larry Reid"]
|
11
|
+
spec.email = ["larry.reid@jadesystems.ca"]
|
12
|
+
|
13
|
+
spec.summary = "Generates nicer views for Devise that use Bootstrap via the `bootstrap_form` gem."
|
14
|
+
spec.description = <<-DESC
|
15
|
+
This gem generates Devise views styled with Bootstrap via the `bootstrap_form`
|
16
|
+
gem. If you plan to use, or are using, `bootstrap_form` in your app, your Devise
|
17
|
+
forms will be consistent with the rest of your forms.
|
18
|
+
|
19
|
+
The generator will detect if you're using `devise_invitable`, and will generate
|
20
|
+
`bootstrap_form` forms for its views as well.
|
21
|
+
DESC
|
22
|
+
spec.homepage = "https://github.com/lcreid/devise-bootstrap-form"
|
23
|
+
spec.license = "MIT"
|
24
|
+
|
25
|
+
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
26
|
+
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
27
|
+
if spec.respond_to?(:metadata) # rubocop:disable Style/GuardClause
|
28
|
+
spec.metadata["allowed_push_host"] = "https://rubygems.org"
|
29
|
+
else
|
30
|
+
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
31
|
+
end
|
32
|
+
|
33
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
|
+
spec.bindir = "exe"
|
35
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
|
+
spec.require_paths = ["lib"]
|
37
|
+
|
38
|
+
spec.add_dependency "bootstrap_form", ">= 4.0.0.alpha1"
|
39
|
+
spec.add_dependency "devise"
|
40
|
+
spec.add_dependency "rails", ">= 5.0.0"
|
41
|
+
spec.add_development_dependency "bundler", "~> 1.12"
|
42
|
+
spec.add_development_dependency "chandler"
|
43
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
44
|
+
end
|
@@ -0,0 +1,39 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "rails/generators"
|
4
|
+
|
5
|
+
module Devise
|
6
|
+
module Views
|
7
|
+
# Generates Devise and Devise Invitable forms using `bootstrap_form` helpers.
|
8
|
+
class BootstrapFormGenerator < Rails::Generators::Base
|
9
|
+
class << self
|
10
|
+
def invitable
|
11
|
+
Object.const_get(:DeviseInvitable).is_a?(Module) rescue false # rubocop:disable Style/RescueModifier
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
desc "Copies views styled for Bootstrap 4 via the `bootstrap_form` gem"
|
16
|
+
|
17
|
+
source_root File.expand_path("../../../../app", __dir__)
|
18
|
+
|
19
|
+
def copy_views
|
20
|
+
%w[confirmations passwords registrations sessions shared unlocks].each do |dir|
|
21
|
+
directory File.join("views/devise", dir), "app/views/devise/#{dir}"
|
22
|
+
end
|
23
|
+
|
24
|
+
if BootstrapFormGenerator.invitable # rubocop:disable Style/GuardClause
|
25
|
+
%w[invitations mailer].each do |dir|
|
26
|
+
directory File.join("views/devise", dir), "app/views/devise/#{dir}"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
|
31
|
+
def copy_assets
|
32
|
+
directory "assets/stylesheets", "app/assets/stylesheets"
|
33
|
+
append_to_file "app/assets/stylesheets/application.scss" do
|
34
|
+
'@import "devise_bootstrap_form";'
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
metadata
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: devise-bootstrap-form
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrew Fomera
|
8
|
+
- Larry Reid
|
9
|
+
autorequire:
|
10
|
+
bindir: exe
|
11
|
+
cert_chain: []
|
12
|
+
date: 2018-08-27 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bootstrap_form
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 4.0.0.alpha1
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 4.0.0.alpha1
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: devise
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :runtime
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: rails
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: 5.0.0
|
49
|
+
type: :runtime
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: 5.0.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: bundler
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '1.12'
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '1.12'
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: chandler
|
72
|
+
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirements:
|
74
|
+
- - ">="
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: '0'
|
77
|
+
type: :development
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: !ruby/object:Gem::Requirement
|
80
|
+
requirements:
|
81
|
+
- - ">="
|
82
|
+
- !ruby/object:Gem::Version
|
83
|
+
version: '0'
|
84
|
+
- !ruby/object:Gem::Dependency
|
85
|
+
name: rake
|
86
|
+
requirement: !ruby/object:Gem::Requirement
|
87
|
+
requirements:
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '10.0'
|
91
|
+
type: :development
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - "~>"
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: '10.0'
|
98
|
+
description: |
|
99
|
+
This gem generates Devise views styled with Bootstrap via the `bootstrap_form`
|
100
|
+
gem. If you plan to use, or are using, `bootstrap_form` in your app, your Devise
|
101
|
+
forms will be consistent with the rest of your forms.
|
102
|
+
|
103
|
+
The generator will detect if you're using `devise_invitable`, and will generate
|
104
|
+
`bootstrap_form` forms for its views as well.
|
105
|
+
email:
|
106
|
+
- larry.reid@jadesystems.ca
|
107
|
+
executables: []
|
108
|
+
extensions: []
|
109
|
+
extra_rdoc_files: []
|
110
|
+
files:
|
111
|
+
- ".gitignore"
|
112
|
+
- ".rspec"
|
113
|
+
- ".rubocop.yml"
|
114
|
+
- ".travis.yml"
|
115
|
+
- CHANGELOG.md
|
116
|
+
- CODE_OF_CONDUCT.md
|
117
|
+
- CONTRIBUTING.md
|
118
|
+
- Dangerfile
|
119
|
+
- Gemfile
|
120
|
+
- LICENSE.txt
|
121
|
+
- README.md
|
122
|
+
- RELEASING.md
|
123
|
+
- Rakefile
|
124
|
+
- Vagrantfile
|
125
|
+
- app/assets/stylesheets/devise_bootstrap_form.scss
|
126
|
+
- app/views/devise/confirmations/new.html.erb
|
127
|
+
- app/views/devise/invitations/edit.html.erb
|
128
|
+
- app/views/devise/invitations/new.html.erb
|
129
|
+
- app/views/devise/mailer/invitation_instructions.html.erb
|
130
|
+
- app/views/devise/mailer/invitation_instructions.text.erb
|
131
|
+
- app/views/devise/passwords/edit.html.erb
|
132
|
+
- app/views/devise/passwords/new.html.erb
|
133
|
+
- app/views/devise/registrations/edit.html.erb
|
134
|
+
- app/views/devise/registrations/new.html.erb
|
135
|
+
- app/views/devise/sessions/new.html.erb
|
136
|
+
- app/views/devise/shared/_links.html.erb
|
137
|
+
- app/views/devise/unlocks/new.html.erb
|
138
|
+
- bin/console
|
139
|
+
- bin/setup
|
140
|
+
- devise-bootstrap-form.gemspec
|
141
|
+
- lib/devise/bootstrap_form.rb
|
142
|
+
- lib/devise/bootstrap_form/railtie.rb
|
143
|
+
- lib/devise/bootstrap_form/version.rb
|
144
|
+
- lib/generators/devise/views/bootstrap_form_generator.rb
|
145
|
+
homepage: https://github.com/lcreid/devise-bootstrap-form
|
146
|
+
licenses:
|
147
|
+
- MIT
|
148
|
+
metadata:
|
149
|
+
allowed_push_host: https://rubygems.org
|
150
|
+
post_install_message:
|
151
|
+
rdoc_options: []
|
152
|
+
require_paths:
|
153
|
+
- lib
|
154
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
155
|
+
requirements:
|
156
|
+
- - ">="
|
157
|
+
- !ruby/object:Gem::Version
|
158
|
+
version: '0'
|
159
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
160
|
+
requirements:
|
161
|
+
- - ">="
|
162
|
+
- !ruby/object:Gem::Version
|
163
|
+
version: '0'
|
164
|
+
requirements: []
|
165
|
+
rubyforge_project:
|
166
|
+
rubygems_version: 2.7.6
|
167
|
+
signing_key:
|
168
|
+
specification_version: 4
|
169
|
+
summary: Generates nicer views for Devise that use Bootstrap via the `bootstrap_form`
|
170
|
+
gem.
|
171
|
+
test_files: []
|