aboutsummaryrefslogtreecommitdiff
path: root/app/templates/macros
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-12-25 17:51:29 +0000
committerrubenwardy <rw@rubenwardy.com>2018-12-25 17:51:29 +0000
commit09150a4dbb74e9fb0d9fe4bdc5ced3ac246cd0e9 (patch)
tree6a79e990698c72053a396456f04ed8b7af0d4981 /app/templates/macros
parentc726f56b3edbc2b97b82b777bada83a2097acb80 (diff)
downloadcheatdb-09150a4dbb74e9fb0d9fe4bdc5ced3ac246cd0e9.tar.xz
Allow users to discard their own topics
Diffstat (limited to 'app/templates/macros')
-rw-r--r--app/templates/macros/topics.html4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/templates/macros/topics.html b/app/templates/macros/topics.html
index 8316a70..432867d 100644
--- a/app/templates/macros/topics.html
+++ b/app/templates/macros/topics.html
@@ -1,4 +1,4 @@
-{% macro render_topics_table(topics, show_author=True, show_discard=False) -%}
+{% macro render_topics_table(topics, show_author=True, show_discard=False, current_user=current_user) -%}
<table class="table">
<tr>
<th></th>
@@ -27,7 +27,7 @@
href="{{ url_for('create_edit_package_page', author=topic.author.username, repo=topic.getRepoURL(), forums=topic.topic_id, title=topic.title, bname=topic.name) }}">
Create
</a>
- {% if show_discard %}
+ {% if show_discard and current_user.is_authenticated and topic.checkPerm(current_user, "TOPIC_DISCARD") %}
<a class="btn btn-{% if topic.discarded %}success{% else %}danger{% endif %} topic-discard" data-tid={{ topic.topic_id }}>
{% if topic.discarded %}
Show