aboutsummaryrefslogtreecommitdiff
path: root/src/match_up/view.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/match_up/view.py')
-rw-r--r--src/match_up/view.py96
1 files changed, 0 insertions, 96 deletions
diff --git a/src/match_up/view.py b/src/match_up/view.py
deleted file mode 100644
index 8fa1c54..0000000
--- a/src/match_up/view.py
+++ /dev/null
@@ -1,96 +0,0 @@
-from dash.html import Div, H4, Thead, Tbody, Tr, Td, Th
-from match_up.model import Player, Game
-from dash_bootstrap_components import (
- Row,
- Col,
- Container,
- Input,
- Select,
- Table,
- NavbarSimple,
-)
-
-
-class GameLayout:
- def __init__(self, game_list: list[Game]):
- table_header = [Thead(Tr([Th("Court"), Th("Team 1"), Th("Team 2")]))]
- table_body = [
- Tbody(
- [
- Tr(
- [
- Td(children=game.court_number),
- Td(children=game.team_1.__str__()),
- Td(children=game.team_2.__str__()),
- ]
- )
- for game in game_list
- ]
- )
- ]
- self._layout = Div(
- [
- H4(children="Game List", style={"textAlign": "center"}),
- Table(table_header + table_body, bordered=True),
- ]
- )
-
- def get(self):
- return self._layout
-
-
-class PlayerLayout:
- def __init__(self, player_list: list[Player]):
- table_header = [Thead(Tr([Th("Player Name")]))]
- table_body = [
- Tbody(
- [
- Tr(
- [
- Td(
- children=player.first_name + " " + player.last_name,
- style={"color": ("green" if player.status else "red")},
- )
- ]
- )
- for player in player_list
- ]
- )
- ]
- self._layout = Div(
- [
- H4(children="Player List", style={"textAlign": "center"}),
- Table(table_header + table_body, bordered=True),
- ]
- )
-
- def get(self):
- return self._layout
-
-
-class MainLayout:
- def __init__(self, player_list: list[Player], game_list: list[Game]):
- self._player_layout = PlayerLayout(player_list)
- self._game_layout = GameLayout(game_list)
-
- def refresh(): ...
-
- def get(self):
- full_layout = Div(
- [
- NavbarSimple(brand="Match Up!"),
- Container(
- [
- Row(
- [
- Col([self._game_layout.get()], width=9),
- Col([self._player_layout.get()], width=3),
- ],
- style={"margin": "15px"},
- )
- ]
- ),
- ]
- )
- # full_layout = Div([Div(children="Hello World")])
- return full_layout