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