2024-06-14 15:56:37 +02:00
|
|
|
from django.db import models
|
|
|
|
from wagtail.admin.panels import FieldPanel
|
|
|
|
from wagtail.contrib.settings.models import BaseSiteSetting, register_setting
|
2024-06-14 16:03:02 +02:00
|
|
|
from wagtail.fields import RichTextField
|
2024-06-14 15:56:37 +02:00
|
|
|
|
|
|
|
|
|
|
|
@register_setting
|
|
|
|
class SiteSettings(BaseSiteSetting):
|
|
|
|
title = models.CharField(max_length=32, blank=True)
|
|
|
|
logo = models.ForeignKey(
|
|
|
|
"wagtailimages.Image",
|
|
|
|
on_delete=models.CASCADE,
|
|
|
|
related_name="+",
|
|
|
|
null=True,
|
|
|
|
blank=True,
|
|
|
|
)
|
2024-06-14 16:03:02 +02:00
|
|
|
footer = RichTextField(blank=True)
|
2024-06-14 15:56:37 +02:00
|
|
|
|
|
|
|
panels = [
|
|
|
|
FieldPanel("title"),
|
|
|
|
FieldPanel("logo"),
|
2024-06-14 16:03:02 +02:00
|
|
|
FieldPanel("footer"),
|
2024-06-14 15:56:37 +02:00
|
|
|
]
|