photo26/photologue_custom/templates/photologue/gallery_detail.html
2021-10-12 18:34:19 +02:00

42 lines
1.8 KiB
HTML

{% extends "photologue/root.html" %}
{% load static i18n %}
{% block title %}{{ gallery.title }}{% endblock %}
{% block extracss %}
<link rel="stylesheet" href="{% static 'lightgallery/css/lightgallery.css' %}" />
<link rel="stylesheet" href="{% static 'lightgallery/css/lg-zoom.css' %}" />
<link rel="stylesheet" href="{% static 'lightgallery/css/lg-thumbnail.css' %}" />
{% endblock %}
{% block extrajs %}
<script src="{% static 'lightgallery/lightgallery.min.js' %}"></script>
<script src="{% static 'lightgallery/plugins/thumbnail/lg-thumbnail.min.js' %}"></script>
<script src="{% static 'lightgallery/plugins/zoom/lg-zoom.min.js' %}"></script>
<script>
lightGallery(document.getElementById('lightgallery'), {
plugins: [lgZoom, lgThumbnail]
});
</script>
{% endblock %}
{% block content %}
<h1>{{ gallery.title }}</h1>
<p class="text-muted small">{% trans "Published" %} {{ gallery.date_added|date }}</p>
{% if gallery.extended.tags.all %}
<p class="text-muted">
Tags : {% for tag in gallery.extended.tags.all %}
<a class="badge rounded-pill bg-dark text-decoration-none" href="{% url 'tag-detail' tag %}">{{ tag }}</a>
{% endfor %}
</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 %}">
</a>
{% endfor %}
</div>
<a href="{% url 'gallery-download' gallery.slug %}" class="btn btn-secondary">{% trans 'Download all gallery' %}</a>
{% endblock %}