feat: Implement blog post management including database schema, models, handlers, and UI.
This commit is contained in:
42
templates/posts_list.html
Normal file
42
templates/posts_list.html
Normal 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 %}
|
||||
Reference in New Issue
Block a user