Files
flask-fet-fotos/foto_gallery/templates/gallery.html
Andreas Stephanides 5eddd2b66e convert to a fotogallery
2020-02-22 16:58:15 +01:00

45 lines
1.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{# -*-jinja2-*- #}
{% extends "layout.html" %}
{% block content %}
<h1>{{post.title}}</h1>
{{post.html | safe}}
{% if post.links.images |length > 0 %}
<hr/>
<!-- The Gallery as lightbox dialog, should be a document body child element -->
<div id="blueimp-gallery" class="blueimp-gallery">
<div class="slides"></div>
<h3 class="title"></h3>
<a class="prev"></a>
<a class="next"></a>
<a class="close">×</a>
<a class="play-pause"></a>
<ol class="indicator"></ol>
</div>
<div id="links">
{% for d in post.links.images %}
<a href="{{d.url}}" title="{{d.title}}">
<img src="{{d.thumb_url}}" alt="{{d.title}}" />
</a>
{% endfor %}
</div>
<script src="/gallery/js/blueimp-gallery.min.js"></script>
<script>
document.getElementById('links').onclick = function(event) {
event = event || window.event
var target = event.target || event.srcElement,
link = target.src ? target.parentNode : target,
options = { index: link, event: event },
links = this.getElementsByTagName('a')
blueimp.Gallery(links, options)
}
</script>
{% endif %}
{% endblock %}