feat: Implement blog post management including database schema, models, handlers, and UI.

This commit is contained in:
2026-03-03 16:34:38 +00:00
parent aee36fa70d
commit ef068f7dfa
7 changed files with 415 additions and 0 deletions

42
templates/posts_list.html Normal file
View File

@@ -0,0 +1,42 @@
{% extends "base.html" %}
{% block title %}Manage Blog Posts{% endblock %}
{% block content %}
<h2>Manage Blog Posts</h2>
<a href="/__dungeon">Back to Dashboard</a> | <a href="/__dungeon/posts/new">Create New Post</a>
<br><br>
{% if let Some(err) = error %}
<font color="red"><b>{{ err }}</b></font><br><br>
{% endif %}
{% if posts.is_empty() %}
<i>No posts found.</i>
{% else %}
<table border="1" cellpadding="5" cellspacing="0">
<tr>
<th>ID</th>
<th>Title</th>
<th>Visibility</th>
<th>Created At</th>
<th>Actions</th>
</tr>
{% for post in posts %}
<tr>
<td>{{ post.id }}</td>
<td>{{ post.title }}</td>
<td>{{ post.visibility }}</td>
<td>{{ post.created_at }}</td>
<td>
<a href="/__dungeon/posts/edit/{{ post.id }}">Edit</a> |
<form method="POST" action="/__dungeon/posts/delete/{{ post.id }}" style="display:inline;">
<input type="submit" value="Delete">
</form>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
{% endblock %}