diff --git a/home/blocks.py b/home/blocks.py index a528f476..954f8bd8 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -186,6 +186,25 @@ class Meta: template = "blocks/caption.html" +class VerticalImageCardBlock(blocks.StreamBlock): + images = blocks.StructBlock( + [ + ("image", ImageChooserBlock(required=True, help_text="size: 800X450px")), + ("caption", CustomCaption()), + ( + "description", + blocks.CharBlock( + max_length=300, required=False, help_text="300 characters limit" + ), + ), + ("link", blocks.URLBlock(required=False)), + ] + ) + + class Meta: + template = "blocks/vertical_image_cards_block.html" + + class RichTextBlock(blocks.StructBlock): text = blocks.RichTextBlock( max_length=10000, @@ -224,3 +243,4 @@ class BaseStreamBlock(blocks.StreamBlock): video_embed = VideoEmbed() table = CustomTableBlock() code_block = CodeBlock() + vertical_image_cards = VerticalImageCardBlock() diff --git a/home/templates/home/general_page.html b/home/templates/home/general_page.html index 95cd3a25..65c39377 100644 --- a/home/templates/home/general_page.html +++ b/home/templates/home/general_page.html @@ -6,7 +6,7 @@ {% block content %}
-
+

{{ page.title }} diff --git a/indymeet/templates/blocks/vertical_image_cards_block.html b/indymeet/templates/blocks/vertical_image_cards_block.html new file mode 100644 index 00000000..c9266b31 --- /dev/null +++ b/indymeet/templates/blocks/vertical_image_cards_block.html @@ -0,0 +1,26 @@ +{% load wagtailcore_tags wagtailimages_tags %} +
+{% for child in self %} +
+ {% if child.value.link %} + + {% endif %} + {% image child.value.image fill-800x450-c100 as image %} +
+ {{ child.value.image.title }} +
+ {% if child.value.link %} +
+ {% endif %} +
+
{{ child.value.caption.text }}
+

+ {{ child.value.description }} +

+
+
+
+
+{% endfor %} + +
diff --git a/indymeet/templates/puput/entry_page.html b/indymeet/templates/puput/entry_page.html index 6a4edcfd..f4ffdade 100644 --- a/indymeet/templates/puput/entry_page.html +++ b/indymeet/templates/puput/entry_page.html @@ -43,7 +43,7 @@ {% block content %}
-
{% include 'puput/entry_page_header.html' with entry=self %}