|
@@ -184,7 +184,6 @@
|
|
<div class="content">{{ article.title }}</div>
|
|
<div class="content">{{ article.title }}</div>
|
|
</h2>
|
|
</h2>
|
|
{% autoescape off %}
|
|
{% autoescape off %}
|
|
-
|
|
|
|
{{ article.html_text }}
|
|
{{ article.html_text }}
|
|
{% endautoescape %}
|
|
{% endautoescape %}
|
|
|
|
|
|
@@ -229,6 +228,15 @@
|
|
|
|
|
|
$(".ui.dropdown").dropdown();
|
|
$(".ui.dropdown").dropdown();
|
|
});
|
|
});
|
|
|
|
+ let imgs = $('#article').find('p>img')
|
|
|
|
+
|
|
|
|
+ for (let i = 0; i < imgs.length; i++) {
|
|
|
|
+ if ($(imgs[i]).attr('alt')) {
|
|
|
|
+ let alt = $(imgs[i]).attr('alt')
|
|
|
|
+ let src = $(imgs[i]).attr('src')
|
|
|
|
+ $(imgs[i]).parent().html(`<a data-pswp-width="${alt.split(',')[0]}" data-pswp-height="${alt.split(',')[1]}" href="${src}"><img width="${alt.split(',')[0]}" height="${alt.split(',')[0]}" data-magnify="gallery" data-src="${src}" src="${src}" data-href="${src}" "/></a>`)
|
|
|
|
+ }
|
|
|
|
+ }
|
|
var lightbox = new PhotoSwipeLightbox({
|
|
var lightbox = new PhotoSwipeLightbox({
|
|
gallery: 'p',
|
|
gallery: 'p',
|
|
children: 'a',
|
|
children: 'a',
|