aboutsummaryrefslogtreecommitdiff
path: root/app/templates/threads
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-11 01:34:51 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-11 01:42:47 +0100
commitbf927c50f00bd15c7bc1765b7d5fb0c6a6abeb86 (patch)
treeff27c709826ce17002e1d670938b5a6142608695 /app/templates/threads
parent5f7be4b4337358e35c9eda4b261260a08a958b4a (diff)
downloadcheatdb-bf927c50f00bd15c7bc1765b7d5fb0c6a6abeb86.tar.xz
Add the ability to lock threads
Diffstat (limited to 'app/templates/threads')
-rw-r--r--app/templates/threads/view.html13
1 files changed, 13 insertions, 0 deletions
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 @@
<input type="submit" class="btn btn-primary" value="Subscribe" />
</form>
{% endif %}
+ {% if thread and thread.checkPerm(current_user, "LOCK_THREAD") %}
+ {% if thread.locked %}
+ <form method="post" action="{{ url_for('threads.set_lock', id=thread.id, lock=0) }}" class="float-right mr-2">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+ <input type="submit" class="btn btn-secondary" value="{{ _('Unlock Thread') }}" />
+ </form>
+ {% else %}
+ <form method="post" action="{{ url_for('threads.set_lock', id=thread.id, lock=1) }}" class="float-right mr-2">
+ <input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
+ <input type="submit" class="btn btn-secondary" value="{{ _('Lock Thread') }}" />
+ </form>
+ {% endif %}
+ {% endif %}
{% endif %}
{% if current_user == thread.author and thread.review %}