From c9ce7a36d05625a6fd1bdb06744af165b35583b5 Mon Sep 17 00:00:00 2001 From: Anthony Correa Date: Sat, 2 Aug 2025 08:56:41 -0500 Subject: [PATCH] Integrate draft session support with phase handling and real-time updates - Added user authentication UI in the base template for navbar. - Expanded `league.dj.html` to include a new "Draft Sessions" tab showing active drafts. - Refactored Django views and models to support `DraftSession` with participants and movies. - Replaced deprecated models like `DraftParticipant` and `DraftMoviePool` with a new schema using `DraftSessionParticipant`. - Introduced WebSocket consumers (`DraftAdminConsumer`, `DraftParticipantConsumer`) with structured phase logic and caching. - Added `DraftStateManager` for managing draft state in Django cache. - Created frontend UI components in React for draft admin and participants, including phase control and WebSocket message logging. - Updated SCSS styles for improved UI structure and messaging area. --- boxofficefantasy/templates/base.dj.html | 11 +- boxofficefantasy/templates/league.dj.html | 127 +++--- boxofficefantasy/templates/leagues.dj.html | 4 +- boxofficefantasy/views.py | 253 +++++++----- draft/admin.py | 13 +- draft/constants.py | 48 +-- draft/consumers.py | 378 ++++++++---------- ..._remove_draftparticipant_draft_and_more.py | 64 +++ draft/models.py | 56 ++- draft/state.py | 137 +++++++ draft/templates/draft/room.dj.html | 5 +- draft/templates/draft/room_admin.dj.html | 3 + draft/views.py | 2 +- frontend/src/apps/draft/constants.js | 39 ++ frontend/src/apps/draft/index.jsx | 128 ++++-- frontend/src/scss/styles.scss | 27 +- 16 files changed, 811 insertions(+), 484 deletions(-) create mode 100644 draft/migrations/0006_remove_draftparticipant_draft_and_more.py create mode 100644 draft/state.py create mode 100644 frontend/src/apps/draft/constants.js diff --git a/boxofficefantasy/templates/base.dj.html b/boxofficefantasy/templates/base.dj.html index ba57089..bf3726c 100644 --- a/boxofficefantasy/templates/base.dj.html +++ b/boxofficefantasy/templates/base.dj.html @@ -18,7 +18,7 @@ -