# HG changeset patch # User Nishanth Amuluru # Date 1294383103 -19800 # Node ID c701e68f8d3579bdfbaa441a4b5be7fa40af78ff # Parent 5cd56898033cce6794d3e2ce0c05bb41ae960780 fixed a typo and browse notifications works fine diff -r 5cd56898033c -r c701e68f8d35 profile/urls.py --- a/profile/urls.py Fri Jan 07 12:16:50 2011 +0530 +++ b/profile/urls.py Fri Jan 07 12:21:43 2011 +0530 @@ -1,10 +1,12 @@ from django.conf.urls.defaults import * -from pytask.profile.views import view_profile, edit_profile +from pytask.profile.views import view_profile, edit_profile,\ + browse_notifications urlpatterns = patterns('', - (r'view', view_profile), - (r'edit', edit_profile), + (r'^view/$', view_profile), + (r'^edit/$', edit_profile), + (r'^notf/browse/$', browse_notifications), ) diff -r 5cd56898033c -r c701e68f8d35 profile/views.py --- a/profile/views.py Fri Jan 07 12:16:50 2011 +0530 +++ b/profile/views.py Fri Jan 07 12:21:43 2011 +0530 @@ -48,7 +48,7 @@ """ get the list of notifications that are not deleted and display in datetime order.""" - user = get_user(request.user) + user = request.user active_notifications = user.notification_sent_to.filter(is_deleted=False).order_by('sent_date').reverse() diff -r 5cd56898033c -r c701e68f8d35 templates/profile/browse_notifications.html --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/profile/browse_notifications.html Fri Jan 07 12:21:43 2011 +0530 @@ -0,0 +1,14 @@ +{% extends 'base.html' %} +{% block content %} +{% if not notifications %} +You have no notifications. +{% else %} +Notifications for you:
+{% for notification in notifications %} + +{% if not notification.is_read %} {% endif %} +{{notification.sub}} +{% if not notification.is_read %} {% endif %}
+{% endfor %} +{% endif %} +{% endblock %} diff -r 5cd56898033c -r c701e68f8d35 urls.py --- a/urls.py Fri Jan 07 12:16:50 2011 +0530 +++ b/urls.py Fri Jan 07 12:21:43 2011 +0530 @@ -22,6 +22,6 @@ url(r'^accounts/register/$', register, {'form_class': CustomRegistrationForm}, name='registration_register'), - (r'^accounts/profile/', include('pytask.profile.urls')), (r'^accounts/', include('registration.urls')), + (r'^profile/', include('pytask.profile.urls')), )