Add list of domains

This commit is contained in:
Joakim Hellsén 2024-02-23 13:34:40 +01:00
commit 062c80c413
5 changed files with 78 additions and 2 deletions

View file

@ -104,7 +104,9 @@
<small>
<div class="leftright">
<div class="left">
<a href='{% url "feeds:index" %}'>Home</a> | <a href='{% url "feeds:feeds" %}'>Feeds</a> |
<a href='{% url "feeds:index" %}'>Home</a> |
<a href='{% url "feeds:domains" %}'>Domains</a> |
<a href='{% url "feeds:feeds" %}'>Feeds</a> |
<a href='{% url "feeds:api" %}'>API</a>
</div>
<div class="right">

15
templates/domain.html Normal file
View file

@ -0,0 +1,15 @@
{% 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="/feed/{{ feed.id }}">{{ feed.feed_url }}</a>
</li>
{% empty %}
<li>Found no feeds for this domain.</li>
{% endfor %}
</ul>
{% endblock %}

19
templates/domains.html Normal file
View file

@ -0,0 +1,19 @@
{% extends "base.html" %}
{% block content %}
<h2>Domains</h2>
<p>
These are the domains that have been added to the database.
{% if domains|length > 0 %}There are {{ domains|length }} domains in the database.{% endif %}
</p>
<ul>
{% for domain in domains %}
{% if not domain.hidden %}
<li>
<a href="/domain/{{ domain.id }}">{{ domain.url }}</a> - {{ domain.created_at|date }}
</li>
{% endif %}
{% empty %}
<li>Found no domains in the database.</li>
{% endfor %}
</ul>
{% endblock %}