@using SharedLibraryCore.Interfaces @using Data.Models @using Data.Models.Client @model SharedLibraryCore.Dtos.PlayerInfo @{ var match = System.Text.RegularExpressions.Regex.Match(Model.Name.ToUpper(), "[A-Z]").Value; var shortCode = match == string.Empty ? "?" : match; var gravatarUrl = Model.Meta.FirstOrDefault(m => m.Key == "GravatarEmail")?.Value; var isFlagged = Model.LevelInt == (int)EFClient.Permission.Flagged; var isPermBanned = Model.LevelInt == (int)EFClient.Permission.Banned; var isTempBanned = Model.ActivePenalty?.Type == EFPenalty.PenaltyType.TempBan; var 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 (var alias in Model.Aliases) {
} @foreach (var ip in Model.IPs) {
@ip
}
} @if (Model.ActivePenalty != null && (Model.ActivePenalty.Type != EFPenalty.PenaltyType.Flag || ViewBag.Authorized)) {
@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.StripColors() : Model.ActivePenalty.Offense.StripColors()) break; case "time": @((Model.ActivePenalty.Expires.Value - DateTime.UtcNow).HumanizeForCurrentCulture()) break; default: @result.MatchValue break; } }
} else { if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy) {
@ViewBag.Localization["GLOBAL_PERMISSION_USER"]
} 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) { } } @if (ViewBag.UseNewStats) { }
@ViewBag.Localization["META_TYPE_ALL_NAME"] @{ var metaTypes = Enum.GetValues(typeof(MetaType)) .Cast() .Where(type => !ignoredMetaTypes.Contains(type)) .ToList(); } @foreach (var type in metaTypes.Take(4)) { @type.ToTranslatedName() } ...
@foreach (var type in metaTypes.Skip(4)) { @type.ToTranslatedName() }
@if ((!ViewBag.Authorized && !ViewBag.EnablePrivilegedUserPrivacy) || ViewBag.Authorized) {
@await Component.InvokeAsync("ProfileMetaList", new { clientId = Model.ClientId, count = 30, offset = 0, startAt = DateTime.UtcNow, metaType = Model.MetaFilterType })
}
@section targetid { } @section scripts { }