Show gallery in a card

This commit is contained in:
Alexandre Iooss 2021-10-13 15:52:18 +02:00
parent b3c85f15e5
commit 2753f70234

View file

@ -41,12 +41,26 @@
</p>
{% endif %}
{% if gallery.description %}<p>{{ gallery.description|safe }}</p>{% endif %}
<div class="gallery-list mb-3" id="lightgallery">
{% for photo in gallery.public %}
<a href="{{ photo.get_absolute_url }}" data-src="{{ photo.get_display_url }}" data-download-url="{{ photo.image.url }}">
<img src="{{ photo.get_thumbnail_url }}" class="img-thumbnail" alt="{{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extented.owner.get_full_name }}">
</a>
{% endfor %}
<div class="card">
<div class="card-header pb-0 border-bottom-0">
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link active" href="#">{% trans "All pictures" %}</a>
</li>
</ul>
</div>
<div class="card-body">
<div id="lightgallery">
{% for photo in gallery.public %}
<a href="{{ photo.get_absolute_url }}" data-src="{{ photo.get_display_url }}" data-download-url="{{ photo.image.url }}">
<img src="{{ photo.get_thumbnail_url }}" class="img-thumbnail" alt="{{ photo.title }}{% if photo.date_taken %} - {{ photo.date_taken|date }} {{ photo.date_taken|time }}{% endif %} - {{ photo.extented.owner.get_full_name }}">
</a>
{% endfor %}
</div>
</div>
<div class="card-footer">
<a href="{% url 'gallery-download' gallery.slug %}" class="btn btn-secondary btn-sm">{% trans 'Download all gallery' %}</a>
</div>
</div>
<a href="{% url 'gallery-download' gallery.slug %}" class="btn btn-secondary">{% trans 'Download all gallery' %}</a>
{% endblock %}