Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Stylistic changes To make them look more like Devise templates * Replace p tags with div tags with specific classes (using Rails/Devise conventions) * Remove deprecated devise_error_messages! with partial * Add partial for error rendering Replaces devise_error_messages! * Replace deprecated devise_error_messages! with error_notification for simple_form * Update test templates * Remove whitespace * Add error partial to test/rails_app * Remove error partial * Change devise dependency from ~> to >= * Do not test Ruby 2.2.10 * Remove explicit jdk version from travis * Update changelog * Whitespace * Remove commented-out methods * Wrap elements in div tags with specific CSS classes To match Devise * Change devise_invitable version to 2.0.0 in README [ci skip] * Fix weird layout in README [skip ci] * Remove instructions describing old devise releases from README [skip ci] * Clarify instructions on how to use devise_invitable with different devise releases * Annotate variables in README so they stand out from the rest of the text [skip ci] * Consistent case when using Devise and DeviseInvitable [skip ci] * Replace a closing tag with an opening tag [skip ci] * Annotate code in README [skip ci] * Remove instructions on how to use devise_invitable with older devise releases (3.2) [skip ci] * Whitespace for alignment [skip ci] * Annotate code, rewrite sentences in README [skip ci] * Annotate even more code, rewrite sentences [skip ci] * Annotate even more code, for the last time! [skip ci] * Add a note about requirements [skip ci] * Change jruby-9.2.6.0 to jruby-head * Specify xenial dist for Travis tests * Remove jruby-head from travis Too unpredictable * Stylistic changes
- Loading branch information
Showing
25 changed files
with
182 additions
and
148 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,45 @@ | ||
dist: xenial | ||
language: ruby | ||
sudo: false | ||
|
||
cache: bundler | ||
|
||
before_install: | ||
- gem update --system | ||
- gem install bundler | ||
sudo: false | ||
cache: bundler | ||
|
||
rvm: | ||
- 2.2.10 | ||
- 2.3.8 | ||
- 2.4.5 | ||
- 2.5.3 | ||
- 2.6.1 | ||
- ruby-head | ||
- jruby-9.2.6.0 | ||
jdk: | ||
- openjdk11 | ||
|
||
script: bundle exec rake test | ||
|
||
env: | ||
matrix: | ||
- DEVISE_ORM=active_record | ||
- DEVISE_ORM=mongoid | ||
|
||
gemfile: | ||
- Gemfile | ||
- gemfiles/Gemfile.rails-5.0 | ||
- gemfiles/Gemfile.rails-5.1 | ||
- gemfiles/Gemfile.rails-5.2 | ||
- gemfiles/Gemfile.rails-master | ||
install: "travis_retry bundle install" | ||
|
||
install: travis_retry bundle install | ||
|
||
services: | ||
- mongodb | ||
|
||
matrix: | ||
exclude: | ||
- rvm: 2.2.10 | ||
gemfile: gemfiles/Gemfile.rails-master | ||
- rvm: 2.3.8 | ||
gemfile: gemfiles/Gemfile.rails-master | ||
- rvm: 2.4.5 | ||
gemfile: gemfiles/Gemfile.rails-master | ||
allow_failures: | ||
- rvm: jruby-9.2.6.0 | ||
- rvm: ruby-head | ||
- gemfile: gemfiles/Gemfile.rails-master |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
<h2><%= t 'devise.invitations.edit.header' %></h2> | ||
<h2><%= t "devise.invitations.edit.header" %></h2> | ||
|
||
<%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :put } do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
<%= f.hidden_field :invitation_token, readonly: true %> | ||
<% if f.object.class.require_password_on_accepting %> | ||
<p><%= f.label :password %><br /> | ||
<%= f.password_field :password %></p> | ||
<div class="field"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password %></p> | ||
</div> | ||
|
||
<p><%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation %></p> | ||
<div class="field"> | ||
<%= f.label :password_confirmation %><br /> | ||
<%= f.password_field :password_confirmation %> | ||
</div> | ||
<% end %> | ||
|
||
<p><%= f.submit t("devise.invitations.edit.submit_button") %></p> | ||
<div class="actions"> | ||
<%= f.submit t("devise.invitations.edit.submit_button") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<h2><%= t "devise.invitations.new.header" %></h2> | ||
|
||
<%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => {:method => :post} do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
<% resource.class.invite_key_fields.each do |field| -%> | ||
<p><%= f.label field %><br /> | ||
<%= f.text_field field %></p> | ||
<% end -%> | ||
<% resource.class.invite_key_fields.each do |field| -%> | ||
<div class="field"> | ||
<%= f.label field %><br /> | ||
<%= f.text_field field %> | ||
</div> | ||
<% end -%> | ||
|
||
<p><%= f.submit t("devise.invitations.new.submit_button") %></p> | ||
<div class="actions"> | ||
<%= f.submit t("devise.invitations.new.submit_button") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ group :test do | |
gem 'rspec-rails' | ||
gem 'shoulda' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ group :test do | |
gem 'rspec-rails' | ||
gem 'shoulda' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,4 +22,3 @@ group :test do | |
gem 'rspec-rails' | ||
gem 'shoulda' | ||
end | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 10 additions & 6 deletions
16
lib/generators/devise_invitable/templates/simple_form_for/invitations/edit.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
<h2><%= t 'devise.invitations.edit.header' %></h2> | ||
<h2><%= t "devise.invitations.edit.header" %></h2> | ||
|
||
<%= simple_form_for resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put } do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= simple_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :put }) do |f| %> | ||
<%= f.error_notification %> | ||
<%= f.hidden_field :invitation_token %> | ||
|
||
<%= f.input :password %> | ||
<%= f.input :password_confirmation %> | ||
<div class="form-inputs"> | ||
<%= f.input :password %> | ||
<%= f.input :password_confirmation %> | ||
</div> | ||
|
||
<%= f.button :submit, t("devise.invitations.edit.submit_button") %> | ||
<div class="form-actions"> | ||
<%= f.button :submit, t("devise.invitations.edit.submit_button") %> | ||
</div> | ||
<% end %> |
16 changes: 10 additions & 6 deletions
16
lib/generators/devise_invitable/templates/simple_form_for/invitations/new.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,15 @@ | ||
<h2><%= t "devise.invitations.new.header" %></h2> | ||
|
||
<%= simple_form_for resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post} do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= simple_form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= f.error_notification %> | ||
<% resource.class.invite_key_fields.each do |field| -%> | ||
<%= f.input field %> | ||
<% end -%> | ||
<% resource.class.invite_key_fields.each do |field| -%> | ||
<div class="form-inputs"> | ||
<%= f.input field %> | ||
</div> | ||
<% end -%> | ||
|
||
<%= f.button :submit, t("devise.invitations.new.submit_button") %> | ||
<div class="form-actions"> | ||
<%= f.button :submit, t("devise.invitations.new.submit_button") %> | ||
</div> | ||
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<h2>Send invitation</h2> | ||
|
||
<%= form_for resource, :as => resource_name, :url => admin_path do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: admin_path) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<p><%= f.label :email %><br /> | ||
<%= f.text_field :email %></p> | ||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.text_field :email %> | ||
</div> | ||
|
||
<p><%= f.submit "Send an invitation" %></p> | ||
<div class="actions"> | ||
<%= f.submit "Send an invitation" %> | ||
</div> | ||
<% end %> | ||
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,25 @@ | ||
<h2>Log in</h2> | ||
|
||
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %> | ||
<div><%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true %></div> | ||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.email_field :email, autofocus: true %> | ||
</div> | ||
|
||
<div><%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "off" %></div> | ||
<div class="field"> | ||
<%= f.label :password %><br /> | ||
<%= f.password_field :password, autocomplete: "off" %> | ||
</div> | ||
|
||
<% if devise_mapping.rememberable? -%> | ||
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div> | ||
<div class="field"> | ||
<%= f.check_box :remember_me %> <%= f.label :remember_me %> | ||
</div> | ||
<% end -%> | ||
|
||
<div><%= f.submit "Log in" %></div> | ||
<div class="actions"> | ||
<%= f.submit "Log in" %> | ||
</div> | ||
<% end %> | ||
<%= render "devise/shared/links" %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,16 @@ | ||
<h2>Send invitation</h2> | ||
|
||
<%= form_for resource, :as => resource_name, :url => free_invitation_path do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: free_invitation_path) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<p><%= f.label :email %><br /> | ||
<%= f.text_field :email %></p> | ||
<div class="field"> | ||
<%= f.label :email %><br /> | ||
<%= f.text_field :email %> | ||
</div> | ||
|
||
<p><%= f.submit "Send an invitation" %></p> | ||
<div class="actions"> | ||
<%= f.submit "Send an invitation" %> | ||
</div> | ||
<% end %> | ||
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,21 @@ | ||
<h2>Send an invitation</h2> | ||
|
||
<%= form_for resource, :as => resource_name, :url => invitation_path(resource_name), :html => { :method => :post } do |f| %> | ||
<%= devise_error_messages! %> | ||
<%= form_for(resource, as: resource_name, url: invitation_path(resource_name), html: { method: :post }) do |f| %> | ||
<%= render "devise/shared/error_messages", resource: resource %> | ||
|
||
<p><%= f.label :username %></p> | ||
<p><%= f.text_field :username %></p> | ||
|
||
<p><%= f.label :email %></p> | ||
<p><%= f.text_field :email %></p> | ||
|
||
<p><%= f.submit "Send an invitation" %></p> | ||
<div class="field"> | ||
<%= f.label :username %> | ||
<%= f.text_field :username %> | ||
</div> | ||
|
||
<div class="field"> | ||
<%= f.label :email %> | ||
<%= f.text_field :email %> | ||
</div> | ||
|
||
<div class="actions"> | ||
<%= f.submit "Send an invitation" %> | ||
</div> | ||
<% end %> | ||
<%= link_to "Home", after_sign_in_path_for(resource_name) %><br /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.