Add the ability to lock threads

This commit is contained in:
rubenwardy
2020-07-11 01:34:51 +01:00
parent 5f7be4b433
commit bf927c50f0
5 changed files with 110 additions and 19 deletions

View File

@@ -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 %}