diff options
Diffstat (limited to 'apioforum/templates/view_forum.html')
-rw-r--r-- | apioforum/templates/view_forum.html | 58 |
1 files changed, 47 insertions, 11 deletions
diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 649c87c..b03d51a 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -26,13 +26,6 @@ <p>your role in this forum: {{role}}</p> {% endif %} - <p>available tags: - {% for the_tag in avail_tags %} - {{tag(the_tag)}} - {% else %} - <em>(none available)</em> - {% endfor %} - </p> </div> <p> @@ -83,7 +76,53 @@ 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 %} + + +<details +{%- if current_sortby != "ad" or tagfilter_tag is not none %} + open +{%- endif -%}> + <summary>sorting and filtering options</summary> + +<form class="inline-form small-form" method="get"> + <fieldset> + <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> + <p>filter by tag:</p> + <input {% if tagfilter_tag is none %}checked{% endif %} type=radio id=tagfilter-none name=tagfilter value=""> + <label for=tagfilter-none>don't</label> + + {% for the_tag in avail_tags %} + + <input type="radio" id="tagfilter-{{the_tag.id}}" + name="tagfilter" value="{{the_tag.id}}" + {% if tagfilter_tag.id == the_tag.id %}checked{% endif %}> + <label for="tagfilter-{{the_tag.id}}"> + {{tag(the_tag)}} + </label> + {% endfor %} + <br> + + + <input type="submit" value="apply"> + </fieldset> +</form> + +</details> +</p> + {{ pagination_nav(page,max_pageno,'forum.view_forum',forum_id=forum.id) }} <div class="thread-list"> {%for thread in threads%} @@ -136,7 +175,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%} |