made Raids collapsable

This commit is contained in:
t.ruspekhofer 2022-03-17 23:44:25 +01:00
parent 89ac7278e1
commit 3b2e0cf3cb

View file

@ -10,11 +10,12 @@
<body>
<label class="errormessage">@_errorMessage</label>
<div @onclick="() => _isCollapsed = !_isCollapsed">
<label class="errormessage">@_errorMessage</label>
<h5>@_raid.Title
@if (_user != null && _isRaidSignUpAllowed)
{
<h5>@_raid.Title
@if (_user != null && _isRaidSignUpAllowed)
{
<div class="signUpStatusTooltip">
@if(_raid.SignUps.Where(s => s.LiebUserId == _user.LiebUserId).Any())
{
@ -32,14 +33,14 @@
<span class="tooltiptext">The raid is full</span>
}
</div>
}
</h5>
}
</h5>
<label style="white-space: pre-line">@_raid.Description</label>
<label style="white-space: pre-line">@_raid.Description</label>
<span class="timesblock">
<span class="timesblock">
<span class="times">
<h5>Date</h5>
<p>@_startTime.DateTime.ToLongDateString()</p>
@ -48,9 +49,12 @@
<h5>Time</h5>
<p>from: @_startTime.DateTime.ToShortTimeString() to: @_endTime.DateTime.ToShortTimeString()</p>
</span>
</span>
</span>
</div>
<span class="detailsblock">
@if (!_isCollapsed)
{
<span class="detailsblock">
<span class="details">
<h5>Organizer</h5>
<p>@_raid.Organizer</p>
@ -63,23 +67,24 @@
<h5>Voice chat</h5>
<p>@_raid.VoiceChat</p>
</span>
</span>
</span>
<RaidRoles _raid=@_raid _user=@_user _isRaidSignUpAllowed=@_isRaidSignUpAllowed/>
<div>
<div>
<AuthorizeView>
<button class="controlButton" @onclick="() => SignOffClicked()">Sign Off</button>
</AuthorizeView>
<AuthorizeView Policy="@Constants.Roles.RaidLead">
<button class="controlButton" @onclick="() => EditClicked()">Edit</button>
@if(_raid.RaidType != RaidType.Planned)
@if (_raid.RaidType != RaidType.Planned)
{
<button class="controlButton" type=button @onclick="() => RandomizeClicked()">Randomize</button>
}
</AuthorizeView>
</div>
</div>
}
</body>
@code {
@ -97,6 +102,8 @@
private DateTimeOffset _endTime;
private DateTimeOffset _freeForAllTime;
bool _isCollapsed = true;
protected override async Task OnParametersSetAsync()
{
_isRaidSignUpAllowed = _user != null && RaidService.IsRaidSignUpAllowed(_user.LiebUserId, _raid.RaidId, out _errorMessage);