Skip to content

Commit

Permalink
clean up _current_user stuff (remove call to current_user) and add de…
Browse files Browse the repository at this point in the history
…stroy_user_session_path, hoping it will be fixed someday (meanwhile fall back to 'users/sign_out' like before.
  • Loading branch information
bbenezech committed Aug 30, 2011
1 parent e71eafa commit a933afb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
9 changes: 3 additions & 6 deletions app/views/layouts/rails_admin/_header.html.haml
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#header
= render :partial => "rails_admin/main/title"
%h1

#user-navigation
%ul.wat-cf
%li= link_to header_icon(:config, t('admin.dashboard.name')), dashboard_path
- if (root_path rescue nil)
%li= link_to header_icon(:home, t('home.name').capitalize), (root_path rescue '/')
- if (current_user rescue nil)
%li= link_to header_icon(:account, current_user.email), (edit_path(:user, current_user) rescue '#')
%li= link_to header_icon(:logout, t("admin.credentials.log_out")), '/users/sign_out', :method => (Devise.sign_out_via rescue :delete)
%li= link_to header_icon(:home, t('home.name').capitalize), (root_path rescue '/')
%li= link_to header_icon(:account, _current_user.email), (edit_path(:user, _current_user) rescue '#')
%li= link_to header_icon(:logout, t("admin.credentials.log_out")), (destroy_user_session_path rescue '/users/sign_out'), :method => (Devise.sign_out_via rescue :delete)
9 changes: 4 additions & 5 deletions app/views/rails_admin/main/_user_info.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
- if current_user = _current_user
.user_info
= current_user.email
- gravatar = (request.ssl? ? "https://secure" : "http://www")+".gravatar.com/avatar"
= image_tag "#{gravatar}/#{Digest::MD5.hexdigest current_user.email}?s=30", :alt => ""
.user_info
= _current_user.email
- gravatar = (request.ssl? ? "https://secure" : "http://www")+".gravatar.com/avatar"
= image_tag "#{gravatar}/#{Digest::MD5.hexdigest _current_user.email}?s=30", :alt => ""

0 comments on commit a933afb

Please sign in to comment.