From e9e92bf1ac15421b9a29c366b9ef6bf2c1b94943 Mon Sep 17 00:00:00 2001 From: Aurélien Bompard Date: Thu, 23 May 2013 15:44:40 +0200 Subject: Reorganize AJAX templates --- hyperkitty/templates/ajax/replies.html | 13 +++++++++ hyperkitty/templates/ajax/temp_message.html | 38 +++++++++++++++++++++++++ hyperkitty/templates/messages/temp_message.html | 38 ------------------------- hyperkitty/templates/thread.html | 2 +- hyperkitty/templates/threads/replies.html | 11 ------- hyperkitty/views/message.py | 2 +- hyperkitty/views/thread.py | 2 +- 7 files changed, 54 insertions(+), 52 deletions(-) create mode 100644 hyperkitty/templates/ajax/replies.html create mode 100644 hyperkitty/templates/ajax/temp_message.html delete mode 100644 hyperkitty/templates/messages/temp_message.html delete mode 100644 hyperkitty/templates/threads/replies.html (limited to 'hyperkitty') diff --git a/hyperkitty/templates/ajax/replies.html b/hyperkitty/templates/ajax/replies.html new file mode 100644 index 0000000..7b6fc70 --- /dev/null +++ b/hyperkitty/templates/ajax/replies.html @@ -0,0 +1,13 @@ +{% load url from future %} +{% load hk_generic %} + + {% for email in replies %} +
+ + {% include 'messages/message.html' %} + +
+ {% endfor %} + +{# vim: set noet: #} diff --git a/hyperkitty/templates/ajax/temp_message.html b/hyperkitty/templates/ajax/temp_message.html new file mode 100644 index 0000000..f518114 --- /dev/null +++ b/hyperkitty/templates/ajax/temp_message.html @@ -0,0 +1,38 @@ +{% load url from future %} +{% load gravatar %} +{% load hk_generic %} + +
+ + + +
+ +{# vim: set noet: #} diff --git a/hyperkitty/templates/messages/temp_message.html b/hyperkitty/templates/messages/temp_message.html deleted file mode 100644 index f518114..0000000 --- a/hyperkitty/templates/messages/temp_message.html +++ /dev/null @@ -1,38 +0,0 @@ -{% load url from future %} -{% load gravatar %} -{% load hk_generic %} - -
- - - -
- -{# vim: set noet: #} diff --git a/hyperkitty/templates/thread.html b/hyperkitty/templates/thread.html index 78ef424..1e1f7ed 100644 --- a/hyperkitty/templates/thread.html +++ b/hyperkitty/templates/thread.html @@ -51,7 +51,7 @@
{% if is_bot %} - {% include 'threads/replies.html' %} + {% include 'ajax/replies.html' %} {% else %} Loading... {% endif %} diff --git a/hyperkitty/templates/threads/replies.html b/hyperkitty/templates/threads/replies.html deleted file mode 100644 index 19ee0e2..0000000 --- a/hyperkitty/templates/threads/replies.html +++ /dev/null @@ -1,11 +0,0 @@ -{% load url from future %} -{% load hk_generic %} - - {% for email in replies %} -
- - {% include 'messages/message.html' %} - -
- {% endfor %} diff --git a/hyperkitty/views/message.py b/hyperkitty/views/message.py index 7508aa0..2cf2f29 100644 --- a/hyperkitty/views/message.py +++ b/hyperkitty/views/message.py @@ -178,7 +178,7 @@ def reply(request, mlist_fqdn, message_id_hash): "content": form.cleaned_data["message"], "level": message.thread_depth, # no need to increment, level = thread_depth - 1 } - t = loader.get_template('messages/temp_message.html') + t = loader.get_template('ajax/temp_message.html') html = t.render(RequestContext(request, { 'email': reply })) result = {"result": "The reply has been sent successfully.", "message_html": html} diff --git a/hyperkitty/views/thread.py b/hyperkitty/views/thread.py index 5c3c7a1..cc4e23a 100644 --- a/hyperkitty/views/thread.py +++ b/hyperkitty/views/thread.py @@ -179,7 +179,7 @@ def replies(request, mlist_fqdn, threadid): context["replies"] = _get_thread_replies(request, thread, offset=offset, limit=chunk_size) - replies_tpl = loader.get_template('threads/replies.html') + replies_tpl = loader.get_template('ajax/replies.html') replies_html = replies_tpl.render(RequestContext(request, context)) response = {"replies_html": replies_html, "more_pending": False, -- cgit