Permalink
Browse files

Fixing counting

  • Loading branch information...
1 parent 518fed2 commit 0659ef1749ae5a8dd97b3820a91f8bd71c18dad9 @adiezbal adiezbal committed Jun 24, 2011
View
2 app/controllers/notifications_controller.rb
@@ -5,7 +5,7 @@ class NotificationsController < ApplicationController
before_filter :check_current_subject_is_owner, :only => [:show, :update, :destroy]
def index
- @notifications = @mailbox.notifications.page(params[:page]).per(10)
+ @notifications = @mailbox.notifications.not_trashed.page(params[:page]).per(10)
end
def show
View
2 app/views/notifications/_notification.html.erb
@@ -16,7 +16,7 @@
<%= raw decode_notification notification.subject,notification.object %>
</div>
<div class="briefing">
- ////// <%= notification.receipt_for(@actor).first.trashed%> ///////
+ ////// <%= notification.is_unread?(@actor) %> ////// <%= notification.is_trashed?(@actor) %> ///////
<%= raw decode_notification notification.body, notification.object %>
</div>
<div class="clearfloat">
View
2 app/views/notifications/index.html.erb
@@ -11,7 +11,7 @@
<% end %>
<%= location(
- link_to(image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other'), notifications_path,:remote => true) +' ('+@notifications.count.to_s+')'
+ link_to(image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other'), notifications_path,:remote => true) +' ('+@mailbox.notifications.not_trashed.unread.count.to_s+')'
) %>
<% toolbar %>
View
2 app/views/toolbar/_notifications_menu.html.erb
@@ -1,3 +1,3 @@
<li>
- <%= link_to( image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other')+' ('+@notifications.count.to_s+')', notifications_path) %>
+ <%= link_to( image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other')+' ('+@mailbox.notifications.not_trashed.unread.count.to_s+')', notifications_path) %>
</li>

0 comments on commit 0659ef1

Please sign in to comment.