From 21b1ae75bb062735db1c5e2eef76bb554bc9fb84 Mon Sep 17 00:00:00 2001 From: Petko Bordjukov Date: Mon, 20 Apr 2015 16:42:42 +0300 Subject: [PATCH] Restyle the Sessions#new view --- .../stylesheets/management/_forms.css.scss | 13 +++++++++++ app/views/devise/sessions/new.html.slim | 23 +++++++++++-------- 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/app/assets/stylesheets/management/_forms.css.scss b/app/assets/stylesheets/management/_forms.css.scss index 644ddd7..09a22f7 100644 --- a/app/assets/stylesheets/management/_forms.css.scss +++ b/app/assets/stylesheets/management/_forms.css.scss @@ -1,3 +1,16 @@ +.centered_form { + @extend .col-md-4; + @extend .col-md-offset-4; + @extend .col-sm-6; + @extend .col-sm-offset-3; + + input[type=submit] { + @extend .btn; + @extend .btn-primary; + @extend .btn-block; + } +} + select.date, select.datetime, select.time { display: inline; width: auto; diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index f460452..26638b5 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -1,14 +1,17 @@ - content_for(:title) { t 'sessions.sign_in' } -h2.entry-title = t :login +.row + .centered_form + = simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| + header + legend + h2.entry-title = t 'sessions.sign_in_heading' + .form-inputs + = f.input :email, required: false, autofocus: true, hint: false + = f.input :password, required: false, hint: false + = f.input :remember_me, as: :boolean if devise_mapping.rememberable? -= simple_form_for(resource, as: resource_name, url: session_path(resource_name), ) do |f| - .form-inputs - = f.input :email, required: false, autofocus: true, hint: false - = f.input :password, required: false, hint: false - = f.input :remember_me, as: :boolean if devise_mapping.rememberable? + .form-actions + = f.button :submit, t('sessions.sign_in') - .form-actions - = f.button :submit, t('sessions.sign_in') - -== render 'devise/shared/links' + = render 'devise/shared/links'