From 56b67048416deb4a5a977527443890e7451cec0e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Valenta?= <git@imaniti.org> Date: Sun, 6 Aug 2023 11:32:02 +0200 Subject: [PATCH] remove unused blocks --- home/blocks.py | 28 ---------------------------- home/models.py | 20 -------------------- 2 files changed, 48 deletions(-) diff --git a/home/blocks.py b/home/blocks.py index 530c220..69f9d64 100644 --- a/home/blocks.py +++ b/home/blocks.py @@ -1,13 +1,9 @@ from wagtail.blocks import ( CharBlock, - DateBlock, EmailBlock, - PageChooserBlock, StructBlock, TextBlock, - URLBlock, ) -from wagtail.documents.blocks import DocumentChooserBlock class PersonBlock(StructBlock): @@ -19,27 +15,3 @@ class PersonBlock(StructBlock): label = "Osoba" template = "home/blocks/person_block.html" icon = "user" - - -class DocumentBlock(StructBlock): - name = CharBlock(label="Jméno") - date_added = DateBlock(label="Datum přidání", required=False) - page = PageChooserBlock(label="Stránka (místo dokumentu)", required=False) - file = DocumentChooserBlock(label="Dokument", required=False) - - class Meta: - label = "Dokument" - template = "home/blocks/document_block.html" - icon = "doc-full-inverse" - - -class EventBlock(StructBlock): - name = CharBlock(label="Jméno") - page = PageChooserBlock(label="Stránka") - date = DateBlock(label="Datum konání", required=False) - location = CharBlock(label="Lokace", required=False) - - class Meta: - label = "Událost" - template = "home/blocks/event_block.html" - icon = "calendar-alt" diff --git a/home/models.py b/home/models.py index dfd0089..6252ba7 100644 --- a/home/models.py +++ b/home/models.py @@ -11,26 +11,6 @@ from .blocks import DocumentBlock, EventBlock, PersonBlock class HomePage(Page): heading_text = RichTextField(verbose_name="Hlavní text stránky") - # --- Events --- - - events = StreamField( - [("event", EventBlock())], - verbose_name="Události", - use_json_field=True, - blank=True, - null=True, - ) - - # --- Documents --- - - documents = StreamField( - [("document", DocumentBlock())], - verbose_name="Dokumenty", - use_json_field=True, - blank=True, - null=True, - ) - # --- Donations --- donation_text = RichTextField(verbose_name="Text pro dary") -- GitLab