Update the Rio Version, add meta tags, refactor rio components that have init overwrites, add member picture for Tim
This commit is contained in:
parent
72d1b9bc33
commit
3aad065477
@ -116,47 +116,47 @@ authentication_service = services.FileBasedAuthenticationService(
|
||||
raise_broken_entries=False
|
||||
)
|
||||
app = rio.App(
|
||||
name='ezgg-website',
|
||||
name='EZGG Homepage',
|
||||
pages=[
|
||||
rio.Page(
|
||||
name="Home",
|
||||
page_url='',
|
||||
build=pages.Home,
|
||||
build=pages.Home
|
||||
),
|
||||
rio.Page(
|
||||
name="About",
|
||||
page_url='about',
|
||||
build=pages.About,
|
||||
build=pages.About
|
||||
),
|
||||
rio.Page(
|
||||
name="Member",
|
||||
page_url='member',
|
||||
build=pages.Member,
|
||||
build=pages.Member
|
||||
),
|
||||
rio.Page(
|
||||
name="Constitution",
|
||||
page_url='constitution',
|
||||
build=pages.Constitution,
|
||||
build=pages.Constitution
|
||||
),
|
||||
rio.Page(
|
||||
name="Join",
|
||||
page_url='join',
|
||||
build=pages.Join,
|
||||
build=pages.Join
|
||||
),
|
||||
rio.Page(
|
||||
name="Pics",
|
||||
page_url='pics',
|
||||
build=pages.Pics,
|
||||
build=pages.Pics
|
||||
),
|
||||
rio.Page(
|
||||
name="Imprint",
|
||||
page_url='imprint',
|
||||
build=pages.Imprint,
|
||||
build=pages.Imprint
|
||||
),
|
||||
rio.Page(
|
||||
name="Privacy",
|
||||
page_url='privacy',
|
||||
build=pages.Privacy,
|
||||
build=pages.Privacy
|
||||
)
|
||||
],
|
||||
theme=themes[6],
|
||||
@ -171,6 +171,8 @@ app = rio.App(
|
||||
# "content-Language": "de", # Temporarily disabled until "http-equiv" is supported by Rio
|
||||
"description": "Homepage der Einfach Zocken Genussgesellschaft. Ein eingetragener Verein der sich mit "
|
||||
"Videospielen und themenverwandten Aktivitäten befasst.",
|
||||
"og:description": "Homepage der Einfach Zocken Genussgesellschaft. Ein eingetragener Verein der sich mit "
|
||||
"Videospielen und themenverwandten Aktivitäten befasst.",
|
||||
"keywords": "Gaming, Clan, Guild, Verein, Club, Einfach, Zocken, Genuss, Gesellschaft, Videospiele, "
|
||||
"Videogames, LAN, Party",
|
||||
"author": "David Rodenkirchen",
|
||||
|
||||
BIN
ezgg_website/assets/member_pictures/tim.png
Normal file
BIN
ezgg_website/assets/member_pictures/tim.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 278 KiB |
@ -1,4 +1,4 @@
|
||||
from .navigation import Navigation
|
||||
from .header import Header
|
||||
from .news_post import NewsPost
|
||||
from .member_card import MemberInfo, MemberCard
|
||||
from .news_post import NewsPost, build_news_post
|
||||
from .member_card import MemberInfo, MemberCard, build_member_card
|
||||
|
||||
@ -16,31 +16,25 @@ class MemberInfo:
|
||||
|
||||
|
||||
class MemberCard(rio.Component):
|
||||
def __init__(self, info: MemberInfo) -> None:
|
||||
super().__init__()
|
||||
self._info = info
|
||||
self.align_y = 0
|
||||
self.margin_top = 0
|
||||
self.margin_bottom = 2
|
||||
self.margin_right = 1
|
||||
info: MemberInfo
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
contact_row = rio.Row()
|
||||
content = rio.Column(
|
||||
rio.Image(self._info.picture_path, height=9, margin_bottom=1.3, margin_top=0.8),
|
||||
rio.Text(self._info.name, margin_bottom=0.4, style=rio.TextStyle(font_weight="bold")),
|
||||
rio.Text(self._info.position, margin_bottom=0.4, style=rio.TextStyle(italic=True)),
|
||||
rio.Text(f"Mitglied seit {self._info.entry_date}", style=rio.TextStyle(italic=True), margin_bottom=0.4),
|
||||
rio.Image(self.info.picture_path, height=9, margin_bottom=1.3, margin_top=0.8),
|
||||
rio.Text(self.info.name, margin_bottom=0.4, style=rio.TextStyle(font_weight="bold")),
|
||||
rio.Text(self.info.position, margin_bottom=0.4, style=rio.TextStyle(italic=True)),
|
||||
rio.Text(f"Mitglied seit {self.info.entry_date}", style=rio.TextStyle(italic=True), margin_bottom=0.4),
|
||||
contact_row
|
||||
)
|
||||
|
||||
# @Todo: Icon alignment broken if only one icon should be shown.
|
||||
if self._info.contact_mail:
|
||||
contact_row.add(rio.Link(rio.Icon("material/mail"), f"mailto://{self._info.contact_mail}", open_in_new_tab=True, margin_top=1, margin_bottom=1, align_x=0.9))
|
||||
if self._info.contact_steam:
|
||||
contact_row.add(rio.Link(rio.Icon("custom/steam"), self._info.contact_steam, open_in_new_tab=True, margin_top=1, margin_bottom=1, align_x=0.1))
|
||||
if self.info.contact_mail:
|
||||
contact_row.add(rio.Link(rio.Icon("material/mail"), f"mailto://{self.info.contact_mail}", open_in_new_tab=True, margin_top=1, margin_bottom=1, align_x=0.9))
|
||||
if self.info.contact_steam:
|
||||
contact_row.add(rio.Link(rio.Icon("custom/steam"), self.info.contact_steam, open_in_new_tab=True, margin_top=1, margin_bottom=1, align_x=0.1))
|
||||
|
||||
if not self._info.contact_steam and not self._info.contact_mail:
|
||||
if not self.info.contact_steam and not self.info.contact_mail:
|
||||
contact_row.add(rio.Text("", margin_top=2))
|
||||
|
||||
return rio.Rectangle(
|
||||
@ -51,3 +45,13 @@ class MemberCard(rio.Component):
|
||||
shadow_color=self.session.theme.hud_color,
|
||||
shadow_offset_y=0
|
||||
)
|
||||
|
||||
|
||||
def build_member_card(info: MemberInfo) -> MemberCard:
|
||||
return MemberCard(
|
||||
info=info,
|
||||
align_y=0,
|
||||
margin_top=0,
|
||||
margin_bottom=2,
|
||||
margin_right=1
|
||||
)
|
||||
|
||||
@ -1,34 +1,36 @@
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
import rio
|
||||
|
||||
|
||||
class NewsPost(rio.Component):
|
||||
def __init__(self, header: str, article_text: Union[str, Path], date: str):
|
||||
super().__init__()
|
||||
header: str
|
||||
date: str
|
||||
article_text_path_or_text: str | Path
|
||||
article_text = ""
|
||||
|
||||
@rio.event.on_populate
|
||||
def on_populate(self):
|
||||
self.align_y = 0
|
||||
self.margin_top = 0
|
||||
self.margin_bottom = 2
|
||||
self.margin_right = 1
|
||||
self._header = header
|
||||
self._date = date
|
||||
if isinstance(article_text, str):
|
||||
self._article_text = article_text
|
||||
elif isinstance(article_text, Path):
|
||||
with open(article_text, "r", encoding="utf-8") as f:
|
||||
self._article_text = f.read()
|
||||
if isinstance(self.article_text_path_or_text, str):
|
||||
self.article_text = self.article_text_path_or_text
|
||||
elif isinstance(self.article_text_path_or_text, Path):
|
||||
with open(self.article_text_path_or_text, "r", encoding="utf-8") as f:
|
||||
self.article_text = f.read()
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return rio.Rectangle(
|
||||
content=rio.Column(
|
||||
rio.Row(
|
||||
rio.Text(self._header, align_x=0.1, style="heading2"),
|
||||
rio.Text(self._date, align_x=0.9, style=rio.TextStyle(italic=True)),
|
||||
rio.Text(self.header, align_x=0.1, style="heading2"),
|
||||
rio.Text(self.date, align_x=0.9, style=rio.TextStyle(italic=True)),
|
||||
margin_top=0.5
|
||||
),
|
||||
rio.Column(
|
||||
rio.Markdown(self._article_text, margin=1)
|
||||
rio.Markdown(self.article_text, margin=1)
|
||||
)
|
||||
),
|
||||
fill=self.session.theme.neutral_color,
|
||||
@ -37,3 +39,15 @@ class NewsPost(rio.Component):
|
||||
shadow_color=self.session.theme.hud_color,
|
||||
shadow_offset_y=0
|
||||
)
|
||||
|
||||
|
||||
def build_news_post(header: str, article_text_path_or_text: str | Path, date: str) -> NewsPost:
|
||||
return NewsPost(
|
||||
header=header,
|
||||
article_text_path_or_text=article_text_path_or_text,
|
||||
date=date,
|
||||
align_y=0,
|
||||
margin_top=0,
|
||||
margin_bottom=2,
|
||||
margin_right=1
|
||||
)
|
||||
|
||||
@ -2,10 +2,11 @@ import asyncio
|
||||
import logging
|
||||
from random import randint
|
||||
|
||||
from rio import Text, Component, TextStyle
|
||||
from rio import Text, Component, TextStyle, i_know_what_im_doing
|
||||
|
||||
|
||||
class Ticker(Component):
|
||||
@i_know_what_im_doing
|
||||
def __init__(self, texts: list[str], refresh_interval: float, style: TextStyle, tick_in_order: bool, **kwargs) -> None:
|
||||
super().__init__()
|
||||
if refresh_interval <= 0:
|
||||
|
||||
@ -1,11 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import asyncio
|
||||
from functools import partial
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
from from_root import from_root
|
||||
|
||||
from .page_builder import build_page
|
||||
from .. import components as comps
|
||||
@ -22,9 +19,9 @@ class About(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Die \"Einfach Zocken Genuss Gesellschaft\"",
|
||||
article_text="""
|
||||
article_text_path_or_text="""
|
||||
Die Einfach Zocken Genussgesellschaft wurde am 29. Oktober 2023 in Bad Endbach-Bottenhorn gegründet. Der Verein entstand aus der gemeinsamen Begeisterung für Videospiele, die einige Freunde in einer gemütlichen Kellerbar zusammenbrachte. Unsere Mission ist es, die Freizeitbeschäftigung "Videospiele" zu fördern und Menschen zusammenzubringen, die diese Leidenschaft teilen.
|
||||
|
||||
### Unsere Ziele und Mission
|
||||
|
||||
@ -19,9 +19,9 @@ class Constitution(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Satzung der Einfach Zocken Gaming Gesellschaft",
|
||||
article_text="""
|
||||
article_text_path_or_text="""
|
||||
§ 1 – Name, Sitz, Geschäftsjahr
|
||||
1. Der Verein trägt den Namen "Einfach Zocken Gaming Gesellschaft". Er soll in das
|
||||
Vereinsregister eingetragen werden und führt dann den Zusatz "e. V."
|
||||
|
||||
@ -31,14 +31,14 @@ class Home(rio.Component):
|
||||
margin_bottom=1,
|
||||
margin_right=1
|
||||
),
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Beitrittsformular verfügbar",
|
||||
article_text=from_root("ezgg_website/assets/news_02_06_24.md"),
|
||||
article_text_path_or_text=from_root("ezgg_website/assets/news_02_06_24.md"),
|
||||
date="02.06.2024"
|
||||
),
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Startschuss für Homepage",
|
||||
article_text=from_root("ezgg_website/assets/news_27_05_24.md"),
|
||||
article_text_path_or_text=from_root("ezgg_website/assets/news_27_05_24.md"),
|
||||
date="24.05.2024"
|
||||
)
|
||||
), window_width=self.session.window_width)
|
||||
|
||||
@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
from from_root import from_root
|
||||
|
||||
from .page_builder import build_page
|
||||
from .. import components as comps
|
||||
@ -20,9 +19,9 @@ class Imprint(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Impressum",
|
||||
article_text="""
|
||||
article_text_path_or_text="""
|
||||
#### Einfach Zocken Genuss Gesellschaft e.V.
|
||||
```txt
|
||||
Im Elchgrund 18
|
||||
|
||||
@ -20,9 +20,9 @@ class Join(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Eintritt in die EZ GG e.V.",
|
||||
article_text="""
|
||||
article_text_path_or_text="""
|
||||
Wir freuen uns sehr, dass du Interesse daran hast, Mitglied bei der Einfach Zocken Genussgesellschaft zu werden! Unsere Gemeinschaft lebt von der Begeisterung und dem Engagement unserer Mitglieder.
|
||||
|
||||
Als Mitglied hast du die Möglichkeit, aktiv an unseren Veranstaltungen teilzunehmen und die Entwicklung des Vereins mitzugestalten. Egal, ob du ein erfahrener Gamer oder ein Neuling bist – bei uns bist du herzlich willkommen!
|
||||
|
||||
@ -10,12 +10,6 @@ from .. import services
|
||||
|
||||
|
||||
class Member(rio.Component):
|
||||
database_service: services.DatabaseService
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.database_service = self.session[services.DatabaseService]
|
||||
|
||||
@rio.event.on_window_size_change
|
||||
async def on_window_size_change(self) -> None:
|
||||
await self.force_refresh()
|
||||
@ -26,9 +20,9 @@ class Member(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
grid = rio.Grid()
|
||||
for i, member in enumerate(self.database_service.get_members()):
|
||||
for i, member in enumerate(self.session[services.DatabaseService].get_members()):
|
||||
grid.add(
|
||||
comps.MemberCard(member),
|
||||
comps.build_member_card(member),
|
||||
row=i // 2,
|
||||
column=i % 2,
|
||||
)
|
||||
|
||||
@ -10,13 +10,7 @@ from .. import components as comps, services
|
||||
|
||||
|
||||
class Pics(rio.Component):
|
||||
database_service: services.DatabaseService
|
||||
active_picture: Optional[rio.URL]
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
self.database_service = self.session[services.DatabaseService]
|
||||
self.active_picture: Optional[rio.URL] = None
|
||||
active_picture: Optional[rio.URL] = None
|
||||
|
||||
@rio.event.on_window_size_change
|
||||
async def on_window_size_change(self) -> None:
|
||||
@ -29,7 +23,7 @@ class Pics(rio.Component):
|
||||
def build(self) -> rio.Component:
|
||||
if self.active_picture is None:
|
||||
grid = rio.Grid(row_spacing=0.4, column_spacing=0.5, margin_right=1)
|
||||
for i, link in enumerate(self.database_service.get_picture_paths()):
|
||||
for i, link in enumerate(self.session[services.DatabaseService].get_picture_paths()):
|
||||
grid.add(
|
||||
rio.Button(
|
||||
rio.Image(
|
||||
|
||||
@ -3,7 +3,6 @@ from __future__ import annotations
|
||||
from typing import * # type: ignore
|
||||
|
||||
import rio
|
||||
from from_root import from_root
|
||||
|
||||
from .page_builder import build_page
|
||||
from .. import components as comps
|
||||
@ -20,9 +19,9 @@ class Privacy(rio.Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return build_page(rio.Column(
|
||||
comps.NewsPost(
|
||||
comps.build_news_post(
|
||||
header="Datenschutzerklärung",
|
||||
article_text="""
|
||||
article_text_path_or_text="""
|
||||
### Präambel
|
||||
|
||||
Mit der folgenden Datenschutzerklärung möchten wir Sie darüber aufklären, welche Arten Ihrer personenbezogenen Daten (nachfolgend auch kurz als "Daten" bezeichnet) wir zu welchen Zwecken und in welchem Umfang verarbeiten. Die Datenschutzerklärung gilt für alle von uns durchgeführten Verarbeitungen personenbezogener Daten, sowohl im Rahmen der Erbringung unserer Leistungen als auch insbesondere auf unseren Webseiten, in mobilen Applikationen sowie innerhalb externer Onlinepräsenzen, wie z. B. unserer Social-Media-Profile (nachfolgend zusammenfassend bezeichnet als "Onlineangebot").
|
||||
|
||||
@ -35,7 +35,7 @@ class DatabaseService:
|
||||
contact_mail=None,
|
||||
contact_steam=None
|
||||
), MemberInfo(
|
||||
picture_path=from_root("ezgg_website/assets/member_pictures/anon.png"),
|
||||
picture_path=from_root("ezgg_website/assets/member_pictures/tim.png"),
|
||||
name="Tim \"Matschwicht\" B.",
|
||||
position="Mitglied",
|
||||
entry_date="29.10.2023",
|
||||
|
||||
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
Loading…
Reference in New Issue
Block a user