#84 Passage du dernier post en cas de nécropost
This commit is contained in:
parent
c0ae3cc8ab
commit
4ddf60353c
|
@ -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)
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
|
||||
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
|
||||
|
||||
{% if not last %}
|
||||
{% if last %}
|
||||
<div class="bg-warn">
|
||||
Ce topic est sans activité depuis plus de X jours, êtes-vous sûr de vouloir y poster ?
|
||||
{{ last }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
|
|
Loading…
Reference in New Issue