@page "/Users/{baid:int}/AccessCode" @inject HttpClient Client @inject IDialogService DialogService @inject AuthService AuthService @inject NavigationManager NavigationManager @inject BreadcrumbsStateContainer BreadcrumbsStateContainer @inject Utilities.StringUtil StringUtil; @if (AuthService.LoginRequired && (!AuthService.IsLoggedIn || (AuthService.GetLoggedInBaid() != Baid && !AuthService.IsAdmin))) { NavigationManager.NavigateTo(!AuthService.IsLoggedIn ? "/Login" : "/"); } else if (User is null) { // Loading ... } else { @Localizer["Add Access Code"] @Localizer["Add"] @Localizer["Access Code"] @for (var idx = 0; idx < User.AccessCodes.Count; idx++) { var accessCode = User.AccessCodes[idx]; var localIdx = idx + 1; @if (accessCode.Length % 4 == 0 && StringUtil.OnlyHexInString(accessCode)) { foreach (var digitGroup in StringUtil.SplitIntoGroups(accessCode, 4)) { @digitGroup } } else { @accessCode } @Localizer["Delete"] } }
@if (accessCode.Length % 4 == 0 && StringUtil.OnlyHexInString(accessCode)) { foreach (var digitGroup in StringUtil.SplitIntoGroups(accessCode, 4)) { @digitGroup } } else { @accessCode }