From 5d879a06433df6849e8c332e65bafdd8a1948ff0 Mon Sep 17 00:00:00 2001 From: gitlabhq Date: Fri, 28 Oct 2011 18:25:00 +0300 Subject: [PATCH] signin page --- app/assets/stylesheets/projects.css.scss | 1 + app/controllers/application_controller.rb | 10 ++++++++ app/views/devise/sessions/new.html.erb | 30 +++++++++-------------- app/views/layouts/devise.html.haml | 16 ++++++++++++ 4 files changed, 38 insertions(+), 19 deletions(-) create mode 100644 app/views/layouts/devise.html.haml diff --git a/app/assets/stylesheets/projects.css.scss b/app/assets/stylesheets/projects.css.scss index e4a018d6466..e5184a7eb2f 100644 --- a/app/assets/stylesheets/projects.css.scss +++ b/app/assets/stylesheets/projects.css.scss @@ -430,6 +430,7 @@ tbody tr:nth-child(2n) td, tbody tr.even td { color:#444; font-size:22px; padding-top:5px; + margin:2px; } } diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 816c4c55b8b..0bf38a57622 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -8,8 +8,18 @@ class ApplicationController < ActionController::Base render :file => File.join(Rails.root, "public", "gitosis_error"), :layout => false end + layout :layout_by_resource + protected + def layout_by_resource + if devise_controller? + "devise" + else + "application" + end + end + def abilities @abilities ||= Six.new end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 21de54f0c4c..c2c6562d01d 100644 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -1,20 +1,12 @@ -

Sign in

+<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => { :class => "login-box" }) do |f| %> + <%= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo" %> + <%= f.text_field :email, :class => "text top" %> + <%= f.password_field :password, :class => "text bottom" %> -
- <%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> -
<%= f.label :email %>
- <%= f.text_field :email %>
- -
<%= f.label :password %>
- <%= f.password_field :password %>
- - <% if devise_mapping.rememberable? -%> -
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
- <% end -%> -
-
<%= f.submit "Sign in", :class => "lbutton vm" %>
- <% end %> -
-
- <%= render :partial => "devise/shared/links" %> -
+ <% if devise_mapping.rememberable? -%> +
<%= f.check_box :remember_me %> <%= f.label :remember_me %>
+ <% end -%> +
+ <%= f.submit "Sign in", :class => "grey-button" %> +
<%= render :partial => "devise/shared/links" %>
+<% end %> diff --git a/app/views/layouts/devise.html.haml b/app/views/layouts/devise.html.haml new file mode 100644 index 00000000000..d814a05807f --- /dev/null +++ b/app/views/layouts/devise.html.haml @@ -0,0 +1,16 @@ +!!! +%html + %head + %title + GitLab #{" - #{@project.name}" if @project && !@project.new_record?} + = stylesheet_link_tag "application" + = javascript_include_tag "application" + = csrf_meta_tags + %link{:href => "/assets/favicon.png", :rel => "icon", :type => "image/png"}/ + = javascript_tag do + REQ_URI = "#{request.env["REQUEST_URI"]}"; + REQ_REFFER = "#{request.env["HTTP_REFERER"]}"; + %body.login-page + #container + = render :partial => "layouts/flash" + = yield