- @ViewBag.Localization["GLOBAL_PERMISSION_USER"]
+
+
+
+ @if (string.IsNullOrEmpty(gravatarUrl))
+ {
+
@shortCode
+ }
- }
+
+
+
+
+
+
+
+
+
+ @if (Model.Aliases.Any())
+ {
+
+ }
+
- else
- {
-
- @Model.Level
+
+
+
+
+
+
+
+
+
+
+
+
+
@Model.NetworkId.ToString("X")
+
+
+
+
+
+
+
@Model.IPAddress
+
+
+
+ @if (Model.IPs.Any(ip => !string.IsNullOrEmpty(ip.Item1)))
+ {
+
+ }
+
+
+
+
+
- }
- }
-
+
-
- @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)
- {
-
- }
-
-
-
-
-
+
+
+
+
+
+
+
+
+ @foreach (var type in Enum.GetValues(typeof(MetaType)).Cast
().Where(meta => !ignoredMetaTypes.Contains(meta)).OrderByDescending(meta => meta == MetaType.All))
+ {
+ var buttonClass = !Model.MetaFilterType.HasValue && type == MetaType.All || Model.MetaFilterType.HasValue && Model.MetaFilterType.Value.ToString() == type.ToString() ? "btn-primary text-light" : "text-muted";
+
+
+
+
+ }
+
+
+ @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 })
+
+
+ }
+
+
+
+
+
+
+
-@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 })
-
-
-}
+
+@{
+ var menuItems = new SideContextMenuItems
+ {
+ MenuTitle = "Actions",
+ };
+
+ if (Model.Online)
+ {
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = "Join Game",
+ IsLink = true,
+ IsButton = true,
+ Reference = Model.ConnectProtocolUrl,
+ Tooltip = $"Playing on {Model.CurrentServerName.StripColors()}",
+ Icon = "oi-play-circle"
+ });
+ }
+
+ if (Model.LevelInt != -1 && ViewBag.Authorized)
+ {
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = "Change Level",
+ IsButton = true,
+ Reference = "edit",
+ Icon = "oi-cog",
+ });
+ }
+
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = "View Stats",
+ IsButton = true,
+ IsLink = true,
+ Reference = Url.Action("Advanced", "ClientStatistics", new { id = Model.ClientId }),
+ Icon = "oi-graph",
+ });
+
+ if (!isPermBanned && ViewBag.Authorized)
+ {
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = isFlagged ? "Unflag" : "Flag",
+ IsButton = true,
+ Reference = isFlagged ? "unflag" : "flag",
+ Icon = "oi-flag"
+ });
+ }
+
+ if ((Model.LevelInt < (int)ViewBag.User.Level && !Model.HasActivePenalty || isTempBanned) && ViewBag.Authorized)
+ {
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = "Ban",
+ IsButton = true,
+ Reference = "ban",
+ Icon = "oi-lock-unlocked",
+ });
+ }
+
+ if ((Model.LevelInt < (int)ViewBag.User.Level && Model.HasActivePenalty || isTempBanned) && ViewBag.Authorized)
+ {
+ menuItems.Items.Add(new SideContextMenuItem
+ {
+ Title = "Unban",
+ IsButton = true,
+ Reference = "unban",
+ Icon = "oi-lock-locked",
+ });
+ }
+}
+
-
@section targetid {
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_AdministeredPenaltyResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_AdministeredPenaltyResponse.cshtml
index a3f592d6d..00251b309 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_AdministeredPenaltyResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_AdministeredPenaltyResponse.cshtml
@@ -1,53 +1,60 @@
@using SharedLibraryCore.Dtos.Meta.Responses
@model AdministeredPenaltyResponse
@{
- string localizationKey = $"WEBFRONT_CLIENT_META_PENALIZED_{Model.PenaltyType.ToString().ToUpper()}_V2";
+ var localizationKey = $"WEBFRONT_CLIENT_META_PENALIZED_{Model.PenaltyType.ToString().ToUpper()}_V2";
}
-
- @foreach (var match in Utilities.SplitTranslationTokens(localizationKey))
+
+ @if (TempData["ShowMetaHeader"] as bool? ?? false)
{
- if (match.IsInterpolation)
- {
- if (match.MatchValue == "action")
- {
- @match.TranslationValue
- }
-
- else if (match.MatchValue == "offender")
- {
-
-
-
-
-
- }
-
- else if (match.MatchValue == "reason")
- {
-
- @if (ViewBag.Authorized && !string.IsNullOrEmpty(Model.AutomatedOffense) && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Warning)
- {
- @Utilities.FormatExt(ViewBag.Localization["WEBFRONT_PROFILE_ANTICHEAT_DETECTION"], Model.AutomatedOffense)
-
- }
- else
- {
-
- }
-
-
- }
-
- else if (match.MatchValue == "time")
- {
- @Model.LengthText
- }
- }
-
- else
- {
- @match.MatchValue
- }
+
}
-
+
+
+ @foreach (var match in Utilities.SplitTranslationTokens(localizationKey))
+ {
+ if (match.IsInterpolation)
+ {
+ if (match.MatchValue == "action")
+ {
+
@match.TranslationValue
+ }
+
+ else if (match.MatchValue == "offender")
+ {
+
+
+
+
+
+ }
+
+ else if (match.MatchValue == "reason")
+ {
+
+ @if (ViewBag.Authorized && !string.IsNullOrEmpty(Model.AutomatedOffense) && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Warning)
+ {
+ @Utilities.FormatExt(ViewBag.Localization["WEBFRONT_PROFILE_ANTICHEAT_DETECTION"], Model.AutomatedOffense)
+
+ }
+ else
+ {
+
+ }
+
+
+ }
+
+ else if (match.MatchValue == "time")
+ {
+
@Model.LengthText
+ }
+ }
+
+ else
+ {
+
@match.MatchValue
+ }
+ }
+
+
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_ConnectionHistoryResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_ConnectionHistoryResponse.cshtml
index c8bb5d3bf..302b71619 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_ConnectionHistoryResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_ConnectionHistoryResponse.cshtml
@@ -4,6 +4,11 @@
var localizationKey = $"WEBFRONT_CLIENT_META_CONNECTION_{Model.ConnectionType.ToString().ToUpper()}";
}
+@if (TempData["ShowMetaHeader"] as bool? ?? false)
+{
+
+}
+
@foreach (var token in Utilities.SplitTranslationTokens(localizationKey))
{
if (token.IsInterpolation)
@@ -11,10 +16,10 @@
switch (token.MatchValue)
{
case "action":
-
@token.TranslationValue
+
@token.TranslationValue
break;
case "server":
-
+
break;
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_Information.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_Information.cshtml
index 73db2ef79..450ec344d 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_Information.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_Information.cshtml
@@ -1,20 +1,20 @@
@model IEnumerable
@{
var informationMeta = Model
- .Where(_meta => _meta.Type == SharedLibraryCore.Interfaces.MetaType.Information)
- .OrderBy(_meta => _meta.Order)
- .GroupBy(_meta => _meta.Column)
- .OrderBy(_grouping => _grouping.Key);
+ .Where(meta => meta.Type == SharedLibraryCore.Interfaces.MetaType.Information)
+ .OrderBy(meta => meta.Order)
+ .Select((meta, i) => new { index = i, meta })
+ .GroupBy(meta => meta.index / 5);
}
@foreach (var metaColumn in informationMeta)
{
-
+
@foreach (var meta in metaColumn)
{
-
+
- @{var results = Utilities.SplitTranslationTokens(meta.Key);}
+ @{var results = Utilities.SplitTranslationTokens(meta.meta.Key);}
@if (results.Any(_result => _result.IsInterpolation))
{
@@ -22,7 +22,7 @@
{
if (result.IsInterpolation)
{
-
+
}
else
@@ -34,8 +34,8 @@
else
{
-
- @meta.Key
+
+ @meta.meta.Key
}
}
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_MessageResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_MessageResponse.cshtml
index dd71a207a..57e056318 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_MessageResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_MessageResponse.cshtml
@@ -1,17 +1,24 @@
@using SharedLibraryCore.Dtos.Meta.Responses
@model MessageResponse
+@if (TempData["ShowMetaHeader"] as bool? ?? false)
+{
+
+}
+
-
+
+
+
@if (!Model.SentIngame)
{
[@ViewBag.Localization["WEBFRONT_PROFILE_MESSAGE_EXTERNAL"]]
}
-
+
@if (Model.IsHidden && !ViewBag.Authorized)
{
-
+
}
else
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_MetaHeader.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_MetaHeader.cshtml
new file mode 100644
index 000000000..b48868969
--- /dev/null
+++ b/WebfrontCore/Views/Client/Profile/Meta/_MetaHeader.cshtml
@@ -0,0 +1,6 @@
+@model DateTime
+@{ Layout = null;}
+
+ @Model.HumanizeForCurrentCulture()
+
+
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_PermissionLevelChangedResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_PermissionLevelChangedResponse.cshtml
index f2c191f44..49f3bcb16 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_PermissionLevelChangedResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_PermissionLevelChangedResponse.cshtml
@@ -1,29 +1,35 @@
@model SharedLibraryCore.Dtos.Meta.Responses.PermissionLevelChangedResponse
-@foreach (var token in Utilities.SplitTranslationTokens("WEBFRONT_CLIENT_META_PERMISSION_CHANGED"))
-{
- if (token.IsInterpolation)
+
+ @if (TempData["ShowMetaHeader"] as bool? ?? false)
{
- switch (token.MatchValue)
+
+ }
+ @foreach (var token in Utilities.SplitTranslationTokens("WEBFRONT_CLIENT_META_PERMISSION_CHANGED"))
+ {
+ if (token.IsInterpolation)
{
- case "permission":
- @Model.CurrentPermissionLevel.ToLocalizedLevelName()
- break;
- case "originClient":
-
-
-
-
-
- break;
- case "type":
- @token.TranslationValue
- break;
+ switch (token.MatchValue)
+ {
+ case "permission":
+ @Model.CurrentPermissionLevel.ToLocalizedLevelName()
+ break;
+ case "originClient":
+
+
+
+
+
+ break;
+ case "type":
+ @token.TranslationValue
+ break;
+ }
+ }
+
+ else
+ {
+ @token.MatchValue
}
}
-
- else
- {
- @token.MatchValue
- }
-}
+
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml
index 23c4d8313..44a7c2699 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_ReceivedPenaltyResponse.cshtml
@@ -2,72 +2,79 @@
@model ReceivedPenaltyResponse
@{
- string localizationKey = $"WEBFRONT_CLIENT_META_WAS_PENALIZED_{Model.PenaltyType.ToString().ToUpper()}_V2";
+ var localizationKey = $"WEBFRONT_CLIENT_META_WAS_PENALIZED_{Model.PenaltyType.ToString().ToUpper()}_V2";
}
-
- @foreach (var match in Utilities.SplitTranslationTokens(localizationKey))
+
+ @if (TempData["ShowMetaHeader"] as bool? ?? false)
{
- if (match.IsInterpolation)
- {
- if (match.MatchValue == "action")
- {
- @match.TranslationValue
- }
-
- else if (match.MatchValue == "punisher")
- {
-
-
-
-
-
- }
-
- else if (match.MatchValue == "reason")
- {
-
- @if (ViewBag.Authorized && !string.IsNullOrEmpty(Model.AutomatedOffense) && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Warning && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Kick)
- {
- @Utilities.FormatExt(ViewBag.Localization["WEBFRONT_PROFILE_ANTICHEAT_DETECTION"], Model.AutomatedOffense)
-
- }
- else
- {
-
- }
-
-
- }
-
- else if (match.MatchValue == "time")
- {
- @Model.LengthText
- }
- }
-
- else
- {
- @match.MatchValue
- }
+
}
- @if (Model.ClientId != Model.OffenderClientId)
- {
- —
- @foreach (var helperResult in Utilities.SplitTranslationTokens("WEBFRONT_PROFILE_LINKED_ACCOUNT"))
+
+ @foreach (var match in Utilities.SplitTranslationTokens(localizationKey))
{
- if (!helperResult.IsInterpolation)
+ if (match.IsInterpolation)
{
-
@helperResult.MatchValue
+ if (match.MatchValue == "action")
+ {
+
@match.TranslationValue
+ }
+
+ else if (match.MatchValue == "punisher")
+ {
+
+
+
+
+
+ }
+
+ else if (match.MatchValue == "reason")
+ {
+
+ @if (ViewBag.Authorized && !string.IsNullOrEmpty(Model.AutomatedOffense) && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Warning && Model.PenaltyType != Data.Models.EFPenalty.PenaltyType.Kick)
+ {
+ @Utilities.FormatExt(ViewBag.Localization["WEBFRONT_PROFILE_ANTICHEAT_DETECTION"], Model.AutomatedOffense)
+
+ }
+ else
+ {
+
+ }
+
+
+ }
+
+ else if (match.MatchValue == "time")
+ {
+
@Model.LengthText
+ }
}
else
{
-
-
-
+
@match.MatchValue
}
}
- }
-
+
+ @if (Model.ClientId != Model.OffenderClientId)
+ {
+ —
+ @foreach (var helperResult in Utilities.SplitTranslationTokens("WEBFRONT_PROFILE_LINKED_ACCOUNT"))
+ {
+ if (!helperResult.IsInterpolation)
+ {
+ @helperResult.MatchValue
+ }
+
+ else
+ {
+
+
+
+ }
+ }
+ }
+
+
diff --git a/WebfrontCore/Views/Client/Profile/Meta/_UpdatedAliasResponse.cshtml b/WebfrontCore/Views/Client/Profile/Meta/_UpdatedAliasResponse.cshtml
index 3eb7f4a76..b20ab43d0 100644
--- a/WebfrontCore/Views/Client/Profile/Meta/_UpdatedAliasResponse.cshtml
+++ b/WebfrontCore/Views/Client/Profile/Meta/_UpdatedAliasResponse.cshtml
@@ -1,6 +1,11 @@
@using SharedLibraryCore.Dtos.Meta.Responses
@model UpdatedAliasResponse
+@if (TempData["ShowMetaHeader"] as bool? ?? false)
+{
+
+}
+
@foreach (var token in Utilities.SplitTranslationTokens("WEBFRONT_PROFILE_META_CONNECT_ALIAS"))
{
if (token.IsInterpolation)
@@ -8,12 +13,14 @@
switch (token.MatchValue)
{
case "action":
- @token.TranslationValue
+ @token.TranslationValue
break;
case "alias":
-
+
- [@Model.IPAddress]
+
+ [@Model.IPAddress]
+
break;
}
diff --git a/WebfrontCore/Views/Client/Statistics/Advanced.cshtml b/WebfrontCore/Views/Client/Statistics/Advanced.cshtml
index 7114804a9..8999dc540 100644
--- a/WebfrontCore/Views/Client/Statistics/Advanced.cshtml
+++ b/WebfrontCore/Views/Client/Statistics/Advanced.cshtml
@@ -6,26 +6,21 @@
@using Humanizer
@using Humanizer.Localisation
@using IW4MAdmin.Plugins.Stats
+@using WebfrontCore.ViewModels
@model Stats.Dtos.AdvancedStatsInfo
+
@{
ViewBag.Title = "Advanced Client Statistics";
ViewBag.Description = Model.ClientName.StripColors();
- const int maxItems = 5;
const string headshotKey = "MOD_HEAD_SHOT";
const string headshotKey2 = "headshot";
const string meleeKey = "MOD_MELEE";
- var suicideKeys = new[] {"MOD_SUICIDE", "MOD_FALLING"};
+ var suicideKeys = new[] { "MOD_SUICIDE", "MOD_FALLING" };
// if they've not copied default settings config this could be null
- var config = (GameStringConfiguration) ViewBag.Config ?? new GameStringConfiguration();
+ var config = (GameStringConfiguration)ViewBag.Config ?? new GameStringConfiguration();
- var headerClass = Model.Level == EFClient.Permission.Banned ? "bg-danger" : "bg-primary";
- var textClass = Model.Level == EFClient.Permission.Banned ? "text-danger" : "text-primary";
- var borderBottomClass = Model.Level == EFClient.Permission.Banned ? "border-bottom-danger border-top-danger" : "border-bottom border-top";
- var borderClass = Model.Level == EFClient.Permission.Banned ? "border-danger" : "border-primary";
- var buttonClass = Model.Level == EFClient.Permission.Banned ? "btn-danger" : "btn-primary";
-
string GetWeaponNameForHit(EFClientHitStatistic stat)
{
if (stat == null)
@@ -46,7 +41,7 @@
return null;
}
- var attachmentText = string.Join('+', new[]
+ var attachmentText = string.Join(" + ", new[]
{
config.GetStringForGame(attachment.Attachment1.Name, attachment.Attachment1.Game),
config.GetStringForGame(attachment.Attachment2?.Name, attachment.Attachment2?.Game),
@@ -58,11 +53,11 @@
var weapons = Model.ByWeapon
.Where(hit => hit.DamageInflicted > 0 || (hit.DamageInflicted == 0 && hit.HitCount > 0))
- .GroupBy(hit => new {hit.WeaponId})
+ .GroupBy(hit => new { hit.WeaponId })
.Select(group =>
{
var withoutAttachments = group.FirstOrDefault(hit => hit.WeaponAttachmentComboId == null);
- var mostUsedAttachment = group.Except(new[] {withoutAttachments})
+ var mostUsedAttachment = group.Except(new[] { withoutAttachments })
.OrderByDescending(g => g.DamageInflicted)
.GroupBy(g => g.WeaponAttachmentComboId)
.FirstOrDefault()
@@ -72,7 +67,7 @@
{
return withoutAttachments;
}
-
+
withoutAttachments.WeaponAttachmentComboId = mostUsedAttachment.WeaponAttachmentComboId;
withoutAttachments.WeaponAttachmentCombo = mostUsedAttachment.WeaponAttachmentCombo;
@@ -107,15 +102,15 @@
.Where(weapon => weapon.DamageInflicted > 0)
.GroupBy(weapon => weapon.WeaponId)
.Count()
- : (int?) null; // want to default to -- in ui instead of 0
+ : (int?)null; // want to default to -- in ui instead of 0
var activeTime = weapons.Any()
? TimeSpan.FromSeconds(weapons.Sum(weapon => weapon.UsageSeconds ?? 0))
- : (TimeSpan?) null; // want to default to -- in ui instead of 0
+ : (TimeSpan?)null; // want to default to -- in ui instead of 0
var kdr = aggregate == null
? null
- : Math.Round(aggregate.KillCount / (float) aggregate.DeathCount, 2).ToString(Utilities.CurrentLocalization.Culture);
+ : Math.Round(aggregate.KillCount / (float)aggregate.DeathCount, 2).ToString(Utilities.CurrentLocalization.Culture);
var serverLegacyStat = Model.LegacyStats
.FirstOrDefault(stat => stat.ServerId == Model.ServerId);
@@ -140,15 +135,15 @@
var headShots = allPerServer.Any()
? allPerServer.Where(hit => hit.MeansOfDeath?.Name == headshotKey || hit.HitLocation?.Name == headshotKey2).Sum(hit => hit.HitCount)
- : (int?) null; // want to default to -- in ui instead of 0
+ : (int?)null; // want to default to -- in ui instead of 0
var meleeKills = allPerServer.Any()
? allPerServer.Where(hit => hit.MeansOfDeath?.Name == meleeKey).Sum(hit => hit.KillCount)
- : (int?) null;
+ : (int?)null;
var suicides = allPerServer.Any()
? allPerServer.Where(hit => suicideKeys.Contains(hit.MeansOfDeath?.Name ?? "")).Sum(hit => hit.KillCount)
- : (int?) null;
+ : (int?)null;
var statCards = new[]
{
@@ -172,7 +167,7 @@
Name = (ViewBag.Localization["WEBFRONT_ADV_STATS_SCORE"] as string).Titleize(),
Value = score.ToNumericalString()
},
- new
+ new
{
Name = (ViewBag.Localization["WEBFRONT_ADV_STATS_ZSCORE"] as string),
Value = Model.ZScore.ToNumericalString(2)
@@ -235,205 +230,170 @@
};
}
-
-