Applied a fix for the delete button that didn't work.

This commit is contained in:
Michael Woods
2025-12-26 14:12:25 -05:00
parent 1f455f47ed
commit 1a0fd25031

View File

@@ -62,7 +62,15 @@
{% for obj in objects %}
<tr>
<td><strong>{{ obj.name }}</strong></td>
<td>{{ "%0.1f KB" | format(obj.size / 1024) if obj.size > 1024 else obj.size ~ " bytes" }}</td>
<td>
{% if obj.size < 1024 %}
{{ obj.size }} bytes
{% elif obj.size < 1048576 %}
{{ "%0.1f" | format(obj.size / 1024) }} KB
{% else %}
{{ "%0.1f" | format(obj.size / 1048576) }} MB
{% endif %}
</td>
<td>
{% if obj.binary %}
<span class="badge bg-secondary">Binary</span>
@@ -70,7 +78,7 @@
<span class="badge bg-info">Text</span>
{% endif %}
</td>
<td>{{ obj.created_at[:10] }}</td>
<td>{{ obj.created_at.strftime('%b %d, %Y') }}</td>
<td>
{% if obj.private %}
<span class="badge bg-warning">Private</span>
@@ -78,14 +86,14 @@
<span class="badge bg-success">Public</span>
{% endif %}
</td>
<td>
<td class="text-nowrap">
{% if not obj.binary %}
<a href="/api/v1/objects/{{ obj.uuid }}/text" class="btn btn-sm btn-outline-info" target="_blank">View Text</a>
<a href="/api/v1/objects/{{ obj.uuid }}/text" class="btn btn-sm btn-outline-info me-1" target="_blank">View Text</a>
{% endif %}
<a href="/api/v1/objects/{{ obj.uuid }}/download" class="btn btn-sm btn-primary">Download</a>
<form action="/api/v1/objects/{{ obj.uuid }}" method="post" style="display:inline;">
<a href="/api/v1/objects/{{ obj.uuid }}/download" class="btn btn-sm btn-primary me-1">Download</a>
<form action="/api/v1/objects/{{ obj.uuid }}" method="post" style="display:inline;" onsubmit="return confirm('Permanently delete {{ obj.name | e }}?');">
<input type="hidden" name="_method" value="DELETE">
<button type="submit" class="btn btn-sm btn-danger" onclick="return confirm('Delete {{ obj.name }}?')">Delete</button>
<button type="submit" class="btn btn-sm btn-danger">Delete</button>
</form>
</td>
</tr>