Add ability to delete threads

This reverts commit 78630b3071.
This commit is contained in:
rubenwardy
2020-12-09 18:40:25 +00:00
parent b28732ee74
commit fd0b203f1e
4 changed files with 54 additions and 5 deletions

View File

@@ -17,16 +17,19 @@
<input type="submit" class="btn btn-primary" value="Subscribe" />
</form>
{% endif %}
{% if thread and thread.checkPerm(current_user, "DELETE_THREAD") %}
<a href="{{ url_for('threads.delete_thread', id=thread.id) }}" class="float-right mr-2 btn btn-danger">{{ _('Delete') }}</a>
{% 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') }}" />
<input type="submit" class="btn btn-secondary" value="{{ _('Unlock') }}" />
</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') }}" />
<input type="submit" class="btn btn-secondary" value="{{ _('Lock') }}" />
</form>
{% endif %}
{% endif %}