refine webfront pages
finish refactor of penalty information/profile optimize pull penalty query start impl of quick message mapping
This commit is contained in:
@ -1,24 +1,40 @@
|
||||
@model List<SharedLibraryCore.Dtos.PlayerInfo>
|
||||
@{
|
||||
@{
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
}
|
||||
|
||||
<div class="mr-auto ml-auto col-12 col-lg-7 border-bottom">
|
||||
<h4 class="pb-2 text-center ">@ViewBag.Title</h4>
|
||||
<div class="row pt-2 pb-2 bg-primary">
|
||||
<div class="col-5 ">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</div>
|
||||
<div class="col-4">@loc["WEBFRONT_PROFILE_LEVEL"]</div>
|
||||
<div class="col-3 text-right">@loc["WEBFRONT_PROFILE_LSEEN"]</div>
|
||||
</div>
|
||||
<div class="row d-none d-lg-block ">
|
||||
<h4 class="pb-2 text-center col-12">@ViewBag.Title</h4>
|
||||
<div class="mr-auto ml-auto col-12 col-lg-8 border-bottom">
|
||||
<div class="row pt-2 pb-2 bg-primary">
|
||||
<div class="col-5 ">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</div>
|
||||
<div class="col-4">@loc["WEBFRONT_PROFILE_LEVEL"]</div>
|
||||
<div class="col-3 text-right">@loc["WEBFRONT_SEARCH_LAST_CONNECTED"]</div>
|
||||
</div>
|
||||
|
||||
@{
|
||||
foreach (var client in Model)
|
||||
@foreach (var client in Model)
|
||||
{
|
||||
<div class="row pt-2 pb-2 bg-dark">
|
||||
<div class="col-5">@Html.ActionLink(client.Name, "ProfileAsync", "Client", new { id = client.ClientId })</div>
|
||||
<div class="col-4 level-color-@client.LevelInt">@client.Level</div>
|
||||
@*<div class="col-3 text-right">@client.LastSeen @loc["WEBFRONT_PENALTY_TEMPLATE_AGO"]</div>*@
|
||||
<div class="col-3 text-right">@client.LastConnectionText</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row d-lg-none">
|
||||
<div class="w-100 bg-primary text-center h3 mb-0 p-3" style="border-bottom: 1px solid #222">@ViewBag.Title</div>
|
||||
@foreach (var client in Model)
|
||||
{
|
||||
<div class="col-5 bg-primary font-weight-bold" style="border-bottom: 1px solid #222">
|
||||
<div class="p-2">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</div>
|
||||
<div class="p-2">@loc["WEBFRONT_PROFILE_LEVEL"]</div>
|
||||
<div class="p-2">@loc["WEBFRONT_SEARCH_LAST_CONNECTED"]</div>
|
||||
</div>
|
||||
<div class="col-7 bg-dark border-bottom">
|
||||
<div class="p-2">@Html.ActionLink(client.Name, "ProfileAsync", "Client", new { id = client.ClientId },new { @class = "link-inverse" } )</div>
|
||||
<div class="p-2 level-color-@client.LevelInt">@client.Level</div>
|
||||
<div class="p-2 text-white-50">@client.LastConnectionText</div>
|
||||
</div>
|
||||
}
|
||||
</div>
|
@ -1,12 +0,0 @@
|
||||
@model IEnumerable<SharedLibraryCore.Dtos.ChatInfo>
|
||||
@{
|
||||
Layout = null;
|
||||
}
|
||||
|
||||
<div class="client-message-context bg-dark p-2 mt-2 mb-2 border-top border-bottom">
|
||||
<h5>@Model.First().Time.ToString()</h5>
|
||||
@foreach (var message in Model)
|
||||
{
|
||||
<span class="text-white">@message.Name</span><span> — @message.Message</span><br />
|
||||
}
|
||||
</div>
|
@ -2,7 +2,7 @@
|
||||
@{
|
||||
var loc = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex;
|
||||
}
|
||||
<h4 class="pb-3 text-center ">@ViewBag.Title</h4>
|
||||
<h4 class="pb-3 text-center">@ViewBag.Title</h4>
|
||||
<div class="row">
|
||||
<select class="form-control bg-dark text-muted" id="penalty_filter_selection">
|
||||
@{
|
||||
@ -36,7 +36,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<table class="table table-striped">
|
||||
<thead class="d-none d-md-table-header-group">
|
||||
<thead class="d-none d-lg-table-header-group">
|
||||
<tr class="bg-primary pt-2 pb-2">
|
||||
<th scope="col">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</th>
|
||||
<th scope="col">@loc["WEBFRONT_PENALTY_TEMPLATE_TYPE"]</th>
|
||||
@ -53,10 +53,10 @@
|
||||
})
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table d-table d-md-none">
|
||||
<table class="table d-table d-lg-none">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
<span id="load_penalties_button" class="oi oi-chevron-bottom text-center text-primary w-100 h3 pb-0 mb-0 d-none d-md-block"></span>
|
||||
<span id="load_penalties_button" class="oi oi-chevron-bottom text-center text-primary w-100 h3 pb-0 mb-0 d-none d-lg-block"></span>
|
||||
</div>
|
||||
|
||||
@section scripts {
|
||||
|
@ -5,72 +5,72 @@
|
||||
|
||||
@model SharedLibraryCore.Dtos.PenaltyInfo
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<tr class="d-table-row d-lg-none bg-dark">
|
||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</th>
|
||||
<td>
|
||||
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<tr class="d-table-row d-lg-none bg-dark">
|
||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_TYPE"]</th>
|
||||
<td class="penalties-color-@Model.PenaltyType.ToLower()">
|
||||
<td class="penalties-color-@Model.PenaltyTypeText.ToLower()">
|
||||
@Model.PenaltyType
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<tr class="d-table-row d-lg-none bg-dark">
|
||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_OFFENSE"]</th>
|
||||
<td class="text-light">
|
||||
@Model.Offense
|
||||
@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<tr class="d-table-row d-lg-none bg-dark">
|
||||
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</th>
|
||||
<td>
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + Model.PunisherLevelId })
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + (int)Model.PunisherLevel })
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-table-row d-md-none bg-dark">
|
||||
<tr class="d-table-row d-lg-none bg-dark">
|
||||
<th scope="row" class="w-25 bg-primary" style="border-bottom: 1px solid #222">@loc["WEBFRONT_PENALTY_TEMPLATE_TIME"]</th>
|
||||
<td class="text-light mb-2 border-bottom">
|
||||
@{
|
||||
if (Model.TimeRemaining == string.Empty)
|
||||
if (Model.Expired)
|
||||
{
|
||||
<span>@Model.TimePunished @loc["WEBFRONT_PENALTY_TEMPLATE_AGO"]</span>
|
||||
<span>@Model.TimePunishedString</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span> @Model.TimeRemaining</span>
|
||||
<span>@Model.TimeRemaining</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="d-none d-md-table-row">
|
||||
<tr class="d-none d-lg-table-row">
|
||||
<td>
|
||||
@Html.ActionLink(Model.OffenderName, "ProfileAsync", "Client", new { id = Model.OffenderId }, new { @class = "link-inverse" })
|
||||
</td>
|
||||
<td class="penalties-color-@Model.PenaltyType.ToLower()">
|
||||
<td class="penalties-color-@Model.PenaltyTypeText.ToLower()">
|
||||
@Model.PenaltyType
|
||||
</td>
|
||||
<td class="text-light w-50">
|
||||
@Model.Offense
|
||||
@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")
|
||||
</td>
|
||||
<td>
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + Model.PunisherLevelId })
|
||||
@Html.ActionLink(Model.PunisherName, "ProfileAsync", "Client", new { id = Model.PunisherId }, new { @class = "level-color-" + (int)Model.PunisherLevel })
|
||||
</td>
|
||||
<td class="text-right text-light">
|
||||
@{
|
||||
if (Model.TimeRemaining == string.Empty)
|
||||
if (Model.Expired)
|
||||
{
|
||||
<span>@Model.TimePunished @loc["WEBFRONT_PENALTY_TEMPLATE_AGO"]</span>
|
||||
<span>@Model.TimePunishedString</span>
|
||||
}
|
||||
else
|
||||
{
|
||||
<span> @Model.TimeRemaining </span>
|
||||
<span>@Model.TimeRemaining</span>
|
||||
}
|
||||
}
|
||||
</td>
|
||||
|
@ -9,24 +9,24 @@
|
||||
var penalty = meta.Value as SharedLibraryCore.Dtos.PenaltyInfo;
|
||||
|
||||
string localizationKey = meta.Type == SharedLibraryCore.Dtos.ProfileMeta.MetaType.Penalized ?
|
||||
$"WEBFRONT_CLIENT_META_PENALIZED_{penalty.PenaltyType.ToUpper()}" :
|
||||
$"WEBFRONT_CLIENT_META_WAS_PENALIZED_{penalty.PenaltyType.ToUpper()}";
|
||||
$"WEBFRONT_CLIENT_META_PENALIZED_{penalty.PenaltyTypeText.ToUpper()}" :
|
||||
$"WEBFRONT_CLIENT_META_WAS_PENALIZED_{penalty.PenaltyTypeText.ToUpper()}";
|
||||
|
||||
string localizationMessage = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex[localizationKey];
|
||||
var regexMatch = System.Text.RegularExpressions.Regex.Match(localizationMessage, @"^.*{{([^{}]+)}}.+$");
|
||||
string penaltyType = regexMatch.Groups[1].Value.ToString();
|
||||
|
||||
localizationMessage = localizationMessage.Replace(penaltyType, $"<span class='penalties-color-{penalty.PenaltyType.ToLower()}'>{penaltyType}</span>");
|
||||
localizationMessage = localizationMessage.Replace(penaltyType, $"<span class='penalties-color-{penalty.PenaltyTypeText.ToLower()}'>{penaltyType}</span>");
|
||||
|
||||
return meta.Type == SharedLibraryCore.Dtos.ProfileMeta.MetaType.Penalized ?
|
||||
string.Format(localizationMessage,
|
||||
$"<span class='text-highlight'><a class='link-inverse' href='{penalty.OffenderId}'>{penalty.OffenderName}</a></span>",
|
||||
$"<span class='automated-penalty-info-detailed text-white' data-clientid='{penalty.OffenderId}'>{penalty.Offense}</span>")
|
||||
$"<span class='{(ViewBag.Authorized ? "automated-penalty-info-detailed" : "")} text-white' data-clientid='{penalty.OffenderId}'>{penalty.Offense} {(ViewBag.Authorized ? penalty.AdditionalPenaltyInformation : "")}</span>")
|
||||
.Replace("{", "")
|
||||
.Replace("}", "") :
|
||||
string.Format(localizationMessage,
|
||||
$"<span class='text-highlight'><a class='link-inverse' href='{penalty.PunisherId}'>{penalty.PunisherName}</a></span>",
|
||||
$"<span class='automated-penalty-info-detailed text-white' data-clientid='{penalty.OffenderId}'>{(ViewBag.Authorized && !string.IsNullOrEmpty(penalty.AutomatedOffense) ? $"{penalty.Offense} ({penalty.AutomatedOffense})" : penalty.Offense)}</span>",
|
||||
$"<span class='{(ViewBag.Authorized ? "automated-penalty-info-detailed" : "")} text-white' data-clientid='{penalty.OffenderId}'>{penalty.Offense} {(ViewBag.Authorized ? penalty.AdditionalPenaltyInformation : "")}</span>",
|
||||
penalty.Offense)
|
||||
.Replace("{", "")
|
||||
.Replace("}", "");
|
||||
@ -55,7 +55,7 @@
|
||||
case SharedLibraryCore.Dtos.ProfileMeta.MetaType.ChatMessage:
|
||||
<div class="profile-meta-entry loader-data-time" data-time="@meta.When">
|
||||
<span style="color:white;">></span>
|
||||
<span class="client-message text-muted" data-serverid="@meta.Extra" data-when="@meta.When"> @meta.Value</span>
|
||||
<span class="client-message text-muted" data-serverid="@meta.Extra" data-when="@meta.When" title="@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_PROFILE_MESSAGE_CONTEXT"]"> @meta.Value</span>
|
||||
</div>
|
||||
break;
|
||||
case SharedLibraryCore.Dtos.ProfileMeta.MetaType.ReceivedPenalty:
|
||||
|
Reference in New Issue
Block a user