Add user-related collections feature with HTMX support and timestamps for collections
This commit is contained in:
@@ -20,7 +20,14 @@
|
||||
hx-swap="innerHTML">
|
||||
Collections to view / take
|
||||
</button>
|
||||
<button class="btn btn-outline-primary ms-2"
|
||||
hx-get="{% url 'atlas:user_related_collections' %}"
|
||||
hx-target="#user-related-collections-placeholder"
|
||||
hx-swap="innerHTML">
|
||||
My collections
|
||||
</button>
|
||||
<div id="user-collections-placeholder" class="mt-3"></div>
|
||||
<div id="user-related-collections-placeholder" class="mt-3"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
<div class="card mb-3">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Related collections</h5>
|
||||
|
||||
<ul class="list-unstyled">
|
||||
{% for item in related_collections %}
|
||||
<li>
|
||||
<a href="{% url 'atlas:collection_detail' item.collection.pk %}">{{ item.collection.name }}</a>
|
||||
{% if item.is_author %}<span class="badge bg-primary ms-2">Author</span>{% endif %}
|
||||
{% if item.is_marker %}<span class="badge bg-secondary ms-2">Marker</span>{% endif %}
|
||||
{% if item.collection.description %}<small class="text-muted"> — {{ item.collection.description }}</small>{% endif %}
|
||||
</li>
|
||||
{% empty %}
|
||||
<li class="text-muted">No related collections.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user