@using SharedLibraryCore.Database.Models @using SharedLibraryCore.Interfaces @using SharedLibraryCore @model SharedLibraryCore.Dtos.PlayerInfo @{ string match = System.Text.RegularExpressions.Regex.Match(Model.Name.ToUpper(), "[A-Z]").Value; string shortCode = match == string.Empty ? "?" : match; var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex; string gravatarUrl = Model.Meta.FirstOrDefault(m => m.Key == "GravatarEmail")?.Value; bool isFlagged = Model.LevelInt == (int)SharedLibraryCore.Database.Models.EFClient.Permission.Flagged; bool isPermBanned = Model.LevelInt == (int)SharedLibraryCore.Database.Models.EFClient.Permission.Banned; bool isTempBanned = Model.ActivePenalty?.Type == EFPenalty.PenaltyType.TempBan; string translationKey = $"WEBFRONT_PROFILE_{Model.ActivePenalty?.Type.ToString().ToUpper()}_INFO"; var ignoredMetaTypes = new[] { MetaType.Information, MetaType.Other, MetaType.QuickMessage }; }
@if (string.IsNullOrEmpty(gravatarUrl)) { @shortCode }
@if (ViewBag.Authorized) {
}
@if (ViewBag.Authorized) {
@foreach (var linked in Model.LinkedAccounts) { @Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new { id = linked.Key }, new { @class = "link-inverse" })
} @foreach (string alias in Model.Aliases) {
} @foreach (string ip in Model.IPs) { @ip
}
} @if (Model.ActivePenalty != null) {
@foreach (var result in Utilities.SplitTranslationTokens(translationKey)) { switch (result.MatchValue) { case "reason": @(ViewBag.Authorized ? !string.IsNullOrEmpty(Model.ActivePenalty.AutomatedOffense) && Model.ActivePenalty.Type != EFPenalty.PenaltyType.Warning ? Utilities.FormatExt(ViewBag.Localization["WEBFRONT_PROFILE_ANTICHEAT_DETECTION"], Model.ActivePenalty.AutomatedOffense) : Model.ActivePenalty.Offense : Model.ActivePenalty.Offense) break; case "time": @Utilities.HumanizeForCurrentCulture(Model.ActivePenalty.Expires.Value - DateTime.UtcNow) break; default: @result.MatchValue break; } }
} else {
@Model.Level
}
@if (ViewBag.Authorized) {
@if (!isPermBanned) { } @if (Model.LevelInt < (int)ViewBag.User.Level && !Model.HasActivePenalty) { } @if (Model.LevelInt < (int)ViewBag.User.Level && Model.HasActivePenalty) { @if (isTempBanned) { } else { } } @if (Model.LevelInt != -1) { }
}
@ViewBag.Localization["WEBFRONT_CLIENT_META_FILTER"]
@ViewBag.Localization["META_TYPE_ALL_NAME"] @foreach (MetaType type in Enum.GetValues(typeof(MetaType))) { if (!ignoredMetaTypes.Contains(type)) { @type.ToTranslatedName() } }
@await Component.InvokeAsync("ProfileMetaList", new { clientId = Model.ClientId, count = 30, offset = 0, startAt = DateTime.UtcNow, metaType = Model.MetaFilterType })
@section targetid { } @section scripts { }