add lan info location
This commit is contained in:
@@ -9,6 +9,8 @@
|
||||
has_showers=false
|
||||
ts3_address=""
|
||||
discord_invite_link=""
|
||||
location_name=""
|
||||
location_link=""
|
||||
|
||||
[database]
|
||||
database_host="localhost"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from rio import Component, Rectangle, Row, Text, Spacer, ProgressBar, Column, Color, TextStyle
|
||||
from rio import Component, Rectangle, Row, Text, Spacer, ProgressBar, Column, Color, TextStyle, Link
|
||||
from rio.event import on_populate
|
||||
|
||||
from elm.services import ConfigurationService
|
||||
@@ -36,6 +36,7 @@ class LanInfoBox(Component):
|
||||
stroke_color=self.session.theme.box_border_color,
|
||||
),
|
||||
Column(
|
||||
Row(Text("Location:", font_size=0.7), Spacer(), Link(Text(lan_info.location_name, fill=self.session.theme.primary_color, font_size=0.8, overflow="nowrap"), target_url=lan_info.location_link)),
|
||||
Row(Text("Start:", font_size=0.7), Spacer(), Text(lan_info.date_from.strftime("%d.%m.%Y"), fill=self.session.theme.primary_color, font_size=0.8, overflow="nowrap")),
|
||||
Row(Text("Ende:", font_size=0.7), Spacer(), Text(lan_info.date_till.strftime("%d.%m.%Y"), fill=self.session.theme.primary_color, font_size=0.8, overflow="nowrap")),
|
||||
Row(Text("Einlass:", font_size=0.7), Spacer(), Text(lan_info.date_from.strftime("%H:%M Uhr"), fill=self.session.theme.primary_color, font_size=0.8, overflow="nowrap")),
|
||||
@@ -81,6 +82,7 @@ class LanInfoBox(Component):
|
||||
stroke_color=self.session.theme.box_border_color,
|
||||
),
|
||||
Column(
|
||||
Row(Text("Location:", font_size=0.9), Spacer(), Link(Text(lan_info.location_name, fill=self.session.theme.primary_color, font_size=0.9, overflow="nowrap"), target_url=lan_info.location_link)),
|
||||
Row(Text("Start:", font_size=0.9), Spacer(), Text(lan_info.date_from.strftime("%d.%m.%Y"), fill=self.session.theme.primary_color, font_size=0.9, overflow="nowrap")),
|
||||
Row(Text("Ende:", font_size=0.9), Spacer(), Text(lan_info.date_till.strftime("%d.%m.%Y"), fill=self.session.theme.primary_color, font_size=0.9, overflow="nowrap")),
|
||||
Row(Text("Einlass:", font_size=0.9), Spacer(), Text(lan_info.date_from.strftime("%H:%M Uhr"), fill=self.session.theme.primary_color, font_size=0.9, overflow="nowrap")),
|
||||
|
||||
@@ -103,7 +103,9 @@ class ConfigurationService:
|
||||
has_wifi=lan_info["has_wifi"],
|
||||
has_showers=lan_info["has_showers"],
|
||||
ts3_address=lan_info["ts3_address"],
|
||||
discord_invite_link=lan_info["discord_invite_link"]
|
||||
discord_invite_link=lan_info["discord_invite_link"],
|
||||
location_name=lan_info["location_name"],
|
||||
location_link=lan_info["location_link"]
|
||||
)
|
||||
except KeyError:
|
||||
logger.fatal("Error loading LAN Info, exiting...")
|
||||
|
||||
@@ -34,6 +34,8 @@ class LanInfo:
|
||||
has_showers: bool
|
||||
ts3_address: str
|
||||
discord_invite_link: str
|
||||
location_name: str
|
||||
location_link: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user