From 11e431f64070a5a20d545d0f1791ce537dbb7a48 Mon Sep 17 00:00:00 2001 From: Gonzalo Rodriguez Date: Wed, 16 Feb 2011 23:35:06 -0200 Subject: [PATCH] Add flash message above the login form --- app/views/devise/sessions/new.haml | 5 +++++ public/stylesheets/sass/application.sass | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/views/devise/sessions/new.haml b/app/views/devise/sessions/new.haml index 7a6b1bda7..04e3d4aff 100644 --- a/app/views/devise/sessions/new.haml +++ b/app/views/devise/sessions/new.haml @@ -17,6 +17,7 @@ $("#spinner").fadeIn(300); }); }); + $(".login_error").remove(); }); }); @@ -25,6 +26,10 @@ = image_tag('logo_caps.png', :id => 'logo', :width => 143, :height => 21) %br %br + + - flash.each do |name, msg| + = content_tag :p, msg, :class => "login_error" + = form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %p = f.label :username , t('username') diff --git a/public/stylesheets/sass/application.sass b/public/stylesheets/sass/application.sass index e226ed732..b3cbcbd8b 100644 --- a/public/stylesheets/sass/application.sass +++ b/public/stylesheets/sass/application.sass @@ -90,6 +90,10 @@ form :text :shadow 0 1px #C66 +.login_error + :color rgb(208,49,43) + :text-shadow 1px 1px 7px rgb(208,49,43) + .fieldWithErrors :display inline @@ -677,7 +681,7 @@ a.paginate, #infscr-loading #main_stream .pagination :display none - + .stream_element .right :position absolute