diff --git a/src/client/public/manifest.webmanifest b/src/client/public/manifest.webmanifest index e4fcce2..50c8dd0 100644 --- a/src/client/public/manifest.webmanifest +++ b/src/client/public/manifest.webmanifest @@ -1,8 +1,6 @@ { "name": "Minigolf Freitag", "short_name": "Minigolf Freitag", - "theme_color": "#9e48d9", - "background_color": "#13276c", "display": "standalone", "scope": "./", "start_url": "./events", diff --git a/src/client/src/app/components/users/user-dialog/user-dialog.component.ts b/src/client/src/app/components/users/user-dialog/user-dialog.component.ts index 2a7cd7f..3318cf4 100644 --- a/src/client/src/app/components/users/user-dialog/user-dialog.component.ts +++ b/src/client/src/app/components/users/user-dialog/user-dialog.component.ts @@ -150,7 +150,7 @@ export class UserDialogComponent { ); } - public open(user?: User) { + public edit(user: User) { this.userToUpdate.set(user); this.form.reset( user @@ -169,6 +169,11 @@ export class UserDialogComponent { this.visible.set(true); } + public create(user: string) { + this.form.reset({ alias: user }); + this.visible.set(true); + } + protected onAddAvoid(user: User) { this.form.controls.preferences.controls.avoid.setValue([...this.avoid(), user.id]); } diff --git a/src/client/src/app/components/users/users.component.html b/src/client/src/app/components/users/users.component.html index 784cdfd..2c440a8 100644 --- a/src/client/src/app/components/users/users.component.html +++ b/src/client/src/app/components/users/users.component.html @@ -26,7 +26,7 @@
@@ -42,7 +42,7 @@ [rounded]="true" [text]="true" size="small" - (onClick)="dialog.open(user)" + (onClick)="dialog.edit(user)" />
} +
+

+ {{ translations.users_footer_admins() }}: + {{ admins().length }} + +

+

+ {{ translations.users_footer_players() }}: + {{ players().length }} + +

+
diff --git a/src/client/src/app/components/users/users.component.ts b/src/client/src/app/components/users/users.component.ts index 4a111fe..7c7f666 100644 --- a/src/client/src/app/components/users/users.component.ts +++ b/src/client/src/app/components/users/users.component.ts @@ -54,7 +54,19 @@ export class UsersComponent { protected readonly translations = inject(TranslateService).translations; protected readonly filter = signal(''); - protected readonly users = computed(() => this.filterUsers(this._allUsers(), this.filter())); + protected readonly players = computed(() => + this.filterUsers( + this._allUsers().filter(x => !x.roles.includes('admin')), + this.filter() + ) + ); + protected readonly admins = computed(() => + this.filterUsers( + this._allUsers().filter(x => x.roles.includes('admin')), + this.filter() + ) + ); + protected readonly users = computed(() => this.admins().concat(this.players())); protected readonly isLoading = computed(() => isActionBusy(this._actionState())); protected readonly hasFailed = computed(() => hasActionFailed(this._actionState())); diff --git a/src/client/src/app/i18n/de.json b/src/client/src/app/i18n/de.json index ffacb3e..2685084 100644 --- a/src/client/src/app/i18n/de.json +++ b/src/client/src/app/i18n/de.json @@ -170,6 +170,10 @@ "title": "Benutzer löschen", "text": "Möchtest du den Benutzer \"{{alias}}\" wirklich löschen?" }, + "footer": { + "players": "Spieler", + "admins": "Administratoren" + }, "dialog": { "addHeader": "Benutzer hinzufügen", "editHeader": "Benutzer \"{{alias}}\" bearbeiten", diff --git a/src/client/src/app/i18n/en.json b/src/client/src/app/i18n/en.json index b2d0ad0..1b3c642 100644 --- a/src/client/src/app/i18n/en.json +++ b/src/client/src/app/i18n/en.json @@ -170,6 +170,10 @@ "title": "Delete user", "text": "Are you sure you want to delete user \"{{alias}}\"?" }, + "footer": { + "players": "Players", + "admins": "Admins" + }, "dialog": { "addHeader": "Add user", "editHeader": "Edit user \"{{alias}}\"", diff --git a/src/client/src/index.html b/src/client/src/index.html index f937e89..5ff12e2 100644 --- a/src/client/src/index.html +++ b/src/client/src/index.html @@ -9,7 +9,6 @@ content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover" /> -