added an unseen_count variable available to all templates for notification signaling

pull/1/head
Andromeda Yelton 2012-03-29 15:34:03 -04:00
parent 320c66c494
commit 92381d8ab5
1 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,11 @@
def is_preview(request):
from django.conf import settings
return {'is_preview': settings.IS_PREVIEW, 'jquery_home': settings.JQUERY_HOME, 'jquery_ui_home': settings.JQUERY_UI_HOME}
return {'is_preview': settings.IS_PREVIEW, 'jquery_home': settings.JQUERY_HOME, 'jquery_ui_home': settings.JQUERY_UI_HOME}
def count_unseen(request):
from notification import NoticeManager
if request.user.is_anonymous():
count = 0
else:
count = NoticeManager.unseen_count_for(request.user)
return {'unseen_count': count }