diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cc8618f9..368b9480 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,4 +1,12 @@ module ApplicationHelper + def auth_server_icon_url + # TODO: if auth servers expand, don't hardcode path + URI::HTTP.build( + :host => Openneo::Auth.config.auth_server, + :path => '/favicon.png' + ).to_s + end + def flashes flash.inject('') do |html, pair| key, value = pair diff --git a/app/stylesheets/screen.scss b/app/stylesheets/screen.scss index 296894c7..1e353552 100644 --- a/app/stylesheets/screen.scss +++ b/app/stylesheets/screen.scss @@ -31,5 +31,24 @@ h1 { } } +#userbar-log-in { + text-decoration: none; + + img { + margin: { + bottom: -4px; + right: .25em; + } + } + + span { + text-decoration: underline; + } + + &:hover span { + text-decoration: none; + } +} + @import "items/index"; @import "items/show"; diff --git a/app/views/layouts/items.html.haml b/app/views/layouts/items.html.haml index 31bf6af1..f637f50c 100644 --- a/app/views/layouts/items.html.haml +++ b/app/views/layouts/items.html.haml @@ -7,13 +7,6 @@ = javascript_include_tag "http://#{RemoteImpressHost}/assets/js/analytics.js" %body{:class => params[:action]} #container - - if user_signed_in? - You are logged in as - = current_user.name - == (#{current_user.id}) - = link_to 'Log out', logout_path - - else - = link_to 'Log in', login_path %h1 = link_to items_path do = image_tag 'http://images.neopets.com/items/mall_floatingneggfaerie.gif' @@ -25,6 +18,17 @@ = yield %a#home-link{:href => "http://#{RemoteImpressHost}"} %span Dress to Impress + #userbar + - if user_signed_in? + %div + == Hey, #{current_user.name}! + == You have #{current_user.points} points. + %div + = link_to 'Log out', logout_path + - else + = link_to login_path, :id => 'userbar-log-in' do + = image_tag auth_server_icon_url + %span Log in #footer %ul %li= link_to 'OpenNeo', 'http://www.openneo.net/' diff --git a/public/stylesheets/compiled/screen.css b/public/stylesheets/compiled/screen.css index 382636fa..783ea133 100644 --- a/public/stylesheets/compiled/screen.css +++ b/public/stylesheets/compiled/screen.css @@ -32,6 +32,24 @@ h1 a:hover span { text-decoration: none; } +/* line 34, ../../../app/stylesheets/screen.scss */ +#userbar-log-in { + text-decoration: none; +} +/* line 37, ../../../app/stylesheets/screen.scss */ +#userbar-log-in img { + margin-bottom: -4px; + margin-right: .25em; +} +/* line 44, ../../../app/stylesheets/screen.scss */ +#userbar-log-in span { + text-decoration: underline; +} +/* line 48, ../../../app/stylesheets/screen.scss */ +#userbar-log-in:hover span { + text-decoration: none; +} + /* line 1, ../../../app/stylesheets/items/_index.scss */ form { margin-bottom: 2em;