Skip to content

Commit b1438be

Browse files
authored
Merge pull request #3094 from TechnologyEnhancedLearning/Develop/Fix/TD-5242-Issue-showing-Admin-link-as-active
TD-5242-Issue showing 'Admin' link as active on 'Super admin' section when re-registered the delegate account
2 parents 034e137 + d6a5f00 commit b1438be

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

DigitalLearningSolutions.Web/Views/SuperAdmin/Users/UserCentreAccounts.cshtml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,15 @@
5858
{
5959
if (centreRow.CentreId == admin.CentreId)
6060
{
61-
<a asp-action="RedirectToAdmin" asp-route-AdminId="@admin.Id">Admin@(admin.Active ? "" : "(Inactive)")</a>
61+
bool IsDelegateActive = false;
62+
foreach (var delegates in Model.UserEntity.DelegateAccounts)
63+
{
64+
if (centreRow.CentreId == delegates.CentreId)
65+
{
66+
IsDelegateActive = delegates.Active;
67+
}
68+
}
69+
<a asp-action="RedirectToAdmin" asp-route-AdminId="@admin.Id">Admin@(!admin.Active && IsDelegateActive ? "(Inactive)" : "")</a>
6270
}
6371
}
6472
}

0 commit comments

Comments
 (0)