added support for External users
fixed potential errors
This commit is contained in:
parent
a47bc3207d
commit
62dc3d1efa
10 changed files with 257 additions and 130 deletions
|
@ -17,7 +17,7 @@
|
|||
@if (_user != null && _isRaidSignUpAllowed)
|
||||
{
|
||||
<div class="signUpStatusTooltip">
|
||||
@if(_raid.SignUps.Where(s => s.LiebUserId == _user.Id && s.SignUpType != SignUpType.SignedOff).Any())
|
||||
@if(_raid.SignUps.Where(s => s.LiebUserId == _user.Id && s.SignUpType != SignUpType.SignedOff && s.LiebUserId > 0).Any())
|
||||
{
|
||||
<span class="oi oi-badge" style="color:green"></span>
|
||||
<span class="tooltiptext">You are signed up</span>
|
||||
|
|
|
@ -234,8 +234,8 @@
|
|||
{
|
||||
_raid = RaidService.GetRaid(parsedId);
|
||||
|
||||
if (_raid != null && (_raid.RaidOwnerId == _user.Id
|
||||
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel))
|
||||
if (_raid.RaidOwnerId == _user.Id
|
||||
|| _user.RoleAssignments.Max(a => a.LiebRole.Level) >= Constants.RaidEditPowerLevel)
|
||||
{
|
||||
_startTime = await TimeZoneService.GetLocalDateTime(_raid.StartTimeUTC);
|
||||
_endTime = await TimeZoneService.GetLocalDateTime(_raid.EndTimeUTC);
|
||||
|
@ -301,13 +301,7 @@
|
|||
{
|
||||
if(!_raid.Roles.Where(r => r.IsRandomSignUpRole).Any())
|
||||
{
|
||||
_raid.Roles.Add(new RaidRole()
|
||||
{
|
||||
Spots = 10,
|
||||
Name = "Random",
|
||||
Description = _raid.RaidType.ToString(),
|
||||
IsRandomSignUpRole = true
|
||||
});
|
||||
_raid.Roles.Add(RaidService.CreateRandomSignUpRole(_raid.RaidType));
|
||||
}
|
||||
|
||||
foreach(RaidRole role in _raid.Roles.Where(r => !r.IsRandomSignUpRole))
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
</thead>
|
||||
<tbody>
|
||||
@{
|
||||
bool isSignedUp = _raid.SignUps.Where(s => s.LiebUserId == _liebUserId && s.SignUpType != SignUpType.SignedOff).Any();
|
||||
bool isSignedUp = _raid.SignUps.Where(s => s.LiebUserId == _liebUserId && s.SignUpType != SignUpType.SignedOff && s.LiebUserId > 0).Any();
|
||||
}
|
||||
@foreach (ExpandableRole role in _expandableRoles.OrderBy(r => r.Role.RaidRoleId))
|
||||
{
|
||||
|
@ -141,7 +141,7 @@
|
|||
{
|
||||
if(_raid.SignUps.Where(s => s.LiebUserId == _liebUserId).Any() && signUpType != SignUpType.Flex)
|
||||
{
|
||||
RaidService.ChangeSignUpType(_raid.RaidId, _liebUserId, role.RaidRoleId, signUpType);
|
||||
await RaidService.ChangeSignUpType(_raid.RaidId, _liebUserId, role.RaidRoleId, signUpType);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -13,12 +13,12 @@
|
|||
{
|
||||
<tr>
|
||||
@{
|
||||
bool isUser = signUp.LiebUserId == _liebUserId;
|
||||
bool isLoggedInUser = signUp.LiebUserId == _liebUserId;
|
||||
string signUpStatus = string.Empty;
|
||||
@if (signUp.SignUpType != SignUpType.SignedUp && _signUpTypes.Count > 1) signUpStatus = $" - {signUp.SignUpType}";
|
||||
}
|
||||
|
||||
@if (isUser && _usableAccounts.Count > 1 && signUp.SignUpType != SignUpType.Flex)
|
||||
@if (isLoggedInUser && _usableAccounts.Count > 1 && signUp.SignUpType != SignUpType.Flex)
|
||||
{
|
||||
<td>
|
||||
<select class="accountselect" value=@signUp.GuildWars2AccountId @onchange="args => _Parent.ChangeAccount(args)">
|
||||
|
@ -29,7 +29,7 @@
|
|||
</select> @signUpStatus
|
||||
</td>
|
||||
}
|
||||
else if(isUser && _showUserColor)
|
||||
else if(isLoggedInUser && _showUserColor)
|
||||
{
|
||||
<td class="nametooltip username">
|
||||
@signUp.GuildWars2Account.AccountName @signUpStatus
|
||||
|
@ -39,13 +39,23 @@
|
|||
}
|
||||
</td>
|
||||
}
|
||||
else if(!signUp.IsExternalUser)
|
||||
{
|
||||
<td class="nametooltip">
|
||||
@signUp.GuildWars2Account.AccountName @signUpStatus
|
||||
@if(_showToolTip)
|
||||
{
|
||||
<span class="tooltiptext">@signUp.LiebUser.Name</span>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
else
|
||||
{
|
||||
<td class="nametooltip">
|
||||
@signUp.GuildWars2Account.AccountName @signUpStatus
|
||||
@signUp.ExternalUserName @signUpStatus
|
||||
@if(_showToolTip)
|
||||
{
|
||||
<span class="tooltiptext">@signUp.LiebUser.Name</span>
|
||||
<span class="tooltiptext">external user</span>
|
||||
}
|
||||
</td>
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue