Compare commits
No commits in common. "9273430f9a8d2ec974d67a189ae26ee0146901ee" and "c0ae3cc8ab74cc213b582ebd07a08beea4029181" have entirely different histories.
9273430f9a
...
c0ae3cc8ab
|
@ -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(days=V5Config.NECROPOST_LIMIT)
|
||||
last_updated_comment = t.thread.comments.filter(Comment.date_modified <= now_minus).first()
|
||||
now_minus = datetime.datetime.now() - datetime.timedelta(minutes=15)
|
||||
last_edited_comment = t.thread.comments.filter(Comment.date_modified >= now_minus).first()
|
||||
|
||||
return render('/forum/topic.html', t=t, form=form, comments=comments, last=last_updated_comment)
|
||||
return render('/forum/topic.html', t=t, form=form, comments=comments, last=last_edited_comment)
|
||||
|
|
|
@ -19,10 +19,9 @@
|
|||
|
||||
{{ widget_pagination.paginate(comments, 'forum_topic', t, {'f': t.forum}) }}
|
||||
|
||||
{% if last %}
|
||||
{% if not 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 %}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ try:
|
|||
from local_config import LocalConfig
|
||||
except ImportError:
|
||||
print(" \033[92mWARNING: Local config not found\033[0m")
|
||||
|
||||
class LocalConfig():
|
||||
pass
|
||||
|
||||
|
@ -26,7 +25,6 @@ class Config(object):
|
|||
# Do not attach cookies to cross-origin requests
|
||||
SESSION_COOKIE_SAMESITE = "Lax"
|
||||
|
||||
|
||||
class DefaultConfig(object):
|
||||
"""Every value here can be overrided in the local_config.py class"""
|
||||
# Domain
|
||||
|
@ -52,9 +50,6 @@ class DefaultConfig(object):
|
|||
# GLaDOS configuration
|
||||
GLADOS_HOST = "127.0.0.1"
|
||||
GLADOS_PORT = 5555
|
||||
# Time in days before trigerring the nec
|
||||
NECROPOST_LIMIT = 31
|
||||
|
||||
|
||||
class V5Config(LocalConfig, DefaultConfig):
|
||||
# Values put here cannot be overidden with local_config
|
||||
|
|
Loading…
Reference in New Issue