From 1586331f780b7998a0eec780998017ea73d8318e Mon Sep 17 00:00:00 2001 From: iou1name Date: Thu, 4 Oct 2018 14:52:36 -0400 Subject: [PATCH] seperated chat pane into individual file, fix chat on homepage --- quest/jinja2/quest/chat.html | 20 ++++++++++++++++++ quest/jinja2/quest/quest.html | 21 +------------------ quest/jinja2/quest/quest_homepage.html | 29 ++++++++------------------ 3 files changed, 30 insertions(+), 40 deletions(-) create mode 100644 quest/jinja2/quest/chat.html diff --git a/quest/jinja2/quest/chat.html b/quest/jinja2/quest/chat.html new file mode 100644 index 0000000..fe505c8 --- /dev/null +++ b/quest/jinja2/quest/chat.html @@ -0,0 +1,20 @@ +
+

Chat

+
+ {% autoescape false %} + {% for message in chat_messages %} +
+
+ {% if quest.owner.username == message.user.username or not quest.anonymize %}{{ message.user.username or quest.anon_name }}{% else %}{{ quest.anon_name }}{% endif %} + {{ localtime(message.timestamp).strftime('%Y-%m-%d %H:%M:%S') }} + No.{{ message.id }} +
+
{{ message.message }}
+
+
+ {% endfor %} + {% endautoescape %} +
+
+
+ diff --git a/quest/jinja2/quest/quest.html b/quest/jinja2/quest/quest.html index 56ddf8b..4127d1b 100644 --- a/quest/jinja2/quest/quest.html +++ b/quest/jinja2/quest/quest.html @@ -175,24 +175,5 @@ {% endif %} -
-

Chat

-
- {% autoescape false %} - {% for message in chat_messages %} -
-
- {% if quest.owner.username == message.user.username or not quest.anonymize %}{{ message.user.username or quest.anon_name }}{% else %}{{ quest.anon_name }}{% endif %} - {{ localtime(message.timestamp).strftime('%Y-%m-%d %H:%M:%S') }} - No.{{ message.id }} -
-
{{ message.message }}
-
-
- {% endfor %} - {% endautoescape %} -
-
-
- + {% include "quest/chat.html" %} {% endblock %} diff --git a/quest/jinja2/quest/quest_homepage.html b/quest/jinja2/quest/quest_homepage.html index 27ccc66..a423ce8 100644 --- a/quest/jinja2/quest/quest_homepage.html +++ b/quest/jinja2/quest/quest_homepage.html @@ -2,6 +2,14 @@ {% block title %}{{ quest.title }}{% endblock %} {% block head %} + + + {% endblock %} {% block header %} {% if request.user == quest.owner %} @@ -77,24 +85,5 @@ {% endif %} -
-

Chat

-
- {% autoescape false %} - {% for message in chat_messages %} -
-
- {{ message.user.username or quest.anon_name }} - {{ localtime(message.timestamp).strftime('%Y-%m-%d %H:%M:%S') }} - No.{{ message.id }} -
-
{{ message.message }}
-
-
- {% endfor %} - {% endautoescape %} -
-
-
- + {% include "quest/chat.html" %} {% endblock %}