From 4ddf60353c52dfd5633d137c100272ef941eac80 Mon Sep 17 00:00:00 2001 From: Eragon Date: Tue, 12 Jan 2021 17:30:54 +0100 Subject: [PATCH] =?UTF-8?q?#84=20Passage=20du=20dernier=20post=20en=20cas?= =?UTF-8?q?=20de=20n=C3=A9cropost?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/routes/forum/topic.py | 6 +++--- app/templates/forum/topic.html | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/routes/forum/topic.py b/app/routes/forum/topic.py index 2af6b3b..324015f 100644 --- a/app/routes/forum/topic.py +++ b/app/routes/forum/topic.py @@ -72,7 +72,7 @@ def forum_topic(f, page): comments = t.thread.comments.paginate(page, Thread.COMMENTS_PER_PAGE, True) - now_minus = datetime.datetime.now() - datetime.timedelta(minutes=15) - last_edited_comment = t.thread.comments.filter(Comment.date_modified >= now_minus).first() + now_minus = datetime.datetime.now() - datetime.timedelta(minutes=1) + last_updated_comment = t.thread.comments.filter(Comment.date_modified <= now_minus).first() - return render('/forum/topic.html', t=t, form=form, comments=comments, last=last_edited_comment) + return render('/forum/topic.html', t=t, form=form, comments=comments, last=last_updated_comment) diff --git a/app/templates/forum/topic.html b/app/templates/forum/topic.html index 99b454a..8353ae5 100644 --- a/app/templates/forum/topic.html +++ b/app/templates/forum/topic.html @@ -19,9 +19,10 @@ {{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }} - {% if not last %} + {% if last %}
Ce topic est sans activité depuis plus de X jours, êtes-vous sûr de vouloir y poster ? + {{ last }}
{% endif %}