render motds in topic and topics views

This commit is contained in:
2025-11-27 22:25:03 +03:00
parent d0dfd3a4c3
commit 8b5b38e38b
10 changed files with 149 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
{% from 'common/macros.html' import pager, timestamp %}
{% from 'common/macros.html' import pager, timestamp, motd %}
{% from 'common/icons.html' import icn_lock, icn_sticky %}
{% extends "base.html" %}
{% block title %}browsing topic {{ topic['name'] }}{% endblock %}
@@ -27,6 +27,14 @@
{{ infobox("This topic is locked.;Only moderators can create new threads.", InfoboxKind.INFO) }}
{% endif %}
{%- with motds = get_motds() -%}
{%- if motds -%}
{%- for motd_obj in motds -%}
{{- motd(motd_obj) -}}
{%- endfor -%}
{%- endif -%}
{%- endwith -%}
{% if threads_list | length == 0 %}
<p>There are no threads in this topic.</p>
{% else %}

View File

@@ -1,5 +1,5 @@
{% from 'common/icons.html' import icn_lock %}
{% from 'common/macros.html' import timestamp %}
{% from 'common/macros.html' import timestamp, motd %}
{% extends "base.html" %}
{% block content %}
<nav class="darkbg">
@@ -9,6 +9,13 @@
<a class="linkbutton" href={{ url_for("mod.sort_topics") }}>Sort topics</a>
{% endif %}
</nav>
{%- with motds = get_motds() -%}
{%- if motds -%}
{%- for motd_obj in motds -%}
{{- motd(motd_obj) -}}
{%- endfor -%}
{%- endif -%}
{%- endwith -%}
{% if topic_list | length == 0 %}
<p>There are no topics.</p>
{% else %}