htmx-patterns/templates/infinite/persons_partial.html
2024-04-05 22:39:40 -05:00

16 lines
554 B
HTML

{% for person in persons %}
{% if loop.last %}
<li hx-get="{{ url_for('infinite', page=next_page) }}" hx-trigger="intersect once" hx-target="#persons"
hx-swap='beforeend' hx-indicator="#persons-loading"
class="cursor-pointer bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded">
{{ person.name }} -
{{ person.phone_number }}
</li>
{% else %}
<li class="cursor-pointer bg-red-500 hover:bg-red-600 text-white font-bold py-2 px-4 rounded">
{{ person.name }} -
{{ person.phone_number }}
</li>
{% endif %}
{% endfor %}