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 .parents import * # noqa
from wagtail.contrib.table_block.blocks import TableBlock
DEFAULT_CONTENT_BLOCKS = [
(
......@@ -43,4 +45,5 @@ DEFAULT_CONTENT_BLOCKS = [
("map_collection", MapFeatureCollectionBlock(label="Mapová kolekce")),
("button", ButtonBlock()),
("button_group", ButtonGroupBlock()),
("popout_point", PopoutPoint())
]
......@@ -8,3 +8,4 @@ from .programs import * # noqa
from .struct import * # noqa
from .text 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 %}
<div class="__js-root">
<ui-popout>
<template slot="toggler">
{{ name }}
</template>
<ui-popout-content>
<div>
{% if guarantor_page %}
<div
class="
!text-grey-250 [&_*]:!text-grey-250
mb-3 flex gap-2 items-center justify-end
"
>
<div class="mr-2">
Garant programového bodu:
</div>
{% with self.page.specific.get_profile_image as profile_image %}
{% if profile_image %}
{% image profile_image fill-150x150 class="w-10 h-10 opacity-75 m-0 p-0 rounded-full" %}
{% endif %}
{% endwith %}
<strong>
<a href="{{ guarantor_page.url }}">
{{ guarantor_page.title }}
</a>
</strong>
{% 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">
<ui-popout>
<template slot="toggler">
{% if name %}{{ name }}{% else %}{{ self.name }}{% endif %}
</template>
<ui-popout-content>
<div>
{% if guarantor_page %}
<div
class="
!text-grey-250 [&_*]:!text-grey-250
mb-3 flex gap-2 items-center justify-end
"
>
<div class="mr-2">
Garant programového bodu:
</div>
{% with self.page.specific.get_profile_image as profile_image %}
{% if profile_image %}
{% image profile_image fill-150x150 class="w-10 h-10 opacity-75 m-0 p-0 rounded-full" %}
{% endif %}
{% endwith %}
<strong>
<a href="{{ guarantor_page.url }}">
{{ guarantor_page.title }}
</a>
</strong>
</div>
{% endif %}
{% if content %}
<div class="prose max-w-screen-lg">
{{ content|richtext }}
</div>
{% else %}
{% for block in self.content %}
{% include_block block %}
{% endfor %}
{% endif %}
</div>
{% endif %}
<div class="prose max-w-screen-lg">
{{ content|richtext }}
</div>
</div>
</ui-popout-content>
</ui-popout>
</div>
</ui-popout-content>
</ui-popout>
</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