From c3d4179eebc2ae651ec441518a3fb0f9bfddec09 Mon Sep 17 00:00:00 2001 From: Raghu Betina Date: Wed, 13 Jul 2016 00:52:52 -0400 Subject: [PATCH 1/9] Update to Bootstrap 4 --- passwords/edit.html.erb | 57 ++++++++++++++++++++++ passwords/new.html.erb | 43 +++++++++++++++++ registrations/edit.html.erb | 84 +++++++++++++++++++++----------- registrations/new.html.erb | 95 ++++++++++++++++++++++--------------- sessions/new.html.erb | 38 ++++++++------- 5 files changed, 236 insertions(+), 81 deletions(-) create mode 100644 passwords/edit.html.erb create mode 100644 passwords/new.html.erb mode change 100644 => 100755 registrations/edit.html.erb mode change 100644 => 100755 registrations/new.html.erb mode change 100644 => 100755 sessions/new.html.erb diff --git a/passwords/edit.html.erb b/passwords/edit.html.erb new file mode 100644 index 0000000..ea8c0c5 --- /dev/null +++ b/passwords/edit.html.erb @@ -0,0 +1,57 @@ +
+
+
+

+ Change your password +

+ +
+ <%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| %> + <%= f.hidden_field :reset_password_token %> + +
"> + <%= f.label :password, "New password", class: "col-sm-2 control-label" %> +
+ <%= f.password_field :password, class: "form-control" %> + + <% if resource.errors.include?(:password) %> + <% resource.errors.full_messages_for(:password).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %> +
+
+ +
"> + <%= f.label :password_confirmation, "Confirm new password", class: "col-sm-2 control-label" %> +
+ <%= f.password_field :password_confirmation, class: "form-control" %> + + <% if resource.errors.include?(:password_confirmation) %> + <% resource.errors.full_messages_for(:password_confirmation).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %> +
+
+ +
+
+ <%= f.submit "Change my password", class: "btn btn-primary btn-block" %> +
+
+ +
+
+ <%= render "devise/shared/links" %> +
+
+ <% end %> +
+
+
+
diff --git a/passwords/new.html.erb b/passwords/new.html.erb new file mode 100644 index 0000000..b30bd75 --- /dev/null +++ b/passwords/new.html.erb @@ -0,0 +1,43 @@ +
+
+
+

+ Forgot your password? +

+ +
+ + <%= form_for(resource, as: resource_name, url: password_path(resource_name)) do |f| %> + +
"> + <%= f.label :email, class: "col-sm-2 control-label" %> +
+ <%= f.email_field :email, autofocus: true, class: "form-control" %> + + <% if resource.errors.include?(:email) %> + <% resource.errors.full_messages_for(:email).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %> +
+
+ +
+
+ <%= f.submit "Send me reset password instructions", class: "btn btn-primary btn-block" %> +
+
+ +
+
+ <%= render "devise/shared/links" %> +
+
+ + <% end %> +
+
+
+
diff --git a/registrations/edit.html.erb b/registrations/edit.html.erb old mode 100644 new mode 100755 index 9bab2c8..e2d2231 --- a/registrations/edit.html.erb +++ b/registrations/edit.html.erb @@ -1,75 +1,105 @@ -
-
-
-
-

Edit <%= resource_name.to_s.humanize %>

-
+
+
+
+

+ Edit <%= resource_name.to_s.humanize %> +

-
+
- <%= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put, class: "form-horizontal", role: "form" }) do |f| %> - <%= devise_error_messages! %> + <%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %> -
+
"> <%= f.label :email, class: "col-sm-2 control-label" %>
<%= f.email_field :email, autofocus: true, class: "form-control" %> + + <% if resource.errors.include?(:email) %> + <% resource.errors.full_messages_for(:email).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %> -
+
-

+

Currently waiting confirmation for: <%= resource.unconfirmed_email %>

<% end %> -
+
"> <%= f.label :password, class: "col-sm-2 control-label" %>
- <%= f.password_field :password, autocomplete: "off", class: "form-control" %> -

- Leave blank if you don't want to change it. -

+ <%= f.password_field :password, class: "form-control" %> + + <% if resource.errors.include?(:password) %> + <% resource.errors.full_messages_for(:password).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %>
-
+
"> <%= f.label :password_confirmation, class: "col-sm-2 control-label" %>
- <%= f.password_field :password_confirmation, autocomplete: "off", class: "form-control" %> + <%= f.password_field :password_confirmation, class: "form-control" %> + + <% if resource.errors.include?(:password_confirmation) %> + <% resource.errors.full_messages_for(:password_confirmation).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% end %>
-
+
"> <%= f.label :current_password, class: "col-sm-2 control-label" %>
<%= f.password_field :current_password, autocomplete: "off", class: "form-control" %> -

- We need your current password to confirm your changes. -

+ + <% if resource.errors.include?(:current_password) %> + <% resource.errors.full_messages_for(:current_password).each do |message| %> +

+ <%= message %> +

+ <% end %> + <% else %> +

+ We need your current password to confirm your changes. +

+ <% end %>
-
+
- <%= f.submit "Update", class: "btn btn-success btn-block" %> + <%= f.submit "Update", class: "btn btn-primary btn-block" %>
-
+
<%= link_to "Back", :back, class: "btn btn-link btn-block" %>
+ <% end %>
-