summaryrefslogtreecommitdiffstats
path: root/group_messaging
diff options
context:
space:
mode:
Diffstat (limited to 'group_messaging')
-rw-r--r--group_messaging/urls.py5
-rw-r--r--group_messaging/views.py13
2 files changed, 15 insertions, 3 deletions
diff --git a/group_messaging/urls.py b/group_messaging/urls.py
index 618ae1d5..30002bf3 100644
--- a/group_messaging/urls.py
+++ b/group_messaging/urls.py
@@ -23,5 +23,10 @@ urlpatterns = patterns('',
'^senders/$',
views.SendersList().as_view(),
name='get_senders'
+ ),
+ url(
+ '^post-reply/$',
+ views.PostReply().as_view(),
+ name='post_reply'
)
)
diff --git a/group_messaging/views.py b/group_messaging/views.py
index 0ea710db..289961ff 100644
--- a/group_messaging/views.py
+++ b/group_messaging/views.py
@@ -40,7 +40,7 @@ class InboxView(object):
"""
if template_name is None:
template_name = self.template_name
- template = get_template(self.template_name)
+ template = get_template(template_name)
html = template.render(context)
json = simplejson.dumps({'html': html, 'success': True})
return HttpResponse(json, mimetype='application/json')
@@ -116,7 +116,7 @@ class NewThread(InboxView):
return HttpResponse(simplejson.dumps(result), mimetype='application/json')
-class NewResponse(InboxView):
+class PostReply(InboxView):
"""view to create a new response"""
http_method_list = ('POST',)
@@ -128,8 +128,15 @@ class NewResponse(InboxView):
text=request.POST['text'],
parent=parent
)
+ last_visit = LastVisitTime.objects.get(
+ message=message.root,
+ user=request.user
+ )
+ last_visit.at = datetime.datetime.now()
+ last_visit.save()
return self.render_to_response(
- {'message': message}, template_name='stored_message.htmtl'
+ {'post': message, 'user': request.user},
+ template_name='group_messaging/stored_message.html'
)
class ThreadsList(InboxView):