Skip to content

Commit

Permalink
Implement new .form-label class, drop .form-group (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbuccini authored Nov 16, 2020
1 parent 59e23f0 commit 099801f
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
4 changes: 2 additions & 2 deletions app/views/devise/confirmations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
<%= form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| %>
<%= render partial: 'devise/shared/error_messages', resource: resource %>

<div class="form-group">
<%= f.label :email %><br />
<div class="mb-3">
<%= f.label :email, class: 'form-label' %><br />
<%= f.email_field :email, autofocus: true, class: 'form-control', value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email) %>
</div>

Expand Down
6 changes: 3 additions & 3 deletions app/views/devise/passwords/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<%= render partial: 'devise/shared/error_messages', resource: resource %>
<%= f.hidden_field :reset_password_token %>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password, autofocus: true, autocomplete: "off", class: 'form-control', placeholder: "Password" %>
<% if @minimum_password_length %>
<p class="text-muted"><small><%= @minimum_password_length %> characters minimum</small></p>
<% end %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: "Confirm Password" %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.submit "Change my password", class: 'btn btn-primary btn-block btn-lg' %>
</div>
<% end %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/devise/passwords/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<%= render partial: 'devise/shared/error_messages', resource: resource %>
<br>
<p class="text-center">Enter your email address below and we will send you a link to reset your password.</p>
<div class="form-group">
<div class="mb-3">
<%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.submit "Send password reset email", class: 'btn btn-primary btn-block btn-lg' %>
</div>
<% end %>
Expand Down
10 changes: 5 additions & 5 deletions app/views/devise/registrations/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,29 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }) do |f| %>
<%= render partial: 'devise/shared/error_messages', resource: resource %>

<div class="form-group">
<div class="mb-3">
<%= f.email_field :email, class: 'form-control', placeholder: 'Email Address' %>
</div>

<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div class="alert alert-warning">Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
<% end %>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: 'Password' %>
<p class="form-text text-muted"><small>Leave password blank if you don't want to change it</small></p>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Confirm Password' %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :current_password, autocomplete: "off", class: 'form-control', placeholder: 'Current Password' %>
<p class="form-text text-muted"><small>We need your current password to confirm your changes</small></p>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.submit "Save Changes", class: 'btn btn-lg btn-block btn-primary' %>
</div>
<% end %>
Expand Down
8 changes: 4 additions & 4 deletions app/views/devise/registrations/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,19 @@
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render partial: 'devise/shared/error_messages', resource: resource %>

<div class="form-group">
<div class="mb-3">
<%= f.email_field :email, autofocus: false, class: 'form-control', placeholder: "Email Address" %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password, autocomplete: "off", class: 'form-control', placeholder: 'Password' %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password_confirmation, autocomplete: "off", class: 'form-control', placeholder: 'Confirm Password' %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.submit "Sign up", class: "btn btn-primary btn-block btn-lg" %>
</div>
<% end %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/devise/sessions/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
<h1 class="text-center">Log in</h1>

<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="form-group">
<div class="mb-3">
<%= f.email_field :email, autofocus: true, placeholder: 'Email Address', class: 'form-control' %>
</div>

<div class="form-group">
<div class="mb-3">
<%= f.password_field :password, autocomplete: "off", placeholder: 'Password', class: 'form-control' %>
</div>

Expand All @@ -20,7 +20,7 @@
</div>
<% end -%>

<div class="form-group">
<div class="mb-3">
<%= f.submit "Log in", class: "btn btn-primary btn-block btn-lg" %>
</div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/devise/unlocks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<%= render partial: 'devise/shared/error_messages', resource: resource %>

<div class="field">
<%= f.label :email %><br />
<%= f.label :email, class: 'form-label' %><br />
<%= f.email_field :email, autofocus: true %>
</div>

Expand Down
2 changes: 1 addition & 1 deletion lib/devise/generators/bootstrapped_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
module Devise
module Views
class BootstrappedGenerator < Rails::Generators::Base
desc "Copies views styled for Bootstrap 3"
desc "Copies views styled for Bootstrap 5"

source_root File.expand_path("../../../..", __FILE__)

Expand Down

0 comments on commit 099801f

Please sign in to comment.