From 7bcf9d300770079db3965ca9aea71e6104e33995 Mon Sep 17 00:00:00 2001 From: iou1name Date: Tue, 26 Jun 2018 00:29:10 -0400 Subject: [PATCH] quest page uses logical divs instead of a table --- static/anonkun.css | 16 +++++----------- templates/quest.html | 35 ++++++++++++++++------------------- tools.py | 3 ++- views.py | 1 + 4 files changed, 24 insertions(+), 31 deletions(-) diff --git a/static/anonkun.css b/static/anonkun.css index 239944a..bae8f3c 100644 --- a/static/anonkun.css +++ b/static/anonkun.css @@ -4,7 +4,6 @@ img { } .header { - display: initial; position: fixed; top: 0; left: 0; @@ -20,7 +19,6 @@ img { } #headerHidden { - display: none; width: auto; } @@ -29,25 +27,21 @@ img { overflow: auto; } -#questBody { +#questPane { padding-left: 10px; padding-right: 32%; } -#questPosts { - border-spacing: 15px; +.questPost { + display: flex; } -.questPostTime { - vertical-align: top; +.questPostMeta { white-space: nowrap; } .questPostData { - vertical-align: top; -} - -#newQPostArea { + padding-left: 20px; } #chatPane { diff --git a/templates/quest.html b/templates/quest.html index 772dbe0..22924bc 100644 --- a/templates/quest.html +++ b/templates/quest.html @@ -84,27 +84,24 @@ {% endblock %} {% block content %}
-
- - - +
+

{{ 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 %} -

{{ quest_title }}

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

diff --git a/tools.py b/tools.py index 38d6b35..ae1cd6d 100644 --- a/tools.py +++ b/tools.py @@ -40,7 +40,8 @@ def handle_img(post): for chunk in res.iter_content(100000): file.write(chunk) alt_text = os.path.basename(url) - img_tag = f'{alt_text}' + img_tag = f'{alt_text}' except requests.exceptions: img_tag = "INVALID_IMG_URL" except assertion: diff --git a/views.py b/views.py index c8ce195..ebeae4b 100644 --- a/views.py +++ b/views.py @@ -117,6 +117,7 @@ def edit_quest(quest_title): return render_template("edit_quest.html", quest_title=quest_title, ident_title=ident_title) + return redirect(url_for(".quest", quest_title=ident_title)) @views.route("/set_session")