diff --git a/main/blocks.py b/main/blocks.py index 1203b03910d24e2788f70c560a01d3dc780b9b0e..2243fcab6b509ebb29285e4d0af80c7dab86d533 100644 --- a/main/blocks.py +++ b/main/blocks.py @@ -125,6 +125,7 @@ class PersonContactBlock(StructBlock): class PersonContactBoxBlock(CTAMixin, StructBlock): title = CharBlock(label="Titulek") + image = ImageChooserBlock(label="Ikona") subtitle = CharBlock(label="Podtitulek") diff --git a/main/migrations/0021_alter_maincontactpage_contact_boxes.py b/main/migrations/0021_alter_maincontactpage_contact_boxes.py new file mode 100644 index 0000000000000000000000000000000000000000..507300a1173e67d0404eac2b819d39d1ae73600a --- /dev/null +++ b/main/migrations/0021_alter_maincontactpage_contact_boxes.py @@ -0,0 +1,21 @@ +# Generated by Django 4.0.7 on 2022-08-25 05:55 + +from django.db import migrations +import wagtail.blocks +import wagtail.fields +import wagtail.images.blocks + + +class Migration(migrations.Migration): + + dependencies = [ + ('main', '0020_alter_mainhomepage_content'), + ] + + operations = [ + migrations.AlterField( + model_name='maincontactpage', + name='contact_boxes', + field=wagtail.fields.StreamField([('item', wagtail.blocks.StructBlock([('button_link', wagtail.blocks.URLBlock(label='Odkaz tlačítka')), ('button_text', wagtail.blocks.CharBlock(label='Text tlačítka')), ('title', wagtail.blocks.CharBlock(label='Titulek')), ('image', wagtail.images.blocks.ImageChooserBlock(label='Ikona')), ('subtitle', wagtail.blocks.CharBlock(label='Podtitulek'))]))], blank=True, use_json_field=None, verbose_name='Kontaktní boxy'), + ), + ] diff --git a/main/templates/main/includes/work_article_preview.html b/main/templates/main/includes/work_article_preview.html index 6d423edbe8e55ed9827ac334a249f29ff0996ae6..ea5c047e119282c1d8dd26ba67168492bce5c8c4 100644 --- a/main/templates/main/includes/work_article_preview.html +++ b/main/templates/main/includes/work_article_preview.html @@ -7,9 +7,10 @@ {{ article_page.title }} </h2> <div class="flex font-bold mb-4 text-xs text-white uppercase"> - {# TODO tags #} - {# <span class="bg-green-400 mr-1 p-2">Duben 2022</span>#} - {# <span class="bg-violet-400 mr-1 p-2">#ENERGETIKA</span>#} + <span class="bg-green-400 mr-1 p-2">{{ article_page.date }}</span> + {% for tag in article_page.tags.all %} + <span class="bg-violet-400 mr-1 p-2">{{ tag }}</span> + {% endfor %} </div> <p class="mb-8"> {{ article_page.perex }} diff --git a/main/templates/main/main_article_page.html b/main/templates/main/main_article_page.html index 115c49783e072b9fb8db6b754e22be72398a1218..f886d0124e169abf01a341ebbbc50833f8e46ff7 100644 --- a/main/templates/main/main_article_page.html +++ b/main/templates/main/main_article_page.html @@ -3,7 +3,7 @@ {% block content %} {% image page.image max-1920x800 as main_img %} - {% with before_title=page.date after_title=page.after_name subtitle=page.position image_url=main_img.url %} + {% with before_title=page.date image_url=main_img.url %} {% include 'main/includes/layout/photo_page_header.html' %} {% endwith %} {# {% routablepageurl page.root_page.articles_page "tags" as articles_tag_page_url %}#} diff --git a/main/templates/main/main_contact_page.html b/main/templates/main/main_contact_page.html index 22176e0947380e255adb7eb97d8a288ca2c7a10b..38222961422947a6c3bdf5080ddb0054287dd3b2 100644 --- a/main/templates/main/main_contact_page.html +++ b/main/templates/main/main_contact_page.html @@ -46,7 +46,8 @@ <div class="contact-box"> <div> <div class="h-16 mx-auto w-16"> - hm, image... + {% image contact_block.value.image fill-150x150 as contact_box_image %} + <img src="{{ contact_box_image.url }}" alt="{{ contact_block.title }}"> </div> <h3 class="font-alt mb-3 text-xl"> {{ contact_block.value.title }} diff --git a/main/templates/main/main_program_page.html b/main/templates/main/main_program_page.html index 97d2b8f38e6b64e2d0b9ec290184b7db3cb1a2a8..38340790ba38d1562742dd64aa7e6ccdec23b120 100644 --- a/main/templates/main/main_program_page.html +++ b/main/templates/main/main_program_page.html @@ -28,7 +28,8 @@ {% for program_group in page.program %} {% for item in program_group.value.point_list %} <div class="flex mb-6"> - <i class="{{ item.icon }} mr-6 text-6xl"></i> + {% image item.icon fill-150x150 as icon %} + <img src="{{ icon.url }}" alt="{{ item.title }}" class="mr-6 text-6xl"> <div class="flex flex-col"> <h3 class="font-alt mb-4 text-4xl"> {{ item.title }}