Merge pull request #2997 from diasp/1994-mobile-notifications

Mobile notifications back again #1994 [ci skip]
This commit is contained in:
Maxwell Salzberg 2012-03-13 14:18:58 -07:00
commit 78cbe0a1d3
4 changed files with 43 additions and 2 deletions

View file

@ -55,6 +55,7 @@ class NotificationsController < ApplicationController
Notification.where(:recipient_id => current_user.id).update_all(:unread => false)
respond_to do |format|
format.html { redirect_to stream_path }
format.mobile{ redirect_to stream_path}
format.xml { render :xml => {}.to_xml }
format.json { render :json => {}.to_json }
end

View file

@ -50,6 +50,12 @@
.navbar-inner
.container{:style => "position: relative;"}
= link_to(image_tag('header-logo2x.png', :height => 40, :width => 40, :id => 'header_title'), stream_path)
#nav_badges
.badge{:id => "notification_badge"}
= link_to(image_tag('icons/notifications_grey.png', :height => 16, :width => 16, :id => 'notification-flag'), notifications_path)
- if current_user.unread_notifications.count > 0
.badge_count
= current_user.unread_notifications.count
- if user_signed_in?
.right

View file

@ -1,3 +1,6 @@
.right
= link_to t('.mark_all_as_read'), notifications_read_all_path, :class => 'btn'
%h3
= t('.notifications')
@ -14,8 +17,7 @@
.content
%span.from
%b= notification_people_link(note)
= object_link(note)
= notification_message_for(note)
.time
= time_ago_in_words(note.created_at)

View file

@ -276,6 +276,38 @@ body {
}
}
#nav_badges {
display: inline-block;
margin-top: 2px; }
#nav_badges a:hover {
text-decoration: none; }
#nav_badges .badge {
position: relative;
top: -15px;
display: inline;
margin: 0 2px;
padding: 8px 3px;
padding-bottom: 9px;
font-weight: bold;
font-size: smaller;
width: 28px; }
#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;