Add infinity scrolling for /domains
This commit is contained in:
parent
d97f980b66
commit
816700a63b
3 changed files with 33 additions and 24 deletions
|
|
@ -1,19 +1,5 @@
|
|||
{% 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="{% url 'domain' domain.id %}">{{ domain.url }}</a> - {{ domain.created_at|date }}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% empty %}
|
||||
<li>Found no domains in the database.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% include "partials/domains.html" %}
|
||||
{% endblock %}
|
||||
|
|
|
|||
12
templates/partials/domains.html
Normal file
12
templates/partials/domains.html
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
{% 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue