From befc678bdb6ec964f8c05563c71a0dda56970ff1 Mon Sep 17 00:00:00 2001 From: Pascal Syma Date: Sun, 10 Aug 2025 00:20:44 +0200 Subject: [PATCH] Add team member and hunt member management for admins --- TODO.md | 10 +- app/components/admin/Team.vue | 210 ++++++++++++++++++ app/lang/de.json | 2 +- app/layouts/default.vue | 15 ++ app/pages/hunt/[huntSlug]/admin.vue | 137 ++++++++++++ app/pages/hunt/[huntSlug]/index.vue | 26 ++- app/pages/hunt/[huntSlug]/teams.vue | 54 +++++ server/api/admin/hunt/[huntId]/index.get.ts | 1 - .../api/admin/hunt/[huntId]/member.delete.ts | 60 +++++ server/api/admin/hunt/[huntId]/member.post.ts | 116 ++++++++++ .../api/admin/hunt/[huntId]/teamless.get.ts | 88 ++++++++ server/api/admin/hunt/[huntId]/teams.get.ts | 83 +++++++ server/api/admin/team/[teamId]/add.post.ts | 110 +++++++++ .../api/admin/team/[teamId]/index.delete.ts | 47 ++++ server/api/admin/team/[teamId]/kick.post.ts | 62 ++++++ 15 files changed, 1009 insertions(+), 12 deletions(-) create mode 100644 app/components/admin/Team.vue create mode 100644 app/pages/hunt/[huntSlug]/teams.vue create mode 100644 server/api/admin/hunt/[huntId]/member.delete.ts create mode 100644 server/api/admin/hunt/[huntId]/member.post.ts create mode 100644 server/api/admin/hunt/[huntId]/teamless.get.ts create mode 100644 server/api/admin/hunt/[huntId]/teams.get.ts create mode 100644 server/api/admin/team/[teamId]/add.post.ts create mode 100644 server/api/admin/team/[teamId]/index.delete.ts create mode 100644 server/api/admin/team/[teamId]/kick.post.ts diff --git a/TODO.md b/TODO.md index 4d29c06..2b93361 100644 --- a/TODO.md +++ b/TODO.md @@ -4,11 +4,12 @@ - [x] Default random name - [ ] Change display name - **Hunt Admin** - - [ ] Start/Stop + - [x] Start/Stop - [ ] Add Reviews/Score - - [ ] View best Answers and Pictures + - [x] View best Answers and Pictures - [ ] All/Best Images gallery - - [ ] Manage teams (remove, kick, add) + - [x] Manage teams (remove, kick, add) + - [x] Manage admins (kick, add) - **Hunt User** - [x] Create Team - [x] Invite Members @@ -17,6 +18,7 @@ - [x] Change/Update Answer and image - [x] View Answers of other members, check for collisions! - [x] View own reviews and score + - [ ] Mark submission as final - **Nice to have** - **Auth** - [ ] Login with LDAP @@ -36,7 +38,7 @@ - [ ] Review other answers (Fan-Favorite) - [ ] View all images on one page - [ ] Notifications - - [ ] i18n + - [ ] i18n data - [ ] Process image uploads (resize, remove EXIF, etc.) - [ ] Mark image as private - [ ] Support chat diff --git a/app/components/admin/Team.vue b/app/components/admin/Team.vue new file mode 100644 index 0000000..7675d7a --- /dev/null +++ b/app/components/admin/Team.vue @@ -0,0 +1,210 @@ + + + + + diff --git a/app/lang/de.json b/app/lang/de.json index 3be0c85..1a48fcc 100644 --- a/app/lang/de.json +++ b/app/lang/de.json @@ -124,7 +124,7 @@ "movePaginationRight": "move pagination right", "next": "Nächstes", "nextPeriod": "next period", - "noOptions": "Items not found", + "noOptions": "Keine Elemente gefunden", "noSelectedOption": "Option is not selected", "ok": "OK", "openColorPicker": "open color picker", diff --git a/app/layouts/default.vue b/app/layouts/default.vue index c345013..fc9f92f 100644 --- a/app/layouts/default.vue +++ b/app/layouts/default.vue @@ -78,6 +78,21 @@ const slugs = computed(() => checkSlug(route.params)); Hunt Admin + + + + Hunt Teams + + Hunt admin members: +
+ Kick {{ member.member.name }} ({{ member.member.email }}) + No members yet +
+
+ Add admin +
diff --git a/app/pages/hunt/[huntSlug]/index.vue b/app/pages/hunt/[huntSlug]/index.vue index bca3c3d..96dc4e0 100644 --- a/app/pages/hunt/[huntSlug]/index.vue +++ b/app/pages/hunt/[huntSlug]/index.vue @@ -43,12 +43,26 @@ async function invite() {