Add user manager page #22
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Components;
|
|||||||
|
|
||||||
namespace GameIdeas.BlazorApp.Pages.Games;
|
namespace GameIdeas.BlazorApp.Pages.Games;
|
||||||
|
|
||||||
public partial class Game
|
public partial class Games
|
||||||
{
|
{
|
||||||
[Inject] private IGameGateway GameGateway { get; set; } = default!;
|
[Inject] private IGameGateway GameGateway { get; set; } = default!;
|
||||||
|
|
||||||
@@ -17,25 +17,28 @@
|
|||||||
@ChildContent
|
@ChildContent
|
||||||
|
|
||||||
<div class="account-add-container">
|
<div class="account-add-container">
|
||||||
<AuthorizeView Roles="@GlobalConstants.ADMIN_MEMBER">
|
@if (DisplayAdd)
|
||||||
<Authorized>
|
{
|
||||||
<div class="add-buttons">
|
<AuthorizeView Roles="@GlobalConstants.ADMIN_MEMBER">
|
||||||
<div class="first-button button">
|
<Authorized>
|
||||||
<svg class="button-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<div class="add-buttons">
|
||||||
<path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
<div class="first-button button">
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
<Select @ref="SelectListAdd" TItem="KeyValuePair<AddType, string>" THeader="object"
|
|
||||||
ValuesChanged=HandleAddTypeClicked Params=SelectParams Theme="SelectTheme.Navigation">
|
|
||||||
<div class="second-button button">
|
|
||||||
<svg class="button-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
<svg class="button-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
<path d="M1 3H23L12 22" />
|
<path d="M19,13H13V19H11V13H5V11H11V5H13V11H19V13Z" />
|
||||||
</svg>
|
</svg>
|
||||||
</div>
|
</div>
|
||||||
</Select>
|
<Select @ref="SelectListAdd" TItem="KeyValuePair<AddType, string>" THeader="object"
|
||||||
</div>
|
ValuesChanged=HandleAddTypeClicked Params=SelectParams Theme="SelectTheme.Navigation">
|
||||||
</Authorized>
|
<div class="second-button button">
|
||||||
</AuthorizeView>
|
<svg class="button-icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24">
|
||||||
|
<path d="M1 3H23L12 22" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</Select>
|
||||||
|
</div>
|
||||||
|
</Authorized>
|
||||||
|
</AuthorizeView>
|
||||||
|
}
|
||||||
|
|
||||||
<UserMenu />
|
<UserMenu />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,7 +8,8 @@ namespace GameIdeas.BlazorApp.Pages.Games.Header;
|
|||||||
|
|
||||||
public partial class GameHeader : ComponentBase
|
public partial class GameHeader : ComponentBase
|
||||||
{
|
{
|
||||||
[Parameter] public EventCallback<AddType> AddTypeChanged { get; set; }
|
[Parameter] public bool DisplayAdd { get; set; } = true;
|
||||||
|
[Parameter] public EventCallback<AddType>? AddTypeChanged { get; set; }
|
||||||
[Parameter] public RenderFragment? ChildContent { get; set; }
|
[Parameter] public RenderFragment? ChildContent { get; set; }
|
||||||
|
|
||||||
|
|
||||||
@@ -39,6 +40,6 @@ public partial class GameHeader : ComponentBase
|
|||||||
private async Task HandleAddTypeClicked(IEnumerable<KeyValuePair<AddType, string>> values)
|
private async Task HandleAddTypeClicked(IEnumerable<KeyValuePair<AddType, string>> values)
|
||||||
{
|
{
|
||||||
SelectListAdd?.Close();
|
SelectListAdd?.Close();
|
||||||
await AddTypeChanged.InvokeAsync(values.FirstOrDefault().Key);
|
await AddTypeChanged?.InvokeAsync(values.FirstOrDefault().Key)!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,9 +23,9 @@
|
|||||||
|
|
||||||
<AuthorizeView Roles="@GlobalConstants.ADMINISTRATOR">
|
<AuthorizeView Roles="@GlobalConstants.ADMINISTRATOR">
|
||||||
<Authorized>
|
<Authorized>
|
||||||
<div class="menu-element">
|
<a class="menu-element" href="/Users">
|
||||||
@ResourcesKey.UserManager
|
@ResourcesKey.UserManager
|
||||||
</div>
|
</a>
|
||||||
<span class="line"></span>
|
<span class="line"></span>
|
||||||
</Authorized>
|
</Authorized>
|
||||||
</AuthorizeView>
|
</AuthorizeView>
|
||||||
|
|||||||
@@ -36,6 +36,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.menu-element {
|
.menu-element {
|
||||||
|
color: var(--white);
|
||||||
|
text-decoration: none;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
|
|||||||
@@ -0,0 +1,42 @@
|
|||||||
|
@page "/Users"
|
||||||
|
@using GameIdeas.BlazorApp.Pages.Games.Header
|
||||||
|
@using GameIdeas.BlazorApp.Layouts
|
||||||
|
@using GameIdeas.BlazorApp.Shared.Components.Popup
|
||||||
|
@using GameIdeas.BlazorApp.Shared.Components.Search
|
||||||
|
@using GameIdeas.BlazorApp.Shared.Components.SelectSearch
|
||||||
|
@using GameIdeas.Shared.Dto
|
||||||
|
|
||||||
|
@layout MainLayout
|
||||||
|
|
||||||
|
<PageTitle>@ResourcesKey.GamesIdeas</PageTitle>
|
||||||
|
|
||||||
|
<GameHeader DisplayAdd="false">
|
||||||
|
<div class="header-content">
|
||||||
|
<SearchInput />
|
||||||
|
<SelectSearch TItem="RoleDto" />
|
||||||
|
</div>
|
||||||
|
</GameHeader>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="content">
|
||||||
|
@if (!IsLoading)
|
||||||
|
{
|
||||||
|
@foreach (var user in UsersDto)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
@for (int i = 0; i < 20; i++)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<Popup @ref=Popup Closable=false>
|
||||||
|
|
||||||
|
</Popup>
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
using GameIdeas.BlazorApp.Shared.Components.Popup;
|
||||||
|
using GameIdeas.Shared.Dto;
|
||||||
|
|
||||||
|
namespace GameIdeas.BlazorApp.Pages.Users;
|
||||||
|
|
||||||
|
public partial class Users
|
||||||
|
{
|
||||||
|
private Popup? Popup;
|
||||||
|
private bool IsLoading = false;
|
||||||
|
private IEnumerable<UserDto> UsersDto = [];
|
||||||
|
|
||||||
|
private void HandleBackdropClicked()
|
||||||
|
{
|
||||||
|
Popup?.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
|
||||||
7
src/GameIdeas/GameIdeas.Shared/Dto/RoleDto.cs
Normal file
7
src/GameIdeas/GameIdeas.Shared/Dto/RoleDto.cs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
namespace GameIdeas.Shared.Dto;
|
||||||
|
|
||||||
|
public class RoleDto
|
||||||
|
{
|
||||||
|
public string Id { get; set; } = string.Empty;
|
||||||
|
public string Name { get; set; } = string.Empty;
|
||||||
|
}
|
||||||
@@ -7,5 +7,5 @@ public class UserDto
|
|||||||
public int? Id { get; set; }
|
public int? Id { get; set; }
|
||||||
public string? Username { get; set; }
|
public string? Username { get; set; }
|
||||||
public string? Password { get; set; }
|
public string? Password { get; set; }
|
||||||
public string? RoleId { get; set; }
|
public RoleDto? Role { get; set; }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user