1
0
Fork 0
forked from OpenNeo/impress

put userbar where it belongs

This commit is contained in:
Emi Matchu 2010-10-18 18:10:50 -04:00
parent 895c6e721e
commit 7939b0570b
4 changed files with 56 additions and 7 deletions

View file

@ -1,4 +1,12 @@
module ApplicationHelper 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 def flashes
flash.inject('') do |html, pair| flash.inject('') do |html, pair|
key, value = pair key, value = pair

View file

@ -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/index";
@import "items/show"; @import "items/show";

View file

@ -7,13 +7,6 @@
= javascript_include_tag "http://#{RemoteImpressHost}/assets/js/analytics.js" = javascript_include_tag "http://#{RemoteImpressHost}/assets/js/analytics.js"
%body{:class => params[:action]} %body{:class => params[:action]}
#container #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 %h1
= link_to items_path do = link_to items_path do
= image_tag 'http://images.neopets.com/items/mall_floatingneggfaerie.gif' = image_tag 'http://images.neopets.com/items/mall_floatingneggfaerie.gif'
@ -25,6 +18,17 @@
= yield = yield
%a#home-link{:href => "http://#{RemoteImpressHost}"} %a#home-link{:href => "http://#{RemoteImpressHost}"}
%span Dress to Impress %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 #footer
%ul %ul
%li= link_to 'OpenNeo', 'http://www.openneo.net/' %li= link_to 'OpenNeo', 'http://www.openneo.net/'

View file

@ -32,6 +32,24 @@ h1 a:hover span {
text-decoration: none; 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 */ /* line 1, ../../../app/stylesheets/items/_index.scss */
form { form {
margin-bottom: 2em; margin-bottom: 2em;