Initial page
Some checks failed
Game Ideas build for PR / build_blazor_app (pull_request) Failing after 30s
Some checks failed
Game Ideas build for PR / build_blazor_app (pull_request) Failing after 30s
This commit is contained in:
@@ -8,7 +8,7 @@ using Microsoft.AspNetCore.Components;
|
||||
|
||||
namespace GameIdeas.BlazorApp.Pages.Games;
|
||||
|
||||
public partial class Game
|
||||
public partial class Games
|
||||
{
|
||||
[Inject] private IGameGateway GameGateway { get; set; } = default!;
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
@ChildContent
|
||||
|
||||
<div class="account-add-container">
|
||||
@if (DisplayAdd)
|
||||
{
|
||||
<AuthorizeView Roles="@GlobalConstants.ADMIN_MEMBER">
|
||||
<Authorized>
|
||||
<div class="add-buttons">
|
||||
@@ -36,6 +38,7 @@
|
||||
</div>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
}
|
||||
|
||||
<UserMenu />
|
||||
</div>
|
||||
|
||||
@@ -8,7 +8,8 @@ namespace GameIdeas.BlazorApp.Pages.Games.Header;
|
||||
|
||||
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; }
|
||||
|
||||
|
||||
@@ -39,6 +40,6 @@ public partial class GameHeader : ComponentBase
|
||||
private async Task HandleAddTypeClicked(IEnumerable<KeyValuePair<AddType, string>> values)
|
||||
{
|
||||
SelectListAdd?.Close();
|
||||
await AddTypeChanged.InvokeAsync(values.FirstOrDefault().Key);
|
||||
await AddTypeChanged?.InvokeAsync(values.FirstOrDefault().Key)!;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
|
||||
<AuthorizeView Roles="@GlobalConstants.ADMINISTRATOR">
|
||||
<Authorized>
|
||||
<div class="menu-element">
|
||||
<a class="menu-element" href="/Users">
|
||||
@ResourcesKey.UserManager
|
||||
</div>
|
||||
</a>
|
||||
<span class="line"></span>
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
@@ -36,6 +36,8 @@
|
||||
}
|
||||
|
||||
.menu-element {
|
||||
color: var(--white);
|
||||
text-decoration: none;
|
||||
height: 32px;
|
||||
padding: 0 20px;
|
||||
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 string? Username { get; set; }
|
||||
public string? Password { get; set; }
|
||||
public string? RoleId { get; set; }
|
||||
public RoleDto? Role { get; set; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user