stable initial
This commit is contained in:
@@ -1 +1,2 @@
|
||||
from .sample_page import SamplePage
|
||||
from .home import Home
|
||||
from .page_builder import build_page
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import KW_ONLY, field
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
from from_root import from_root
|
||||
|
||||
from .page_builder import build_page
|
||||
from .. import components as comps
|
||||
|
||||
|
||||
class Home(rio.Component):
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
rio.Rectangle(
|
||||
content=rio.Markdown("### Willkommen auf der Homepage der EZ GG e.V.", margin=1),
|
||||
fill=self.session.theme.neutral_color,
|
||||
corner_radius=self.session.theme.corner_radius_medium,
|
||||
shadow_radius=1,
|
||||
shadow_color=self.session.theme.shadow_color,
|
||||
shadow_offset_y=0.2,
|
||||
margin_bottom=1,
|
||||
margin_right=1
|
||||
),
|
||||
comps.NewsPost(
|
||||
header="Voll der Fließtext",
|
||||
article_text=from_root("ezgg_website/assets/demo_article_1.txt"),
|
||||
date="24.05.2024"
|
||||
),
|
||||
comps.NewsPost(
|
||||
header="Lorem Ipsum",
|
||||
article_text=from_root("ezgg_website/assets/demo_article_2.txt"),
|
||||
date="12.02.1884"
|
||||
)
|
||||
))
|
||||
@@ -0,0 +1,36 @@
|
||||
from __future__ import annotations
|
||||
|
||||
|
||||
from dataclasses import KW_ONLY, field
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
|
||||
from .. import components as comps
|
||||
|
||||
|
||||
def build_page(main_component: rio.Component) -> rio.Component:
|
||||
return rio.Column(
|
||||
rio.Row(
|
||||
comps.Header()
|
||||
),
|
||||
rio.Row(
|
||||
rio.Column(
|
||||
comps.Navigation(),
|
||||
width="natural",
|
||||
align_y=0,
|
||||
margin_right=1
|
||||
),
|
||||
rio.Column(
|
||||
main_component,
|
||||
width="grow",
|
||||
align_y=0
|
||||
),
|
||||
width="grow",
|
||||
height="grow"
|
||||
),
|
||||
spacing=2,
|
||||
margin=0,
|
||||
width="grow",
|
||||
height="grow"
|
||||
)
|
||||
@@ -1,27 +0,0 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from dataclasses import KW_ONLY, field
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
|
||||
from .. import components as comps
|
||||
|
||||
class SamplePage(rio.Component):
|
||||
"""
|
||||
This is an example Page. Pages are identical to other Components and only
|
||||
differ in how they're used.
|
||||
"""
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return rio.Column(
|
||||
rio.Text("My App", style="heading2"),
|
||||
rio.Text(
|
||||
"This is a sample page. Replace it with your own content."
|
||||
),
|
||||
spacing=2,
|
||||
margin=2,
|
||||
align_x=0.5,
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user