add motd editor and motd display

This commit is contained in:
2026-05-27 02:02:55 +03:00
parent e74b9403e9
commit 303750a281
8 changed files with 96 additions and 12 deletions

View File

@@ -1,4 +1,4 @@
{%- from 'common/icons.html' import icn_info, icn_warn, icn_error, icn_bookmark -%}
{%- from 'common/icons.html' import icn_info, icn_warn, icn_error, icn_bookmark, icn_megaphone -%}
{% macro timestamp(unix_ts) -%}
<time datetime="{{ unix_ts | iso8601 }}">{{ unix_ts | ts_datetime('%Y-%m-%d %H:%M')}} <abbr title="Server Time">ST</abbr></time>
@@ -238,3 +238,18 @@
{%- endif -%}
</div>
{%- endmacro %}
{% macro motd(motd_objs) -%}
{%- if motd_objs -%}
<div class="motd plank contrast-bg">
<div class="contain-svg">
{{ icn_megaphone(64) }}
<i><abbr title="Message of the Day">MOTD</abbr></i>
</div>
<div class="motd-content mobile-fill-flex">
<h2 class="info">{{ motd_objs[0].title }}</h2>
<div class="motd-body">{{ motd_objs[0].body_rendered | safe }}</div>
</div>
</div>
{%- endif -%}
{%- endmacro %}