added stalking mode
This commit is contained in:
parent
c8673f9dde
commit
5c868d45c6
3 changed files with 90 additions and 6 deletions
51
Lieb/Pages/GuildWars2/AccountBuildOverview.razor
Normal file
51
Lieb/Pages/GuildWars2/AccountBuildOverview.razor
Normal file
|
@ -0,0 +1,51 @@
|
|||
@page "/gw2accountbuilds/{gw2Id}"
|
||||
@using Lieb.Data
|
||||
@using Lieb.Models
|
||||
@using Lieb.Models.GuildWars2
|
||||
@using System.ComponentModel.DataAnnotations
|
||||
@using System.Security.Claims
|
||||
@inject GuildWars2AccountService GuildWars2AccountService
|
||||
@inject GuildWars2BuildService GuildWars2BuildService
|
||||
@inject UserService UserService
|
||||
@inject NavigationManager NavigationManager
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
@inject IJSRuntime JsRuntime
|
||||
|
||||
<h3>Build Overview @_account.AccountName</h3>
|
||||
|
||||
<AuthorizeView Policy="@Constants.Roles.Admin.Name">
|
||||
<Authorized>
|
||||
|
||||
@if (_account.GuildWars2AccountId != 0)
|
||||
{
|
||||
<br/>
|
||||
<BuildList _account=@_account _allowEdit=false></BuildList>
|
||||
}
|
||||
|
||||
</Authorized>
|
||||
</AuthorizeView>
|
||||
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public string gw2Id { get; set; }
|
||||
|
||||
public GuildWars2Account _account;
|
||||
|
||||
private LiebUser _user;
|
||||
|
||||
private string _saveMessage = string.Empty;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
if(!string.IsNullOrEmpty(gw2Id) && int.TryParse(gw2Id, out int parsedId))
|
||||
{
|
||||
_account = GuildWars2AccountService.GetAccount(parsedId);
|
||||
}
|
||||
else
|
||||
{
|
||||
_account = new GuildWars2Account();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,12 +28,12 @@
|
|||
<input @bind="_searchString" />
|
||||
</label>
|
||||
|
||||
<table>
|
||||
<table class="usertable">
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>GW2 Account</th>
|
||||
<th style="padding-left: 15px;">Created At</th>
|
||||
<th style="padding-left: 15px;">Banned Until</th>
|
||||
<th>Created At</th>
|
||||
<th>Banned Until</th>
|
||||
</tr>
|
||||
@{
|
||||
HashSet<LiebUser> foundUsers = new HashSet<LiebUser>();
|
||||
|
@ -67,11 +67,26 @@
|
|||
@{string navLink = $"useredit/{@user.Id}";}
|
||||
<NavLink class="nav-link" href="@navLink">@user.Name</NavLink>
|
||||
</td>
|
||||
<td>@foreach(var account in user.GuildWars2Accounts){<div>@account.AccountName </div> }</td>
|
||||
<td style="padding-left: 15px;">@user.CreatedAt.ToShortDateString()</td>
|
||||
<td>
|
||||
@foreach(var account in user.GuildWars2Accounts)
|
||||
{
|
||||
<AuthorizeView Policy="@Constants.Roles.Admin.Name">
|
||||
<Authorized>
|
||||
<div>
|
||||
@{string navLink = $"gw2accountbuilds/{@account.GuildWars2AccountId}";}
|
||||
<NavLink class="nav-link" href="@navLink">@account.AccountName</NavLink>
|
||||
</div>
|
||||
</Authorized>
|
||||
<NotAuthorized>
|
||||
<div>@account.AccountName </div>
|
||||
</NotAuthorized>
|
||||
</AuthorizeView>
|
||||
}
|
||||
</td>
|
||||
<td>@user.CreatedAt.ToShortDateString()</td>
|
||||
@if(user.BannedUntil >= DateTime.Now.Date)
|
||||
{
|
||||
<td style="padding-left: 15px;">@user.BannedUntil?.ToShortDateString()</td>
|
||||
<td>@user.BannedUntil?.ToShortDateString()</td>
|
||||
}
|
||||
</tr>
|
||||
}
|
||||
|
|
18
Lieb/Pages/User/UserOverview.razor.css
Normal file
18
Lieb/Pages/User/UserOverview.razor.css
Normal file
|
@ -0,0 +1,18 @@
|
|||
.usertable{
|
||||
margin-top: 15px;
|
||||
border: 1px solid;
|
||||
|
||||
}
|
||||
|
||||
.usertable td {
|
||||
border: 1px solid;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
||||
|
||||
.usertable th {
|
||||
border: 1px solid;
|
||||
margin-left: 10px;
|
||||
padding-left: 8px;
|
||||
padding-right: 8px;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue