changes for latest release

This commit is contained in:
RaidMax
2019-03-30 17:21:01 -05:00
parent 8521df85f5
commit 37d3f4f90d
7 changed files with 142 additions and 69 deletions

View File

@ -7,7 +7,9 @@
bool isTempBanned = Model.ActivePenaltyType == "TempBan";
var informationMeta = Model.Meta
.Where(_meta => _meta.Type == SharedLibraryCore.Dtos.ProfileMeta.MetaType.Information)
.ToList();
.OrderBy(_meta => _meta.Order)
.GroupBy(_meta => _meta.Column)
.OrderBy(_grouping => _grouping.Key);
}
<div id="profile_wrapper" class="pb-3 row d-flex flex-column flex-lg-row">
@ -79,35 +81,18 @@
</div>
<div id="profile_info" class="row d-block d-lg-flex flex-row border-bottom border-top pt-2 pb-2">
<div id="profile_meta_0" class="text-center text-lg-left mr-0 mr-lg-4">
@for (int i = 0; i < informationMeta.Count; i += 3)
{
<div class="profile-meta-entry">
<span class="profile-meta-value text-primary">@informationMeta[i].Value</span>
<span class="profile-meta-title text-muted"> @informationMeta[i].Key</span>
</div>
}
</div>
<div class="text-center text-lg-left mr-0 mr-lg-4" id="profile_meta_1">
@for (int i = 1; i < informationMeta.Count; i += 3)
{
<div class="profile-meta-entry">
<span class="profile-meta-value text-primary">@informationMeta[i].Value</span>
<span class="profile-meta-title text-muted"> @informationMeta[i].Key</span>
</div>
}
</div>
<div class="text-center text-lg-left" id="profile_meta_2">
@for (int i = 2; i < informationMeta.Count; i += 3)
{
<div class="profile-meta-entry">
<span class="profile-meta-value text-primary">@informationMeta[i].Value</span>
<span class="profile-meta-title text-muted"> @informationMeta[i].Key</span>
</div>
}
</div>
@foreach (var metaColumn in informationMeta)
{
<div class="text-center text-lg-left mr-0 mr-lg-4">
@foreach (var meta in metaColumn)
{
<div class="profile-meta-entry">
<span class="profile-meta-value text-primary">@meta.Value</span>
<span class="profile-meta-title text-muted"> @meta.Key</span>
</div>
}
</div>
}
</div>
<div class="row d-md-flex pt-2">

View File

@ -13,7 +13,7 @@
</tr>
<tr class="d-table-row d-md-none bg-dark">
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_PenaltyType"]</th>
<th scope="row" class="bg-primary">@loc["WEBFRONT_PENALTY_TEMPLATE_TYPE"]</th>
<td class="penalties-color-@Model.PenaltyType.ToLower()">
@Model.PenaltyType
</td>

View File

@ -2,6 +2,8 @@
@{
Layout = null;
var timeSinceLastEvent = DateTime.MinValue;
string formatPenalty(SharedLibraryCore.Dtos.ProfileMeta meta)
{
var penalty = meta.Value as SharedLibraryCore.Dtos.PenaltyInfo;
@ -11,7 +13,7 @@
$"WEBFRONT_CLIENT_META_WAS_PENALIZED_{penalty.PenaltyType.ToUpper()}";
string localizationMessage = SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex[localizationKey];
var regexMatch = System.Text.RegularExpressions.Regex.Match(localizationMessage, @"^{{([^{}]+)}}.+$");
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>");
@ -24,28 +26,30 @@
.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}'>{penalty.Offense}</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>",
penalty.Offense)
.Replace("{", "")
.Replace("}", "");
}
}
@if (Model.Count > 0)
{
<div class="p2 text-white profile-event-timestep">
<span class="text-primary">&mdash;</span>
<span>@SharedLibraryCore.Utilities.GetTimePassed(Model.First().When, true)</span>
</div>
}
@if (Model.Count == 0)
{
<div class="p2 text-muted profile-event-timestep">@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_CLIENT_META_NONE"]</div>
<div class="p2 text-muted profile-event-timestep">@SharedLibraryCore.Utilities.CurrentLocalization.LocalizationIndex["WEBFRONT_CLIENT_META_NONE"]</div>
}
@foreach (var meta in Model.OrderByDescending(_meta => _meta.When))
{
@if (Math.Abs((meta.When - timeSinceLastEvent).TotalDays) >= 1)
{
<div class="p2 text-white profile-event-timestep">
<span class="text-primary">&mdash;</span>
<span>@SharedLibraryCore.Utilities.GetTimePassed(meta.When, true)</span>
</div>
timeSinceLastEvent = meta.When;
}
@switch (meta.Type)
{
case SharedLibraryCore.Dtos.ProfileMeta.MetaType.ChatMessage: