Add new styling for Devise views

This commit is contained in:
Andreas Nedbal 2020-05-06 21:56:10 +02:00
parent 6c54f8b79f
commit 83f51b6422
5 changed files with 59 additions and 41 deletions

View File

@ -1,11 +1,15 @@
- provide(:title, generate_title("Resend confirmation instructions")) - provide(:title, generate_title("Resend confirmation instructions"))
.container .container
%h1 Resend confirmation instructions .row
= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| .col-sm-8.offset-sm-2
= devise_error_messages! .card.mt-3
.card-body
%h1 Resend confirmation instructions
= bootstrap_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.text_field :screen_name, autofocus: true, label: "User name" = f.text_field :screen_name, autofocus: true, label: "User name"
= f.submit "Resend confirmation instructions" = f.submit "Resend confirmation instructions", class: "btn btn-primary mb-3"
= render "devise/shared/links" = render "devise/shared/links"
= render "shared/links" = render "shared/links"

View File

@ -1,15 +1,19 @@
- provide(:title, generate_title("Reset Password")) - provide(:title, generate_title("Reset Password"))
.container .container
%h1 Change your password .row
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| .col-sm-4.offset-sm-4
= devise_error_messages! .card.mt-3
.card-body
%h1 Change your password
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f|
= devise_error_messages!
= f.hidden_field :reset_password_token = f.hidden_field :reset_password_token
= f.password_field :password, autofocus: true, autocomplete: "off", label: "New password" = f.password_field :password, autofocus: true, autocomplete: "off", label: "New password"
= f.password_field :password_confirmation, autocomplete: "off", label: "Confirm new password" = f.password_field :password_confirmation, autocomplete: "off", label: "Confirm new password"
= f.submit "Change my password" = f.submit "Change my password"
= render "devise/shared/links" = render "devise/shared/links"
= render "shared/links" = render "shared/links"

View File

@ -1,11 +1,15 @@
- provide(:title, generate_title("Forgot your Password?")) - provide(:title, generate_title("Forgot your Password?"))
.container .container
%h1 Forgot your password? .row
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| .col-sm-8.offset-sm-2
= devise_error_messages! .card.mt-3
.card-body
%h1 Forgot your password?
= bootstrap_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f|
= devise_error_messages!
= f.email_field :email, autofocus: true, label: "Email address" = f.email_field :email, autofocus: true, label: "Email address"
= f.submit "Send me password reset instructions" = f.submit "Send me password reset instructions", class: "btn btn-primary mb-3"
= render "devise/shared/links" = render "devise/shared/links"
= render "shared/links" = render "shared/links"

View File

@ -1,18 +1,21 @@
- provide(:title, generate_title("Sign Up")) - provide(:title, generate_title("Sign Up"))
.container .container
%h1= t('views.sessions.new') .row
.col-sm-8.offset-sm-2
.card.mt-3
.card-body
%h1= t('views.sessions.new')
= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f|
= devise_error_messages!
= bootstrap_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| = f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username')
= devise_error_messages! = f.email_field :email, autofocus: false, label: t('views.settings.account.email')
= f.text_field :screen_name, autofocus: true, label: t('views.settings.account.username') = f.password_field :password, autocomplete: "off", label: t('views.settings.account.password')
= f.email_field :email, autofocus: false, label: t('views.settings.account.email') = f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm')
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password') %p= raw t('views.sessions.info', terms: link_to(t('views.general.terms'), terms_path))
= f.password_field :password_confirmation, autocomplete: "off", label: t('views.settings.account.password_confirm') = f.submit "Sign up", class: "btn btn-primary mb-3"
%p= raw t('views.sessions.info', terms: link_to(t('views.general.terms'), terms_path)) = render "devise/shared/links"
= f.submit "Sign up"
= render "devise/shared/links"
= render 'shared/links' = render 'shared/links'

View File

@ -1,17 +1,20 @@
- provide(:title, generate_title("Sign In")) - provide(:title, generate_title("Sign In"))
.container .container
%h1= t('views.sessions.create') .row
= render 'layouts/messages' .col-sm-4.offset-sm-4
= render 'layouts/messages'
.card.mt-3
.card-body
%h1.mb-3.mt-0= t('views.sessions.create')
= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f|
= bootstrap_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| = f.text_field :login, autofocus: true, label: t('views.settings.account.username')
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password')
= f.text_field :login, autofocus: true, label: t('views.settings.account.username') - if devise_mapping.rememberable?
= f.password_field :password, autocomplete: "off", label: t('views.settings.account.password') = f.check_box :remember_me
- if devise_mapping.rememberable? = f.submit t('views.sessions.create'), class: "btn btn-primary mt-3 mb-3"
= f.check_box :remember_me
= f.submit t('views.sessions.create') = render "devise/shared/links"
= render "devise/shared/links"
= render "shared/links" = render "shared/links"