2021-03-22 12:09:25 -04:00
|
|
|
@using SharedLibraryCore.Interfaces
|
|
|
|
@using Data.Models
|
2021-03-23 16:30:49 -04:00
|
|
|
@using Data.Models.Client
|
2020-08-17 22:21:11 -04:00
|
|
|
@model SharedLibraryCore.Dtos.PlayerInfo
|
2018-03-22 14:50:09 -04:00
|
|
|
@{
|
2021-03-23 16:30:49 -04:00
|
|
|
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";
|
2021-03-22 12:09:25 -04:00
|
|
|
var ignoredMetaTypes = new[] {MetaType.Information, MetaType.Other, MetaType.QuickMessage};
|
2018-03-13 17:30:22 -04:00
|
|
|
}
|
2019-03-25 22:12:16 -04:00
|
|
|
|
2019-03-26 22:02:11 -04:00
|
|
|
<div id="profile_wrapper" class="pb-3 row d-flex flex-column flex-lg-row">
|
2019-03-25 22:12:16 -04:00
|
|
|
<!-- Initial/Avatar Column -->
|
2021-01-09 13:37:20 -05:00
|
|
|
<div id="profile_avatar" class="d-block d-lg-inline-flex flex-column mr-auto ml-auto mr-lg-0 ml-lg-0 justify-content-center text-center level-bgcolor-@(!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy ? "0" : Model.LevelInt.ToString()) @(isTempBanned ? "penalties-bgcolor-tempban" : "")" style="background-image:url('@string.Format("https://gravatar.com/avatar/{0}?size=168&default=blank&rating=pg", gravatarUrl)')">
|
2019-03-09 11:28:04 -05:00
|
|
|
@if (string.IsNullOrEmpty(gravatarUrl))
|
|
|
|
{
|
|
|
|
<span class="profile-shortcode">@shortCode</span>
|
|
|
|
}
|
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
<!-- Name/Level Column -->
|
2021-06-30 10:57:07 -04:00
|
|
|
<div class="w-50 d-block d-lg-inline-flex flex-column flex-fill text-center text-lg-left pb-3 pb-lg-0 pt-3 pt-lg-0 pl-3 pr-3 ml-auto mr-auto" style="overflow-wrap: anywhere">
|
2021-07-02 11:04:56 -04:00
|
|
|
<div class="mt-n2 d-block d-lg-inline-flex @(ViewBag.Authorized ? "" : "flex-fill")">
|
2021-03-22 12:09:25 -04:00
|
|
|
<div id="profile_name" class="client-name h1 mb-0">
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@Model.Name"></color-code>
|
2021-03-22 12:09:25 -04:00
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
2019-03-26 22:02:11 -04:00
|
|
|
<div id="profile_aliases_btn" class="oi oi-caret-bottom h3 ml-0 ml-lg-2 mb-0 pt-lg-2 mt-lg-1"></div>
|
2019-03-25 22:12:16 -04:00
|
|
|
}
|
2018-02-21 20:29:23 -05:00
|
|
|
</div>
|
2020-08-17 22:21:11 -04:00
|
|
|
|
2019-03-24 22:34:20 -04:00
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
2021-07-02 11:04:56 -04:00
|
|
|
<div class="d-flex flex-row justify-content-start flex-fill flex-column flex-lg-row mr-lg-2 mb-2 mb-md-0">
|
|
|
|
<div class="ip-lookup-profile align-self-center mr-0 mr-lg-2 ml-lg-n1" data-ip="@Model.IPAddress"></div>
|
|
|
|
<div id="ip_lookup_country" class="h4 mb-2 mb-lg-0 align-self-center text-muted"></div>
|
2021-07-01 22:58:09 -04:00
|
|
|
</div>
|
|
|
|
|
2019-03-26 22:02:11 -04:00
|
|
|
<div id="profile_aliases" class="text-muted pt-0 pt-lg-2 pb-2">
|
2019-03-25 22:12:16 -04:00
|
|
|
@foreach (var linked in Model.LinkedAccounts)
|
2019-03-09 11:28:04 -05:00
|
|
|
{
|
2021-03-31 12:20:32 -04:00
|
|
|
<div>
|
|
|
|
@Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new {id = linked.Key}, new {@class = "link-inverse"})
|
|
|
|
</div>
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
2021-03-22 12:09:25 -04:00
|
|
|
@foreach (var alias in Model.Aliases)
|
2019-03-09 11:28:04 -05:00
|
|
|
{
|
2021-03-31 12:20:32 -04:00
|
|
|
<div>
|
2022-01-22 13:49:12 -05:00
|
|
|
<color-code value="@alias"></color-code>
|
2021-03-31 12:20:32 -04:00
|
|
|
</div>
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
2018-04-15 00:26:27 -04:00
|
|
|
|
2021-03-31 12:20:32 -04:00
|
|
|
@foreach (var ip in Model.IPs)
|
2018-04-02 01:25:06 -04:00
|
|
|
{
|
2021-03-31 12:20:32 -04:00
|
|
|
<div>
|
|
|
|
<a class="ip-locate-link" href="#" data-ip="@ip">@ip</a>
|
|
|
|
</div>
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
|
|
|
</div>
|
2019-03-24 22:34:20 -04:00
|
|
|
}
|
2020-10-02 09:29:20 -04:00
|
|
|
@if (Model.ActivePenalty != null && (Model.ActivePenalty.Type != EFPenalty.PenaltyType.Flag || ViewBag.Authorized))
|
2020-08-17 22:21:11 -04:00
|
|
|
{
|
|
|
|
<div class="font-weight-bold h4 mb-0 penalties-color-@Model.ActivePenalty.Type.ToString().ToLower()">
|
|
|
|
@foreach (var result in Utilities.SplitTranslationTokens(translationKey))
|
|
|
|
{
|
|
|
|
switch (result.MatchValue)
|
|
|
|
{
|
|
|
|
case "reason":
|
2021-03-23 16:30:49 -04:00
|
|
|
<span class="text-white font-weight-lighter">@(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())</span>
|
2020-08-17 22:21:11 -04:00
|
|
|
break;
|
|
|
|
case "time":
|
|
|
|
<span class="text-white font-weight-lighter">
|
2021-03-22 12:09:25 -04:00
|
|
|
@((Model.ActivePenalty.Expires.Value - DateTime.UtcNow).HumanizeForCurrentCulture())
|
2020-08-17 22:21:11 -04:00
|
|
|
</span>
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
<span>@result.MatchValue</span>
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-01-09 13:37:20 -05:00
|
|
|
if (!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy)
|
|
|
|
{
|
|
|
|
<div id="profile_level" class="font-weight-bold h4 mb-0 level-color-0">
|
|
|
|
@ViewBag.Localization["GLOBAL_PERMISSION_USER"]
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<div id="profile_level" class="font-weight-bold h4 mb-0 level-color-@Model.LevelInt">
|
|
|
|
@Model.Level
|
|
|
|
</div>
|
|
|
|
}
|
2020-08-17 22:21:11 -04:00
|
|
|
}
|
2019-03-24 22:34:20 -04:00
|
|
|
</div>
|
2021-03-22 12:09:25 -04:00
|
|
|
|
|
|
|
<div class="pr-lg-0 text-center text-lg-right">
|
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
2019-08-06 14:36:37 -04:00
|
|
|
@if (!isPermBanned)
|
|
|
|
{
|
|
|
|
<div class="profile-action oi oi-flag h3 ml-2 @(isFlagged ? "text-secondary" : "text-success")" data-action="@(isFlagged ? "unflag" : "flag")" aria-hidden="true"></div>
|
|
|
|
}
|
2019-08-04 18:06:07 -04:00
|
|
|
|
2021-03-22 12:09:25 -04:00
|
|
|
@if (Model.LevelInt < (int) ViewBag.User.Level && !Model.HasActivePenalty)
|
2019-03-25 22:12:16 -04:00
|
|
|
{
|
|
|
|
<div id="profile_action_ban_btn" class="profile-action oi oi-lock-unlocked text-success h3 ml-2" title="Ban Client" data-action="ban" aria-hidden="true"></div>
|
|
|
|
}
|
2019-03-24 22:34:20 -04:00
|
|
|
|
2021-03-22 12:09:25 -04:00
|
|
|
@if (Model.LevelInt < (int) ViewBag.User.Level && Model.HasActivePenalty)
|
2019-03-25 22:12:16 -04:00
|
|
|
{
|
|
|
|
@if (isTempBanned)
|
|
|
|
{
|
|
|
|
<div id="profile_action_ban_btn" class="profile-action oi oi-lock-unlocked text-success h3 ml-2" title="Ban Client" data-action="ban" aria-hidden="true"></div>
|
|
|
|
<div id="profile_action_unban_btn" class="profile-action oi oi-lock-locked penalties-color-tempban h3 ml-2" title="Unban Client" data-action="unban" aria-hidden="true"></div>
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
<div id="profile_action_unban_btn" class="profile-action oi oi-lock-locked text-danger h3 ml-2" title="Unban Client" data-action="unban" aria-hidden="true"></div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-04 18:06:07 -04:00
|
|
|
|
2019-03-26 22:02:11 -04:00
|
|
|
@if (Model.LevelInt != -1)
|
|
|
|
{
|
|
|
|
<div id="profile_action_edit_btn" class="profile-action oi oi-cog text-muted h3 ml-2" title="Client Options" data-action="edit" aria-hidden="true"></div>
|
|
|
|
}
|
2021-03-22 12:09:25 -04:00
|
|
|
}
|
|
|
|
@if (ViewBag.UseNewStats)
|
|
|
|
{
|
|
|
|
<a asp-controller="ClientStatistics" asp-action="Advanced" asp-route-id="@Model.ClientId" class="oi oi-graph text-primary h3 ml-2" title="Stats" aria-hidden="true"></a>
|
|
|
|
}
|
|
|
|
</div>
|
2019-03-26 22:02:11 -04:00
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
|
2019-03-26 22:02:11 -04:00
|
|
|
<div id="profile_info" class="row d-block d-lg-flex flex-row border-bottom border-top pt-2 pb-2">
|
2021-03-22 12:09:25 -04:00
|
|
|
<partial name="Meta/_Information.cshtml" model="@Model.Meta"/>
|
2020-08-17 22:21:11 -04:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="row border-bottom">
|
|
|
|
<div class="text-center bg-dark p-2 pl-3 pr-4 text-muted col-12 col-md-auto" id="filter_meta_container_button">
|
|
|
|
<span class="oi oi-sort-ascending"></span>
|
2020-08-20 12:08:21 -04:00
|
|
|
<a>@ViewBag.Localization["WEBFRONT_CLIENT_META_FILTER"]</a>
|
2020-08-17 22:21:11 -04:00
|
|
|
</div>
|
|
|
|
<div class="d-none d-md-flex flex-fill" id="filter_meta_container">
|
2020-08-20 12:08:21 -04:00
|
|
|
<a asp-action="ProfileAsync" asp-controller="Client"
|
|
|
|
class="nav-link p-2 pl-3 pr-3 text-center col-12 col-md-auto text-md-left @(!Model.MetaFilterType.HasValue ? "btn-primary text-white" : "text-muted")"
|
2021-03-22 12:09:25 -04:00
|
|
|
asp-route-id="@Model.ClientId">
|
|
|
|
@ViewBag.Localization["META_TYPE_ALL_NAME"]
|
|
|
|
</a>
|
2020-08-20 12:08:21 -04:00
|
|
|
|
2020-08-17 22:21:11 -04:00
|
|
|
@foreach (MetaType type in Enum.GetValues(typeof(MetaType)))
|
|
|
|
{
|
|
|
|
if (!ignoredMetaTypes.Contains(type))
|
2019-03-30 18:21:01 -04:00
|
|
|
{
|
2020-08-17 22:21:11 -04:00
|
|
|
<a asp-action="ProfileAsync" asp-controller="Client"
|
|
|
|
class="nav-link p-2 pl-3 pr-3 text-center col-12 col-md-auto text-md-left @(Model.MetaFilterType.HasValue && Model.MetaFilterType.Value.ToString() == type.ToString() ? "btn-primary text-white" : "text-muted")"
|
|
|
|
asp-route-id="@Model.ClientId"
|
|
|
|
asp-route-metaFilterType="@type"
|
2021-03-22 12:09:25 -04:00
|
|
|
data-meta-type="@type">
|
|
|
|
@type.ToTranslatedName()
|
|
|
|
</a>
|
2019-03-30 18:21:01 -04:00
|
|
|
}
|
2020-08-17 22:21:11 -04:00
|
|
|
}
|
|
|
|
</div>
|
2018-02-21 20:29:23 -05:00
|
|
|
</div>
|
2018-02-24 00:56:03 -05:00
|
|
|
|
2021-01-09 13:37:20 -05:00
|
|
|
@if ((!ViewBag.Authorized && !ViewBag.EnablePrivilegedUserPrivacy) || ViewBag.Authorized)
|
|
|
|
{
|
|
|
|
<div class="row d-md-flex pt-2">
|
|
|
|
<div id="profile_events" class="text-muted text-left pl-4 pr-4 pl-md-0 pr-md-0">
|
|
|
|
@await Component.InvokeAsync("ProfileMetaList", new {clientId = Model.ClientId, count = 30, offset = 0, startAt = DateTime.UtcNow, metaType = Model.MetaFilterType})
|
|
|
|
</div>
|
2018-02-21 20:29:23 -05:00
|
|
|
</div>
|
2021-01-09 13:37:20 -05:00
|
|
|
}
|
2018-02-21 20:29:23 -05:00
|
|
|
|
2019-03-29 22:56:56 -04:00
|
|
|
<div class="row">
|
|
|
|
<div class="oi oi-chevron-bottom text-center mt-2 btn btn-primary btn-block loader-load-more" title="Load more meta" data-action="unban" aria-hidden="true"></div>
|
|
|
|
</div>
|
|
|
|
|
2018-03-27 00:54:20 -04:00
|
|
|
@section targetid {
|
2021-03-22 12:09:25 -04:00
|
|
|
<input type="hidden" name="targetId" value="@Model.ClientId"/>
|
2018-03-27 00:54:20 -04:00
|
|
|
}
|
|
|
|
|
2018-02-21 20:29:23 -05:00
|
|
|
@section scripts {
|
2018-04-09 23:33:42 -04:00
|
|
|
<environment include="Development">
|
2019-03-27 20:40:26 -04:00
|
|
|
<script type="text/javascript" src="~/js/loader.js"></script>
|
2018-04-09 23:33:42 -04:00
|
|
|
<script type="text/javascript" src="~/js/profile.js"></script>
|
|
|
|
</environment>
|
2020-08-17 22:21:11 -04:00
|
|
|
<script>initLoader('/Client/Meta/@Model.ClientId', '#profile_events', 30, 30, [{ 'name': 'metaFilterType', 'value': '@Model.MetaFilterType' }]);</script>
|
2022-01-22 13:49:12 -05:00
|
|
|
}
|