rename lan

This commit was merged in pull request #22.
This commit is contained in:
David Rodenkirchen
2025-07-26 14:16:09 +02:00
parent 6e598b577f
commit 29caadaca2
81 changed files with 234 additions and 234 deletions
+27
View File
@@ -0,0 +1,27 @@
from rio import Column, Component, event
from src.ezgg_lan_manager import ConfigurationService, NewsService
from src.ezgg_lan_manager.components.NewsPost import NewsPost
from src.ezgg_lan_manager.types.News import News
class NewsPage(Component):
news_posts: list[News] = []
@event.on_populate
async def on_populate(self) -> None:
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - Neuigkeiten")
self.news_posts = (await self.session[NewsService].get_news())[:8]
def build(self) -> Component:
posts = [NewsPost(
title=news.title,
subtitle=news.subtitle,
text=news.content,
date=news.news_date.strftime("%d.%m.%Y"),
author=news.author.user_name
) for news in self.news_posts]
return Column(
*posts,
align_y=0,
)