Skip to content
Snippets Groups Projects
Commit c6241e7f authored by Tomi Valentová's avatar Tomi Valentová
Browse files

add popout blocks

parent 94a831cd
Branches
No related tags found
2 merge requests!1071Release,!1070Feat/uniweb redesign improvements 1
Pipeline #19114 passed
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
from .children import * # noqa from .children import * # noqa
from .parents import * # noqa from .parents import * # noqa
from wagtail.contrib.table_block.blocks import TableBlock
DEFAULT_CONTENT_BLOCKS = [ DEFAULT_CONTENT_BLOCKS = [
( (
...@@ -43,4 +45,5 @@ DEFAULT_CONTENT_BLOCKS = [ ...@@ -43,4 +45,5 @@ DEFAULT_CONTENT_BLOCKS = [
("map_collection", MapFeatureCollectionBlock(label="Mapová kolekce")), ("map_collection", MapFeatureCollectionBlock(label="Mapová kolekce")),
("button", ButtonBlock()), ("button", ButtonBlock()),
("button_group", ButtonGroupBlock()), ("button_group", ButtonGroupBlock()),
("popout_point", PopoutPoint())
] ]
...@@ -8,3 +8,4 @@ from .programs import * # noqa ...@@ -8,3 +8,4 @@ from .programs import * # noqa
from .struct import * # noqa from .struct import * # noqa
from .text import * # noqa from .text import * # noqa
from .video import * # noqa from .video import * # noqa
from .popout import * # noqa
\ No newline at end of file
from wagtail import blocks
from wagtail.contrib.table_block.blocks import TableBlock
from .text import HeadlineBlock, RICH_TEXT_DEFAULT_FEATURES
class PopoutPoint(blocks.StructBlock):
name = blocks.CharBlock(
label="Název",
required=True,
)
content = blocks.StreamBlock(
[
(
"text",
blocks.RichTextBlock(
label="Textový editor",
group="1. Text",
features=RICH_TEXT_DEFAULT_FEATURES,
template="styleguide2/includes/atoms/text/prose_richtext.html",
),
),
("headline", HeadlineBlock()),
(
"table",
TableBlock(
template="styleguide2/includes/atoms/table/table.html",
group="3. Ostatní",
label="Tabulka",
),
),
],
label="Obsah"
)
class Meta:
label = "Rozbalovací blok"
group = "3. Ostatní"
template = "styleguide2/includes/molecules/popouts/popout_point.html"
\ No newline at end of file
{% load wagtailcore_tags wagtailimages_tags shared_filters %} {% load wagtailcore_tags wagtailimages_tags shared_filters %}
{% if block %}
<div
class="
{% if not page.root_page.content_is_full_width %}
max-w-[100ch]
{% else %}
max-w-[100%]
{% endif %}
{% if page.root_page.content_is_centered %}
mx-auto
{% endif %}
"
>
{% endif %}
<div class="__js-root"> <div class="__js-root">
<ui-popout> <ui-popout>
<template slot="toggler"> <template slot="toggler">
{{ name }} {% if name %}{{ name }}{% else %}{{ self.name }}{% endif %}
</template> </template>
<ui-popout-content> <ui-popout-content>
<div> <div>
...@@ -34,10 +50,20 @@ ...@@ -34,10 +50,20 @@
</div> </div>
{% endif %} {% endif %}
{% if content %}
<div class="prose max-w-screen-lg"> <div class="prose max-w-screen-lg">
{{ content|richtext }} {{ content|richtext }}
</div> </div>
{% else %}
{% for block in self.content %}
{% include_block block %}
{% endfor %}
{% endif %}
</div> </div>
</ui-popout-content> </ui-popout-content>
</ui-popout> </ui-popout>
</div> </div>
{% if block %}
</div>
{% endif %}
\ No newline at end of file
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment