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 %}
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
{% load static %}
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
|
|
@ -7,11 +8,8 @@
|
|||
{% if keywords %}<meta name="keywords" content="{{ keywords }}" />{% endif %}
|
||||
{% if author %}<meta name="author" content="{{ author }}" />{% endif %}
|
||||
{% if canonical %}<link rel="canonical" href="{{ canonical }}" />{% endif %}
|
||||
{% if title %}
|
||||
<title>{{ title }}</title>
|
||||
{% else %}
|
||||
<title>FeedVault</title>
|
||||
{% endif %}
|
||||
<title>{{ title|default:"FeedVault" }}</title>
|
||||
<script src="{% static 'htmx.min.js' %}"></script>
|
||||
<style>
|
||||
html {
|
||||
max-width: 88ch;
|
||||
|
|
@ -70,6 +68,10 @@
|
|||
.success {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.warning {
|
||||
color: orange;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
{% if feeds %}
|
||||
{% for feed in feeds %}
|
||||
<a href="{% url 'feed' feed.id %}">{{ feed.feed_url|default:"Unknown Feed" }} →</a>
|
||||
<br>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>No feeds yet. Time to add some!</p>
|
||||
|
|
|
|||
|
|
@ -14,16 +14,29 @@
|
|||
<h2>Upload</h2>
|
||||
<p>
|
||||
You can also upload files containing the feeds you wish to archive.
|
||||
Currently supported file formats: .opml, .xml, .json. Your file will be parsed in the future if not currently supported. Feel free to upload databases, backups, or any other files containing feeds. The service will parse the files and add the feeds to the archive.
|
||||
Currently supported file formats: .opml, .xml, .json.
|
||||
Your file will be parsed in the future if not currently supported.
|
||||
Feel free to upload databases, backups, or any other files containing feeds.
|
||||
</p>
|
||||
<form enctype="multipart/form-data"
|
||||
method="post"
|
||||
action="{% url 'upload' %}">
|
||||
{% csrf_token %}
|
||||
<p>
|
||||
<label for="file">Choose a file to upload</label>
|
||||
<br>
|
||||
<br>
|
||||
<input type="file" name="file" id="file" required>
|
||||
<br>
|
||||
<br>
|
||||
<label for="description">Description (optional)</label>
|
||||
<input type="text"
|
||||
name="description"
|
||||
id="description"
|
||||
size="80"
|
||||
placeholder="Description (optional)">
|
||||
</p>
|
||||
<button type="submit">Upload feeds</button>
|
||||
<button type="submit">Upload file</button>
|
||||
</form>
|
||||
{% else %}
|
||||
<h2>Welcome to FeedVault!</h2>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue