diff options
author | ubq323 <ubq323> | 2021-07-22 18:35:01 +0000 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2022-05-13 22:39:37 +0100 |
commit | 14f72326212adc91f27c436e201a19c431eab3e2 (patch) | |
tree | 80032b7f9b2f8d1a55cc0c40a61b3e582292769d /apioforum/templates | |
parent | 6f5741731efac510336e2b5d512b4523b9d8da13 (diff) |
add ability to sort threads by creation or modification, asc or desc
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/view_forum.html | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 649c87c..c1906b6 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -83,7 +83,26 @@ please log in to create a new thread you do not have permission to create threads in this forum {% endif %} -{% if has_permission(forum.id, g.user, "p_view_threads", login_required=False) %} +{% macro sortby_option(code, text) %} +{% if current_sortby==code %} +<option selected value="{{code}}">{{text}}</option> +{% else %} +<option value="{{code}}">{{text}}</option> +{% endif %} +{% endmacro %} + +<form class="inline-form small-form" method="get"> + <label for="sortby">sort threads by</label> + <select name="sortby"> + {{ sortby_option("ad", "last activity (newest first)") }} + {{ sortby_option("aa", "last activity (oldest first)") }} + {{ sortby_option("cd", "creation time (newest first)") }} + {{ sortby_option("ca", "creation time (oldest first)") }} + </select> + <input type="submit" value="go"> +</form> +</p> + {{ pagination_nav(page,max_pageno,'forum.view_forum',forum_id=forum.id) }} <div class="thread-list"> {%for thread in threads%} @@ -136,7 +155,4 @@ you do not have permission to create threads in this forum </div> -{% else %} -<p>you do not have permission to view threads in this forum</p> -{% endif %} {%endblock%} |