Show placeholder message in unadded topics profile section when empty

This commit is contained in:
rubenwardy 2018-12-25 18:32:23 +00:00
parent d04e060854
commit f7d4b4bf6d
2 changed files with 14 additions and 10 deletions

@ -72,7 +72,7 @@
<a class="nav-link" href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a> <a class="nav-link" href="{{ url_for('user_profile_page', username=current_user.username) }}">Profile</a>
</li class="nav-item"> </li class="nav-item">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="{{ url_for('user_profile_page', username=current_user.username) }}#unadded-packages">Your unadded topics</a> <a class="nav-link" href="{{ url_for('user_profile_page', username=current_user.username) }}#unadded-topics">Your unadded topics</a>
</li class="nav-item"> </li class="nav-item">
{% if current_user.canAccessTodoList() %} {% if current_user.canAccessTodoList() %}
<li class="nav-item"><a class="nav-link" href="{{ url_for('todo_page') }}">Work Queue</a></li> <li class="nav-item"><a class="nav-link" href="{{ url_for('todo_page') }}">Work Queue</a></li>

@ -128,18 +128,22 @@
{% from "macros/packagegridtile.html" import render_pkggrid %} {% from "macros/packagegridtile.html" import render_pkggrid %}
{{ render_pkggrid(packages, show_author=False) }} {{ 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"> <div class="card mt-3">
<a name="unadded-packages"></a> <a name="unadded-topics"></a>
<h2 class="card-header">Unadded Packages</h2> <h2 class="card-header">Unadded topics</h2>
<p class="card-body"> {% if topics_to_add %}
List of your forum topics which do not have a matching package. <p class="card-body">
Topics with a strikethrough have been marked as discarded. List of your forum topics which do not have a matching package.
</p> Topics with a strikethrough have been marked as discarded.
</p>
{% from "macros/topics.html" import render_topics_table %} {% from "macros/topics.html" import render_topics_table %}
{{ render_topics_table(topics_to_add, show_author=False, show_discard=True, current_user=current_user) }} {{ 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> </div>
{% endif %} {% endif %}