From e3a79972a90c15c30458c479cc9a3da7391da9dc Mon Sep 17 00:00:00 2001 From: iou1name Date: Wed, 27 Jun 2018 08:43:00 -0400 Subject: [PATCH] qm post tabs and fixed error with posting --- events.py | 4 +-- templates/quest.html | 75 +++++++++++++++++++++++++++++++++----------- 2 files changed, 58 insertions(+), 21 deletions(-) diff --git a/events.py b/events.py index bdb5e09..7725f14 100644 --- a/events.py +++ b/events.py @@ -66,7 +66,7 @@ def new_post(data): post = data["post"] post = bleach.clean(post.strip()) post = post.replace("\n", "
") - message = tools.handle_img(message) + post = tools.handle_img(post) data["post"] = [post] db.insert_quest_post(room, post, int(time.time())) @@ -87,7 +87,7 @@ def update_post(data): post = data["post"] post = post.strip().replace("
", "
") - message = tools.handle_img(message) + post = tools.handle_img(post) data["post"] = post post_id = data["post_id"] diff --git a/templates/quest.html b/templates/quest.html index 22924bc..dfb44ce 100644 --- a/templates/quest.html +++ b/templates/quest.html @@ -75,6 +75,24 @@ document.getElementById('savePost-' + post_id).style.display = 'none'; } + {% endif %} {% endblock %} {% block header %} @@ -86,29 +104,48 @@

{{ quest_title }}

- {% for quest_post in quest_posts %} -
-
- {{ quest_post[3] | strftime }} - {% if session.get("user_id") == owner_id %} -
Edit - - {% endif %} -
-
- {% autoescape false %} - {{ quest_post[2] }} - {% endautoescape %} -
-

- {% endfor %} +
+ {% for quest_post in quest_posts %} +
+
+ {{ quest_post[3] | strftime }} + {% if session.get("user_id") == owner_id %} +
Edit + + {% endif %} +
+
+ {% autoescape false %} + {{ quest_post[2] }} + {% endautoescape %} +
+

+ {% endfor %} +
{% if session.get("user_id") == owner_id %} -
-
- +
+
+ +
+
+
+ +
+ +
{% endif %}
+
+

Chat