devise-bootstrap-form 0.1.0 → 1.0.0.alpha.pre.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ruby.yml +46 -0
- data/.gitignore +17 -0
- data/.rubocop.yml +31 -12
- data/CHANGELOG.md +54 -1
- data/CONTRIBUTING.md +38 -14
- data/Dangerfile +11 -13
- data/Gemfile +1 -1
- data/README.md +67 -44
- data/RELEASING.md +2 -1
- data/app/views/devise/confirmations/new.html.erb +13 -19
- data/app/views/devise/invitations/edit.html.erb +10 -16
- data/app/views/devise/invitations/new.html.erb +8 -14
- data/app/views/devise/mailer/invitation_instructions.html.erb +1 -1
- data/app/views/devise/mailer/invitation_instructions.text.erb +1 -1
- data/app/views/devise/passwords/edit.html.erb +19 -25
- data/app/views/devise/passwords/new.html.erb +11 -18
- data/app/views/devise/registrations/edit.html.erb +20 -26
- data/app/views/devise/registrations/new.html.erb +16 -22
- data/app/views/devise/sessions/new.html.erb +15 -21
- data/app/views/devise/shared/_error_messages.html.erb +15 -0
- data/app/views/devise/shared/_links.html.erb +5 -5
- data/app/views/devise/unlocks/new.html.erb +10 -16
- data/app/views/i18n/confirmations/new.html.erb +17 -0
- data/app/views/i18n/mailer/confirmation_instructions.html.erb +4 -0
- data/app/views/i18n/mailer/email_changed.html.erb +7 -0
- data/app/views/i18n/mailer/password_change.html.erb +3 -0
- data/app/views/i18n/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/i18n/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/i18n/passwords/edit.html.erb +23 -0
- data/app/views/i18n/passwords/new.html.erb +12 -0
- data/app/views/i18n/registrations/edit.html.erb +27 -0
- data/app/views/i18n/registrations/new.html.erb +19 -0
- data/app/views/i18n/sessions/new.html.erb +18 -0
- data/app/views/i18n/shared/_links.html.erb +25 -0
- data/app/views/i18n/unlocks/new.html.erb +14 -0
- data/bin/console +5 -5
- data/devise-bootstrap-form.gemspec +22 -13
- data/gemfiles/5.2.gemfile +14 -0
- data/gemfiles/6.0.gemfile +14 -0
- data/gemfiles/6.1.gemfile +14 -0
- data/gemfiles/7.0.gemfile +14 -0
- data/lib/devise_bootstrap_form/railtie.rb +6 -0
- data/lib/devise_bootstrap_form/version.rb +6 -0
- data/lib/{devise/bootstrap_form.rb → devise_bootstrap_form.rb} +1 -1
- data/lib/generators/devise/views/bootstrap_form_generator.rb +25 -8
- metadata +59 -28
- data/.travis.yml +0 -23
- data/lib/devise/bootstrap_form/railtie.rb +0 -6
- data/lib/devise/bootstrap_form/version.rb +0 -7
@@ -5,7 +5,7 @@
|
|
5
5
|
<p><%= link_to t("devise.mailer.invitation_instructions.accept"), accept_invitation_url(@resource, :invitation_token => @token) %></p>
|
6
6
|
|
7
7
|
<% if @resource.invitation_due_at %>
|
8
|
-
<p><%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :
|
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
9
|
<% end %>
|
10
10
|
|
11
11
|
<p><%= t("devise.mailer.invitation_instructions.ignore") %></p>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<%= accept_invitation_url(@resource, :invitation_token => @token) %>
|
6
6
|
|
7
7
|
<% if @resource.invitation_due_at %>
|
8
|
-
<%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :
|
8
|
+
<%= t("devise.mailer.invitation_instructions.accept_until", due_date: l(@resource.invitation_due_at, format: :"devise.mailer.invitation_instructions.accept_until_format")) %>
|
9
9
|
<% end %>
|
10
10
|
|
11
11
|
<%= t("devise.mailer.invitation_instructions.ignore") %>
|
@@ -1,29 +1,23 @@
|
|
1
|
-
<
|
2
|
-
<div class="devise-bootstrap-form-row">
|
3
|
-
<div class="devise-bootstrap-form-col">
|
4
|
-
<h2 class="text-center">Change your password</h2>
|
1
|
+
<h2 class="text-center">Change your password</h2>
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
7
|
+
<%= f.password_field :password,
|
8
|
+
autofocus: true,
|
9
|
+
autocomplete: "new-password",
|
10
|
+
help: "(#{@minimum_password_length} characters minimum)",
|
11
|
+
label: "New password" %>
|
12
|
+
<%= f.password_field :password_confirmation,
|
13
|
+
label: "Confirm new password",
|
14
|
+
autocomplete: "off",
|
15
|
+
class: "required" %>
|
16
|
+
<%= f.form_group class: "d-grid" do %>
|
17
|
+
<%= f.submit "Change my password", class: "btn btn-primary btn-lg" %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
23
20
|
|
24
|
-
|
25
|
-
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
</div>
|
21
|
+
<div class="text-center">
|
22
|
+
<%= render "devise/shared/links" %>
|
29
23
|
</div>
|
@@ -1,20 +1,13 @@
|
|
1
|
-
<
|
2
|
-
<div class="devise-bootstrap-form-row">
|
3
|
-
<div class="devise-bootstrap-form-col">
|
4
|
-
<h2 class="text-center">Forgot your password?</h2>
|
1
|
+
<h2 class="text-center">Forgot your password?</h2>
|
5
2
|
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
<%= render "devise/shared/links" %>
|
17
|
-
</div>
|
18
|
-
</div>
|
19
|
-
</div>
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<p class="text-left">Please enter your email address and we will send you a link to reset your password.</p>
|
6
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
7
|
+
<%= f.form_group class: "d-grid" do %>
|
8
|
+
<%= f.submit "Send me reset password instructions", class: "btn btn-primary btn-lg" %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
<div class="text-center">
|
12
|
+
<%= render "devise/shared/links" %>
|
20
13
|
</div>
|
@@ -1,33 +1,27 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
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! %>
|
1
|
+
<h2 class="text-center">Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
3
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
4
|
|
8
|
-
|
5
|
+
<%= f.email_field :email %>
|
9
6
|
|
10
|
-
|
11
|
-
|
12
|
-
|
7
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
8
|
+
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
9
|
+
<% end %>
|
13
10
|
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
11
|
+
<%= f.password_field :password, autocomplete: "off", help: "leave blank if you don't want to change it" %>
|
12
|
+
<%= f.password_field :password_confirmation, autocomplete: "off", class: "required" %>
|
13
|
+
<%= f.password_field :current_password,
|
14
|
+
autocomplete: "off",
|
15
|
+
class: "required",
|
16
|
+
help: "We need your current password to confirm your changes." %>
|
20
17
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
18
|
+
<%= f.form_group class: "d-grid" do %>
|
19
|
+
<%= f.submit "Update", class: "btn btn-lg btn-primary" %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
25
22
|
|
26
|
-
|
23
|
+
<h2>Cancel my account</h2>
|
27
24
|
|
28
|
-
|
25
|
+
<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>
|
29
26
|
|
30
|
-
|
31
|
-
</div>
|
32
|
-
</div>
|
33
|
-
</div>
|
27
|
+
<%= link_to "Back", :back %>
|
@@ -1,25 +1,19 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
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! %>
|
1
|
+
<h2 class="text-center">Sign up</h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
3
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
5
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
6
|
+
<%= f.password_field :password,
|
7
|
+
autocomplete: "new-password",
|
8
|
+
help: "(#{@minimum_password_length} characters minimum)" %>
|
9
|
+
<%= f.password_field :password_confirmation,
|
10
|
+
autocomplete: "new-password",
|
11
|
+
label_class: "required" %>
|
15
12
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
</div>
|
23
|
-
</div>
|
24
|
-
</div>
|
13
|
+
<%= f.form_group class: "d-grid" do %>
|
14
|
+
<%= f.submit "Sign up", class: "btn btn-primary btn-lg" %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<div class="text-center">
|
18
|
+
<%= render "devise/shared/links" %>
|
25
19
|
</div>
|
@@ -1,24 +1,18 @@
|
|
1
|
-
<
|
2
|
-
|
3
|
-
|
4
|
-
|
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' %>
|
1
|
+
<h2 class="text-center">Log in</h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
3
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
4
|
+
<%= f.password_field :password, autocomplete: "current-password", placeholder: "Password" %>
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
<% if devise_mapping.rememberable? -%>
|
7
|
+
<%= f.form_group do %>
|
8
|
+
<%= f.check_box :remember_me %>
|
9
|
+
<% end %>
|
10
|
+
<% end -%>
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
</div>
|
22
|
-
</div>
|
23
|
-
</div>
|
12
|
+
<%= f.form_group class: "d-grid" do %>
|
13
|
+
<%= f.submit "Log in", class: "btn btn-primary btn-lg" %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<div class="text-center">
|
17
|
+
<%= render "devise/shared/links" %>
|
24
18
|
</div>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<% if resource.errors.any? %>
|
2
|
+
<div id="error_explanation">
|
3
|
+
<h2>
|
4
|
+
<%= I18n.t("errors.messages.not_saved",
|
5
|
+
count: resource.errors.count,
|
6
|
+
resource: resource.class.model_name.human.downcase)
|
7
|
+
%>
|
8
|
+
</h2>
|
9
|
+
<ul>
|
10
|
+
<% resource.errors.full_messages.each do |message| %>
|
11
|
+
<li><%= message %></li>
|
12
|
+
<% end %>
|
13
|
+
</ul>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
@@ -1,20 +1,20 @@
|
|
1
|
-
<%- if controller_name !=
|
1
|
+
<%- if controller_name != "sessions" %>
|
2
2
|
<%= link_to "Log in", new_session_path(resource_name) %><br />
|
3
3
|
<% end -%>
|
4
4
|
|
5
|
-
<%- if devise_mapping.registerable? && controller_name !=
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != "registrations" %>
|
6
6
|
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
7
7
|
<% end -%>
|
8
8
|
|
9
|
-
<%- if devise_mapping.recoverable? && controller_name !=
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != "passwords" && controller_name != "registrations" %>
|
10
10
|
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
11
|
<% end -%>
|
12
12
|
|
13
|
-
<%- if devise_mapping.confirmable? && controller_name !=
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != "confirmations" %>
|
14
14
|
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
15
|
<% end -%>
|
16
16
|
|
17
|
-
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name !=
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != "unlocks" %>
|
18
18
|
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
19
|
<% end -%>
|
20
20
|
|
@@ -1,20 +1,14 @@
|
|
1
|
-
<
|
2
|
-
<div class="devise-bootstrap-form-row">
|
3
|
-
<div class="devise-bootstrap-form-col">
|
4
|
-
<h2 class="text-center">Resend unlock instructions</h2>
|
1
|
+
<h2 class="text-center">Resend unlock instructions</h2>
|
5
2
|
|
6
|
-
|
7
|
-
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
8
5
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
6
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
7
|
+
<%= f.form_group class: "d-grid" do %>
|
8
|
+
<%= f.submit "Resend unlock instructions", class: "btn btn-primary btn-lg" %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
14
11
|
|
15
|
-
|
16
|
-
|
17
|
-
</div>
|
18
|
-
</div>
|
19
|
-
</div>
|
12
|
+
<div class="text-center">
|
13
|
+
<%= render "devise/shared/links" %>
|
20
14
|
</div>
|
@@ -0,0 +1,17 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".resend_confirmation_instructions") %></h2>
|
2
|
+
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%= f.email_field :email,
|
7
|
+
autofocus: true,
|
8
|
+
autocomplete: "email",
|
9
|
+
value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
|
10
|
+
<%= f.form_group class: "d-grid" do %>
|
11
|
+
<%= f.submit t(".resend_confirmation_instructions"), class: "btn btn-primary btn-lg btn-block" %>
|
12
|
+
<% end %>
|
13
|
+
<% end %>
|
14
|
+
|
15
|
+
<div class="text-center">
|
16
|
+
<%= render "devise/shared/links" %>
|
17
|
+
</div>
|
@@ -0,0 +1,23 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".change_your_password") %></h2>
|
2
|
+
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<%= f.hidden_field :reset_password_token %>
|
6
|
+
|
7
|
+
<%= f.password_field :password,
|
8
|
+
autofocus: true,
|
9
|
+
autocomplete: "new-password",
|
10
|
+
help: "t("devise.shared.minimum_password_length", count: @minimum_password_length)",
|
11
|
+
label: t(".new_password") %>
|
12
|
+
<%= f.password_field :password_confirmation,
|
13
|
+
label: t(".confirm_new_password"),
|
14
|
+
autocomplete: "off",
|
15
|
+
class: "required" %>
|
16
|
+
<%= f.form_group class: "d-grid" do %>
|
17
|
+
<%= f.submit t(".change_my_password"), class: "btn btn-primary btn-lg" %>
|
18
|
+
<% end %>
|
19
|
+
<% end %>
|
20
|
+
|
21
|
+
<div class="text-center">
|
22
|
+
<%= render "devise/shared/links" %>
|
23
|
+
</div>
|
@@ -0,0 +1,12 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".forgot_your_password") %></h2>
|
2
|
+
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
6
|
+
<%= f.form_group class: "d-grid" do %>
|
7
|
+
<%= f.submit t(".send_me_reset_password_instructions"), class: "btn btn-primary btn-lg" %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
<div class="text-center">
|
11
|
+
<%= render "devise/shared/links" %>
|
12
|
+
</div>
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<h2 class="text-center">t(".title", resource: resource_name.to_s.humanize)</h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
|
3
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
4
|
+
|
5
|
+
<%= f.email_field :email %>
|
6
|
+
|
7
|
+
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
|
8
|
+
<div><%= t(".currently_waiting_confirmation_for_email", email: resource.unconfirmed_email) %></div>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%= f.password_field :password, autocomplete: "off", help: t(".leave_blank_if_you_don_t_want_to_change_it") + " " + t("devise.shared.minimum_password_length", count: @minimum_password_length) %>
|
12
|
+
<%= f.password_field :password_confirmation, autocomplete: "off", class: "required" %>
|
13
|
+
<%= f.password_field :current_password,
|
14
|
+
autocomplete: "off",
|
15
|
+
class: "required",
|
16
|
+
help: t(".we_need_your_current_password_to_confirm_your_changes") %>
|
17
|
+
|
18
|
+
<%= f.form_group class: "d-grid" do %>
|
19
|
+
<%= f.submit t(".update"), class: "btn btn-lg btn-primary" %>
|
20
|
+
<% end %>
|
21
|
+
<% end %>
|
22
|
+
|
23
|
+
<h2><%= t(".cancel_my_account") %></h2>
|
24
|
+
|
25
|
+
<p><%= t(".unhappy") %> <%= button_to t(".cancel_my_account"), registration_path(resource_name), class: "btn btn-danger", data: { confirm: t(".are_you_sure") }, method: :delete %></p>
|
26
|
+
|
27
|
+
<%= link_to t("devise.shared.links.back"), :back %>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".sign_up") %></h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
3
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
4
|
+
|
5
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
6
|
+
<%= f.password_field :password,
|
7
|
+
autocomplete: "new-password",
|
8
|
+
help: t("devise.shared.minimum_password_length", count: @minimum_password_length) %>
|
9
|
+
<%= f.password_field :password_confirmation,
|
10
|
+
autocomplete: "new-password",
|
11
|
+
label_class: "required" %>
|
12
|
+
|
13
|
+
<%= f.form_group class: "d-grid" do %>
|
14
|
+
<%= f.submit t(".sign_up"), class: "btn btn-primary btn-lg" %>
|
15
|
+
<% end %>
|
16
|
+
<% end %>
|
17
|
+
<div class="text-center">
|
18
|
+
<%= render "devise/shared/links" %>
|
19
|
+
</div>
|
@@ -0,0 +1,18 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".sign_in") %></h2>
|
2
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
|
3
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
4
|
+
<%= f.password_field :password, autocomplete: "current-password", placeholder: "Password" %>
|
5
|
+
|
6
|
+
<% if devise_mapping.rememberable? -%>
|
7
|
+
<%= f.form_group do %>
|
8
|
+
<%= f.check_box :remember_me %>
|
9
|
+
<% end %>
|
10
|
+
<% end -%>
|
11
|
+
|
12
|
+
<%= f.form_group class: "d-grid" do %>
|
13
|
+
<%= f.submit t(".sign_in"), class: "btn btn-primary btn-lg" %>
|
14
|
+
<% end %>
|
15
|
+
<% end %>
|
16
|
+
<div class="text-center">
|
17
|
+
<%= render "devise/shared/links" %>
|
18
|
+
</div>
|
@@ -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) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<h2 class="text-center"><%= t(".resend_unlock_instructions") %></h2>
|
2
|
+
|
3
|
+
<%= bootstrap_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
|
4
|
+
<%= render "devise/shared/error_messages", resource: resource %>
|
5
|
+
|
6
|
+
<%= f.email_field :email, autofocus: true, autocomplete: "email" %>
|
7
|
+
<%= f.form_group class: "d-grid" do %>
|
8
|
+
<%= f.submit t(".resend_unlock_instructions"), class: "btn btn-primary btn-lg" %>
|
9
|
+
<% end %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<div class="text-center">
|
13
|
+
<%= render "devise/shared/links" %>
|
14
|
+
</div>
|
data/bin/console
CHANGED
@@ -2,14 +2,14 @@
|
|
2
2
|
# frozen_string_literal: true
|
3
3
|
|
4
4
|
require "bundler/setup"
|
5
|
-
require "
|
5
|
+
require "devise_bootstrap_form"
|
6
6
|
|
7
7
|
# You can add fixtures and/or initialization code here to make experimenting
|
8
8
|
# with your gem easier. You can also use a different console, if you like.
|
9
9
|
|
10
10
|
# (If you use this, don't forget to add pry to your Gemfile!)
|
11
|
-
|
12
|
-
|
11
|
+
require "pry"
|
12
|
+
Pry.start
|
13
13
|
|
14
|
-
require "irb"
|
15
|
-
IRB.start
|
14
|
+
# require "irb"
|
15
|
+
# IRB.start
|
@@ -2,22 +2,23 @@
|
|
2
2
|
|
3
3
|
lib = File.expand_path("lib", __dir__)
|
4
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
5
|
-
require "
|
5
|
+
require "devise_bootstrap_form/version"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
8
|
spec.name = "devise-bootstrap-form"
|
9
|
-
spec.version =
|
10
|
-
spec.authors = ["
|
9
|
+
spec.version = DeviseBootstrapForm::VERSION
|
10
|
+
spec.authors = ["Larry Reid"]
|
11
11
|
spec.email = ["larry.reid@jadesystems.ca"]
|
12
12
|
|
13
13
|
spec.summary = "Generates nicer views for Devise that use Bootstrap via the `bootstrap_form` gem."
|
14
|
-
spec.description =
|
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.
|
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
18
|
|
19
|
-
The generator will detect if you're using `devise_invitable`, and will generate
|
20
|
-
`bootstrap_form` forms for its views as well.
|
19
|
+
The generator will detect if you're using `devise_invitable`, and will generate
|
20
|
+
`bootstrap_form` forms for its views as well. If you're using `devise-i18n`, the
|
21
|
+
forms will use translations.
|
21
22
|
DESC
|
22
23
|
spec.homepage = "https://github.com/lcreid/devise-bootstrap-form"
|
23
24
|
spec.license = "MIT"
|
@@ -30,15 +31,23 @@ The generator will detect if you're using `devise_invitable`, and will generate
|
|
30
31
|
raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
|
31
32
|
end
|
32
33
|
|
34
|
+
spec.required_ruby_version = ">= 2.6"
|
35
|
+
|
33
36
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
34
37
|
spec.bindir = "exe"
|
35
38
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
36
39
|
spec.require_paths = ["lib"]
|
37
40
|
|
38
|
-
spec.add_dependency "bootstrap_form", "
|
39
|
-
|
41
|
+
spec.add_dependency "bootstrap_form", "~> 5.0"
|
42
|
+
# Devise deprecated devise_error_messages! at 4.6.0, so for later versions
|
43
|
+
# we add a new partial.
|
44
|
+
spec.add_dependency "devise", ">= 4.6.0"
|
40
45
|
spec.add_dependency "rails", ">= 5.0.0"
|
41
|
-
spec.add_development_dependency "bundler"
|
46
|
+
spec.add_development_dependency "bundler"
|
42
47
|
spec.add_development_dependency "chandler"
|
43
|
-
spec.add_development_dependency "
|
48
|
+
spec.add_development_dependency "pry"
|
49
|
+
spec.add_development_dependency "rake"
|
50
|
+
spec.metadata = {
|
51
|
+
"rubygems_mfa_required" => "true"
|
52
|
+
}
|
44
53
|
end
|
@@ -0,0 +1,14 @@
|
|
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 path: ".."
|
7
|
+
|
8
|
+
# Set a Rails version compatible with a Ruby version
|
9
|
+
gem "rails", "~> 5.2.0"
|
10
|
+
|
11
|
+
group :development do
|
12
|
+
gem "rubocop", require: false
|
13
|
+
gem "rubocop-rake", require: false
|
14
|
+
end
|