111 lines
3 KiB
Text
111 lines
3 KiB
Text
@using System.Security.Claims
|
|
@using Lieb.Data
|
|
@using Lieb.Models
|
|
@using Lieb.Models.GuildWars2.Raid
|
|
@inject UserService UserService
|
|
@inject RaidService RaidService
|
|
@inject TimeZoneService TimeZoneService
|
|
@inject NavigationManager NavigationManager
|
|
@inject RaidRandomizerService RaidRandomizerService
|
|
|
|
<body>
|
|
|
|
<div @onclick="() => _isCollapsed = !_isCollapsed">
|
|
<h5>@_template.Title</h5>
|
|
|
|
<label style="white-space: pre-line">@_template.Description</label>
|
|
|
|
<span class="timesblock">
|
|
@if(_template.EndTime - _template.StartTime > new TimeSpan(24,0,0))
|
|
{
|
|
<span class="times">
|
|
<h5>From</h5>
|
|
<p>@_template.StartTime.ToLongDateString() @_template.StartTime.ToShortTimeString()</p>
|
|
</span>
|
|
<span class="times">
|
|
<h5>To</h5>
|
|
<p>@_template.EndTime.ToLongDateString() @_template.EndTime.ToShortTimeString()</p>
|
|
</span>
|
|
}
|
|
else
|
|
{
|
|
<div class="times">
|
|
<h5>Date</h5>
|
|
<p>@_template.StartTime.ToLongDateString()</p>
|
|
</div>
|
|
<div class="times">
|
|
<h5>Time</h5>
|
|
<p>from: @_template.StartTime.ToShortTimeString() to: @_template.EndTime.ToShortTimeString()</p>
|
|
</div>
|
|
}
|
|
<div class="times">
|
|
<h5>TimeZone</h5>
|
|
<p>@_template.TimeZone</p>
|
|
</div>
|
|
<div class="times">
|
|
<h5>Type</h5>
|
|
<p>@_template.EventType</p>
|
|
</div>
|
|
</span>
|
|
</div>
|
|
|
|
@if (!_isCollapsed)
|
|
{
|
|
|
|
<div>
|
|
<div class="details">
|
|
<h5>Organizer</h5>
|
|
<p>@_template.Organizer</p>
|
|
</div>
|
|
<div class="details">
|
|
<h5>Guild</h5>
|
|
<p>@_template.Guild</p>
|
|
</div>
|
|
<div class="details">
|
|
<h5>Voice chat</h5>
|
|
<p>@_template.VoiceChat</p>
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<div>
|
|
<table class="table">
|
|
<tbody>
|
|
@foreach (var role in _template.Roles.OrderBy(r => r.RaidRoleId))
|
|
{
|
|
<tr>
|
|
<td><Label> <b>@role.Name</b> (@role.Spots) <br> @role.Description </Label></td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
|
|
|
|
<AuthorizeView>
|
|
@if (_template.RaidOwnerId == _user.Id || _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
|
{
|
|
<button class="controlButton raidButton" @onclick="() => EditClicked()">Edit</button>
|
|
}
|
|
</AuthorizeView>
|
|
}
|
|
</body>
|
|
|
|
@code {
|
|
[Parameter]
|
|
public RaidTemplate _template { get; set; }
|
|
|
|
[Parameter]
|
|
public LiebUser? _user { get; set; }
|
|
|
|
bool _isCollapsed = true;
|
|
|
|
protected override async Task OnParametersSetAsync()
|
|
{
|
|
}
|
|
|
|
async Task EditClicked()
|
|
{
|
|
NavigationManager.NavigateTo($"raidtemplateedit/{_template.RaidTemplateId}");
|
|
}
|
|
}
|