feat: Add attachment management with upload, deletion, serving, and media metadata stripping.
This commit is contained in:
47
templates/attachments.html
Normal file
47
templates/attachments.html
Normal file
@@ -0,0 +1,47 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Manage Attachments{% endblock %}
|
||||
{% block content %}
|
||||
|
||||
<h2>Manage Attachments</h2>
|
||||
|
||||
<a href="/__dungeon">< Back to Dashboard</a><br><br>
|
||||
|
||||
<b>Upload New Attachment</b><br>
|
||||
<form method="POST" action="/__dungeon/attachments/upload" enctype="multipart/form-data">
|
||||
File: <input type="file" name="file" required><br><br>
|
||||
<input type="submit" value="Upload Attachment">
|
||||
</form>
|
||||
<br>
|
||||
|
||||
<b>Existing Attachments</b><br>
|
||||
{% if attachments.is_empty() %}
|
||||
<p>No attachments found.</p>
|
||||
{% else %}
|
||||
<table border="1" cellpadding="5" cellspacing="0">
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Filename</th>
|
||||
<th>Type</th>
|
||||
<th>Size</th>
|
||||
<th>Created At</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
{% for att in attachments %}
|
||||
<tr>
|
||||
<td><code>{{ att.id }}</code></td>
|
||||
<td><a href="/__attachments/{{ att.id }}" target="_blank">{{ att.filename }}</a></td>
|
||||
<td>{{ att.content_type }}</td>
|
||||
<td>{{ att.size }} bytes</td>
|
||||
<td>{{ att.formatted_created_at() }}</td>
|
||||
<td>
|
||||
<form method="POST" action="/__dungeon/attachments/delete/{{ att.id }}" style="display:inline;"
|
||||
onsubmit="return confirm('Are you sure you want to delete this attachment?');">
|
||||
<input type="submit" value="Delete">
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user