Skip to content
Snippets Groups Projects
Commit 3c2ff385 authored by Alexa Valentová's avatar Alexa Valentová
Browse files

WIP - alignable table block

parent 60e5b387
No related branches found
No related tags found
2 merge requests!948Release,!940Aligned tables, PirSTAN GDPR from main page
Pipeline #17212 passed
from wagtail.blocks import CharBlock, ListBlock, PageChooserBlock, StructBlock, URLBlock
from wagtail.blocks import CharBlock, ListBlock, PageChooserBlock, StructBlock, URLBlock, ChoiceBlock
from wagtail.contrib.table_block.blocks import TableBlock as ContribTableBlock
class AlignedTableBlock(ContribTableBlock):
alignment = ChoiceBlock(
choices=[
("left", "Vlevo"),
("center", "Vprostřed"),
("right", "Vpravo"),
],
default="left",
)
class PersonUrlBlock(StructBlock):
......
This diff is collapsed.
......@@ -19,7 +19,6 @@ from wagtail.admin.panels import (
from wagtail.contrib.forms.models import AbstractForm, AbstractFormField
from wagtail.contrib.forms.panels import FormSubmissionsPanel
from wagtail.contrib.routable_page.models import RoutablePageMixin, route
from wagtail.contrib.table_block.blocks import TableBlock
from wagtail.fields import RichTextField, StreamField
from wagtail.images.blocks import ImageChooserBlock
from wagtail.models import Page
......@@ -42,7 +41,7 @@ from shared.models import (
from shared.utils import make_promote_panels, strip_all_html_tags, trim_to_length
from tuning import admin_help
from .blocks import PeopleGroupListBlock, PersonUrlBlock
from .blocks import PeopleGroupListBlock, PersonUrlBlock, AlignedTableBlock
from .constants import (
ALIGN_CHOICES,
ALIGN_CSS,
......@@ -307,7 +306,7 @@ CONTENT_STREAM_BLOCKS = [
("picture_list", PictureListBlock()),
(
"table",
TableBlock(
AlignedTableBlock(
label="tabulka",
group="ostatní",
template="uniweb/blocks/table.html",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment