Loaders
Some checks failed
Rust / Test (push) Has been cancelled
Rust / Rustfmt (push) Has been cancelled
Rust / Clippy (push) Has been cancelled
Rust / Code coverage (push) Has been cancelled

This commit is contained in:
Alphonse Paix
2025-09-23 23:47:30 +02:00
parent b1e315921e
commit 3153b99d94
7 changed files with 72 additions and 31 deletions

View File

@@ -1,4 +1,5 @@
{% extends "base.html" %}
{%- import "macros.html" as macros -%}
{% block title %}Posts{% endblock %}
{% block content %}
<div class="max-w-4xl mx-auto">
@@ -27,18 +28,24 @@
{% endfor %}
<div id="load-more" class="text-center">
{% if let Some(n) = next_page %}
<button hx-get="/posts/load_more?page={{ n }}"
hx-target="#load-more"
hx-swap="outerHTML"
class="text-center bg-blue-600 text-white hover:bg-blue-700 font-medium py-3 px-6 rounded-md transition-colors">
Load more
</button>
{% else %}
<p class="text-gray-600">No more posts. Check back later for more!</p>
{% endif %}
</div>
{% endblock %}
</div>
{% endif %}
</div>
{% endblock %}
<div class="flex flex-col items-center space-y-6">
<button hx-get="/posts/load_more?page={{ n }}"
hx-target="#load-more"
hx-swap="outerHTML"
hx-indicator="#indicator"
class="text-center bg-blue-600 text-white hover:bg-blue-700 font-medium py-3 px-6 rounded-md transition-colors">
Load more
</button>
<span id="indicator" class="htmx-indicator">
{% call macros::spinner(class="text-blue-300 w-8 h-8", highlight_class="text-blue-700", size=30) %}
</span>
</div>
{% else %}
<p class="text-gray-600">No more posts. Check back later for more!</p>
{% endif %}
</div>
{% endblock %}
</div>
{% endif %}
</div>
{% endblock %}