From 66121d6caabb7f5169e4fc21e6bb8938a5ec14b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 7 Feb 2013 13:20:33 +0200 Subject: [PATCH] Improve devise views --- app/assets/stylesheets/sections/login.scss | 6 +++--- app/views/devise/passwords/new.html.erb | 10 +++++----- app/views/devise/registrations/new.html.haml | 19 +++++++++---------- app/views/devise/sessions/new.html.haml | 6 +++--- 4 files changed, 20 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/sections/login.scss b/app/assets/stylesheets/sections/login.scss index 7536abff..89b8f1c0 100644 --- a/app/assets/stylesheets/sections/login.scss +++ b/app/assets/stylesheets/sections/login.scss @@ -1,7 +1,7 @@ /* Login Page */ -body.login-page{ - padding-top: 10%; - background: #f1f1f1; +body.login-page{ + padding-top: 7%; + background: #666; } .login-box{ diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 1171b3bf..0e39f318 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -1,9 +1,9 @@ -<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :class => "login-box", :method => :post }) do |f| %> - <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> +<%= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: "login-box", method: :post }) do |f| %> + <%= image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo" %> <%= devise_error_messages! %> - <%= f.email_field :email, :placeholder => "Email", :class => "text" %> + <%= f.email_field :email, placeholder: "Email", class: "text" %>

- <%= f.submit "Reset password", :class => "btn-primary btn" %> -
<%= link_to "Sign in", new_session_path(resource_name), :class => "btn" %>
+ <%= f.submit "Reset password", class: "btn-primary btn" %> +
<%= link_to "Sign in", new_session_path(resource_name), class: "btn" %>
<% end %> diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 2b72d4ad..12b04382 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,19 +1,18 @@ -= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :class => "login-box" }) do |f| - = image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" += form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "login-box" }) do |f| + = image_tag "login-logo.png", width: "304", height: "66", class: "login-logo", alt: "Login Logo" = devise_error_messages! %div - = f.text_field :name, :class => "text top", :placeholder => "Name", :required => true + = f.text_field :name, class: "text top", placeholder: "Name", required: true %div - = f.text_field :username, :class => "text middle", :placeholder => "Username", :required => true + = f.text_field :username, class: "text middle", placeholder: "Username", required: true %div - = f.email_field :email, :class => "text middle", :placeholder => "Email", :required => true + = f.email_field :email, class: "text middle", placeholder: "Email", required: true %div - = f.password_field :password, :class => "text middle", :placeholder => "Password", :required => true + = f.password_field :password, class: "text middle", placeholder: "Password", required: true %div - = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm password", :required => true + = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm password", required: true %div - = f.submit "Sign up", :class => "btn-primary btn wide" - %br + = f.submit "Sign up", class: "btn-create btn" %hr = link_to "Sign in", new_session_path(resource_name) - = link_to "Forgot your password?", new_password_path(resource_name), :class => "right" + = link_to "Forgot your password?", new_password_path(resource_name), class: "pull-right" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 7ea41876..d904e701 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -11,18 +11,18 @@ = f.check_box :remember_me %span Remember me %br/ - = f.submit "Sign in", :class => "btn-primary btn wide" + = f.submit "Sign in", :class => "btn-create btn" .pull-right = link_to "Forgot your password?", new_password_path(resource_name), :class => "btn" %br/ - %br/ - if Gitlab.config.gitlab.signup_enabled %hr/ Don't have an account? = link_to "Sign up", new_registration_path(resource_name) - .clearfix - if devise_mapping.omniauthable? && resource_class.omniauth_providers.present? + %hr %div + %span Sign in with:   - resource_class.omniauth_providers.each do |provider| %span = link_to authbutton(provider, 32), omniauth_authorize_path(resource_name, provider)