From c48e792c7559f5bfa90e6e2ac726b4e02e131f2a Mon Sep 17 00:00:00 2001 From: Diaspora Europe Date: Tue, 13 Mar 2012 17:27:40 +0100 Subject: [PATCH] added notification badge --- app/views/layouts/application.mobile.haml | 1 + public/stylesheets/sass/mobile.scss | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 94c3343b5..6b51993bc 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -54,6 +54,7 @@ .badge{:id => "notification_badge"} = link_to(image_tag('icons/notifications_grey.png', :height => 16, :width => 16, :id => 'notification-flag'), notifications_path) .badge_count + = current_user.unread_notifications.count - if user_signed_in? .right diff --git a/public/stylesheets/sass/mobile.scss b/public/stylesheets/sass/mobile.scss index a01e2cce2..a5a54d1ba 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/public/stylesheets/sass/mobile.scss @@ -283,7 +283,7 @@ body { text-decoration: none; } #nav_badges .badge { position: relative; - top: 2px; + top: -15px; display: inline; margin: 0 2px; padding: 8px 3px; @@ -294,6 +294,20 @@ body { #nav_badges .badge:hover .badge_count { background-color: #bd0902; } +.badge_count { + -moz-border-radius: 2px 2px 2px 2px; + -webkit-border-radius: 2px 2px 2px 2px; + border-radius: 2px 2px 2px 2px; + z-index: 3; + position: absolute; + top: -2px; + left: 13px; + padding: 0 2px; + padding-bottom: 1px; + background-color: #a40802; + line-height: 12px; + color: white; } + #header_title { position: relative; top: -3px;