Refactor collections button to use HTMX for dynamic loading of user collections
This commit is contained in:
@@ -14,7 +14,13 @@
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Collections</h5>
|
||||
<p class="card-text">Quick access to collections you can view or take.</p>
|
||||
<a href="{% url 'atlas:user_collections' %}" class="btn btn-primary">Collections to view / take</a>
|
||||
<button class="btn btn-primary"
|
||||
hx-get="{% url 'atlas:user_collections' %}"
|
||||
hx-target="#user-collections-placeholder"
|
||||
hx-swap="innerHTML">
|
||||
Collections to view / take
|
||||
</button>
|
||||
<div id="user-collections-placeholder" class="mt-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -29,14 +35,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<!-- HTMX-loaded user collections (loads on page load) -->
|
||||
<div id="user-collections-placeholder"
|
||||
hx-get="{% url 'atlas:user_collections' %}"
|
||||
hx-trigger="load"
|
||||
hx-swap="innerHTML"
|
||||
class="mt-3">
|
||||
<div class="text-muted">Loading your collections…</div>
|
||||
</div>
|
||||
<!-- user collections will load into the Collections card when requested -->
|
||||
</div>
|
||||
|
||||
<div class="col-12 col-md-4">
|
||||
|
||||
Reference in New Issue
Block a user