2018-04-08 02:44:42 -04:00
|
|
|
@model SharedLibraryCore.Dtos.PlayerInfo
|
2018-03-22 14:50:09 -04:00
|
|
|
@{
|
2018-03-13 17:30:22 -04:00
|
|
|
string match = System.Text.RegularExpressions.Regex.Match(Model.Name.ToUpper(), "[A-Z]").Value;
|
|
|
|
string shortCode = match == string.Empty ? "?" : match;
|
2018-05-05 18:52:04 -04:00
|
|
|
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
2018-06-02 00:48:10 -04:00
|
|
|
string gravatarUrl = Model.Meta.FirstOrDefault(m => m.Key == "GravatarEmail")?.Value;
|
2019-02-24 20:07:56 -05:00
|
|
|
bool isTempBanned = Model.ActivePenaltyType == "TempBan";
|
2018-03-13 17:30:22 -04:00
|
|
|
}
|
2019-03-25 22:12:16 -04:00
|
|
|
<div class="row" style="background: white; height: 50px;"></div>
|
|
|
|
|
|
|
|
<div id="profile_wrapper" class="pb-3 row">
|
|
|
|
<!-- Initial/Avatar Column -->
|
|
|
|
<div id="profile_avatar" class="col-12 col-lg-2 text-center level-bgcolor-@Model.LevelInt @(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 -->
|
|
|
|
<div class="text-center text-lg-left col-12 col-lg-8">
|
|
|
|
<div class="d-block d-lg-inline-flex align-self-start">
|
|
|
|
<div id="profile_name" class="client-name h1 mb-0 mt-n2">@Model.Name</div>
|
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
|
|
|
<div id="profile_aliases_btn" class="oi oi-caret-bottom h3 ml-0 ml-lg-2 mb-0 mt-0 mt-lg-2 align-self-center"></div>
|
|
|
|
}
|
2018-02-21 20:29:23 -05:00
|
|
|
</div>
|
2019-03-24 22:34:20 -04:00
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
2019-03-25 22:12:16 -04:00
|
|
|
<div id="profile_aliases" class="text-muted mt-2 mb-2">
|
|
|
|
@foreach (var linked in Model.LinkedAccounts)
|
2019-03-09 11:28:04 -05:00
|
|
|
{
|
2019-03-25 22:12:16 -04:00
|
|
|
@Html.ActionLink(linked.Value.ToString("X"), "ProfileAsync", "Client", new { id = linked.Key }, new { @class = "link-inverse" })<br />
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
2019-03-25 22:12:16 -04:00
|
|
|
@foreach (string alias in Model.Aliases)
|
2019-03-09 11:28:04 -05:00
|
|
|
{
|
2019-03-25 22:12:16 -04:00
|
|
|
@alias<br />
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
2018-04-15 00:26:27 -04:00
|
|
|
|
2019-03-25 22:12:16 -04:00
|
|
|
@foreach (string ip in Model.IPs)
|
2018-04-02 01:25:06 -04:00
|
|
|
{
|
2019-03-25 22:12:16 -04:00
|
|
|
<a class="ip-locate-link" href="#" data-ip="@ip">@ip</a><br />
|
2019-03-09 11:28:04 -05:00
|
|
|
}
|
|
|
|
</div>
|
2019-03-24 22:34:20 -04:00
|
|
|
}
|
2019-03-25 22:12:16 -04:00
|
|
|
<div id="profile_level" class="text-muted align-self-end">
|
|
|
|
<h4 class="mb-0">
|
|
|
|
<span class="level-color-@Model.LevelInt @(isTempBanned ? "penalties-color-tempban" : "")">
|
|
|
|
<strong>@Model.Level @(isTempBanned ? $"({loc["WEBFRONT_PROFILE_TEMPBAN"]})" : "")</strong>
|
|
|
|
</span>
|
|
|
|
</h4>
|
|
|
|
</div>
|
2019-03-24 22:34:20 -04:00
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
@if (ViewBag.Authorized)
|
|
|
|
{
|
|
|
|
<div class="col-12 col-lg-2 pr-lg-0 text-center text-lg-right">
|
|
|
|
|
|
|
|
@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>
|
|
|
|
}
|
|
|
|
@if (Model.LevelInt < (int)ViewBag.User.Level && !Model.HasActivePenalty)
|
|
|
|
{
|
|
|
|
<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
|
|
|
|
2019-03-25 22:12:16 -04:00
|
|
|
@if (Model.LevelInt < (int)ViewBag.User.Level && Model.HasActivePenalty)
|
|
|
|
{
|
|
|
|
@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-03-24 22:34:20 -04:00
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
@*<div id="profile_info" class="text-center text-md-left pr-md-3 pl-md-3">
|
|
|
|
|
|
|
|
<div id="profile_time_played" class="text-muted">
|
|
|
|
@loc["WEBFRONT_PROFILE_PLAYER"] <span class="text-primary">@Model.TimePlayed</span> @loc["GLOBAL_TIME_HOURS"]
|
|
|
|
</div>
|
|
|
|
<div id="profile_first_seen" class="text-muted">
|
|
|
|
@loc["WEBFRONT_PROFILE_FSEEN"] <span class="text-primary">@Model.FirstSeen</span> @loc["WEBFRONT_PENALTY_TEMPLATE_AGO"]
|
|
|
|
</div>
|
|
|
|
<div id="profile_last_seen" class="text-muted">
|
|
|
|
@loc["WEBFRONT_PROFILE_LSEEN"] <span class="text-primary">@Model.LastSeen</span> @loc["WEBFRONT_PENALTY_TEMPLATE_AGO"]
|
|
|
|
</div>
|
|
|
|
<div id="profile_meta_0" class="text-center text-sm-left"></div>
|
2019-03-24 22:34:20 -04:00
|
|
|
</div>
|
2019-03-25 22:12:16 -04:00
|
|
|
<div class="flex-fill mb-1 pl-md-3 pr-md-3 align-self-end text-center text-sm-left" id="profile_meta_1">
|
2018-05-16 00:57:37 -04:00
|
|
|
</div>
|
2019-03-24 22:34:20 -04:00
|
|
|
|
2019-03-25 22:12:16 -04:00
|
|
|
<div class="flex-fill text-center text-sm-right" id="profile_meta_2">
|
|
|
|
</div>*@
|
2018-02-21 20:29:23 -05:00
|
|
|
</div>
|
2018-02-24 00:56:03 -05:00
|
|
|
|
2018-02-22 01:06:21 -05:00
|
|
|
<div class="row d-md-flex pt-2">
|
2018-02-21 20:29:23 -05:00
|
|
|
<div id="profile_events" class="text-muted text-left ml-sm-0">
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2018-03-27 00:54:20 -04:00
|
|
|
@section targetid {
|
|
|
|
<input type="hidden" name="targetId" value="@Model.ClientId" />
|
|
|
|
}
|
|
|
|
|
2018-02-21 20:29:23 -05:00
|
|
|
@section scripts {
|
|
|
|
<script>
|
|
|
|
const clientInfo = {};
|
|
|
|
clientInfo.clientId = @Model.ClientId;
|
2019-03-24 22:34:20 -04:00
|
|
|
clientInfo.Meta = @Html.Raw(Json.Serialize(@Model.Meta.Where(m => m.Show)));
|
2018-02-21 20:29:23 -05:00
|
|
|
</script>
|
2018-04-09 23:33:42 -04:00
|
|
|
<environment include="Development">
|
|
|
|
<script type="text/javascript" src="~/js/profile.js"></script>
|
|
|
|
</environment>
|
|
|
|
}
|