From 56bf0c5cdd26e80d40af07ea24fc77ef2fda73ec Mon Sep 17 00:00:00 2001 From: Amit Kaplansky <106595737+amitKaplansky@users.noreply.github.com> Date: Fri, 2 Jun 2023 10:58:18 +0300 Subject: [PATCH] Modify game event template Implement logic in join event --- game_event/models.py | 6 + .../templates/game_event/game-event.html | 153 +++++++------ .../templates/game_event/join-event.html | 15 +- game_event/templates/game_event/result.html | 19 -- game_event/tests.py | 47 ++-- game_event/views.py | 54 +++-- message/tests.py | 4 +- player/models.py | 11 + static/css/chat.css | 207 +++++++++--------- static/css/game-event.css | 45 +++- static/css/join-game-event.css | 32 +++ 11 files changed, 349 insertions(+), 244 deletions(-) delete mode 100644 game_event/templates/game_event/result.html create mode 100644 static/css/join-game-event.css diff --git a/game_event/models.py b/game_event/models.py index 8ff5418..23d502d 100644 --- a/game_event/models.py +++ b/game_event/models.py @@ -51,3 +51,9 @@ def validate_game_event(court, ball_game, min_number_of_players, max_number_of_p @staticmethod def is_ball_game_playable_at_court(court, ball_game): return CourtBallGame.is_ball_game_playable(court, ball_game) + + def is_event_full(self): + from game_event_player.models import GameEventPlayer + + current_players = GameEventPlayer.objects.filter(game_event=self).count() + return current_players == self.max_number_of_players diff --git a/game_event/templates/game_event/game-event.html b/game_event/templates/game_event/game-event.html index 3a72511..44382eb 100644 --- a/game_event/templates/game_event/game-event.html +++ b/game_event/templates/game_event/game-event.html @@ -2,32 +2,49 @@ {% block content %} {% load static %} + -
+ -Time: {{ time }}
-Level: {{ level_of_game }}
-Min Players: {{ min_number_of_players }}
-Max Players: {{ max_number_of_players }}
-Court: {{ court }} {{ neighborhood }}
-Game: {{ ball_game }}
-