add motd schema and motd editor

This commit is contained in:
2025-11-27 19:47:26 +03:00
parent 04fd3f5d20
commit fca214dfcf
12 changed files with 156 additions and 32 deletions

View File

@@ -0,0 +1,17 @@
{% from 'common/macros.html' import babycode_editor_component %}
{% extends 'base.html' %}
{% block title %}editing MOTD{% endblock %}
{% block content %}
<div class="darkbg settings-container">
<h1>Edit Message of the Day</h1>
<p>The Message of the Day will show up on the main page and in every topic.</p>
<form method="POST">
<label for="title">Title</label>
<input name="title" id="title" type="text" required autocomplete="off" placeholder="Required" value="{{ current.title }}"><br>
<label for="body">Body</label>
{{ babycode_editor_component('body', ta_placeholder='MOTD body (required)', banned_tags=['img', 'spoiler'], prefill=current.body_original_markup) }}
<input type="submit" value="Save">
<input class="critical" type="submit" formaction="{{ url_for('mod.motd_delete') }}" value="Delete MOTD" formnovalidate {{"disabled" if not current else ""}}>
</form>
</div>
{% endblock %}

View File

@@ -6,6 +6,7 @@
<ul>
<li><a href="{{ url_for('mod.user_list') }}">User list</a></li>
<li><a href="{{ url_for('mod.sort_topics') }}">Sort topics</a></li>
<li><a href="{{ url_for('mod.motd_editor') }}">Message of the Day</a></li>
</ul>
</div>
{% endblock %}