From 1dd7c516ed583631d9d2e4becd842060f876658f Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Fri, 5 Jul 2019 00:29:51 +0200 Subject: [PATCH] More poll/question tweaks --- app.py | 5 ++++- sass/base_theme.scss | 2 +- templates/utils.html | 5 +++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app.py b/app.py index 16312d7..55e3de7 100644 --- a/app.py +++ b/app.py @@ -929,8 +929,11 @@ def _build_thread(data, include_children=True): # noqa: C901 } replies = [data] for dat in DB.activities.find(query): + print(dat["type"]) if dat["type"][0] == ActivityType.CREATE.value: replies.append(dat) + if dat["type"][0] == ActivityType.UPDATE.value: + continue else: # Make a Note/Question/... looks like a Create dat = { @@ -958,7 +961,7 @@ def _build_thread(data, include_children=True): # noqa: C901 rep_id = rep["activity"]["object"]["id"] if rep_id == root_id: continue - reply_of = ap._get_id(rep["activity"]["object"]["inReplyTo"]) + reply_of = ap._get_id(rep["activity"]["object"].get("inReplyTo")) try: idx[reply_of]["_nodes"].append(rep) except KeyError: diff --git a/sass/base_theme.scss b/sass/base_theme.scss index 980fbd5..ce16014 100644 --- a/sass/base_theme.scss +++ b/sass/base_theme.scss @@ -214,7 +214,7 @@ a:hover { overflow: hidden; } - .bottom-bar { margin-top:10px; } + .bottom-bar { margin-top:10px;display:inline-block; } .img-attachment { max-width:100%; diff --git a/templates/utils.html b/templates/utils.html index b224582..3d355e3 100644 --- a/templates/utils.html +++ b/templates/utils.html @@ -86,7 +86,7 @@ {% set pct = cnt * 100.0 / total_votes %} {% endif %}
  • - {% if not meta.voted_for and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %} + {% if session.logged_in and not meta.voted_for and not (real_end_time | gtnow) and not (obj.id | is_from_outbox) %}
    @@ -161,7 +161,8 @@
    -{% if perma %}{{ obj.published | format_time }} +{% if perma %} +{{ obj.published | format_time }} {% if not (obj.id | is_from_outbox) %} permalink {% endif %}