Load more button on Posts page
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user