lostplaces-backend/django_lostplaces/lostplaces/templates/partials/placeImageGrid.html

37 lines
1.4 KiB
HTML
Raw Normal View History

2021-04-02 17:22:28 +02:00
{% load static %}
{% load lostplaces %}
2021-04-02 17:22:28 +02:00
{% if headline %}
<h1 class="LP-Headline">{{headline}}</h1>
{% endif %}
<div class="LP-ImageGrid">
<ul class="LP-ImageGrid__Container">
{% for image in image_list %}
<li id="thumbnail{{forloop.counter}}" class="LP-ImageGrid__Item">
{{ "#image"|add:forloop.counter }}
{% include 'partials/image.html' with source_url=image.filename.thumbnail.url link_url="#image"|addstr:forloop.counter %}
2021-04-02 17:22:28 +02:00
{% if user.explorer == image.submitted_by%}
<span class="LP-ImageGrid__DeleteItem" title="Bild löschen">
<a href="{% url 'place_image_delete' pk=image.id %}" class="LP-Link">
<img class="LP-Icon" src="{% static 'icons/cancel.svg' %}" />
</a>
</span>
{% endif %}
<div id="image{{forloop.counter}}" class="LP-ImageGrid__LightBox">
<img class="LP-ImageGrid__FullSizeImage" src="{{image.filename.large.url}}" loading="lazy"/>
{% if forloop.counter < image_list|length %}
<a href="#image{{forloop.counter|add:1}}" class="LP-ImageGrid__Next">Next</a>
{% endif %}
{% if forloop.counter > 1 %}
<a href="#image{{forloop.counter|add:-1}}" class="LP-ImageGrid__Previous">Previous</a>
{% endif %}
<span class="LP-ImageGrid__Close LP-ImageGrid__DeleteItem" title="Schließen">
<a href="#thumbnail{{forloop.counter}}" class="LP-Link">
<img class="LP-Icon" src="{% static 'icons/cancel.svg' %}"/>
</a>
</span>
</div>
2021-04-02 17:22:28 +02:00
</li>
{% endfor %}
</ul>
</div>