diff --git a/Lieb/Pages/Raids/RaidDetails.razor b/Lieb/Pages/Raids/RaidDetails.razor index 1c22b12..8b5e57b 100644 --- a/Lieb/Pages/Raids/RaidDetails.razor +++ b/Lieb/Pages/Raids/RaidDetails.razor @@ -7,6 +7,9 @@ @inject RaidRandomizerService RaidRandomizerService + + +
@_raid.Title
@_raid.Description
@@ -37,115 +40,23 @@ - - - @{ - ulong discordId = ulong.Parse(@context.User.Claims.FirstOrDefault(c => c.Type == ClaimTypes.NameIdentifier).Value); - LiebUser user = UserService.GetLiebUser(discordId); - RaidSignUp userRole = _raid.SignUps.Where(s => s.LiebUserId == user.LiebUserId).FirstOrDefault(); - bool isSignedUp = userRole != null; - bool isRaidSignUpAllowed = RaidService.IsRaidSignUpAllowed(user.LiebUserId, _raid.RaidId, out string errorMessage); + @if(_isRaidSignUpAllowed) + { + if(_raid.RaidType == RaidType.Planned) + { + } - - - - @foreach (var role in _raid.Roles) - { - RaidSignUp[] signUps = _raid.SignUps.Where(s => s.PlannedRaidRoleId == role.PlannedRaidRoleId).ToArray(); - int usedSpots = signUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count(); + else + { + + } + } + else + { + + } - - @if (isRaidSignUpAllowed) - { - @if (RaidService.IsRoleSignUpAllowed(_raid.RaidId, user.LiebUserId, role.PlannedRaidRoleId, SignUpType.SignedUp, false)) - { - - - } - else - { - - - } - - - } - - - - @foreach (var signUp in signUps) - { - @if(signUp.SignUpType != SignUpType.SignedOff) - { - - @{bool isUser = isSignedUp && userRole.PlannedRaidRole.PlannedRaidRoleId == role.PlannedRaidRoleId && signUp.LiebUserId == user.LiebUserId;} - @if (isRaidSignUpAllowed) - { - - - - @if(isUser) - { - - } - else - { - - } - } - @{string signUpStatus = string.Empty;} - @if (signUp.SignUpType != SignUpType.SignedUp) signUpStatus = $" - {signUp.SignUpType}"; - - @if (isUser) - { - - } - else - { - - } - - } - } - } - -
@role.Name: @role.Description (@usedSpots /@role.Spots)
@signUp.LiebUser.Name - @signUpStatus @signUp.LiebUser.Name (@signUp.GuildWars2Account.AccountName) @signUpStatus
-
- -
- - - @foreach (var role in _raid.Roles) - { - Models.GuildWars2.Raid.RaidSignUp[] signUps = _raid.SignUps.Where(s => s.PlannedRaidRoleId == role.PlannedRaidRoleId).ToArray(); - int usedSpots = signUps.Where(s => s.SignUpType == SignUpType.SignedUp).Count(); - - - - - @foreach (var signUp in signUps) - { - if(signUp.SignUpType != SignUpType.SignedOff) - { - string signUpStatus = string.Empty; - if (signUp.SignUpType != SignUpType.SignedUp) signUpStatus = $" - {signUp.SignUpType}"; - - - - } - } - } - -
@role.Name: @role.Description (@usedSpots /@role.Spots)
@signUp.LiebUser.Name (@signUp.GuildWars2Account.AccountName) @signUpStatus
-
-
-
+