Load more button on Posts page
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 18:24:12 +02:00
parent 5c5e3b0e4c
commit b1e315921e
7 changed files with 96 additions and 37 deletions

View File

@@ -21,12 +21,23 @@
</div>
{% else %}
<div class="space-y-6">
{% for post in posts %}{{ post.render() | safe }}{% endfor %}
</div>
<div class="mt-8 text-center">
<button class="bg-blue-600 text-white hover:bg-blue-700 font-medium py-3 px-6 rounded-md transition-colors">
Load more
</button>
{% block posts %}
{% for post in posts %}
{% include "post_card_fragment.html" %}
{% 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>

View File

@@ -39,7 +39,7 @@
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<div class="text-sm text-amber-800">
<p>You will receive an email with an unsubscribe link.</p>
<p>You will receive an email with an confirmation link.</p>
</div>
</div>
</div>