From: Tom MacWright Date: Tue, 7 Aug 2012 17:03:36 +0000 (-0400) Subject: Improve styling of inbox counter in greeting bar X-Git-Tag: live~5458 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/f08259a5293dc7756fe73cef6a46d5664386b678 Improve styling of inbox counter in greeting bar --- diff --git a/app/assets/stylesheets/common.css.scss b/app/assets/stylesheets/common.css.scss index b5e7af5dd..8a848e9ee 100644 --- a/app/assets/stylesheets/common.css.scss +++ b/app/assets/stylesheets/common.css.scss @@ -309,6 +309,15 @@ h2 { text-decoration: none; } +.count-number { + padding: 2px 5px; + border-radius: 3px; + background: #eee; + margin: 0 2px; + font-size: 11px; + color: #333; +} + /* Rules for greeting bar in the top right corner */ #greeting { diff --git a/app/views/layouts/_inbox.html.erb b/app/views/layouts/_inbox.html.erb index 18716618f..2af76f9ed 100644 --- a/app/views/layouts/_inbox.html.erb +++ b/app/views/layouts/_inbox.html.erb @@ -1,7 +1,7 @@ -<% -inbox_attributes = {} -inbox_attributes[:id] = "inboxanchor" -inbox_attributes[:class] = 'greeting-bar-unread' if @user.new_messages.size > 0 -inbox_attributes[:title] = t 'layouts.inbox_tooltip', :count => @user.new_messages.size -%> -<%= link_to t('layouts.inbox', :count => @user.new_messages.size), {:controller => 'message', :action => 'inbox', :display_name => @user.display_name}, inbox_attributes %> +<%= link_to raw(t('layouts.inbox', + :count => @user.new_messages.size > 0 ? "#{@user.new_messages.size}" : '')), + { + :action => 'inbox', + :display_name => @user.display_name, + :controller => 'message' + }, { :id => 'inboxanchor' } %> diff --git a/config/locales/en.yml b/config/locales/en.yml index e89158f2f..76beb030a 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -948,7 +948,7 @@ en: welcome_user_link_tooltip: Your user page home: home home_tooltip: Go to home location - inbox: "inbox (%{count})" + inbox: "inbox %{count}" inbox_tooltip: zero: Your inbox contains no unread messages one: Your inbox contains 1 unread message