Loaders
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user