158 lines
3.3 KiB
Python
158 lines
3.3 KiB
Python
from datetime import datetime
|
|
from typing import Literal, Optional, Union
|
|
|
|
from ninja import Schema
|
|
|
|
|
|
class MediaOut(Schema):
|
|
url: str
|
|
alt: str
|
|
|
|
|
|
class SeoOut(Schema):
|
|
title: str
|
|
description: str
|
|
image: Optional[MediaOut] = None
|
|
|
|
|
|
class SiteContentOut(Schema):
|
|
official_name: str
|
|
short_name: str
|
|
faculty_subline: str
|
|
description: str
|
|
logo: Optional[MediaOut] = None
|
|
navigation: dict[str, str]
|
|
contacts: dict[str, str]
|
|
address: str
|
|
footer_copy: str
|
|
enamad_image: Optional[MediaOut] = None
|
|
enamad_url: str
|
|
seo: SeoOut
|
|
|
|
|
|
class PageBaseOut(Schema):
|
|
slug: str
|
|
title: str
|
|
intro: str
|
|
seo: SeoOut
|
|
|
|
|
|
class HomePageOut(PageBaseOut):
|
|
slug: Literal["home"]
|
|
hero_heading: str
|
|
hero_body: str
|
|
hero_image: Optional[MediaOut] = None
|
|
hero_action_label: str
|
|
hero_action_url: str
|
|
hero_secondary_action_label: str
|
|
hero_secondary_action_url: str
|
|
featured_events_heading: str
|
|
featured_events_intro: str
|
|
featured_events_link_label: str
|
|
featured_events_url: str
|
|
featured_event_action_label: str
|
|
featured_posts_heading: str
|
|
featured_posts_intro: str
|
|
featured_posts_link_label: str
|
|
featured_posts_url: str
|
|
featured_post_action_label: str
|
|
participation_heading: str
|
|
participation_body: str
|
|
participation_image: Optional[MediaOut] = None
|
|
participation_action_label: str
|
|
participation_action_url: str
|
|
participation_secondary_action_label: str
|
|
participation_secondary_action_url: str
|
|
|
|
|
|
class AboutItemOut(Schema):
|
|
kind: str
|
|
title: str
|
|
text: str
|
|
position: int
|
|
|
|
|
|
class AboutMemberOut(Schema):
|
|
name: str
|
|
role: str
|
|
entry_year: str
|
|
bio: str
|
|
photo: Optional[MediaOut] = None
|
|
position: int
|
|
|
|
|
|
class AboutGalleryImageOut(Schema):
|
|
image: MediaOut
|
|
caption: str
|
|
position: int
|
|
|
|
|
|
class AboutAudienceOut(Schema):
|
|
title: str
|
|
text: str
|
|
icon: str
|
|
position: int
|
|
|
|
|
|
class AboutMilestoneOut(Schema):
|
|
year_label: str
|
|
title: str
|
|
description: str
|
|
position: int
|
|
|
|
|
|
class AboutSelectedEventOut(Schema):
|
|
id: int
|
|
title: str
|
|
slug: str
|
|
start_time: datetime
|
|
featured_image: Optional[MediaOut] = None
|
|
|
|
|
|
class AboutYearOut(Schema):
|
|
year_label: str
|
|
position: int
|
|
members: list[AboutMemberOut]
|
|
selected_events: list[AboutSelectedEventOut]
|
|
|
|
|
|
class AboutPageOut(PageBaseOut):
|
|
slug: Literal["about"]
|
|
identity_heading: str
|
|
identity_body: str
|
|
mission_heading: str
|
|
mission_body: str
|
|
vision_heading: str
|
|
vision_body: str
|
|
activities_heading: str
|
|
activities_body: str
|
|
values_heading: str
|
|
values_body: str
|
|
faq_heading: str
|
|
contact_heading: str
|
|
members_heading: str
|
|
members_intro: str
|
|
gallery_heading: str
|
|
gallery_intro: str
|
|
past_events_heading: str
|
|
history_heading: str
|
|
audience_heading: str
|
|
year_events_heading: str
|
|
cta_heading: str
|
|
cta_body: str
|
|
cta_action_label: str
|
|
cta_action_url: str
|
|
items: list[AboutItemOut]
|
|
members: list[AboutMemberOut]
|
|
gallery_images: list[AboutGalleryImageOut]
|
|
audiences: list[AboutAudienceOut]
|
|
milestones: list[AboutMilestoneOut]
|
|
years: list[AboutYearOut]
|
|
|
|
|
|
class ListingPageOut(PageBaseOut):
|
|
slug: Literal["events", "blog"]
|
|
|
|
|
|
PageContentOut = Union[HomePageOut, AboutPageOut, ListingPageOut]
|