add excerpt field to associations

This commit is contained in:
2024-05-20 19:12:59 +02:00
parent 238edbd9dc
commit e6cc646da7
10 changed files with 109 additions and 57 deletions

View File

@ -43,6 +43,7 @@ class AssociationPage(Page):
FORENING = "forening", "Forening"
UTVALG = "utvalg", "Utvalg"
excerpt = models.TextField(max_length=512, blank=False)
body = StreamField(
[
("paragraph", blocks.RichTextBlock()),
@ -61,6 +62,11 @@ class AssociationPage(Page):
website_url = models.URLField()
content_panels = Page.content_panels + [
FieldPanel(
"excerpt",
heading="Utdrag",
help_text="En veldig kort oppsummering av innholdet nedenfor. Brukes i listevisninger.",
),
FieldPanel("body"),
FieldPanel("logo"),
FieldPanel("association_type", heading="Type"),
@ -68,6 +74,7 @@ class AssociationPage(Page):
]
graphql_fields = [
GraphQLString("excerpt"),
GraphQLStreamfield("body"),
GraphQLImage("logo"),
GraphQLString("website_url"),