Files
51l3nt51n-blog/templates/posts_list.html

42 lines
1.1 KiB
HTML

{% 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.formatted_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 %}