Mercurial > libervia-templates
comparison sat_templates/templates/bulma/forum/categories.html @ 413:0190a0d32909 default tip
Forum: Major redesign of forums:
Forums have been redesigned. They follow the new general design with 2 or 3 panels,
allowing to have directly a forum if one is found/set up, and a panel on the left to
search/discover other ones.
Categories have been rewritten to be usable with pubsub relationships, a XEP-0277 type
node is used for topics, and each item has a comments node for the threads.
The thread view is set in `forum/show_messages.html` template. It has a header with a
search box and a button to (un)subscribe.
Items are displayed with the same macros as for the blog items.
Below a room is set for editor, tags and attachments.
rel 463
author | Goffi <goffi@goffi.org> |
---|---|
date | Fri, 05 Sep 2025 21:54:09 +0200 |
parents | sat_templates/templates/bulma/forum/overview.html@1928ba66c194 |
children |
comparison
equal
deleted
inserted
replaced
412:c1d33d7e4b96 | 413:0190a0d32909 |
---|---|
1 {% if not embedded %}{% extends 'base/base.html' %}{% endif %} | |
2 | |
3 {% macro generate_forums(forums_data, level=0) %} | |
4 <div class="forum-list"> | |
5 {% for forum in forums_data %} | |
6 <div class="forum-item mb-4"> | |
7 {% if forum.forum_type == "main_category" %} | |
8 | |
9 {# Main Categories #} | |
10 <div class="forum-category box has-background-primary"> | |
11 <div class="media {% if level == 0 %}is-aligned-center{% else %}is-aligned-left{% endif %}"> | |
12 <div class="media-left"> | |
13 <span class="icon {% if level == 0 %}is-large{% else %}is-medium{% endif %} has-text-white"> | |
14 <i class="fas fa-layer-group {% if level == 0 %}fa-2x{% endif %}"></i> | |
15 </span> | |
16 </div> | |
17 <div class="media-content"> | |
18 {% if 'http_url' in forum %} | |
19 <a href="{{ forum.http_url }}" class="has-text-white"> | |
20 {% endif %} | |
21 <h3 class="title {% if level == 0 %}is-3{% else %}is-4{% endif %} has-text-white"> | |
22 {{ forum.title }} | |
23 </h3> | |
24 {% if forum.description %} | |
25 <p class="subtitle is-5 has-text-white-bis">{{ forum.description }}</p> | |
26 {% endif %} | |
27 {% if 'http_url' in forum %} | |
28 </a> | |
29 {% endif %} | |
30 </div> | |
31 {% if level == 0 %} | |
32 <div class="media-right"> | |
33 <span class="tag is-light is-medium"> | |
34 <span class="icon"><i class="fas fa-folder"></i></span> | |
35 <span>{{ forum.children|length }} Forums</span> | |
36 </span> | |
37 </div> | |
38 {% endif %} | |
39 </div> | |
40 </div> | |
41 | |
42 {% if forum.children %} | |
43 <div class="forum-children pl-5 pr-3 mt-2"> | |
44 {{ generate_forums(forum.children, level+1) }} | |
45 </div> | |
46 {% endif %} | |
47 | |
48 {% else %} | |
49 | |
50 {# Subcategories #} | |
51 <a {% if 'http_url' in forum %}href="{{ forum.http_url }}"{% endif %} | |
52 class="forum-subcategory box is-hoverable"> | |
53 <div class="media"> | |
54 <div class="media-left"> | |
55 <span class="icon is-medium has-text-primary"> | |
56 <i class="fas fa-folder fa-2x"></i> | |
57 </span> | |
58 </div> | |
59 <div class="media-content"> | |
60 <div class="content"> | |
61 <strong class="title is-4 mb-1">{{ forum.title }}</strong> | |
62 {% if forum.description %} | |
63 <p class="subtitle is-6 has-text-grey">{{ forum.description }}</p> | |
64 {% endif %} | |
65 </div> | |
66 <div class="forum-stats"> | |
67 {% if 'nb_items' in forum %} | |
68 <span class="tag is-light is-rounded"> | |
69 <span class="icon"><i class="fas fa-comment"></i></span> | |
70 <span>{{ forum.nb_items }} Topics</span> | |
71 </span> | |
72 {% endif %} | |
73 {% if forum.last_activity %} | |
74 <span class="tag is-light is-rounded ml-2"> | |
75 <span class="icon"><i class="fas fa-clock"></i></span> | |
76 <span>{{ forum.last_activity|date_fmt('short', tz_name=tz_name)}}</span> | |
77 </span> | |
78 {% endif %} | |
79 </div> | |
80 </div> | |
81 <div class="media-right"> | |
82 {% if 'http_url' in forum %} | |
83 <span class="icon has-text-info"> | |
84 <i class="fas fa-chevron-right"></i> | |
85 </span> | |
86 {% endif %} | |
87 </div> | |
88 </div> | |
89 </a> | |
90 {% endif %} | |
91 </div> | |
92 {% endfor %} | |
93 </div> | |
94 {% endmacro %} | |
95 | |
96 {% block body %} | |
97 <div class="container forums px-4 py-2"> | |
98 {% if not forums %} | |
99 <div class="message is-info"> | |
100 <div class="message-body has-text-centered"> | |
101 <span class="icon is-large mb-3"> | |
102 <i class="fas fa-comments fa-2x"></i> | |
103 </span> | |
104 <h3 class="title is-4">{% trans %}No forums found{% endtrans %}</h3> | |
105 <p class="subtitle is-6">{% trans %}You may ask your service administrator to create some.{% endtrans %}</p> | |
106 </div> | |
107 </div> | |
108 {% else %} | |
109 {{ generate_forums(forums) }} | |
110 {% endif %} | |
111 </div> | |
112 {% endblock body %} |