From bf927c50f00bd15c7bc1765b7d5fb0c6a6abeb86 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 11 Jul 2020 01:34:51 +0100 Subject: Add the ability to lock threads --- app/templates/macros/threads.html | 30 +++++++++++++++++++++++------- app/templates/threads/view.html | 13 +++++++++++++ 2 files changed, 36 insertions(+), 7 deletions(-) (limited to 'app/templates') diff --git a/app/templates/macros/threads.html b/app/templates/macros/threads.html index 4732af2..f9f298a 100644 --- a/app/templates/macros/threads.html +++ b/app/templates/macros/threads.html @@ -8,7 +8,7 @@ -
+
+{% if thread.locked %} +

+ + {{ _("This thread has been locked by a moderator.") }} +

+{% endif %} + {% if current_user.is_authenticated %}
- {% if current_user.canCommentRL() %} + {% if not current_user.canCommentRL() %} +
+
+ +
+ {% elif not thread.checkPerm(current_user, "COMMENT_THREAD") %} +
+ {% if thread.locked %} +
+ {% else %} +
+ {% endif %} + +
+ {% else %}

- {% else %} -
-
- -
{% endif %}
diff --git a/app/templates/threads/view.html b/app/templates/threads/view.html index ef53d1f..f92ef39 100644 --- a/app/templates/threads/view.html +++ b/app/templates/threads/view.html @@ -17,6 +17,19 @@ {% endif %} + {% if thread and thread.checkPerm(current_user, "LOCK_THREAD") %} + {% if thread.locked %} +
+ + +
+ {% else %} +
+ + +
+ {% endif %} + {% endif %} {% endif %} {% if current_user == thread.author and thread.review %} -- cgit v1.2.3