Skip to content

Commit 30cd276

Browse files
committed
Initial commit, bootstrapped view generator
0 parents  commit 30cd276

28 files changed

+483
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.bundle/
2+
/.yardoc
3+
/Gemfile.lock
4+
/_yardoc/
5+
/coverage/
6+
/doc/
7+
/pkg/
8+
/spec/reports/
9+
/tmp/

.rspec

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
--format documentation
2+
--color

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sudo: false
2+
language: ruby
3+
rvm:
4+
- 2.3.1
5+
before_install: gem install bundler -v 1.12.5

CODE_OF_CONDUCT.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributor Code of Conduct
2+
3+
As contributors and maintainers of this project, and in the interest of
4+
fostering an open and welcoming community, we pledge to respect all people who
5+
contribute through reporting issues, posting feature requests, updating
6+
documentation, submitting pull requests or patches, and other activities.
7+
8+
We are committed to making participation in this project a harassment-free
9+
experience for everyone, regardless of level of experience, gender, gender
10+
identity and expression, sexual orientation, disability, personal appearance,
11+
body size, race, ethnicity, age, religion, or nationality.
12+
13+
Examples of unacceptable behavior by participants include:
14+
15+
* The use of sexualized language or imagery
16+
* Personal attacks
17+
* Trolling or insulting/derogatory comments
18+
* Public or private harassment
19+
* Publishing other's private information, such as physical or electronic
20+
addresses, without explicit permission
21+
* Other unethical or unprofessional conduct
22+
23+
Project maintainers have the right and responsibility to remove, edit, or
24+
reject comments, commits, code, wiki edits, issues, and other contributions
25+
that are not aligned to this Code of Conduct, or to ban temporarily or
26+
permanently any contributor for other behaviors that they deem inappropriate,
27+
threatening, offensive, or harmful.
28+
29+
By adopting this Code of Conduct, project maintainers commit themselves to
30+
fairly and consistently applying these principles to every aspect of managing
31+
this project. Project maintainers who do not follow or enforce the Code of
32+
Conduct may be permanently removed from the project team.
33+
34+
This code of conduct applies both within project spaces and in public spaces
35+
when an individual is representing the project or its community.
36+
37+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
38+
reported by contacting a project maintainer at [email protected]. All
39+
complaints will be reviewed and investigated and will result in a response that
40+
is deemed necessary and appropriate to the circumstances. Maintainers are
41+
obligated to maintain confidentiality with regard to the reporter of an
42+
incident.
43+
44+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
45+
version 1.3.0, available at
46+
[http://contributor-covenant.org/version/1/3/0/][version]
47+
48+
[homepage]: http://contributor-covenant.org
49+
[version]: http://contributor-covenant.org/version/1/3/0/

Gemfile

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
source 'https://rubygems.org'
2+
3+
# Specify your gem's dependencies in devise-bootstrapped.gemspec
4+
gemspec

LICENSE.txt

+21
Original file line numberDiff line numberDiff line change
@@ -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.

README.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Devise::Bootstrapped
2+
3+
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/bootstrapped`. To experiment with that code, run `bin/console` for an interactive prompt.
4+
5+
TODO: Delete this and the text above, and describe your gem
6+
7+
## Installation
8+
9+
Add this line to your application's Gemfile:
10+
11+
```ruby
12+
gem 'devise-bootstrapped'
13+
```
14+
15+
And then execute:
16+
17+
$ bundle
18+
19+
Or install it yourself as:
20+
21+
$ gem install devise-bootstrapped
22+
23+
## Usage
24+
25+
TODO: Write usage instructions here
26+
27+
## Development
28+
29+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
30+
31+
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 tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
32+
33+
## Contributing
34+
35+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/devise-bootstrapped. 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.
36+
37+
38+
## License
39+
40+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
41+

Rakefile

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
require "bundler/gem_tasks"
2+
require "rspec/core/rake_task"
3+
4+
RSpec::Core::RakeTask.new(:spec)
5+
6+
task :default => :spec
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
<h2 class="text-center">Resend confirmation instructions</h2>
4+
5+
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
6+
<%= devise_error_messages! %>
7+
8+
<div class="form-group">
9+
<%= f.label :email %><br />
10+
<%= f.email_field :email, autofocus: true, class: 'form-control', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
11+
</div>
12+
13+
<div class="actions">
14+
<%= f.submit "Resend confirmation instructions", class: 'btn btn-primary btn-lg btn-block' %>
15+
</div>
16+
<% end %>
17+
18+
<div class="text-center">
19+
<%= render "devise/shared/links" %>
20+
</div>
21+
22+
</div>
23+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<p>Welcome <%= @email %>!</p>
2+
3+
<p>You can confirm your account email through the link below:</p>
4+
5+
<p><%= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @token) %></p>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<p>Hello <%= @resource.email %>!</p>
2+
3+
<p>We're contacting you to notify you that your password has been changed.</p>
Original file line numberDiff line numberDiff line change
@@ -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>
Original file line numberDiff line numberDiff line change
@@ -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>
+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
<h2 class="text-center">Change your password</h2>
4+
5+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
6+
<%= devise_error_messages! %>
7+
<%= f.hidden_field :reset_password_token %>
8+
9+
<div class="form-group">
10+
<%= f.label :password, "New password" %><br />
11+
<% if @minimum_password_length %>
12+
<em>(<%= @minimum_password_length %> characters minimum)</em><br />
13+
<% end %>
14+
<%= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control' %>
15+
</div>
16+
17+
<div class="form-group">
18+
<%= f.label :password_confirmation, "Confirm new password" %><br />
19+
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
20+
</div>
21+
22+
<div class="form-group">
23+
<%= f.submit "Change my password", class: 'btn btn-primary btn-block btn-lg' %>
24+
</div>
25+
<% end %>
26+
27+
<div class="text-center">
28+
<%= render "devise/shared/links" %>
29+
</div>
30+
31+
</div>
32+
</div>
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
<h2 class="text-center">Forgot your password?</h2>
4+
5+
<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
6+
<%= devise_error_messages! %>
7+
<br>
8+
<p class="text-left">Please enter your email address and we will send you a link to reset your password.</p>
9+
<div class="form-group">
10+
<%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
11+
</div>
12+
13+
<div class="form-group">
14+
<%= f.submit "Send me reset password instructions", class: 'btn btn-primary btn-block btn-lg' %>
15+
</div>
16+
<% end %>
17+
<div class="text-center">
18+
<%= render "devise/shared/links" %>
19+
</div>
20+
</div>
21+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
<h1>Edit <%= resource_name.to_s.humanize %></h1>
4+
<hr>
5+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
6+
<%= devise_error_messages! %>
7+
8+
<div class="form-group">
9+
<%= f.label :email %><br />
10+
<%= f.email_field :email, class: 'form-control' %>
11+
</div>
12+
13+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
14+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
15+
<% end %>
16+
17+
<div class="form-group">
18+
<%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
19+
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
20+
</div>
21+
22+
<div class="form-group">
23+
<%= f.label :password_confirmation %><br />
24+
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
25+
</div>
26+
27+
<div class="form-group">
28+
<%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
29+
<%= f.password_field :current_password, autocomplete: "off", class: 'form-control' %>
30+
</div>
31+
32+
<div class="form-group">
33+
<%= f.submit "Update", class: 'btn btn-lg btn-block btn-primary' %>
34+
</div>
35+
<% end %>
36+
<hr>
37+
38+
<h2>Cancel my account</h2>
39+
40+
<p>Unhappy? <%= button_to "Cancel my account", registration_path(resource_name), class: "btn btn-danger", data: { confirm: "Are you sure? You cannot undo this." }, method: :delete %></p>
41+
42+
<%= link_to "Back", :back %>
43+
<hr>
44+
</div>
45+
</div>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
4+
<h1 class="text-center">Sign Up</h1>
5+
<hr>
6+
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
7+
<%= devise_error_messages! %>
8+
9+
<div class="form-group">
10+
<%= f.label :email %><br />
11+
<%= f.email_field :email, autofocus: false, class: 'form-control' %>
12+
</div>
13+
14+
<div class="form-group">
15+
<%= f.label :password %>
16+
<% if @minimum_password_length %>
17+
<em>(<%= @minimum_password_length %> characters minimum)</em>
18+
<% end %><br />
19+
<%= f.password_field :password, autocomplete: "off", class: 'form-control' %>
20+
</div>
21+
22+
<div class="form-group">
23+
<%= f.label :password_confirmation %><br />
24+
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control' %>
25+
</div>
26+
27+
<div class="form-group">
28+
<%= f.submit "Sign up", class: "btn btn-primary btn-block btn-lg" %>
29+
</div>
30+
<% end %>
31+
<div class="text-center">
32+
<%= render "devise/shared/links" %>
33+
</div>
34+
</div>
35+
</div>
+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<div class="row">
2+
<div class="col-sm-4 col-sm-offset-4">
3+
<h1 class="text-center">Log in</h1>
4+
<hr>
5+
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
6+
<div class="form-group">
7+
<%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
8+
</div>
9+
10+
<div class="form-group">
11+
<%= f.password_field :password, autocomplete: "off", placeholder: 'Password', class: 'form-control' %>
12+
</div>
13+
14+
<% if devise_mapping.rememberable? -%>
15+
<div class="form-group">
16+
<%= f.check_box :remember_me %>
17+
<%= f.label :remember_me %>
18+
</div>
19+
<% end -%>
20+
21+
<div class="form-group">
22+
<%= f.submit "Log in", class: "btn btn-primary btn-block btn-lg" %>
23+
</div>
24+
<% end %>
25+
<div class="text-center">
26+
<%= render "devise/shared/links" %>
27+
</div>
28+
</div>
29+
</div>
+25
Original file line numberDiff line numberDiff line change
@@ -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 commit comments

Comments
 (0)