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/icons.html' import icn_image, icn_spoiler, icn_info, icn_lock, icn_warn, icn_error, icn_bookmark %}
{% from 'common/icons.html' import icn_image, icn_spoiler, icn_info, icn_lock, icn_warn, icn_error, icn_bookmark, icn_megaphone %}
{% macro pager(current_page, page_count) %}
{% set left_start = [1, current_page - 5] | max %}
{% set right_end = [page_count, current_page + 5] | min %}
@@ -61,6 +61,19 @@
</div>
{% endmacro %}
{% macro motd(motd_obj) %}
<div class="motd">
<div class="motd-icon-container contain-svg">
{{ icn_megaphone(80) }}
<i><abbr title="Message of the Day">MOTD</abbr></i>
</div>
<div class="motd-content-container">
<div class="motd-title">{{ motd_obj.title }}</div>
<div class="motd-body">{{ motd_obj.body_rendered | safe}}</div>
</div>
</div>
{% endmacro %}
{% macro timestamp(unix_ts) -%}
<span class="timestamp" data-utc="{{ unix_ts }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></span>
{%- endmacro %}