Allow any post to be set as main post #130

This commit is contained in:
Eragon 2024-03-09 16:15:52 +01:00
parent f7e91c4793
commit f9c4d05121
Signed by: Eragon
GPG Key ID: 087126EBFC725006
2 changed files with 4 additions and 1 deletions

View File

@ -261,7 +261,7 @@ class Member(User):
if comment.type != "comment":
return False
post = comment.thread.owner_post
return self.can_edit_post(post) and (comment.author == post.author)
return self.can_edit_post(post)
def can_lock_thread(self, post):
"""Whether this member can lock the thread associated with the post"""

View File

@ -24,6 +24,9 @@
<div class="info">
<div>
Créé le {{ t.date_created | dyndate }}
{% if t.author_id != t.thread.top_comment.author.id %}
par <a href="{{ url_for('user', username=t.author.name) }}">{{ t.author.name }}</a>
{% endif %}
<!-- We check if the formatted date is not the same, because the date might differ slightly between the two even if it's the same -->
{% if t.thread.top_comment.date_created | dyndate != t.date_created | dyndate %}
(Posté le {{ t.thread.top_comment.date_created | dyndate }})