Use TitleFieldPanel for all StrictHierarcy Pages

This commit is contained in:
Lorenz Padberg 2024-04-12 11:28:50 +02:00
parent f398839765
commit 547dc29134
5 changed files with 10 additions and 9 deletions

View File

@ -1,6 +1,6 @@
from django.db import models
from django.utils.text import slugify
from wagtail.admin.panels import FieldPanel
from wagtail.admin.panels import FieldPanel, TitleFieldPanel
from wagtail.fields import RichTextField, StreamField
from wagtail.images.blocks import ImageChooserBlock
@ -110,7 +110,7 @@ class BasicKnowledge(StrictHierarchyPage):
)
content_panels = [
FieldPanel("title", classname="full title"),
TitleFieldPanel("title", classname="full title"),
FieldPanel("new_type"),
FieldPanel("intro"),
FieldPanel("contents"),

View File

@ -1,6 +1,6 @@
import logging
from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList
from wagtail.admin.panels import TabbedInterface, ObjectList, TitleFieldPanel
from core.wagtail_utils import StrictHierarchyPage, get_default_settings
@ -13,7 +13,7 @@ class Book(StrictHierarchyPage):
verbose_name_plural = 'Bücher'
content_panels = [
FieldPanel('title', classname="full title")
TitleFieldPanel('title', classname="full title")
]
edit_handler = TabbedInterface([

View File

@ -1,7 +1,7 @@
import logging
from django.db import models
from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList
from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList, TitleFieldPanel
from core.wagtail_utils import StrictHierarchyPage, get_default_settings
from users.models import SchoolClass
@ -18,7 +18,7 @@ class Chapter(StrictHierarchyPage, GraphqlNodeMixin):
description = models.TextField(blank=True)
content_panels = [
FieldPanel("title", classname="full title"),
TitleFieldPanel("title", classname="full title"),
FieldPanel("description", classname="full description"),
]

View File

@ -3,6 +3,7 @@ from wagtail.admin.panels import (
FieldPanel,
TabbedInterface,
ObjectList,
TitleFieldPanel,
)
from wagtail.blocks import StreamBlock
from wagtail.fields import StreamField
@ -140,7 +141,7 @@ class ContentBlock(StrictHierarchyPage, GraphqlNodeMixin):
type = models.CharField(max_length=100, choices=TYPE_CHOICES, default=NORMAL)
content_panels = [
FieldPanel("title", classname="full title"),
TitleFieldPanel("title", classname="full title"),
FieldPanel("type"),
FieldPanel("contents"),
]

View File

@ -1,7 +1,7 @@
import logging
from django.db import models
from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList
from wagtail.admin.panels import FieldPanel, TabbedInterface, ObjectList, TitleFieldPanel
from wagtail.fields import RichTextField
from core.constants import DEFAULT_RICH_TEXT_FEATURES
@ -22,7 +22,7 @@ class Topic(StrictHierarchyPage):
instructions = models.CharField(max_length=255, blank=True, null=True, default=None)
content_panels = [
FieldPanel('title', classname="full title"),
TitleFieldPanel('title', classname="full title"),
FieldPanel('order'),
FieldPanel('teaser'),
FieldPanel('vimeo_id'),