Add Sponsoring section to navigation #40
BIN
src/ezgg_lan_manager/assets/img/crackz.png
Normal file
BIN
src/ezgg_lan_manager/assets/img/crackz.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 57 KiB |
@ -5,6 +5,7 @@ from rio import *
|
||||
|
||||
from src.ezgg_lan_manager import ConfigurationService, UserService, LocalDataService
|
||||
from src.ezgg_lan_manager.components.DesktopNavigationButton import DesktopNavigationButton
|
||||
from src.ezgg_lan_manager.components.NavigationSponsorBox import NavigationSponsorBox
|
||||
from src.ezgg_lan_manager.components.UserInfoAndLoginBox import UserInfoAndLoginBox
|
||||
from src.ezgg_lan_manager.services.LocalDataService import LocalData
|
||||
from src.ezgg_lan_manager.types.SessionStorage import SessionStorage
|
||||
@ -44,7 +45,7 @@ class DesktopNavigation(Component):
|
||||
self.force_login_box_refresh.append(user_info_and_login_box.force_refresh)
|
||||
user_navigation = [
|
||||
DesktopNavigationButton("News", "./news"),
|
||||
Spacer(min_height=1),
|
||||
Spacer(min_height=0.7),
|
||||
DesktopNavigationButton(f"Über {lan_info.name} {lan_info.iteration}", "./overview"),
|
||||
DesktopNavigationButton("Ticket kaufen", "./buy_ticket"),
|
||||
DesktopNavigationButton("Sitzplan", "./seating"),
|
||||
@ -53,12 +54,12 @@ class DesktopNavigation(Component):
|
||||
DesktopNavigationButton("Turniere", "./tournaments"),
|
||||
DesktopNavigationButton("FAQ", "./faq"),
|
||||
DesktopNavigationButton("Regeln & AGB", "./rules-gtc"),
|
||||
Spacer(min_height=1),
|
||||
Spacer(min_height=0.7),
|
||||
DesktopNavigationButton("Discord", "https://discord.gg/8gTjg34yyH", open_new_tab=True),
|
||||
DesktopNavigationButton("Die EZ GG e.V.", "https://ezgg-ev.de/about", open_new_tab=True),
|
||||
DesktopNavigationButton("Kontakt", "./contact"),
|
||||
DesktopNavigationButton("Impressum & DSGVO", "./imprint"),
|
||||
Spacer(min_height=1)
|
||||
Spacer(min_height=0.7)
|
||||
]
|
||||
team_navigation = [
|
||||
Text("Verwaltung", align_x=0.5, margin_top=0.3, style=TextStyle(fill=Color.from_hex("F0EADE"), font_size=1.2)),
|
||||
@ -67,7 +68,7 @@ class DesktopNavigation(Component):
|
||||
DesktopNavigationButton("Benutzer", "./manage-users", is_team_navigation=True),
|
||||
DesktopNavigationButton("Catering", "./manage-catering", is_team_navigation=True),
|
||||
DesktopNavigationButton("Turniere", "./manage-tournaments", is_team_navigation=True),
|
||||
Spacer(min_height=1),
|
||||
Spacer(min_height=0.7),
|
||||
Revealer(
|
||||
header="Normale Navigation",
|
||||
content=Column(*user_navigation),
|
||||
@ -83,6 +84,8 @@ class DesktopNavigation(Component):
|
||||
Text(f"Edition {lan_info.iteration}", align_x=0.5, style=TextStyle(fill=self.session.theme.hud_color, font_size=1.2), margin_top=0.3, margin_bottom=2),
|
||||
user_info_and_login_box,
|
||||
*nav_to_use,
|
||||
Text("Unsere Sponsoren", align_x=0.5, style=TextStyle(fill=self.session.theme.hud_color, font_size=0.9), margin_bottom=0.5, margin_top=1),
|
||||
NavigationSponsorBox(img_name="crackz", url="https://www.crackz.gg/"),
|
||||
align_y=0
|
||||
),
|
||||
color=self.session.theme.neutral_color,
|
||||
|
||||
@ -102,5 +102,5 @@ class LoginBox(Component):
|
||||
min_width=12,
|
||||
align_x=0.5,
|
||||
margin_top=0.3,
|
||||
margin_bottom=2
|
||||
)
|
||||
margin_bottom=1.5
|
||||
)
|
||||
|
||||
23
src/ezgg_lan_manager/components/NavigationSponsorBox.py
Normal file
23
src/ezgg_lan_manager/components/NavigationSponsorBox.py
Normal file
@ -0,0 +1,23 @@
|
||||
from from_root import from_root
|
||||
from rio import Component, Link, Rectangle, Image, Color
|
||||
|
||||
|
||||
class NavigationSponsorBox(Component):
|
||||
img_name: str
|
||||
url: str
|
||||
img_suffix: str = "png"
|
||||
|
||||
def build(self) -> Component:
|
||||
return Link(
|
||||
content=Rectangle(
|
||||
content=Image(image=from_root(f"src/ezgg_lan_manager/assets/img/{self.img_name}.{self.img_suffix}"), min_width=10, min_height=10),
|
||||
stroke_width=0.1,
|
||||
stroke_color=Color.TRANSPARENT,
|
||||
hover_stroke_width=0.1,
|
||||
hover_stroke_color=self.session.theme.secondary_color,
|
||||
margin=0.6,
|
||||
cursor="pointer"
|
||||
),
|
||||
target_url=self.url,
|
||||
open_in_new_tab=True
|
||||
)
|
||||
@ -117,5 +117,5 @@ class UserInfoBox(Component):
|
||||
min_width=12,
|
||||
align_x=0.5,
|
||||
margin_top=0.3,
|
||||
margin_bottom=2
|
||||
margin_bottom=1.5
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user