Skip to content

Commit

Permalink
center login form
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhairi committed Nov 27, 2017
1 parent 5ba125b commit 44b2e5d
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 83 deletions.
5 changes: 4 additions & 1 deletion app/assets/stylesheets/devise.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
.login-form {
margin: auto !important;
margin-left: auto !important;
margin-right: auto !important;
display: flex;
justify-content: center;

.card {
max-width: 500px;
Expand Down
2 changes: 0 additions & 2 deletions app/views/layouts/login.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ html
margin-bottom: 1rem;
}



body class="#{@color}"
main style="padding-top: 4rem"
section#login
Expand Down
37 changes: 18 additions & 19 deletions app/views/users/confirmations/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
.row.login-form
.col.s12
.card.hoverable
.card-content
span.card-title.center
| Resend Confirmation Instructions
.divider
= simple_form_for resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post } do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
.form-actions.center
= f.button :submit, "Resend Confirmation Instructions"
.card-action
.devise-links
= render "users/shared/links"
.login-form
.card.hoverable
.card-content
span.card-title.center
| Resend Confirmation Instructions
.divider
= simple_form_for resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post } do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true, value: (resource.pending_reconfirmation? ? resource.unconfirmed_email : resource.email)
.form-actions.center
= f.button :submit, "Resend Confirmation Instructions"
.card-action
.devise-links
= render "users/shared/links"
37 changes: 18 additions & 19 deletions app/views/users/passwords/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
.row.login-form
.col.s12
.card.hoverable
.card-content
span.card-title.center Forgot your Password?
.divider
= simple_form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :post } do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true
.form-actions.center
= f.button :submit, "Send Me Reset Instructions"
.card-action
.devise-links
= render "users/shared/links"

.login-form
.card.hoverable
.card-content
span.card-title.center Forgot your Password?
.divider
= simple_form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :post } do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true
.form-actions.center
= f.button :submit, "Send Me Reset Instructions"
.card-action
.devise-links
= render "users/shared/links"

41 changes: 20 additions & 21 deletions app/views/users/registrations/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
.row.login-form
.col.s12
.card.hoverable
.card-content
span.card-title.center Sign Up
.divider
= simple_form_for resource, as: resource_name, url: registration_path(resource_name) do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true
= f.input :password, autocomplete: "off", required: true, icon: "lock", label_html: { data: { hint: "#{@minimum_password_length} Characters Minimum" } }
= f.input :password_confirmation, autocomplete: "off", required: true, icon: "lock"
.form-actions.center
= f.button :submit, "Sign Up"
.card-action
.devise-links
= render "users/shared/links"

.login-form
.card.hoverable
.card-content
span.card-title.center Sign Up
.divider
= simple_form_for resource, as: resource_name, url: registration_path(resource_name) do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, autofocus: true, required: true
= f.input :password, autocomplete: "off", required: true, icon: "lock", label_html: { data: { hint: "#{@minimum_password_length} Characters Minimum" } }
= f.input :password_confirmation, autocomplete: "off", required: true, icon: "lock"
.form-actions.center
= f.button :submit, "Sign Up"
.card-action
.devise-links
= render "users/shared/links"

41 changes: 20 additions & 21 deletions app/views/users/sessions/new.html.slim
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
.row.login-form
.col.s12
.card.hoverable
.card-content
span.card-title.center Log In
.divider
= simple_form_for resource, as: resource_name, url: session_path(resource_name) do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, required: true, autofocus: true
= f.input :password, required: true, autocomplete: "off", icon: "lock", hint: false
= f.input :remember_me, as: :boolean if devise_mapping.rememberable?
.form-actions.center
= f.button :submit, "Log In"
.card-action
.devise-links
= render "users/shared/links"

.login-form
.card.hoverable
.card-content
span.card-title.center Log In
.divider
= simple_form_for resource, as: resource_name, url: session_path(resource_name) do |f|
- if devise_error_messages? || alert
.form-errors.red.lighten-1
= devise_error_messages!
= alert
.form-inputs.row
= f.input :email, required: true, autofocus: true
= f.input :password, required: true, autocomplete: "off", icon: "lock", hint: false
= f.input :remember_me, as: :boolean if devise_mapping.rememberable?
.form-actions.center
= f.button :submit, "Log In"
.card-action
.devise-links
= render "users/shared/links"

0 comments on commit 44b2e5d

Please sign in to comment.