regluit/context_processors.py

11 lines
406 B
Python
Raw Normal View History

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}
def count_unseen(request):
2012-03-29 20:25:35 +00:00
from notification.models import Notice, NoticeManager
if request.user.is_anonymous():
count = 0
else:
2012-03-29 20:25:35 +00:00
count = Notice.objects.unseen_count_for(request.user)
return {'unseen_count': count}