aboutsummaryrefslogtreecommitdiff
path: root/app/templates/users
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-12-25 18:32:23 +0000
committerrubenwardy <rw@rubenwardy.com>2018-12-25 18:34:38 +0000
commitf7d4b4bf6da4bc9d3f00812f0da0c384d4ef7dac (patch)
tree2aeaf9617052ceab51597159379badba20c96972 /app/templates/users
parentd04e06085433c84d8baccef95e4b9f95c48b24cc (diff)
downloadcheatdb-f7d4b4bf6da4bc9d3f00812f0da0c384d4ef7dac.tar.xz
Show placeholder message in unadded topics profile section when empty
Diffstat (limited to 'app/templates/users')
-rw-r--r--app/templates/users/user_profile_page.html26
1 files changed, 15 insertions, 11 deletions
diff --git a/app/templates/users/user_profile_page.html b/app/templates/users/user_profile_page.html
index f0f7ab0..d81d461 100644
--- a/app/templates/users/user_profile_page.html
+++ b/app/templates/users/user_profile_page.html
@@ -128,18 +128,22 @@
{% from "macros/packagegridtile.html" import render_pkggrid %}
{{ render_pkggrid(packages, show_author=False) }}
-{% if topics_to_add %}
+{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(UserRank.EDITOR)) %}
<div class="card mt-3">
- <a name="unadded-packages"></a>
- <h2 class="card-header">Unadded Packages</h2>
-
- <p class="card-body">
- List of your forum topics which do not have a matching package.
- Topics with a strikethrough have been marked as discarded.
- </p>
-
- {% from "macros/topics.html" import render_topics_table %}
- {{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }}
+ <a name="unadded-topics"></a>
+ <h2 class="card-header">Unadded topics</h2>
+
+ {% if topics_to_add %}
+ <p class="card-body">
+ List of your forum topics which do not have a matching package.
+ Topics with a strikethrough have been marked as discarded.
+ </p>
+
+ {% from "macros/topics.html" import render_topics_table %}
+ {{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }}
+ {% else %}
+ <p>Congrats! You don't have any topics which aren't on CDB.</p>
+ {% endif %}
</div>
{% endif %}