aboutsummaryrefslogtreecommitdiff
path: root/app/templates/todo
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-12-25 16:40:19 +0000
committerrubenwardy <rw@rubenwardy.com>2018-12-25 16:40:19 +0000
commitdaded6d193433cb6f76d93a4ed3833131d70f597 (patch)
treee59bc2ecb3eed0b25bcdf5c3fc4bbc97703aa0c3 /app/templates/todo
parentb0a5980833c0f4bded04f0b6500a1713652ca552 (diff)
downloadcheatdb-daded6d193433cb6f76d93a4ed3833131d70f597.tar.xz
Add sort by option to topic list
Diffstat (limited to 'app/templates/todo')
-rw-r--r--app/templates/todo/topics.html17
1 files changed, 14 insertions, 3 deletions
diff --git a/app/templates/todo/topics.html b/app/templates/todo/topics.html
index 2156e8d..8b39b8e 100644
--- a/app/templates/todo/topics.html
+++ b/app/templates/todo/topics.html
@@ -9,17 +9,28 @@ Topics to be Added
{% if current_user.rank.atLeast(current_user.rank.EDITOR) %}
{% if n >= 10000 %}
<a class="btn btn-primary"
- href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=100) }}">
+ href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=100, sort=sort_by) }}">
Paginiated List
</a>
{% else %}
<a class="btn btn-primary"
- href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=10000) }}">
+ href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=10000, sort=sort_by) }}">
Unlimited List
</a>
{% endif %}
{% endif %}
- <a class="btn btn-primary" href="{{ url_for('todo_topics_page', q=query, show_discarded=not show_discarded) }}">
+ {% if sort_by == "name" %}
+ <a class="btn btn-primary"
+ href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=n, sort='date') }}">
+ Sort by date
+ </a>
+ {% else %}
+ <a class="btn btn-primary"
+ href="{{ url_for('todo_topics_page', q=query, show_discarded=show_discarded, n=n, sort='name') }}">
+ Sort by name
+ </a>
+ {% endif %}
+ <a class="btn btn-primary" href="{{ url_for('todo_topics_page', q=query, show_discarded=not show_discarded, n=n, sort=sort_by) }}">
{% if not show_discarded %}
Show
{% else %}