Skip to content
Snippets Groups Projects
Commit d58b53fe authored by jarmil's avatar jarmil
Browse files

Pridani titulku do galerie obrazku

parent 2b43fde8
No related branches found
No related tags found
2 merge requests!137Sync test,!126Program gallery
Pipeline #1334 passed
# Generated by Django 3.1.1 on 2020-09-30 09:56
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.images.blocks
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("program2021", "0003_program2021pointpage_image_title"),
]
operations = [
migrations.AlterField(
model_name="program2021pointpage",
name="images",
field=wagtail.core.fields.StreamField(
[
(
"item",
wagtail.core.blocks.StructBlock(
[
(
"image",
wagtail.images.blocks.ImageChooserBlock(
label="ilustrační obrázek"
),
),
("title", wagtail.core.blocks.CharBlock(label="popis")),
],
label="obrázek",
),
)
],
blank=True,
verbose_name="ilustrační obrázky",
),
),
]
......@@ -186,7 +186,18 @@ class Program2021PointPage(Page, MetadataPageMixin):
blank=True,
)
images = StreamField(
[("image", ImageChooserBlock(label="ilustrační obrázek"))],
[
(
"item",
blocks.StructBlock(
[
("image", ImageChooserBlock(label="ilustrační obrázek")),
("title", blocks.CharBlock(label="popis")),
],
label="obrázek",
),
),
],
verbose_name="ilustrační obrázky",
blank=True,
)
......
......@@ -92,10 +92,11 @@
{% if page.images %}
<div class="row about-images mb-5 mt-3 jumbotron">
{% for block in page.images %}
{% image block.value width-2000 as img %}
{% image block.value fill-300x200 as thumb %}
{% image block.value.image width-2000 as img %}
{% image block.value.image fill-300x200 as thumb %}
<div class="col-6 col-md-3 mb-4">
<a data-fancybox="gallery" href="{{ img.url }}"><img data-src="{{ thumb.url }}" class="lazyload img-fluid" alt="{{ thumb.alt }}"></a>
<a data-fancybox="gallery" href="{{ img.url }}"><img data-src="{{ thumb.url }}" class="lazyload img-fluid" alt="{{ block.value.title }}"></a><br>
{{ block.value.title }}
</div><!-- /column -->
{% endfor %}
</div><!-- /row -->
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment