From e2677b60a3aa6e4c78754948f82c7b323f45d1ed Mon Sep 17 00:00:00 2001 From: julius Date: Fri, 19 Dec 2025 09:18:16 +0100 Subject: [PATCH] restyle TeamPanel and Calendar --- cutt/analysis.py | 1 + frontend/src/Calendar.tsx | 125 +++++++++++++++++++------------ frontend/src/TeamPanel.tsx | 146 +++++++++++++++++++------------------ 3 files changed, 154 insertions(+), 118 deletions(-) diff --git a/cutt/analysis.py b/cutt/analysis.py index ace0228..a884aa2 100644 --- a/cutt/analysis.py +++ b/cutt/analysis.py @@ -344,6 +344,7 @@ def last_submissions( times[r.time.date()] = {} times[r.time.date()][r.user] = ( times[r.time.date()].get(r.user, "") + + " " + translate_tablename[survey.__tablename__] ) return times diff --git a/frontend/src/Calendar.tsx b/frontend/src/Calendar.tsx index 36bdd25..292b1e6 100644 --- a/frontend/src/Calendar.tsx +++ b/frontend/src/Calendar.tsx @@ -55,16 +55,35 @@ const Calendar = ({ playerId }: { playerId: number }) => { // Render month navigation const renderMonthNavigation = () => { return ( -
- - - - {selectedDate.toLocaleString("default", { - month: "long", - year: "numeric", - })} - - +
+

+ +

+

+ +

+

+ +

); }; @@ -89,11 +108,14 @@ const Calendar = ({ playerId }: { playerId: number }) => { const date = new Date(0); date.setDate(i + 5); days.push( -
+
+ ); } @@ -109,34 +131,34 @@ const Calendar = ({ playerId }: { playerId: number }) => { const todaysEvents = getEventsForDay(date); days.push( -
handleDayClick(date)} > -
- {day} -
-
+ {day} + ); day++; } - return
{days}
; + return ( +
+
{days}
+
+ ); }; // Render events for the selected day @@ -144,29 +166,38 @@ const Calendar = ({ playerId }: { playerId: number }) => { const eventsForDay = getEventsForDay(selectedDate); return (
- {eventsForDay && ( -
    - {Object.entries(eventsForDay).map(([id, sub]) => { - const name = players?.find((p) => p.id === Number(id)); - return ( -
  • - {name !== undefined ? name.display_name : ""}:{" "} - {sub} -
  • - ); - })} -
- )} + {eventsForDay && + Object.entries(eventsForDay).map(([id, sub]) => { + const name = players?.find((p) => p.id === Number(id)); + return ( +

+

+
+ + {name !== undefined ? name.display_name : ""} + + + {sub} + +
+
+

+ ); + })}
); }; return ( -
-

Latest Submissions

- {renderMonthNavigation()} - {renderCalendar()} - {renderEvents()} +
+

Latest Submissions

+
+
+ {renderMonthNavigation()} + {renderCalendar()} +
+
{renderEvents()}
+
); }; diff --git a/frontend/src/TeamPanel.tsx b/frontend/src/TeamPanel.tsx index 0e7b783..d759d94 100644 --- a/frontend/src/TeamPanel.tsx +++ b/frontend/src/TeamPanel.tsx @@ -70,29 +70,21 @@ const TeamPanel = () => { (team) => team.id == teams?.activeTeam )[0]; return ( -
-

{activeTeam.name}

-
- -
- -
- -

players

+
+

{activeTeam.name}

+

+ {activeTeam.location}, {activeTeam.country} +

+
+

Players

{players ? ( -
+
{players.map((p) => ( ))}
-
-
- + +
+ +
{ }} />
-
- +
+
+ +
{ }} />
-
- - +
+
+ +
+
+ +
-
- +
+
+ +
{ @@ -177,9 +181,12 @@ const TeamPanel = () => { }} />
-
- +
+
+ +
{ @@ -188,36 +195,33 @@ const TeamPanel = () => { }} />
-
- {error?.message && ( - - {error.message} - - )} -
-
- -
- {player.id !== 0 && ( -
- -
+ {error?.message && ( +

+ {error.message} +

)} - -
+
+
+ + {player.id !== 0 && ( + + )} +
+ -
+
); } else ; };