Permalink
Browse files

revamped login screen

  • Loading branch information...
1 parent df1938c commit 1bb7c781342a1ec152ec76732439c6fb54be998b @mrreynolds mrreynolds committed Apr 13, 2012
Showing with 9 additions and 11 deletions.
  1. +3 −3 app/controllers/user_sessions_controller.rb
  2. +6 −8 app/views/user_sessions/new.html.erb
@@ -15,7 +15,7 @@
# limitations under the License.
class UserSessionsController < ApplicationController
-
+
skip_before_filter :require_user, :only => [:new, :create]
def new
@@ -29,7 +29,7 @@ def create
@user_session = UserSession.new(params[:user_session])
if @user_session.save
- flash[:notice] = I18n.t("txt.controllers.user_sessions.login_success")
+ flash[:success] = I18n.t("txt.controllers.user_sessions.login_success")
redirect_to params[:back_to] || (can?(:use, :dashboard) ? dashboard_url : root_path)
else
flash[:error] = I18n.t("txt.views.user_sessions.error")
@@ -41,7 +41,7 @@ def destroy
# TODO Check abilities
current_user_session.destroy
- flash[:notice] = I18n.t("txt.controllers.user_sessions.logout_success")
+ flash[:success] = I18n.t("txt.controllers.user_sessions.logout_success")
redirect_to root_path
end
@@ -1,11 +1,9 @@
<%= page_header :title => t("txt.views.user_sessions.header") %>
-<%= form_for @user_session, :url => user_session_path(:back_to => params[:back_to]), :class => "well" do |f| %>
- <%= f.label :email, t("txt.views.user_sessions.email") %>
- <%= f.text_field :email %>
-
- <%= f.label :password, t("txt.views.user_sessions.password") %>
- <%= f.password_field :password %>
-
- <button type="submit" class="btn"><%= t("txt.views.user_sessions.login") %></button>
+<%= simple_form_for @user_session, :url => user_session_path(:back_to => params[:back_to]) do |f| %>
+ <%= f.input :email %>
+ <%= f.input :password %>
+ <div class="form-actions">
+ <%= submit_tag t("txt.views.user_sessions.login"), :class => 'btn btn-primary' %>
+ </div>
<% end %>

0 comments on commit 1bb7c78

Please sign in to comment.