diff options
| author | Karan Jayachandra <mail@karanjayachandra.com> | 2024-10-16 21:42:22 +0000 |
|---|---|---|
| committer | Karan Jayachandra <mail@karanjayachandra.com> | 2024-10-16 21:42:22 +0000 |
| commit | 7643486d7122b322a052bfca8ec83326c48053d0 (patch) | |
| tree | 096d2b629818f79674d22a14eff124f082449b6e /src/match_up/view.py | |
| parent | 9ef7d95c7010351078a929f5144f5098d4142cd0 (diff) | |
| parent | 36cc7d82a55cbd8167e1f52637dd1938497dd8cc (diff) | |
Merge branch 'develop' into 'main'
Full functionality available
See merge request KaranJayachandra/match_up!3
Diffstat (limited to 'src/match_up/view.py')
| -rw-r--r-- | src/match_up/view.py | 96 |
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 |
