From 544e79661fb6fd90732a1d943dcf0af699bceb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Bedna=C5=99=C3=ADk?= <jan.bednarik@gmail.com> Date: Thu, 26 Nov 2020 13:10:38 +0100 Subject: [PATCH] uniweb: Title with image --- uniweb/models.py | 5 ++++- uniweb/templates/uniweb/blocks/picture_title.html | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 uniweb/templates/uniweb/blocks/picture_title.html diff --git a/uniweb/models.py b/uniweb/models.py index ecc8812a4..9d86e9c80 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -99,7 +99,10 @@ class AdvancedTitleBlock(ColorBlock, AlignBlock): class PictureTitleBlock(ColorBlock): title = blocks.CharBlock(label="nadpis") - image = ImageChooserBlock(label="obrázek") + picture = ImageChooserBlock( + label="obrázek", + help_text="rozměr na výšku 75px nebo více (obrázek bude zmenšen na výšku 75px)", + ) class Meta: label = "nadpis (s obrázkem)" diff --git a/uniweb/templates/uniweb/blocks/picture_title.html b/uniweb/templates/uniweb/blocks/picture_title.html new file mode 100644 index 000000000..863e5ef88 --- /dev/null +++ b/uniweb/templates/uniweb/blocks/picture_title.html @@ -0,0 +1,5 @@ +{% load wagtailimages_tags %} +<h1 class="head-alt-md md:head-alt-lg px-4 pt-4 pb-2 lg:mt-16 clearfix {{ css_class|join:" " }}"> + {% image block.value.picture height-75 class="float-right mb-2" %} + {{ block.value.title }} +</h1> -- GitLab