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