forked from Sarah/Lieb-Website
reorganized Raid pages
This commit is contained in:
parent
f40903851e
commit
d0ff8251a2
16 changed files with 174 additions and 53 deletions
|
@ -1,44 +0,0 @@
|
|||
@page "/raidtemplateoverview"
|
||||
@using Lieb.Data
|
||||
@using System.Security.Claims
|
||||
@using Lieb.Models
|
||||
@using Lieb.Models.GuildWars2.Raid
|
||||
@inject RaidTemplateService RaidTemplateService
|
||||
@inject UserService UserService
|
||||
@inject AuthenticationStateProvider AuthenticationStateProvider
|
||||
|
||||
|
||||
<h3>RaidTemplateOverview</h3>
|
||||
|
||||
|
||||
<AuthorizeView Policy="@Constants.Roles.RaidLead.Name">
|
||||
<div class="nav-item px-3">
|
||||
<NavLink class="nav-link" href="raidtemplateedit">
|
||||
<span class="oi oi-plus" aria-hidden="true"></span> Add Raid
|
||||
</NavLink>
|
||||
</div>
|
||||
</AuthorizeView>
|
||||
|
||||
@foreach (var raid in _templates.OrderBy(r => r.StartTime))
|
||||
{
|
||||
<br />
|
||||
<RaidTemplateDetails _template=@raid _user=@_user/>
|
||||
}
|
||||
|
||||
@code
|
||||
{
|
||||
private List<RaidTemplate> _templates;
|
||||
private LiebUser? _user;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
_templates = RaidTemplateService.GetTemplates();
|
||||
var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
|
||||
|
||||
if (authState.User.Identity.IsAuthenticated)
|
||||
{
|
||||
ulong discordId = ulong.Parse(authState.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value);
|
||||
_user = UserService.GetLiebUser(discordId);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue