Improve uploading/downloading files
This commit is contained in:
parent
5ca163d35a
commit
7005490bf4
18 changed files with 4596 additions and 134 deletions
|
|
@ -13,4 +13,38 @@
|
|||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
<h3>Uploads</h3>
|
||||
{% if user_uploads %}
|
||||
<p>Uploaded files:</p>
|
||||
{% else %}
|
||||
<p>No uploaded files yet.</p>
|
||||
{% endif %}
|
||||
<ul id="uploads-list">
|
||||
{% for upload in user_uploads %}
|
||||
<li id="upload-{{ upload.id }}">
|
||||
<a href="{{ upload.get_absolute_url }}">{{ upload }}</a>
|
||||
<p>
|
||||
Description: <span id="description-{{ upload.id }}">{{ upload.description|default:"No description" }}</span>
|
||||
{% if upload.notes %}
|
||||
<br>
|
||||
Notes: {{ upload.notes }}
|
||||
{% endif %}
|
||||
</p>
|
||||
<form method="post" action="{% url 'delete_upload' %}">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="file_id" value="{{ upload.id }}">
|
||||
<button type="submit">Delete</button>
|
||||
</form>
|
||||
<form method="post"
|
||||
hx-post="{% url 'edit_description' %}"
|
||||
hx-target="#description-{{ upload.id }}"
|
||||
hx-swap="innerHTML">
|
||||
{% csrf_token %}
|
||||
<input type="hidden" name="file_id" value="{{ upload.id }}">
|
||||
<input type="text" name="description" placeholder="New description" required>
|
||||
<button type="submit">Edit description</button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue