diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-27 11:27:20 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2012-09-27 11:27:20 -0400 |
commit | 7619f3b08fb2ef2bb4b27636bc3bf3caf34192c5 (patch) | |
tree | 535d33ecd92b7e0b4f9dc860ffd983ca187def9a /group_messaging | |
parent | 6838a4cd8638aacc924f5ab8f208e1d31696349b (diff) | |
parent | 23ac9ee8e92ef6b8429b239e4229c39dc7bb4ac5 (diff) | |
download | askbot-7619f3b08fb2ef2bb4b27636bc3bf3caf34192c5.tar.gz askbot-7619f3b08fb2ef2bb4b27636bc3bf3caf34192c5.tar.bz2 askbot-7619f3b08fb2ef2bb4b27636bc3bf3caf34192c5.zip |
Merge branch 'group-messaging' into kp-dev
Diffstat (limited to 'group_messaging')
-rw-r--r-- | group_messaging/urls.py | 5 | ||||
-rw-r--r-- | group_messaging/views.py | 13 |
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): |