Display notifications on the site, and provide a ajaxy way to acknowledge them

This commit is contained in:
Trever Fischer
2012-06-08 14:53:32 -04:00
parent 60acb6b315
commit f99949cb7b
7 changed files with 60 additions and 0 deletions

View File

@@ -130,3 +130,10 @@ def index(request):
latestNews = None
forums = Forum.objects.filter(parent=None)
return render_to_response('local/index.html', {'news': latestNews, 'forums': forums}, context_instance = RequestContext(request))
@login_required
def mark_notifications_read(request):
for notice in notification.Notice.objects.notices_for(request.user, unseen=True):
notice.unseen = False
notice.save()
return HttpResponseRedirect(reverse('user_profile'))