diff --git a/app/controllers/notifications_controller.rb b/app/controllers/notifications_controller.rb index 3cafaecfa..7e0af8645 100644 --- a/app/controllers/notifications_controller.rb +++ b/app/controllers/notifications_controller.rb @@ -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 diff --git a/app/views/layouts/application.mobile.haml b/app/views/layouts/application.mobile.haml index 4479d4b75..8350693c5 100644 --- a/app/views/layouts/application.mobile.haml +++ b/app/views/layouts/application.mobile.haml @@ -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 diff --git a/app/views/notifications/index.mobile.haml b/app/views/notifications/index.mobile.haml index 18ea33fef..6ea77428d 100644 --- a/app/views/notifications/index.mobile.haml +++ b/app/views/notifications/index.mobile.haml @@ -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) diff --git a/public/stylesheets/sass/mobile.scss b/public/stylesheets/sass/mobile.scss index 4dd46de06..a5a54d1ba 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/public/stylesheets/sass/mobile.scss @@ -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;