upgrade-rio-version #1
BIN
requirements.txt
BIN
requirements.txt
Binary file not shown.
@ -5,7 +5,7 @@ import sys
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from rio import App, Theme, Color, Font, Page, Session
|
||||
from rio import App, Theme, Color, Font, ComponentPage, Session
|
||||
from from_root import from_root
|
||||
|
||||
from src.ez_lan_manager import pages, init_services
|
||||
@ -45,94 +45,95 @@ if __name__ == "__main__":
|
||||
|
||||
app = App(
|
||||
name="EZ LAN Manager",
|
||||
build=pages.BasePage,
|
||||
pages=[
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="News",
|
||||
page_url="",
|
||||
url_segment="",
|
||||
build=pages.NewsPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="News",
|
||||
page_url="news",
|
||||
url_segment="news",
|
||||
build=pages.NewsPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Overview",
|
||||
page_url="overview",
|
||||
url_segment="overview",
|
||||
build=lambda: pages.PlaceholderPage(placeholder_name="LAN Übersicht"),
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="BuyTicket",
|
||||
page_url="buy_ticket",
|
||||
url_segment="buy_ticket",
|
||||
build=pages.BuyTicketPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="SeatingPlan",
|
||||
page_url="seating",
|
||||
url_segment="seating",
|
||||
build=pages.SeatingPlanPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Catering",
|
||||
page_url="catering",
|
||||
url_segment="catering",
|
||||
build=pages.CateringPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Guests",
|
||||
page_url="guests",
|
||||
url_segment="guests",
|
||||
build=pages.GuestsPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Tournaments",
|
||||
page_url="tournaments",
|
||||
url_segment="tournaments",
|
||||
build=pages.TournamentsPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="FAQ",
|
||||
page_url="faq",
|
||||
url_segment="faq",
|
||||
build=pages.FaqPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="RulesGTC",
|
||||
page_url="rules-gtc",
|
||||
url_segment="rules-gtc",
|
||||
build=pages.RulesPage
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Contact",
|
||||
page_url="contact",
|
||||
url_segment="contact",
|
||||
build=pages.ContactPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Imprint",
|
||||
page_url="imprint",
|
||||
url_segment="imprint",
|
||||
build=pages.ImprintPage,
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Register",
|
||||
page_url="register",
|
||||
url_segment="register",
|
||||
build=pages.RegisterPage,
|
||||
guard=not_logged_in_guard
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="ForgotPassword",
|
||||
page_url="forgot-password",
|
||||
url_segment="forgot-password",
|
||||
build=pages.ForgotPasswordPage,
|
||||
guard=not_logged_in_guard
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="EditProfile",
|
||||
page_url="edit-profile",
|
||||
url_segment="edit-profile",
|
||||
build=pages.EditProfilePage,
|
||||
guard=logged_in_guard
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="Account",
|
||||
page_url="account",
|
||||
url_segment="account",
|
||||
build=pages.AccountPage,
|
||||
guard=logged_in_guard
|
||||
),
|
||||
Page(
|
||||
ComponentPage(
|
||||
name="DbErrorPage",
|
||||
page_url="db-error",
|
||||
url_segment="db-error",
|
||||
build=pages.DbErrorPage,
|
||||
)
|
||||
],
|
||||
|
||||
@ -23,8 +23,8 @@ class CateringCartItem(Component):
|
||||
|
||||
def build(self) -> rio.Component:
|
||||
return Row(
|
||||
Text(self.ellipsize_string(self.article_name), align_x=0, wrap=True, min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Text(self.ellipsize_string(self.article_name), align_x=0, overflow="wrap", min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Text(AccountingService.make_euro_string_from_int(self.article_price), style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
IconButton(icon="material/close", size=2, color=self.session.theme.danger_color, style="plain", on_press=lambda: self.remove_item_cb(self.list_id)),
|
||||
IconButton(icon="material/close", size=2, color=self.session.theme.danger_color, style="plain-text", on_press=lambda: self.remove_item_cb(self.list_id)),
|
||||
proportions=(19, 5, 2)
|
||||
)
|
||||
|
||||
@ -32,7 +32,7 @@ class CateringOrderItem(Component):
|
||||
def build(self) -> rio.Component:
|
||||
order_status, color = self.get_display_text_and_color_for_order_status(self.order_status)
|
||||
return Row(
|
||||
Text(f"ID: {str(self.order_id):0>6}", align_x=0, wrap=True, min_width=10, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9), margin_right=1),
|
||||
Text(order_status, wrap=True, min_width=10, style=TextStyle(fill=color, font_size=0.9), margin_right=1),
|
||||
Text(f"ID: {str(self.order_id):0>6}", align_x=0, overflow="wrap", min_width=10, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9), margin_right=1),
|
||||
Text(order_status, overflow="wrap", min_width=10, style=TextStyle(fill=color, font_size=0.9), margin_right=1),
|
||||
Text(self.order_datetime.strftime("%d.%m. %H:%M"), style=TextStyle(fill=self.session.theme.background_color, font_size=0.9), align_x=1)
|
||||
)
|
||||
|
||||
@ -40,25 +40,25 @@ class CateringSelectionItem(Component):
|
||||
return Card(
|
||||
content=Column(
|
||||
Row(
|
||||
Text(article_name_top, align_x=0, wrap=True, min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Text(article_name_top, align_x=0, overflow="wrap", min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Text(AccountingService.make_euro_string_from_int(self.article_price), style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
IconButton(
|
||||
icon="material/add",
|
||||
size=2,
|
||||
color=self.session.theme.success_color,
|
||||
style="plain",
|
||||
style="plain-text",
|
||||
on_press=lambda: self.on_add_callback(self.article_id),
|
||||
is_sensitive=self.is_sensitive
|
||||
),
|
||||
proportions=(19, 5, 2),
|
||||
margin_bottom=0
|
||||
),
|
||||
Spacer() if not article_name_bottom else Text(article_name_bottom, align_x=0, wrap=True, min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Spacer() if not article_name_bottom else Text(article_name_bottom, align_x=0, overflow="wrap", min_width=19, style=TextStyle(fill=self.session.theme.background_color, font_size=0.9)),
|
||||
Row(
|
||||
Text(
|
||||
self.additional_info,
|
||||
align_x=0,
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
min_width=19,
|
||||
style=TextStyle(fill=self.session.theme.background_color, font_size=0.6)
|
||||
),
|
||||
|
||||
@ -21,7 +21,7 @@ class NewsPost(Component):
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.3
|
||||
),
|
||||
wrap="ellipsize"
|
||||
overflow="ellipsize"
|
||||
),
|
||||
Text(
|
||||
self.date,
|
||||
@ -31,7 +31,7 @@ class NewsPost(Component):
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.6
|
||||
),
|
||||
wrap=True
|
||||
overflow="wrap"
|
||||
)
|
||||
),
|
||||
Text(
|
||||
@ -44,7 +44,7 @@ class NewsPost(Component):
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
wrap="ellipsize"
|
||||
overflow="ellipsize"
|
||||
),
|
||||
Text(
|
||||
self.text,
|
||||
@ -52,7 +52,7 @@ class NewsPost(Component):
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color
|
||||
),
|
||||
wrap=True
|
||||
overflow="wrap"
|
||||
),
|
||||
Text(
|
||||
f"Geschrieben von {self.author}",
|
||||
@ -66,7 +66,7 @@ class NewsPost(Component):
|
||||
font_size=0.5,
|
||||
italic=True
|
||||
),
|
||||
wrap=False
|
||||
overflow="nowrap"
|
||||
)
|
||||
),
|
||||
fill=self.session.theme.primary_color,
|
||||
|
||||
@ -21,7 +21,7 @@ class SeatingPlanLegend(Component):
|
||||
content=Column(
|
||||
Text(f"Freier Platz", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.7), align_x=0.5, selectable=False),
|
||||
Text(f"", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.9), align_x=0.5,
|
||||
selectable=False, wrap=True)
|
||||
selectable=False, overflow="wrap")
|
||||
),
|
||||
min_width=1,
|
||||
min_height=1,
|
||||
@ -36,7 +36,7 @@ class SeatingPlanLegend(Component):
|
||||
content=Column(
|
||||
Text(f"Belegter Platz", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.7), align_x=0.5, selectable=False),
|
||||
Text(f"", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.9), align_x=0.5,
|
||||
selectable=False, wrap=True)
|
||||
selectable=False, overflow="wrap")
|
||||
),
|
||||
min_width=1,
|
||||
min_height=1,
|
||||
@ -51,7 +51,7 @@ class SeatingPlanLegend(Component):
|
||||
content=Column(
|
||||
Text(f"Eigener Platz", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.7), align_x=0.5, selectable=False),
|
||||
Text(f"", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.9), align_x=0.5,
|
||||
selectable=False, wrap=True)
|
||||
selectable=False, overflow="wrap")
|
||||
),
|
||||
min_width=1,
|
||||
min_height=1,
|
||||
|
||||
@ -17,21 +17,21 @@ class SeatingPlanInfoBox(Component):
|
||||
if not self.show:
|
||||
return Spacer()
|
||||
if self.is_blocked:
|
||||
return Column(Text(f"Sitzplatz gesperrt", margin=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), wrap=True, justify="center"), min_height=10)
|
||||
return Column(Text(f"Sitzplatz gesperrt", margin=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), overflow="wrap", justify="center"), min_height=10)
|
||||
if self.seat_id is None and self.seat_occupant is None:
|
||||
return Column(Text(f"Sitzplatz auswählen...", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), wrap=True, justify="center"), min_height=10)
|
||||
return Column(Text(f"Sitzplatz auswählen...", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), overflow="wrap", justify="center"), min_height=10)
|
||||
return Column(
|
||||
Text(f"Dieser Sitzplatz ({self.seat_id}) ist gebucht von:", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), wrap=True, justify="center"),
|
||||
Text(f"{self.seat_occupant}", margin_bottom=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), wrap=True, justify="center"),
|
||||
Text(f"Dieser Sitzplatz ({self.seat_id}) ist gebucht von:", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), overflow="wrap", justify="center"),
|
||||
Text(f"{self.seat_occupant}", margin_bottom=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), overflow="wrap", justify="center"),
|
||||
min_height=10
|
||||
) if self.seat_id and self.seat_occupant else Column(
|
||||
Text(f"Dieser Sitzplatz ({self.seat_id}) ist frei", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), wrap=True, justify="center"),
|
||||
Text(f"Dieser Sitzplatz ({self.seat_id}) ist frei", margin=1, style=TextStyle(fill=self.session.theme.neutral_color), overflow="wrap", justify="center"),
|
||||
Button(
|
||||
Text(
|
||||
f"Buchen",
|
||||
margin=1,
|
||||
style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.1),
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
justify="center"
|
||||
),
|
||||
shape="rounded",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
from functools import partial
|
||||
|
||||
from rio import Component, Text, Icon, TextStyle, Rectangle, Spacer, Color, MouseEventListener, Column
|
||||
from rio import Component, Text, Icon, TextStyle, Rectangle, Spacer, Color, PointerEventListener, Column
|
||||
from typing import Optional, Callable
|
||||
|
||||
from src.ez_lan_manager.types.Seat import Seat
|
||||
@ -20,11 +20,11 @@ class SeatPixel(Component):
|
||||
return self.session.theme.success_color
|
||||
|
||||
def build(self) -> Component:
|
||||
return MouseEventListener(
|
||||
return PointerEventListener(
|
||||
content=Rectangle(
|
||||
content=Column(
|
||||
Text(f"{self.seat_id}", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.7), align_x=0.5, selectable=False),
|
||||
Text(f"{self.seat.category[0]}", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.9), align_x=0.5, selectable=False, wrap=True)
|
||||
Text(f"{self.seat.category[0]}", style=TextStyle(fill=self.session.theme.primary_color, font_size=0.9), align_x=0.5, selectable=False, overflow="wrap")
|
||||
),
|
||||
min_width=1,
|
||||
min_height=1,
|
||||
|
||||
@ -29,17 +29,17 @@ class SeatingPurchaseBox(Component):
|
||||
if self.success_msg:
|
||||
return Column(
|
||||
Text(f"{self.success_msg}", margin=1, style=TextStyle(fill=self.session.theme.success_color, font_size=1.1),
|
||||
wrap=True, justify="center"),
|
||||
overflow="wrap", justify="center"),
|
||||
Row(
|
||||
Button(
|
||||
Text("Zurück",
|
||||
margin=1,
|
||||
style=TextStyle(fill=self.session.theme.success_color, font_size=1.1),
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
justify="center"
|
||||
),
|
||||
shape="rounded",
|
||||
style="plain",
|
||||
style="plain-text",
|
||||
on_press=self.cancel_cb
|
||||
)
|
||||
),
|
||||
@ -49,17 +49,17 @@ class SeatingPurchaseBox(Component):
|
||||
if self.error_msg:
|
||||
return Column(
|
||||
Text(f"{self.error_msg}", margin=1, style=TextStyle(fill=self.session.theme.danger_color, font_size=1.1),
|
||||
wrap=True, justify="center"),
|
||||
overflow="wrap", justify="center"),
|
||||
Row(
|
||||
Button(
|
||||
Text("Zurück",
|
||||
margin=1,
|
||||
style=TextStyle(fill=self.session.theme.danger_color, font_size=1.1),
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
justify="center"
|
||||
),
|
||||
shape="rounded",
|
||||
style="plain",
|
||||
style="plain-text",
|
||||
on_press=self.cancel_cb
|
||||
)
|
||||
),
|
||||
@ -67,24 +67,24 @@ class SeatingPurchaseBox(Component):
|
||||
)
|
||||
|
||||
return Column(
|
||||
Text(f"Sitzplatz {self.seat_id} verbindlich buchen?", margin=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), wrap=True, justify="center"),
|
||||
Text(f"Sitzplatz {self.seat_id} verbindlich buchen?", margin=1, style=TextStyle(fill=self.session.theme.neutral_color, font_size=1.4), overflow="wrap", justify="center"),
|
||||
Row(
|
||||
Button(
|
||||
Text("Nein",
|
||||
margin=1,
|
||||
style=TextStyle(fill=self.session.theme.danger_color, font_size=1.1),
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
justify="center"
|
||||
),
|
||||
shape="rounded",
|
||||
style="plain",
|
||||
style="plain-text",
|
||||
on_press=self.cancel_cb
|
||||
),
|
||||
Button(
|
||||
Text("Ja",
|
||||
margin=1,
|
||||
style=TextStyle(fill=self.session.theme.success_color, font_size=1.1),
|
||||
wrap=True,
|
||||
overflow="wrap",
|
||||
justify="center"
|
||||
),
|
||||
shape="rounded",
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
from asyncio import sleep, create_task
|
||||
|
||||
import rio
|
||||
from rio import Component, Column, Text, TextStyle, Button, Row, ScrollContainer, Spacer, Popup, PopupOpenOrCloseEvent
|
||||
from rio import Component, Column, Text, TextStyle, Button, Row, ScrollContainer, Spacer, Popup
|
||||
|
||||
from src.ez_lan_manager.components.CateringCartItem import CateringCartItem
|
||||
from src.ez_lan_manager.components.CateringOrderItem import CateringOrderItem
|
||||
@ -111,7 +111,7 @@ class ShoppingCartAndOrders(Component):
|
||||
cart_container,
|
||||
Popup(
|
||||
anchor=cart_container,
|
||||
content=Text(self.popup_message, style=TextStyle(fill=self.session.theme.danger_color if self.popup_is_error else self.session.theme.success_color), wrap=True, margin=2, justify="center", min_width=20),
|
||||
content=Text(self.popup_message, style=TextStyle(fill=self.session.theme.danger_color if self.popup_is_error else self.session.theme.success_color), overflow="wrap", margin=2, justify="center", min_width=20),
|
||||
is_open=self.popup_is_shown,
|
||||
position="center",
|
||||
color=self.session.theme.primary_color
|
||||
|
||||
@ -58,7 +58,7 @@ class TicketBuyCard(Component):
|
||||
Column(
|
||||
Text(self.description, margin_left=1, margin_top=1, style=ticket_description_style),
|
||||
Text("Du besitzt dieses Ticket!", margin_left=1, margin_top=1, style=ticket_owned_style) if self.user_ticket is not None and self.user_ticket.category == self.category else Spacer(),
|
||||
Text(self.additional_info, margin_left=1, margin_top=1, style=ticket_additional_info_style, wrap=True),
|
||||
Text(self.additional_info, margin_left=1, margin_top=1, style=ticket_additional_info_style, overflow="wrap"),
|
||||
Row(
|
||||
progress_bar,
|
||||
tickets_side_text,
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
from asyncio import sleep
|
||||
from typing import Optional
|
||||
|
||||
from rio import Column, Component, event, Text, TextStyle, Button, Color, Spacer, Revealer, Row, ProgressCircle
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, AccountingService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
from src.ez_lan_manager.types.Transaction import Transaction
|
||||
from src.ez_lan_manager.types.User import User
|
||||
@ -28,18 +26,16 @@ class AccountPage(Component):
|
||||
|
||||
def build(self) -> Component:
|
||||
if not self.user and not self.balance:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
align_y = 0,
|
||||
)
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
self.banking_info_revealer = Revealer(
|
||||
@ -79,9 +75,9 @@ class AccountPage(Component):
|
||||
align_x=0.5
|
||||
)
|
||||
),
|
||||
margin = 2,
|
||||
margin_top = 0,
|
||||
margin_bottom = 1,
|
||||
margin=2,
|
||||
margin_top=0,
|
||||
margin_bottom=1,
|
||||
grow_x=True
|
||||
)
|
||||
|
||||
@ -127,57 +123,55 @@ class AccountPage(Component):
|
||||
)
|
||||
)
|
||||
)
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
content=Text(
|
||||
f"Kontostand: {AccountingService.make_euro_string_from_int(self.balance)}",
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
content=Text(
|
||||
f"Kontostand: {AccountingService.make_euro_string_from_int(self.balance)}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=2,
|
||||
align_x=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"LAN-Konto aufladen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=2,
|
||||
align_x=0.5
|
||||
),
|
||||
Button(
|
||||
content=Text("BANKÜBERWEISUNG", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"),
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="secondary",
|
||||
grow_x=True,
|
||||
margin=2,
|
||||
margin_top=0,
|
||||
margin_bottom=1,
|
||||
on_press=self._on_banking_info_press
|
||||
),
|
||||
self.banking_info_revealer,
|
||||
Button(
|
||||
content=Text("PAYPAL", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"),
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="secondary",
|
||||
grow_x=True,
|
||||
margin=2,
|
||||
margin_top=0,
|
||||
is_sensitive=False
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"LAN-Konto aufladen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=2,
|
||||
align_x=0.5
|
||||
),
|
||||
Button(
|
||||
content=Text("BANKÜBERWEISUNG", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"),
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="secondary",
|
||||
grow_x=True,
|
||||
margin=2,
|
||||
margin_top=0,
|
||||
margin_bottom=1,
|
||||
on_press=self._on_banking_info_press
|
||||
),
|
||||
self.banking_info_revealer,
|
||||
Button(
|
||||
content=Text("PAYPAL", style=TextStyle(fill=Color.from_hex("121212"), font_size=0.8), justify="center"),
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="secondary",
|
||||
grow_x=True,
|
||||
margin=2,
|
||||
margin_top=0,
|
||||
is_sensitive=False
|
||||
)
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
content=transaction_history
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
content=transaction_history
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
@ -2,14 +2,14 @@ from __future__ import annotations
|
||||
|
||||
from typing import * # type: ignore
|
||||
|
||||
from rio import Component, event, Spacer, Card, Container, Column, Row, TextStyle, Color, Text
|
||||
from rio import Component, event, Spacer, Card, Container, Column, Row, TextStyle, Color, Text, PageView
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, DatabaseService
|
||||
from src.ez_lan_manager.components.DesktopNavigation import DesktopNavigation
|
||||
|
||||
class BasePage(Component):
|
||||
content: Component
|
||||
|
||||
color = "secondary"
|
||||
corner_radius = (0, 0.5, 0, 0)
|
||||
@event.periodic(60)
|
||||
async def check_db_conn(self) -> None:
|
||||
is_healthy = await self.session[DatabaseService].is_healthy()
|
||||
@ -21,15 +21,12 @@ class BasePage(Component):
|
||||
await self.force_refresh()
|
||||
|
||||
def build(self) -> Component:
|
||||
if self.content is None:
|
||||
content = Spacer()
|
||||
else:
|
||||
content = Card(
|
||||
self.content,
|
||||
color="secondary",
|
||||
min_width=38,
|
||||
corner_radius=(0, 0.5, 0, 0)
|
||||
)
|
||||
content = Card(
|
||||
PageView(),
|
||||
color="secondary",
|
||||
min_width=38,
|
||||
corner_radius=(0, 0.5, 0, 0)
|
||||
)
|
||||
if self.session.window_width > 28:
|
||||
return Container(
|
||||
content=Column(
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
from asyncio import sleep
|
||||
from functools import partial
|
||||
from typing import Optional
|
||||
|
||||
from rio import Text, Column, TextStyle, Component, event, TextInput, MultiLineTextInput, Row, Button, Card, Popup
|
||||
from rio import Text, Column, TextStyle, Component, event, Button, Popup
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, MailingService, AccountingService, TicketingService
|
||||
from src.ez_lan_manager.components.AnimatedText import AnimatedText
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, TicketingService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.components.TicketBuyCard import TicketBuyCard
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.services.AccountingService import InsufficientFundsError
|
||||
from src.ez_lan_manager.services.TicketingService import TicketNotAvailableError, UserAlreadyHasTicketError
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
@ -57,7 +53,7 @@ class BuyTicketPage(Component):
|
||||
self.is_popup_success = False
|
||||
except UserAlreadyHasTicketError:
|
||||
self.popup_message = (f"Du besitzt bereits ein Ticket. Um dein aktuelles Ticket zu stornieren, kontaktiere bitte den Support unter "
|
||||
f"{self.session[ConfigurationService].get_lan_info().organizer_mail}.")
|
||||
f"{self.session[ConfigurationService].get_lan_info().organizer_mail}.")
|
||||
self.is_popup_success = False
|
||||
except RuntimeError:
|
||||
self.popup_message = "Ein unbekannter Fehler ist aufgetreten."
|
||||
@ -65,12 +61,10 @@ class BuyTicketPage(Component):
|
||||
self.is_popup_open = True
|
||||
await self.on_populate()
|
||||
|
||||
|
||||
async def on_popup_close_pressed(self) -> None:
|
||||
self.is_popup_open = False
|
||||
self.popup_message = ""
|
||||
|
||||
|
||||
def build(self) -> Component:
|
||||
ticket_infos = self.session[ConfigurationService].get_ticket_info()
|
||||
header = Text(
|
||||
@ -84,44 +78,41 @@ class BuyTicketPage(Component):
|
||||
align_x=0.5
|
||||
)
|
||||
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
header,
|
||||
Popup(
|
||||
anchor=header,
|
||||
content=Column(
|
||||
Text(
|
||||
self.popup_message,
|
||||
style=TextStyle(font_size=1.1, fill=self.session.theme.success_color if self.is_popup_success else self.session.theme.danger_color),
|
||||
wrap=True,
|
||||
grow_y=True,
|
||||
margin=1
|
||||
),
|
||||
Button("Bestätigen", shape="rounded", grow_y=False, on_press=self.on_popup_close_pressed),
|
||||
min_width=34,
|
||||
min_height=10
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
header,
|
||||
Popup(
|
||||
anchor=header,
|
||||
content=Column(
|
||||
Text(
|
||||
self.popup_message,
|
||||
style=TextStyle(font_size=1.1, fill=self.session.theme.success_color if self.is_popup_success else self.session.theme.danger_color),
|
||||
overflow="wrap",
|
||||
grow_y=True,
|
||||
margin=1
|
||||
),
|
||||
is_open=self.is_popup_open,
|
||||
position="bottom",
|
||||
margin=1,
|
||||
corner_radius=0.2,
|
||||
color=self.session.theme.primary_color
|
||||
Button("Bestätigen", shape="rounded", grow_y=False, on_press=self.on_popup_close_pressed),
|
||||
min_width=34,
|
||||
min_height=10
|
||||
),
|
||||
*[TicketBuyCard(
|
||||
description=t.description,
|
||||
additional_info=t.additional_info,
|
||||
price=t.price,
|
||||
category=t.category,
|
||||
pressed_cb=self.on_buy_pressed,
|
||||
is_enabled=self.is_buying_enabled,
|
||||
total_tickets=t.total_tickets,
|
||||
user_ticket=self.user_ticket
|
||||
) for t in ticket_infos]
|
||||
is_open=self.is_popup_open,
|
||||
position="bottom",
|
||||
margin=1,
|
||||
corner_radius=0.2,
|
||||
color=self.session.theme.primary_color
|
||||
),
|
||||
*[TicketBuyCard(
|
||||
description=t.description,
|
||||
additional_info=t.additional_info,
|
||||
price=t.price,
|
||||
category=t.category,
|
||||
pressed_cb=self.on_buy_pressed,
|
||||
is_enabled=self.is_buying_enabled,
|
||||
total_tickets=t.total_tickets,
|
||||
user_ticket=self.user_ticket
|
||||
) for t in ticket_infos]
|
||||
),
|
||||
align_y=0
|
||||
),
|
||||
grow_x=True
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -6,7 +6,6 @@ from src.ez_lan_manager import ConfigurationService, CateringService
|
||||
from src.ez_lan_manager.components.CateringSelectionItem import CateringSelectionItem
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.components.ShoppingCartAndOrders import ShoppingCartAndOrders
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.CateringMenuItem import CateringMenuItemCategory, CateringMenuItem
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
|
||||
@ -24,7 +23,6 @@ class CateringPage(Component):
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - Catering")
|
||||
self.all_menu_items = await self.session[CateringService].get_menu()
|
||||
|
||||
|
||||
async def on_user_logged_in_status_changed(self) -> None:
|
||||
await self.force_refresh()
|
||||
|
||||
@ -35,7 +33,6 @@ class CateringPage(Component):
|
||||
def get_menu_items_by_category(all_menu_items: list[CateringMenuItem], category: Optional[CateringMenuItemCategory]) -> list[CateringMenuItem]:
|
||||
return list(filter(lambda item: item.category == category, all_menu_items))
|
||||
|
||||
|
||||
def build(self) -> Component:
|
||||
user_id = self.session[SessionStorage].user_id
|
||||
if len(self.shopping_cart_and_orders) == 0:
|
||||
@ -73,217 +70,215 @@ class CateringPage(Component):
|
||||
) if user_id else Spacer()
|
||||
|
||||
menu = [MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
)] if not self.all_menu_items else [MainViewContentBox(
|
||||
Revealer(
|
||||
header="Snacks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.SNACK))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Frühstück",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BREAKFAST))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Hauptspeisen",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.MAIN_COURSE))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Desserts",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.DESSERT))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Wasser & Softdrinks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_NON_ALCOHOLIC))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Alkoholische Getränke",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_ALCOHOLIC))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Cocktails & Longdrinks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_COCKTAIL))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Shots",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_SHOT))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Sonstiges",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.NON_FOOD))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
)]
|
||||
|
||||
return BasePage(
|
||||
content=Column(
|
||||
# SHOPPING CART
|
||||
shopping_cart_and_orders_container,
|
||||
# ITEM SELECTION
|
||||
*menu,
|
||||
align_y=0
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
)] if not self.all_menu_items else [MainViewContentBox(
|
||||
Revealer(
|
||||
header="Snacks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.SNACK))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Frühstück",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BREAKFAST))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Hauptspeisen",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.MAIN_COURSE))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Desserts",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.DESSERT))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Wasser & Softdrinks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_NON_ALCOHOLIC))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Alkoholische Getränke",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_ALCOHOLIC))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Cocktails & Longdrinks",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_COCKTAIL))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Shots",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.BEVERAGE_SHOT))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Revealer(
|
||||
header="Sonstiges",
|
||||
content=Column(
|
||||
*[CateringSelectionItem(
|
||||
article_name=catering_menu_item.name,
|
||||
article_price=catering_menu_item.price,
|
||||
article_id=catering_menu_item.item_id,
|
||||
on_add_callback=self.shopping_cart_and_orders[0].on_add_item,
|
||||
is_sensitive=(user_id is not None) and not catering_menu_item.is_disabled,
|
||||
additional_info=catering_menu_item.additional_info,
|
||||
is_grey=idx % 2 == 0
|
||||
) for idx, catering_menu_item in enumerate(self.get_menu_items_by_category(self.all_menu_items, CateringMenuItemCategory.NON_FOOD))],
|
||||
),
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin=1,
|
||||
align_y=0.5
|
||||
)
|
||||
)]
|
||||
|
||||
return Column(
|
||||
# SHOPPING CART
|
||||
shopping_cart_and_orders_container,
|
||||
# ITEM SELECTION
|
||||
*menu,
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -6,7 +6,6 @@ from rio import Text, Column, TextStyle, Component, event, TextInput, MultiLineT
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, MailingService
|
||||
from src.ez_lan_manager.components.AnimatedText import AnimatedText
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
from src.ez_lan_manager.types.User import User
|
||||
|
||||
@ -59,9 +58,9 @@ class ContactPage(Component):
|
||||
|
||||
def build(self) -> Component:
|
||||
self.animated_text = AnimatedText(
|
||||
margin_top = 2,
|
||||
margin_bottom = 1,
|
||||
align_x = 0.1
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
align_x=0.1
|
||||
)
|
||||
|
||||
self.email_input = TextInput(
|
||||
@ -105,30 +104,27 @@ class ContactPage(Component):
|
||||
color="primary",
|
||||
on_press=self.on_send_pressed
|
||||
)
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Kontakt",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Kontakt",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
self.email_input,
|
||||
self.subject_input,
|
||||
self.message_input,
|
||||
Row(
|
||||
self.animated_text,
|
||||
self.submit_button,
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
align_x=0.5
|
||||
),
|
||||
self.email_input,
|
||||
self.subject_input,
|
||||
self.message_input,
|
||||
Row(
|
||||
self.animated_text,
|
||||
self.submit_button,
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
),
|
||||
grow_x=True
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -34,7 +34,7 @@ class DbErrorPage(Component):
|
||||
fill=self.session.theme.danger_color,
|
||||
font_size=1.3
|
||||
),
|
||||
wrap=True
|
||||
overflow="wrap"
|
||||
)
|
||||
),
|
||||
color="secondary",
|
||||
|
||||
@ -10,7 +10,6 @@ from email_validator import validate_email, EmailNotValidError
|
||||
from src.ez_lan_manager import ConfigurationService, UserService
|
||||
from src.ez_lan_manager.components.AnimatedText import AnimatedText
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
from src.ez_lan_manager.types.User import User
|
||||
|
||||
@ -18,6 +17,7 @@ from src.ez_lan_manager.types.User import User
|
||||
class EditProfilePage(Component):
|
||||
user: Optional[User] = None
|
||||
pfp: Optional[bytes] = None
|
||||
|
||||
@staticmethod
|
||||
def optional_date_to_str(d: Optional[date]) -> str:
|
||||
if not d:
|
||||
@ -96,18 +96,16 @@ class EditProfilePage(Component):
|
||||
|
||||
def build(self) -> Component:
|
||||
if not self.user:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
align_y = 0
|
||||
)
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
self.animated_text = AnimatedText(
|
||||
@ -175,57 +173,55 @@ class EditProfilePage(Component):
|
||||
margin_bottom=1
|
||||
)
|
||||
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
self.pfp_image_container,
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
self.pfp_image_container,
|
||||
Button(
|
||||
content=Text(
|
||||
"Neues Bild hochladen",
|
||||
style=TextStyle(fill=Color.from_hex("02dac5"), font_size=0.9)
|
||||
),
|
||||
align_x=0.5,
|
||||
margin_bottom=1,
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="primary",
|
||||
on_press=self.upload_new_pfp
|
||||
),
|
||||
Row(
|
||||
TextInput(label="Deine User-ID", text=self.user.user_id, is_sensitive=False, margin_left=1, grow_x=False),
|
||||
TextInput(label="Dein Nickname", text=self.user.user_name, is_sensitive=False, margin_left=1, margin_right=1, grow_x=True),
|
||||
margin_bottom=1
|
||||
),
|
||||
self.email_input,
|
||||
Row(
|
||||
self.first_name_input,
|
||||
self.last_name_input,
|
||||
margin_bottom=1
|
||||
),
|
||||
self.birthday_input,
|
||||
self.new_pw_1_input,
|
||||
self.new_pw_2_input,
|
||||
|
||||
Row(
|
||||
self.animated_text,
|
||||
Button(
|
||||
content=Text(
|
||||
"Neues Bild hochladen",
|
||||
style=TextStyle(fill=Color.from_hex("02dac5"), font_size=0.9)
|
||||
"Speichern",
|
||||
style=TextStyle(fill=self.session.theme.success_color, font_size=0.9),
|
||||
align_x=0.2
|
||||
),
|
||||
align_x=0.5,
|
||||
align_x=0.9,
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="primary",
|
||||
on_press=self.upload_new_pfp
|
||||
on_press=self.on_save_pressed
|
||||
),
|
||||
Row(
|
||||
TextInput(label="Deine User-ID", text=self.user.user_id, is_sensitive=False, margin_left=1, grow_x=False),
|
||||
TextInput(label="Dein Nickname", text=self.user.user_name, is_sensitive=False, margin_left=1, margin_right=1, grow_x=True),
|
||||
margin_bottom=1
|
||||
),
|
||||
self.email_input,
|
||||
Row(
|
||||
self.first_name_input,
|
||||
self.last_name_input,
|
||||
margin_bottom=1
|
||||
),
|
||||
self.birthday_input,
|
||||
self.new_pw_1_input,
|
||||
self.new_pw_2_input,
|
||||
|
||||
Row(
|
||||
self.animated_text,
|
||||
Button(
|
||||
content=Text(
|
||||
"Speichern",
|
||||
style=TextStyle(fill=self.session.theme.success_color, font_size=0.9),
|
||||
align_x=0.2
|
||||
),
|
||||
align_x=0.9,
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
shape="rectangle",
|
||||
style="major",
|
||||
color="primary",
|
||||
on_press=self.on_save_pressed
|
||||
),
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
@ -2,63 +2,69 @@ from rio import Column, Component, event, TextStyle, Text, Revealer
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
FAQ: list[list[str]] = [
|
||||
["Wie melde ich mich für die LAN an?", "Registriere dich auf dieser Seite, lade dein Guthabenkonto auf und kaufe ein Ticket. Danach such dir einen freien Sitzplatz auf dem Sitzplan aus."],
|
||||
["Wie lade ich mein Guthabenkonto auf?", "Logge dich in deinen Account ein und klicke auf die Schaltfläche 'Guthaben' in der Navigationsleiste. Dort findest du alle weiteren Informationen."],
|
||||
["Wie melde ich mich für die LAN an?",
|
||||
"Registriere dich auf dieser Seite, lade dein Guthabenkonto auf und kaufe ein Ticket. Danach such dir einen freien Sitzplatz auf dem Sitzplan aus."],
|
||||
["Wie lade ich mein Guthabenkonto auf?",
|
||||
"Logge dich in deinen Account ein und klicke auf die Schaltfläche 'Guthaben' in der Navigationsleiste. Dort findest du alle weiteren Informationen."],
|
||||
["Wie kann ich mein Ticket stornieren?", "Schreibe uns eine Mail an tech@ezgg-ev.de, wir kümmern uns dann Zeitnah um die Stornierung."],
|
||||
["Was soll ich zur LAN mitbringen?", "Deinen PC inklusive aller zugehörigen Geräte (Maus, Tastatur, Monitor, Headset), sowie aller Anschlusskabel. Wir empfehlen ein LAN Kabel von mindestens 5 Metern Länge mitzubringen. Des weiteren benötigste du eine Mehrfachsteckdose, da dir an deinem Platz nur ein einzelner Steckplatz zugewiesen wird."],
|
||||
["Was soll ich zur LAN mitbringen?",
|
||||
"Deinen PC inklusive aller zugehörigen Geräte (Maus, Tastatur, Monitor, Headset), sowie aller Anschlusskabel. Wir empfehlen ein LAN Kabel von mindestens 5 Metern Länge mitzubringen. Des weiteren benötigste du eine Mehrfachsteckdose, da dir an deinem Platz nur ein einzelner Steckplatz zugewiesen wird."],
|
||||
["Wohin mit technischen Problemen?", "Melde dich einfach am Einlass bzw in der Orga-Ecke, wir helfen gerne weiter."],
|
||||
["Wo entsorge ich meinen Müll?", "Im gesamten Veranstaltungsgebäude findest du Mülltüten/Mülleimer."],
|
||||
["Darf ich Cannabis konsumieren?", "Generell verbieten wir den Konsum von Cannabis nicht. Beachte aber die allgemeine Gesetzeslage und ziehe ggf. die Bubatzkarte zu Rat."],
|
||||
["Gibt es einen Discord oder TeamSpeak?", "Du kannst gerne unseren Vereins-TeamSpeak3-Server unter ts3.ezgg-ev.de nutzen. Den Link zum offiziellen Discord findest du in der Navigationsleiste."],
|
||||
["Wo bleibt mein Essen?", "Vermutlich ist es auf dem Weg. Du kannst auf der Catering-Seite den Status deiner Bestellung überprüfen. Hast du Bedenken das sie verloren gegangen sein könnte, sprich ein Team-Mitglied an der Theke darauf an."],
|
||||
["Wie lange dauert eine Aufladung per Überweißung?", "In der Regel wird das Guthaben deinem Konto innerhalb von 2 bis 3 Werktagen gutgeschrieben. In Ausnahmefällen kann es bis zu 7 Tagen dauern."],
|
||||
["Wie melde ich meinen Clan an?", "Wenn in deiner Gruppe mehr als 3 Personen sind, dann schreib uns bitte eine Mail mit dem Betreff 'Gruppenticket' an tech@ezgg-ev.de. Schreibe uns dort die Nutzer-ID's sowie die Sitzplätze deiner Gruppe auf. Gehe sicher das jede Person in deiner Gruppe entweder bereits ein passendes Ticket besitzt oder über genug Guthaben verfügt um ein Ticket zu kaufen."],
|
||||
["Wo kann ich schlafen?", "Im Veranstaltungsgebäude sind offizielle Schlafbereiche ausgewiesen. Solange du keine Zugangs-, Durchgangs-, oder Rettungswege blockierst, darfst du überall schlafen."]
|
||||
["Gibt es einen Discord oder TeamSpeak?",
|
||||
"Du kannst gerne unseren Vereins-TeamSpeak3-Server unter ts3.ezgg-ev.de nutzen. Den Link zum offiziellen Discord findest du in der Navigationsleiste."],
|
||||
["Wo bleibt mein Essen?",
|
||||
"Vermutlich ist es auf dem Weg. Du kannst auf der Catering-Seite den Status deiner Bestellung überprüfen. Hast du Bedenken das sie verloren gegangen sein könnte, sprich ein Team-Mitglied an der Theke darauf an."],
|
||||
["Wie lange dauert eine Aufladung per Überweißung?",
|
||||
"In der Regel wird das Guthaben deinem Konto innerhalb von 2 bis 3 Werktagen gutgeschrieben. In Ausnahmefällen kann es bis zu 7 Tagen dauern."],
|
||||
["Wie melde ich meinen Clan an?",
|
||||
"Wenn in deiner Gruppe mehr als 3 Personen sind, dann schreib uns bitte eine Mail mit dem Betreff 'Gruppenticket' an tech@ezgg-ev.de. Schreibe uns dort die Nutzer-ID's sowie die Sitzplätze deiner Gruppe auf. Gehe sicher das jede Person in deiner Gruppe entweder bereits ein passendes Ticket besitzt oder über genug Guthaben verfügt um ein Ticket zu kaufen."],
|
||||
["Wo kann ich schlafen?",
|
||||
"Im Veranstaltungsgebäude sind offizielle Schlafbereiche ausgewiesen. Solange du keine Zugangs-, Durchgangs-, oder Rettungswege blockierst, darfst du überall schlafen."]
|
||||
]
|
||||
|
||||
|
||||
class FaqPage(Component):
|
||||
@event.on_populate
|
||||
async def on_populate(self) -> None:
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - FAQ")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="FAQ",
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="FAQ",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
),
|
||||
*[Revealer(
|
||||
header=question,
|
||||
content=Text(
|
||||
text=answer,
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
),
|
||||
*[Revealer(
|
||||
header=question,
|
||||
content=Text(
|
||||
text=answer,
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
wrap=True
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
grow_x=True,
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
)
|
||||
) for question, answer in FAQ]
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
overflow="wrap"
|
||||
),
|
||||
margin=1,
|
||||
grow_x=True,
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
)
|
||||
) for question, answer in FAQ]
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -6,7 +6,7 @@ from rio import Column, Component, event, Text, TextStyle, TextInput, TextInputC
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, MailingService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
|
||||
class ForgotPasswordPage(Component):
|
||||
def on_email_changed(self, change_event: TextInputChangeEvent) -> None:
|
||||
@ -85,27 +85,25 @@ class ForgotPasswordPage(Component):
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
margin_bottom=2,
|
||||
wrap=True
|
||||
overflow="wrap"
|
||||
)
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"Passwort vergessen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"Passwort vergessen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
self.email_input,
|
||||
self.submit_button,
|
||||
self.info_text
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
),
|
||||
self.email_input,
|
||||
self.submit_button,
|
||||
self.info_text
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
@ -4,7 +4,6 @@ from rio import Column, Component, event, TextStyle, Text, Button, Row, TextInpu
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, TicketingService, SeatingService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.Seat import Seat
|
||||
from src.ez_lan_manager.types.User import User
|
||||
|
||||
@ -51,46 +50,45 @@ class GuestsPage(Component):
|
||||
seat = None
|
||||
self.table_elements.append(
|
||||
Button(
|
||||
content=Row(Text(text=f"{user.user_id:0>4}", align_x=0, margin_right=1), Text(text=user.user_name, grow_x=True, wrap="ellipsize"), Text(text="-" if seat is None else seat.seat_id, align_x=1)),
|
||||
content=Row(Text(text=f"{user.user_id:0>4}", align_x=0, margin_right=1), Text(text=user.user_name, grow_x=True, overflow="ellipsize"),
|
||||
Text(text="-" if seat is None else seat.seat_id, align_x=1)),
|
||||
shape="rectangle",
|
||||
grow_x=True,
|
||||
color=self.session.theme.hud_color if idx % 2 == 0 else self.session.theme.primary_color
|
||||
)
|
||||
)
|
||||
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Teilnehmer",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Teilnehmer",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
TextInput(
|
||||
label="Suche nach Name oder ID",
|
||||
margin=1,
|
||||
margin_left=3,
|
||||
margin_right=3,
|
||||
on_change=self.on_searchbar_content_change
|
||||
),
|
||||
Button(
|
||||
content=Row(Text(text="ID ", align_x=0, margin_right=1), Text(text="Benutzername", grow_x=True), Text(text="Sitzplatz", align_x=1)),
|
||||
shape="rectangle",
|
||||
grow_x=True,
|
||||
color=self.session.theme.primary_color,
|
||||
style="plain",
|
||||
is_sensitive=False
|
||||
),
|
||||
*self.table_elements,
|
||||
Spacer(min_height=1)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
),
|
||||
TextInput(
|
||||
label="Suche nach Name oder ID",
|
||||
margin=1,
|
||||
margin_left=3,
|
||||
margin_right=3,
|
||||
on_change=self.on_searchbar_content_change
|
||||
),
|
||||
Button(
|
||||
content=Row(Text(text="ID ", align_x=0, margin_right=1), Text(text="Benutzername", grow_x=True), Text(text="Sitzplatz", align_x=1)),
|
||||
shape="rectangle",
|
||||
grow_x=True,
|
||||
color=self.session.theme.primary_color,
|
||||
style="plain-text",
|
||||
is_sensitive=False
|
||||
),
|
||||
*self.table_elements,
|
||||
Spacer(min_height=1)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@ from rio import Text, Column, TextStyle, Component, event, Link, Color
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
|
||||
class ImprintPage(Component):
|
||||
@event.on_populate
|
||||
@ -10,98 +10,95 @@ class ImprintPage(Component):
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - Impressum & DSGVO")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Impressum",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Impressum",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
Text(
|
||||
text="Angaben gemäß § 5 TMG:\n\n"
|
||||
"Einfach Zockem Gaming Gesellschaft e.V.\n"
|
||||
"Im Elchgrund 18\n"
|
||||
"35080 Bad Endbach - Bottenhorn\n\n"
|
||||
|
||||
"Vertreten durch:\n\n"
|
||||
|
||||
"1. Vorsitzender: David Rodenkirchen\n"
|
||||
"2. Vorsitzender: Julia Albring\n"
|
||||
"Schatzmeisterin: Jessica Rodenkirchen\n\n"
|
||||
|
||||
"Kontakt:\n\n"
|
||||
|
||||
"E-Mail: vorstand (at) ezgg-ev.de\n\n"
|
||||
|
||||
"Registereintrag:\n\n"
|
||||
|
||||
"Eingetragen im Vereinsregister.\n"
|
||||
"Registergericht: Amtsgericht Marburg\n"
|
||||
"Registernummer: VR 5837\n\n"
|
||||
|
||||
"Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV:\n\n"
|
||||
|
||||
"David Rodenkirchen\n"
|
||||
"Im Elchgrund 18\n"
|
||||
"35080 Bad Endbach - Bottenhorn\n",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=2,
|
||||
wrap=True
|
||||
)
|
||||
margin_top=2,
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="Angaben gemäß § 5 TMG:\n\n"
|
||||
"Einfach Zockem Gaming Gesellschaft e.V.\n"
|
||||
"Im Elchgrund 18\n"
|
||||
"35080 Bad Endbach - Bottenhorn\n\n"
|
||||
|
||||
"Vertreten durch:\n\n"
|
||||
|
||||
"1. Vorsitzender: David Rodenkirchen\n"
|
||||
"2. Vorsitzender: Julia Albring\n"
|
||||
"Schatzmeisterin: Jessica Rodenkirchen\n\n"
|
||||
|
||||
"Kontakt:\n\n"
|
||||
|
||||
"E-Mail: vorstand (at) ezgg-ev.de\n\n"
|
||||
|
||||
"Registereintrag:\n\n"
|
||||
|
||||
"Eingetragen im Vereinsregister.\n"
|
||||
"Registergericht: Amtsgericht Marburg\n"
|
||||
"Registernummer: VR 5837\n\n"
|
||||
|
||||
"Verantwortlich für den Inhalt nach § 55 Abs. 2 RStV:\n\n"
|
||||
|
||||
"David Rodenkirchen\n"
|
||||
"Im Elchgrund 18\n"
|
||||
"35080 Bad Endbach - Bottenhorn\n",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=2,
|
||||
overflow="wrap"
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Datenschutzerklärung",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="Die Datenschutzerklärung kann über den untenstehenden Link eingesehen werden",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
overflow="wrap",
|
||||
align_x=0.5,
|
||||
grow_x=True,
|
||||
min_width=30
|
||||
),
|
||||
Link(
|
||||
content=Text(
|
||||
text="Datenschutzerklärung",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
fill=Color.from_hex("000080"),
|
||||
font_size=0.9,
|
||||
underlined=True
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
margin_top=1,
|
||||
overflow="wrap",
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="Die Datenschutzerklärung kann über den untenstehenden Link eingesehen werden",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
wrap=True,
|
||||
align_x=0.5,
|
||||
grow_x=True,
|
||||
min_width=30
|
||||
),
|
||||
Link(
|
||||
content=Text(
|
||||
text="Datenschutzerklärung",
|
||||
style=TextStyle(
|
||||
fill=Color.from_hex("000080"),
|
||||
font_size=0.9,
|
||||
underlined=True
|
||||
),
|
||||
margin_bottom=1,
|
||||
margin_top=1,
|
||||
wrap=True,
|
||||
align_x=0.5
|
||||
),
|
||||
target_url="https://ezgg-ev.de/privacy",
|
||||
open_in_new_tab=True
|
||||
)
|
||||
target_url="https://ezgg-ev.de/privacy",
|
||||
open_in_new_tab=True
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
),
|
||||
grow_x=True
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -2,7 +2,6 @@ from rio import Column, Component, event
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, NewsService
|
||||
from src.ez_lan_manager.components.NewsPost import NewsPost
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.types.News import News
|
||||
|
||||
|
||||
@ -22,9 +21,7 @@ class NewsPage(Component):
|
||||
date=news.news_date.strftime("%d.%m.%Y"),
|
||||
author=news.author.user_name
|
||||
) for news in self.news_posts]
|
||||
return BasePage(
|
||||
content=Column(
|
||||
return Column(
|
||||
*posts,
|
||||
align_y=0,
|
||||
)
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@ from rio import Column, Component, event
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.NewsPost import NewsPost
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
|
||||
class PlaceholderPage(Component):
|
||||
placeholder_name: str
|
||||
@ -12,13 +12,11 @@ class PlaceholderPage(Component):
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - {self.placeholder_name}")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
NewsPost(
|
||||
title="Platzhalter",
|
||||
text=f"Dies ist die Platzhalterseite für {self.placeholder_name}.",
|
||||
date="99.99.9999"
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
return Column(
|
||||
NewsPost(
|
||||
title="Platzhalter",
|
||||
text=f"Dies ist die Platzhalterseite für {self.placeholder_name}.",
|
||||
date="99.99.9999"
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
@ -6,12 +6,12 @@ from rio import Column, Component, event, Text, TextStyle, TextInput, TextInputC
|
||||
from src.ez_lan_manager import ConfigurationService, UserService, MailingService
|
||||
from src.ez_lan_manager.components.AnimatedText import AnimatedText
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
MINIMUM_PASSWORD_LENGTH = 6
|
||||
|
||||
logger = logging.getLogger(__name__.split(".")[-1])
|
||||
|
||||
|
||||
class RegisterPage(Component):
|
||||
def on_pw_change(self, _: TextInputChangeEvent) -> None:
|
||||
if not (self.pw_1.text == self.pw_2.text) or len(self.pw_1.text) < MINIMUM_PASSWORD_LENGTH:
|
||||
@ -21,7 +21,6 @@ class RegisterPage(Component):
|
||||
self.pw_1.is_valid = True
|
||||
self.pw_2.is_valid = True
|
||||
|
||||
|
||||
def on_email_changed(self, change_event: TextInputChangeEvent) -> None:
|
||||
try:
|
||||
validate_email(change_event.text, check_deliverability=False)
|
||||
@ -154,28 +153,26 @@ class RegisterPage(Component):
|
||||
margin_right=1,
|
||||
margin_bottom=2
|
||||
)
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"Neues Konto anlegen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
content=Column(
|
||||
Text(
|
||||
"Neues Konto anlegen",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
self.user_name_input,
|
||||
self.email_input,
|
||||
self.pw_1,
|
||||
self.pw_2,
|
||||
self.submit_button,
|
||||
self.animated_text
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
),
|
||||
self.user_name_input,
|
||||
self.email_input,
|
||||
self.pw_1,
|
||||
self.pw_2,
|
||||
self.submit_button,
|
||||
self.animated_text
|
||||
)
|
||||
),
|
||||
align_y=0,
|
||||
)
|
||||
|
||||
@ -2,7 +2,6 @@ from rio import Column, Component, event, TextStyle, Text, Revealer
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
RULES: list[str] = [
|
||||
"Respektvolles Verhalten: Sei höflich und respektvoll gegenüber anderen Gästen und dem Team.",
|
||||
@ -44,151 +43,150 @@ AGB: dict[str, list[str]] = {
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
class RulesPage(Component):
|
||||
@event.on_populate
|
||||
async def on_populate(self) -> None:
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - Regeln & AGB")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Regeln",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Regeln",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
Text(
|
||||
text="(AGB's in verständlichem deutsch)",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.5
|
||||
),
|
||||
margin_top=0.5,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="(AGB's in verständlichem deutsch)",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.5
|
||||
),
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
wrap=True
|
||||
) for idx, rule in enumerate(RULES)],
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="AGB",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
align_x=0.5
|
||||
margin_top=0.5,
|
||||
margin_bottom=2,
|
||||
align_x=0.5
|
||||
),
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
Revealer(
|
||||
header="§ 1 Allgemeine Bestimmungen",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=2,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
wrap=True
|
||||
) for idx, rule in enumerate(AGB["§1"])]
|
||||
)
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
overflow="wrap"
|
||||
) for idx, rule in enumerate(RULES)],
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="AGB",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
Revealer(
|
||||
header="§ 2 Teilnahmevoraussetzungen",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
wrap=True
|
||||
) for idx, rule in enumerate(AGB["§2"])]
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=1,
|
||||
align_x=0.5
|
||||
),
|
||||
Revealer(
|
||||
header="§ 1 Allgemeine Bestimmungen",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
Revealer(
|
||||
header="§ 3 Verhaltensregeln",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
wrap=True
|
||||
) for idx, rule in enumerate(AGB["§3"])]
|
||||
)
|
||||
margin=1,
|
||||
margin_top=2,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
overflow="wrap"
|
||||
) for idx, rule in enumerate(AGB["§1"])]
|
||||
)
|
||||
),
|
||||
Revealer(
|
||||
header="§ 2 Teilnahmevoraussetzungen",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
Revealer(
|
||||
header="§ 4 Internetzugang",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
wrap=True
|
||||
) for idx, rule in enumerate(AGB["§4"])]
|
||||
)
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
overflow="wrap"
|
||||
) for idx, rule in enumerate(AGB["§2"])]
|
||||
)
|
||||
),
|
||||
Revealer(
|
||||
header="§ 3 Verhaltensregeln",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
overflow="wrap"
|
||||
) for idx, rule in enumerate(AGB["§3"])]
|
||||
)
|
||||
),
|
||||
Revealer(
|
||||
header="§ 4 Internetzugang",
|
||||
header_style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1
|
||||
),
|
||||
margin=1,
|
||||
margin_top=0,
|
||||
content=Column(
|
||||
*[Text(
|
||||
f"{idx + 1}. {rule}",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.8
|
||||
),
|
||||
margin_bottom=0.8,
|
||||
margin_left=1,
|
||||
margin_right=1,
|
||||
overflow="wrap"
|
||||
) for idx, rule in enumerate(AGB["§4"])]
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -2,22 +2,21 @@ import logging
|
||||
from asyncio import sleep
|
||||
from typing import Optional
|
||||
|
||||
from rio import Text, Column, TextStyle, Component, event, PressEvent, ProgressCircle, Row, Image, Button, Spacer
|
||||
from rio import Text, Column, TextStyle, Component, event, PressEvent, ProgressCircle
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService, SeatingService, TicketingService, UserService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.components.SeatingPlan import SeatingPlan, SeatingPlanLegend
|
||||
from src.ez_lan_manager.components.SeatingPlanInfoBox import SeatingPlanInfoBox
|
||||
from src.ez_lan_manager.components.SeatingPurchaseBox import SeatingPurchaseBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
from src.ez_lan_manager.services.SeatingService import NoTicketError, SeatNotFoundError, WrongCategoryError, SeatAlreadyTakenError
|
||||
from src.ez_lan_manager.types.Seat import Seat
|
||||
from src.ez_lan_manager.types.SessionStorage import SessionStorage
|
||||
from src.ez_lan_manager.types.User import User
|
||||
|
||||
|
||||
logger = logging.getLogger(__name__.split(".")[-1])
|
||||
|
||||
|
||||
class SeatingPlanPage(Component):
|
||||
seating_info: Optional[list[Seat]] = None
|
||||
current_seat_id: Optional[str] = None
|
||||
@ -94,7 +93,6 @@ class SeatingPlanPage(Component):
|
||||
self.purchase_box_loading = False
|
||||
await self.on_populate()
|
||||
|
||||
|
||||
async def on_purchase_cancelled(self) -> None:
|
||||
self.purchase_box_loading = False
|
||||
self.show_info_box = True
|
||||
@ -102,47 +100,43 @@ class SeatingPlanPage(Component):
|
||||
self.purchase_box_error_msg = None
|
||||
self.purchase_box_success_msg = None
|
||||
|
||||
|
||||
def build(self) -> Component:
|
||||
if not self.seating_info:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
)
|
||||
return BasePage(
|
||||
content=Column(
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
SeatingPlanInfoBox(seat_id=self.current_seat_id, seat_occupant=self.current_seat_occupant, seat_price=self.current_seat_price,
|
||||
is_blocked=self.current_seat_is_blocked, is_booking_blocked=self.is_booking_blocked, show=self.show_info_box, purchase_cb=self.on_purchase_clicked),
|
||||
SeatingPurchaseBox(
|
||||
show=self.show_purchase_box,
|
||||
seat_id=self.current_seat_id,
|
||||
is_loading=self.purchase_box_loading,
|
||||
confirm_cb=self.on_purchase_confirmed,
|
||||
cancel_cb=self.on_purchase_cancelled,
|
||||
error_msg=self.purchase_box_error_msg,
|
||||
success_msg=self.purchase_box_success_msg
|
||||
)
|
||||
ProgressCircle(
|
||||
color="secondary",
|
||||
align_x=0.5,
|
||||
margin_top=2,
|
||||
margin_bottom=2
|
||||
)
|
||||
),
|
||||
MainViewContentBox(
|
||||
SeatingPlan(seat_clicked_cb=self.on_seat_clicked, seating_info=self.seating_info) if self.seating_info else
|
||||
Column(ProgressCircle(color=self.session.theme.secondary_color, margin=3), Text("Sitzplan wird geladen", style=TextStyle(fill=self.session.theme.neutral_color), align_x=0.5, margin=1))
|
||||
),
|
||||
MainViewContentBox(
|
||||
SeatingPlanLegend(),
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
SeatingPlanInfoBox(seat_id=self.current_seat_id, seat_occupant=self.current_seat_occupant, seat_price=self.current_seat_price,
|
||||
is_blocked=self.current_seat_is_blocked, is_booking_blocked=self.is_booking_blocked, show=self.show_info_box,
|
||||
purchase_cb=self.on_purchase_clicked),
|
||||
SeatingPurchaseBox(
|
||||
show=self.show_purchase_box,
|
||||
seat_id=self.current_seat_id,
|
||||
is_loading=self.purchase_box_loading,
|
||||
confirm_cb=self.on_purchase_confirmed,
|
||||
cancel_cb=self.on_purchase_cancelled,
|
||||
error_msg=self.purchase_box_error_msg,
|
||||
success_msg=self.purchase_box_success_msg
|
||||
)
|
||||
)
|
||||
),
|
||||
grow_x=True
|
||||
MainViewContentBox(
|
||||
SeatingPlan(seat_clicked_cb=self.on_seat_clicked, seating_info=self.seating_info) if self.seating_info else
|
||||
Column(ProgressCircle(color=self.session.theme.secondary_color, margin=3),
|
||||
Text("Sitzplan wird geladen", style=TextStyle(fill=self.session.theme.neutral_color), align_x=0.5, margin=1))
|
||||
),
|
||||
MainViewContentBox(
|
||||
SeatingPlanLegend(),
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@ from rio import Column, Component, event, TextStyle, Text
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
|
||||
class PAGENAME(Component):
|
||||
@event.on_populate
|
||||
@ -10,31 +10,29 @@ class PAGENAME(Component):
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - PAGENAME")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="HEADER",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="HEADER",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
Text(
|
||||
text="BASIC TEXT",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
wrap=True
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="BASIC TEXT",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
overflow="wrap"
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
@ -2,7 +2,7 @@ from rio import Column, Component, event, TextStyle, Text
|
||||
|
||||
from src.ez_lan_manager import ConfigurationService
|
||||
from src.ez_lan_manager.components.MainViewContentBox import MainViewContentBox
|
||||
from src.ez_lan_manager.pages import BasePage
|
||||
|
||||
|
||||
class TournamentsPage(Component):
|
||||
@event.on_populate
|
||||
@ -10,31 +10,29 @@ class TournamentsPage(Component):
|
||||
await self.session.set_title(f"{self.session[ConfigurationService].get_lan_info().name} - Turniere")
|
||||
|
||||
def build(self) -> Component:
|
||||
return BasePage(
|
||||
content=Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Turniere",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
return Column(
|
||||
MainViewContentBox(
|
||||
Column(
|
||||
Text(
|
||||
text="Turniere",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=1.2
|
||||
),
|
||||
Text(
|
||||
text="Aktuell ist noch kein Turnierplan hinterlegt.",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
wrap=True
|
||||
)
|
||||
margin_top=2,
|
||||
margin_bottom=0,
|
||||
align_x=0.5
|
||||
),
|
||||
Text(
|
||||
text="Aktuell ist noch kein Turnierplan hinterlegt.",
|
||||
style=TextStyle(
|
||||
fill=self.session.theme.background_color,
|
||||
font_size=0.9
|
||||
),
|
||||
margin=1,
|
||||
overflow="wrap"
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
)
|
||||
),
|
||||
align_y=0
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user