Add new to do list UI

This commit is contained in:
rubenwardy
2021-01-29 19:38:14 +00:00
parent b613ac4b89
commit 4f920f011f
14 changed files with 299 additions and 110 deletions

View File

@@ -15,6 +15,10 @@
<a class="btn btn-primary float-right" href="{{ url_for('users.profile_edit', username=user.username) }}">
{{ _("Edit Profile") }}
</a>
<a class="btn btn-secondary float-right mr-3" href="{{ url_for('todo.view_user', username=user.username) }}">
{{ _("To Do List") }}
</a>
{% endif %}
{% if current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.MODERATOR) and user.email %}
@@ -128,32 +132,4 @@
{% from "macros/reviews.html" import render_reviews %}
{{ render_reviews(user.reviews, current_user, True) }}
{% if current_user == user or (current_user.is_authenticated and current_user.rank.atLeast(current_user.rank.EDITOR)) %}
<div class="card mt-5">
<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 class="card-body">Congrats! You don't have any topics which aren't on CDB.</p>
{% endif %}
</div>
{% endif %}
{% endblock %}
{% block scriptextra %}
<script>
const csrf_token = "{{ csrf_token() }}";
</script>
<script src="/static/topic_discard.js"></script>
{% endblock %}