Filter gallery by photo owner

This commit is contained in:
Alexandre Iooss 2021-10-13 17:05:29 +02:00
parent 740cbc9df0
commit cc3ba4a492
3 changed files with 40 additions and 3 deletions

View file

@ -46,13 +46,24 @@
<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>
{% url 'pl-gallery' gallery.slug as url %}
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}">
{% trans "All pictures" %}
</a>
</li>
{% for owner in owners %}
<li class="nav-item">
{% url 'pl-gallery-owner' slug=gallery.slug owner=owner.id as url %}
<a class="nav-link {% if request.path_info == url %}active{% endif %}" href="{{ url }}">
{% if owner.get_full_name %}{{ owner.get_full_name }}{% else %}{{ owner.username }}{% endif %}
</a>
</li>
{% endfor %}
</ul>
</div>
<div class="card-body">
<div id="lightgallery">
{% for photo in gallery.public %}
{% for photo in photos %}
<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>