summaryrefslogtreecommitdiff
path: root/profile/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'profile/views.py')
-rwxr-xr-xprofile/views.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/profile/views.py b/profile/views.py
index 386ca49..40eb0a7 100755
--- a/profile/views.py
+++ b/profile/views.py
@@ -57,3 +57,29 @@ def browse_notifications(request):
}
return render_to_response('profile/browse_notifications.html', context)
+
+@login_required
+def view_notification(request, nid):
+ """ get the notification depending on nid.
+ Display it.
+ """
+
+ user = get_user(request.user)
+ newest, newer, notification, older, oldest =
+ get_notification(nid, user)
+
+ if not notification:
+ raise Http404
+
+ notification.is_read = True
+ notification.save()
+
+ context = {'user':user,
+ 'notification':notification,
+ 'newest':newest,
+ 'newer':newer,
+ 'older':older,
+ 'oldest':oldest,
+ }
+
+ return render_to_response('profile/view_notification.html', context)