You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
51 lines
1.6 KiB
51 lines
1.6 KiB
@page "/banned-users"
|
|
@using HeartTrack.Models
|
|
|
|
<PageTitle>Banned Users</PageTitle>
|
|
|
|
<h1>Banned Users</h1>
|
|
|
|
This is banned users list of this website.
|
|
<div>
|
|
<NavLink class="btn btn-primary" href="banned-users/add" Match="NavLinkMatch.All">
|
|
<i class="fa fa-plus"></i> Ajouter
|
|
</NavLink>
|
|
</div>
|
|
|
|
<DataGrid TItem="User"
|
|
Data="@users"
|
|
ReadData="@OnReadData"
|
|
TotalItems="@totalUser"
|
|
PageSize="10"
|
|
ShowPager
|
|
Responsive>
|
|
<DataGridColumn TItem="User" Field="@nameof(User.Username)" Caption="Username" />
|
|
<DataGridColumn TItem="User" Field="@nameof(User.isBan)" Caption="#">
|
|
<DisplayTemplate>
|
|
@if(context.isBan)
|
|
{
|
|
<MudChip Variant="Variant.Outlined" Color="Color.Error">Banni</MudChip>
|
|
|
|
} else
|
|
{
|
|
<MudChip Variant="Variant.Outlined" Color="Color.Success">Libre</MudChip>
|
|
|
|
}
|
|
</DisplayTemplate>
|
|
</DataGridColumn>
|
|
<DataGridColumn TItem="User" Field="@nameof(User.Id)" Caption="Actions" Sortable="false" Width="150px">
|
|
<DisplayTemplate>
|
|
@if (context.isBan)
|
|
{
|
|
<MudFab Color="Color.Tertiary" StartIcon="@Icons.Material.Filled.LockOpen" Size="Size.Small" @onclick="()=>UnbanOnID(context.Id)" />
|
|
}
|
|
else
|
|
{
|
|
<MudFab Color="Color.Secondary" StartIcon="@Icons.Material.Filled.Lock" Size="Size.Small" @onclick="()=>BanOnID(context.Id)" />
|
|
}
|
|
</DisplayTemplate>
|
|
</DataGridColumn>
|
|
</DataGrid>
|
|
|
|
|