diff options
author | citrons <citrons@mondecitronne.com> | 2025-06-14 01:03:34 -0500 |
---|---|---|
committer | ubq323 <ubq323@ubq323.website> | 2025-06-14 10:17:34 +0100 |
commit | 69240eafea18a4505bedc60cc9f79aa38ac9abd1 (patch) | |
tree | a8a46021df4e7fb04edafd123acf65cc188ef1d1 /apioforum/templates | |
parent | a62beb7a48044686e50a27a53d112a99f8607461 (diff) |
integrated subforum list
the UI is more compact and aesthetically pleasing, and it allows seeing
activity in subforae more easily. as it stands, all subforae are hidden
away, so no one sees anything that anyone posts in them! this UI
implicitly shows up to four unread subforae.
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/view_forum.html | 68 |
1 files changed, 40 insertions, 28 deletions
diff --git a/apioforum/templates/view_forum.html b/apioforum/templates/view_forum.html index 7732b21..7640439 100644 --- a/apioforum/templates/view_forum.html +++ b/apioforum/templates/view_forum.html @@ -42,34 +42,6 @@ {% endif %} </p> -{% if subforums %} -<h2>subforæ</h2> -<details> -<summary>show subforæ</summary> -<div class="forum-list"> - {% for subforum in subforums %} - <div class="listing"> - <div class="listing-main {% if not is_read('forum', subforum.id) %}unread{% endif %}"> - <div class="listing-title"> - <a href="{{url_for('forum.view_forum',forum_id=subforum.id)}}"> - {{- subforum.name -}} - </a> - </div> - </div> - <div class="listing-caption"> - {% if subforum.updated %} - last activity {{ts(subforum.updated)}} ago - {% else %} - no threads - {% endif %} - </div> - </div> - {% endfor %} -</div> -</details> -{% endif %} - -<h2>threads</h2> <p> {% if has_permission(forum.id, g.user, "p_create_threads") %} <a class="actionbutton" href="{{url_for('forum.create_thread',forum_id=forum.id)}}">create new thread</a> @@ -126,7 +98,47 @@ you do not have permission to create threads in this forum </details> </p> + + {{ pagination_nav(page,max_pageno,'forum.view_forum',forum_id=forum.id) }} + +{% macro subforum_listing(subforum) %} + <div class="listing"> + <div class="listing-main {% if not is_read('forum', subforum.id) %}unread{% endif %}"> + <div class="listing-title"> + <a href="{{url_for('forum.view_forum',forum_id=subforum.id)}}"> + {{- subforum.name -}} + </a> + </div> + </div> + <div class="listing-caption"> + {% if subforum.updated %} + last activity {{ts(subforum.updated)}} ago + {% else %} + no threads + {% endif %} + </div> + </div> +{% endmacro %} + +{% if page == 1 and shown_subforums %} +<h2 class="listing-header">subforæ</h2> +<div class="forum-list"> + {% for subforum in shown_subforums %} + {{subforum_listing(subforum)}} + {% endfor %} + {% if hidden_subforums %} + <details class="more-subforums"> + <summary>more...</summary> + {% for subforum in hidden_subforums %} + {{subforum_listing(subforum)}} + {% endfor %} + </details> + {% endif %} +</div> +<h2 class="listing-header">threads</h2> +{% endif %} + <div class="thread-list"> {%for thread in threads%} <div class="listing"> |