Skip to content
Snippets Groups Projects
Commit 10bdf75c authored by jan.bednarik's avatar jan.bednarik
Browse files

uniweb: Move content into shareable mixin

parent b79d2373
No related branches found
No related tags found
2 merge requests!150Sync test,!149Uniweb
......@@ -72,9 +72,7 @@ class SubpageMixin:
return self.search_image or self.root_page.get_meta_image()
class UniwebHomePage(MetadataPageMixin, Page):
### FIELDS
class UniwebContentMixin(models.Model):
content = StreamField(
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
......@@ -98,6 +96,14 @@ class UniwebHomePage(MetadataPageMixin, Page):
verbose_name="obsah stránky",
blank=True,
)
class Meta:
abstract = True
class UniwebHomePage(Page, UniwebContentMixin, MetadataPageMixin):
### FIELDS
# settings
matomo_id = models.IntegerField(
"Matomo ID pro sledování návštěvnosti", blank=True, null=True
......@@ -147,33 +153,9 @@ class UniwebHomePage(MetadataPageMixin, Page):
return self
class UniwebFlexiblePage(Page, SubpageMixin, MetadataPageMixin):
class UniwebFlexiblePage(Page, UniwebContentMixin, SubpageMixin, MetadataPageMixin):
### FIELDS
content = StreamField(
[
("title", blocks.CharBlock(label="nadpis", icon="title")),
("text", blocks.RichTextBlock(label="text", features=RICH_TEXT_FEATURES)),
("text_columns", ColumnsTextBlock()),
(
"gallery",
blocks.ListBlock(
ImageChooserBlock(label="obrázek"), label="galerie", icon="image"
),
),
(
"table",
TableBlock(
label="tabulka",
template="uniweb/snippet_table.html",
),
),
("jupyter", DocumentChooserBlock(label="Jupyter notebook")),
],
verbose_name="obsah stránky",
blank=True,
)
### PANELS
promote_panels = [
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment