From 3b2e0cf3cbcb292622e62a321b3b5f07f9d71060 Mon Sep 17 00:00:00 2001 From: "t.ruspekhofer" Date: Thu, 17 Mar 2022 23:44:25 +0100 Subject: [PATCH] made Raids collapsable --- Lieb/Pages/Raids/RaidDetails.razor | 133 +++++++++++++++-------------- 1 file changed, 70 insertions(+), 63 deletions(-) diff --git a/Lieb/Pages/Raids/RaidDetails.razor b/Lieb/Pages/Raids/RaidDetails.razor index e071f6c..0181fe2 100644 --- a/Lieb/Pages/Raids/RaidDetails.razor +++ b/Lieb/Pages/Raids/RaidDetails.razor @@ -10,76 +10,81 @@ - +
+ -
@_raid.Title -@if (_user != null && _isRaidSignUpAllowed) -{ -
- @if(_raid.SignUps.Where(s => s.LiebUserId == _user.LiebUserId).Any()) - { - - You are signed up - } - else if(_raid.SignUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count() < _raid.Roles.Sum(r => r.Spots)) - { - - You can sign up - } - else - { - - The raid is full - } -
-} -
+
@_raid.Title + @if (_user != null && _isRaidSignUpAllowed) + { +
+ @if(_raid.SignUps.Where(s => s.LiebUserId == _user.LiebUserId).Any()) + { + + You are signed up + } + else if(_raid.SignUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count() < _raid.Roles.Sum(r => r.Spots)) + { + + You can sign up + } + else + { + + The raid is full + } +
+ } +
- + - - -
Date
-

@_startTime.DateTime.ToLongDateString()

+ + +
Date
+

@_startTime.DateTime.ToLongDateString()

+
+ +
Time
+

from: @_startTime.DateTime.ToShortTimeString() to: @_endTime.DateTime.ToShortTimeString()

+
- -
Time
-

from: @_startTime.DateTime.ToShortTimeString() to: @_endTime.DateTime.ToShortTimeString()

-
-
- - - -
Organizer
-

@_raid.Organizer

-
- -
Guild
-

@_raid.Guild

-
- -
Voice chat
-

@_raid.VoiceChat

-
-
- - - - -
- - - - - - @if(_raid.RaidType != RaidType.Planned) - { - - } -
+ + @if (!_isCollapsed) + { + + +
Organizer
+

@_raid.Organizer

+
+ +
Guild
+

@_raid.Guild

+
+ +
Voice chat
+

@_raid.VoiceChat

+
+
+ + + + +
+ + + + + + @if (_raid.RaidType != RaidType.Planned) + { + + } + +
+ } @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);