Skip to content
Browse files

Counting notifications

  • Loading branch information...
1 parent 8457aab commit 518fed21c0647ae2436fd0f764bbf8ca9f5cef21 @adiezbal adiezbal committed Jun 24, 2011
View
2 app/controllers/notifications_controller.rb
@@ -44,7 +44,7 @@ def update_all
end
def destroy
- @notification.destroy
+ @notification.receipt_for(@actor).move_to_trash
redirect_to notifications_path
end
View
1 app/views/notifications/_notification.html.erb
@@ -16,6 +16,7 @@
<%= raw decode_notification notification.subject,notification.object %>
</div>
<div class="briefing">
+ ////// <%= notification.receipt_for(@actor).first.trashed%> ///////
<%= 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)
+ link_to(image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other'), notifications_path,:remote => true) +' ('+@notifications.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_path) %>
+ <%= link_to( image_tag("btn/btn_notification.png", :class => "menu_icon")+t('notification.other')+' ('+@notifications.count.to_s+')', notifications_path) %>
</li>

0 comments on commit 518fed2

Please sign in to comment.
Something went wrong with that request. Please try again.