Lemon sadness

This commit is contained in:
Joakim Hellsén 2024-05-20 04:34:51 +02:00
commit bfe90aa69d
No known key found for this signature in database
GPG key ID: D196AE66FEBE1DC9
52 changed files with 1564 additions and 2492 deletions

View file

@ -1,9 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>Change Password</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Change Password</button>
</form>
{% endblock %}

View file

@ -1,12 +0,0 @@
{% extends "base.html" %}
{% block content %}
<p>
You can register <a href="{% url 'register' %}">here</a>.
</p>
<h2>Login</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Login</button>
</form>
{% endblock %}

View file

@ -1,50 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>{{ user.username }}</h2>
<form method="post" action="{% url 'logout' %}">
{% csrf_token %}
<button type="submit">Logout</button>
</form>
<h3>Feeds</h3>
<ul>
{% for feed in user_feeds %}
<li>
<a href='{% url "feed" feed.id %}'>{{ feed.feed_url }}</a>
</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 %}

View file

@ -1,9 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>Register</h2>
<form method="post">
{% csrf_token %}
{{ form.as_p }}
<button type="submit">Register</button>
</form>
{% endblock %}

View file

@ -84,7 +84,7 @@
{% endif %}
<span class="title">
<h1>
<a href="{% url 'index' %}">FeedVault</a>
<a href="{% url 'feeds:index' %}">FeedVault</a>
</h1>
</span>
<div class="leftright">
@ -96,7 +96,7 @@
</small>
</div>
<div class="right">
<form action="{% url 'search' %}" method="get">
<form action="{% url 'feeds:search' %}" method="get">
<input type="text" name="q" placeholder="Search" />
<button type="submit">Search</button>
</form>
@ -106,22 +106,15 @@
<small>
<div class="leftright">
<div class="left">
<a href="{% url 'index' %}">Home</a> |
<a href="{% url 'domains' %}">Domains</a> |
<a href="{% url 'feeds' %}">Feeds</a> |
<a href="{% url 'api_v1:openapi-view' %}">API</a>
<a href="{% url 'feeds:index' %}">Home</a> |
<a href="{% url 'feeds:feeds' %}">Feeds</a> |
<a href="{% url 'feeds:upload' %}">Upload</a>
</div>
<div class="right">
<a href="https://github.com/TheLovinator1/FeedVault">GitHub</a> |
<a href="https://github.com/sponsors/TheLovinator1">Donate</a>
<!-- Show login if not logged in -->
{% if not user.is_authenticated %}
| <a href="{% url 'login' %}">Login</a>
{% endif %}
<!-- Show username if logged in -->
{% if user.is_authenticated %}
| <a href="{% url 'profile' %}">{{ user.username }}</a>
{% endif %}
{% if not user.is_authenticated %}| <a href="">Login</a>{% endif %}
{% if user.is_authenticated %}| <a href="">{{ user.username }}</a>{% endif %}
</div>
</div>
</small>
@ -135,14 +128,12 @@
<small>
<div class="leftright">
<div class="left">
Made by <a href="https://github.com/TheLovinator1">Joakim Hellsén</a>.
<a href="">Privacy Policy</a> | <a href="">Terms of Service</a>
</div>
<div class="right">No rights reserved.</div>
</div>
<div class="leftright">
<div class="left">
<a href="mailto:hello@feedvault.se">hello@feedvault.se</a>
</div>
<div class="left">TheLovinator#9276 on Discord</div>
<div class="right">A birthday present for Plipp ❤️</div>
</div>
</small>

View file

@ -1,15 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>{{ domain.url }}</h2>
<p>This domain was added to the database on {{ domain.created_at|date }}.</p>
<p>Feeds for this domain:</p>
<ul>
{% for feed in feeds %}
<li>
<a href="{% url 'feed' feed.id %}">{{ feed.feed_url }}</a>
</li>
{% empty %}
<li>Found no feeds for this domain.</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -1,5 +0,0 @@
{% extends "base.html" %}
{% block content %}
<h2>Domains</h2>
{% include "partials/domains.html" %}
{% endblock %}

View file

@ -1,6 +1,6 @@
{% extends "base.html" %}
{% block content %}
<h2>{{ feed.feed_url }}</h2>
<h2>{{ feed.url }}</h2>
<p>{{ feed.description }}</p>
<h3>Entries</h3>
<ul>

View file

@ -1,5 +1,12 @@
{% extends "base.html" %}
{% block content %}
<h2>Latest Feeds</h2>
{% include "partials/feeds.html" %}
<ul>
{% for feed in feeds %}
<li>
<a href="{% url 'feeds:feed' feed.id %}">{{ feed.url }}</a>
<p>{{ feed.description }}</p>
</li>
{% endfor %}
</ul>
{% endblock %}

View file

@ -1,52 +1,14 @@
{% extends "base.html" %}
{% block content %}
{% if user.is_authenticated %}
<h2>Welcome, {{ user.username }}!</h2>
<p>
Input the URLs of the feeds you wish to archive below. You can add as many as needed, and access them through the website or API. Alternatively, include links to .opml files, and the feeds within will be archived.
</p>
<form action="{% url 'add' %}" method='post'>
{% csrf_token %}
<textarea id="urls" name="urls" rows="5" cols="50" required></textarea>
<button type="submit">Add feeds</button>
</form>
<br>
<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.
</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 file</button>
</form>
{% else %}
<h2>Welcome to FeedVault!</h2>
<p>
FeedVault is a service that archives web feeds. It allows users to access and search for historical content from various websites. The service is designed to preserve the history of the web and provide a reliable source for accessing content that may no longer be available on the original websites.
</p>
<p>
You need to <a href="{% url 'login' %}">login</a> or <a href="{% url 'register' %}">register</a> to add new feeds or upload files.
</p>
{% endif %}
<h2>Welcome, archivist!</h2>
<p>
Input the URLs of the feeds you wish to archive below. You can add as many as needed, and access them through the website or API. Alternatively, include links to .opml files, and the feeds within will be archived.
</p>
<form action="{% url 'feeds:add' %}" method='post'>
{% csrf_token %}
<textarea id="urls" name="urls" rows="5" cols="50" required></textarea>
<button type="submit">Add feeds</button>
</form>
<h2>FAQ</h2>
<details>
<summary>What are web feeds?</summary>

View file

@ -1,12 +0,0 @@
{% if domains %}
{% for domain in domains %}
<a href="{% url 'domain' domain.id %}">{{ domain.url }}</a> - {{ domain.created_at|date }}
<br>
{% endfor %}
{% else %}
<p>No domains yet. Time to add some!</p>
{% endif %}
<div hx-get="{% url 'domains' %}?page={{ page|add:1 }}"
hx-trigger="revealed"
hx-target="this"
hx-swap="outerHTML">Loading...</div>

View file

@ -1,12 +0,0 @@
{% 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>
{% endif %}
<div hx-get="{% url 'feeds' %}?page={{ page|add:1 }}"
hx-trigger="revealed"
hx-target="this"
hx-swap="outerHTML">Loading...</div>

View file

@ -6,7 +6,7 @@
</h2>
{% if feeds %}
{% for feed in feeds %}
<a href="{% url 'feed' feed.id %}">{{ feed.feed_url|default:"Unknown Feed" }} →</a>
<a href="{% url 'feeds:feed' feed.id %}">{{ feed.url|default:"Unknown Feed" }} →</a>
<br>
{% endfor %}
{% else %}

27
templates/upload.html Normal file
View file

@ -0,0 +1,27 @@
<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.
</p>
<form enctype="multipart/form-data"
method="post"
action="{% url 'feeds: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 file</button>
</form>