@inject HttpClient Client
@inject IDialogService DialogService
@inject LoginService LoginService
@inject NavigationManager NavigationManager
@page "/Users"
Users
@if (response is null)
{
@for (uint i = 0; i < 3; i++)
{
}
}
else if (response.Users.Count != 0)
{
if (LoginService.IsAdmin || !LoginService.LoginRequired) // Admin mode, can see all users
{
@foreach (var user in response.Users)
{
User: @user.Baid
Show QR Code
Manage Access Codes
@if (LoginService.AllowUserDelete)
{
Delete User
}
Access Code
@user.AccessCodes[0]
@if (user.AccessCodes.Count > 1)
{
... and @(user.AccessCodes.Count-1) other access code(s)
}
Edit Profile
High Scores
Dani Dojo
}
}
else
{
@if (!LoginService.IsLoggedIn) // Not logged in, show login form
{
Login
Login
@if (!LoginService.OnlyAdmin)
{
Register
}
}
else
{
var user = LoginService.GetLoggedInUser(); // Logged in, show only own user
User: @user.Baid
Show QR Code
Manage Access Codes
@if (LoginService.AllowUserDelete)
{
Delete User
}
Access Code
@user.AccessCodes[0]
@if (user.AccessCodes.Count > 1)
{
... and @(user.AccessCodes.Count-1) other access code(s)
}
Edit Profile
High Scores
Dani Dojo
}
}
}
else
{ // No users in the database
No data.
}