diff --git a/district/models.py b/district/models.py index 545dffbd9a66c9a050dd7bce36ab87005950038e..453a7b5ad72eaaf249ac230c9ecf6ca3ce56819d 100644 --- a/district/models.py +++ b/district/models.py @@ -5,6 +5,7 @@ from django.conf import settings from django.contrib import messages from django.core.cache import cache from django.core.exceptions import ValidationError +from django.utils.safestring import mark_safe from django.db import models from django.http import HttpResponseRedirect from modelcluster.contrib.taggit import ClusterTaggableManager @@ -12,6 +13,7 @@ from modelcluster.fields import ParentalKey, ParentalManyToManyField from taggit.models import TaggedItemBase from wagtail.admin.panels import ( FieldPanel, + HelpPanel, InlinePanel, MultiFieldPanel, ObjectList, @@ -586,9 +588,34 @@ class DistrictPeoplePage(MainPeoplePageMixin): ### PANELS + content_panels = Page.content_panels + [ + MultiFieldPanel( + [ + FieldPanel("perex_col_1", heading="První sloupec"), + FieldPanel("perex_col_2", heading="Druhý sloupec"), + ], + "Perex" + ), + MultiFieldPanel( + [ + HelpPanel( + content=mark_safe( + "Pokud chceš importovat skupinu osob z Chobotnice, můžeš přidat do " + "sekce <em>Lidé a týmy</em> blok <em>Skupina z Chobotnice</em>. Do " + "zkratky skupiny můžeš vyplnit například <em>cen_ao_ved</em> pro " + "skupinu <a href='https://pi2.cz/chobo-ao'>Administrativní odbor - " + " vedení</a>." + ), + ), + FieldPanel("content") + ], + "Obsah" + ) + ] + edit_handler = TabbedInterface( [ - ObjectList(MainPeoplePageMixin.content_panels, heading="Obsah"), + ObjectList(content_panels, heading="Obsah"), ObjectList(MainPeoplePageMixin.promote_panels, heading="Metadata"), ] ) diff --git a/shared/models/main.py b/shared/models/main.py index a1fef210bf89648ca8b72795d312d793d9a7f1cf..4574534d1c4bc014c7eb9d1599a4cb2ecae062bf 100644 --- a/shared/models/main.py +++ b/shared/models/main.py @@ -1854,8 +1854,13 @@ class MainPeoplePageMixin( ### PANELS content_panels = Page.content_panels + [ - FieldPanel("perex_col_1"), - FieldPanel("perex_col_2"), + MultiFieldPanel( + [ + FieldPanel("perex_col_1", heading="První sloupec"), + FieldPanel("perex_col_2", heading="Druhý sloupec"), + ], + "Perex" + ), FieldPanel("content"), ]