IW4M-Admin/WebfrontCore/Views/Penalty/_Penalty.cshtml

79 lines
3.5 KiB
Plaintext
Raw Normal View History

2018-02-21 20:29:23 -05:00
@{
Layout = null;
2022-04-19 19:43:58 -04:00
var loc = Utilities.CurrentLocalization.LocalizationIndex;
var canSeeLevel = (ViewBag.PermissionsSet as IEnumerable<string>).HasPermission(WebfrontEntity.ClientLevel, WebfrontPermission.Read) && Model.PunisherLevel != 0;
var punisherLevelClass = canSeeLevel ? $"level-color-{Model.PunisherLevel.ToString().ToLower()}" : "text-light-dm text-dark-lm";
var offenderLevelClass = canSeeLevel ? $"level-color-{Model.OffenderLevel.ToString().ToLower()}" : "text-light-dm text-dark-lm";
2018-02-21 20:29:23 -05:00
}
2022-04-19 19:43:58 -04:00
@using WebfrontCore.Permissions
2018-04-08 02:44:42 -04:00
@model SharedLibraryCore.Dtos.PenaltyInfo
2018-02-21 20:29:23 -05:00
2022-04-19 19:43:58 -04:00
<!-- desktop -->
<tr class="d-none d-lg-table-row">
<td colspan="20%">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@Model.OffenderId" class="@offenderLevelClass">
2022-01-22 13:49:12 -05:00
<color-code value="@Model.OffenderName"></color-code>
2019-08-02 19:04:34 -04:00
</a>
2018-02-21 20:29:23 -05:00
</td>
2022-04-19 19:43:58 -04:00
<td colspan="10%" class="penalties-color-@Model.PenaltyTypeText.ToLower()">
2022-07-08 21:40:27 -04:00
@ViewBag.Localization[$"WEBFRONT_PENALTY_{Model.PenaltyType.ToString().ToUpper()}"]
2018-02-21 20:29:23 -05:00
</td>
2022-04-19 19:43:58 -04:00
<td colspan="35%">
2022-01-22 13:49:12 -05:00
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")"></color-code>
2018-02-21 20:29:23 -05:00
</td>
2022-04-19 19:43:58 -04:00
<td colspan="20%">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@Model.PunisherId" class="@punisherLevelClass">
<color-code value="@Model.PunisherName"></color-code>
</a>
2018-02-21 20:29:23 -05:00
</td>
2022-04-19 19:43:58 -04:00
<td colspan="15%" class="text-right">
@if (Model.Expired)
{
<span>@Model.TimePunishedString</span>
}
else
{
<span>@Model.TimeRemaining</span>
2018-02-21 20:29:23 -05:00
}
</td>
</tr>
2022-04-19 19:43:58 -04:00
<!-- mobile -->
<tr class="d-table-row d-lg-none d-flex border-bottom">
2022-07-23 12:22:16 -04:00
<td class="bg-primary text-light text-right d-flex flex-column w-quarter">
2022-04-19 19:43:58 -04:00
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</div>
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_TYPE"]</div>
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_OFFENSE"]</div>
2022-07-23 12:22:16 -04:00
<div class="mt-5 mb-5 mt-auto">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</div>
2022-04-19 19:43:58 -04:00
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_TIME"]</div>
2018-02-21 20:29:23 -05:00
</td>
2022-07-23 12:22:16 -04:00
<td class=" d-flex flex-column w-three-quarter">
2022-04-19 19:43:58 -04:00
<div class="mt-5 mb-5">
<a asp-controller="Client" asp-action="Profile" asp-route-id="@Model.OffenderId" >
<color-code value="@Model.OffenderName"></color-code>
</a>
</div>
<div class="mt-5 mb-5 penalties-color-@Model.PenaltyTypeText.ToLower()">
@ViewBag.Localization[$"WEBFRONT_PENALTY_{Model.PenaltyType.ToString().ToUpper()}"]
2022-04-19 19:43:58 -04:00
</div>
2022-07-23 12:22:16 -04:00
<div class="mt-5 mb-5 text-force-break">
2022-04-19 19:43:58 -04:00
<color-code value="@($"{Model.Offense}{(ViewBag.Authorized ? Model.AdditionalPenaltyInformation : "")}")"></color-code>
</div>
<a asp-controller="Client" asp-action="Profile" asp-route-id="@Model.PunisherId" class="mt-5 mb-5 @((!ViewBag.Authorized && ViewBag.EnablePrivilegedUserPrivacy) || Model.PunisherLevel == 0 ? "text-dark-lm text-light-dm" : "level-color-" + (int)Model.PunisherLevel)">
<color-code value="@Model.PunisherName"></color-code>
</a>
2022-07-23 12:22:16 -04:00
<div class="mt-5 mb-5 text-muted">
2022-04-19 19:43:58 -04:00
@if (Model.Expired)
2018-02-21 20:29:23 -05:00
{
<span>@Model.TimePunishedString</span>
2018-02-21 20:29:23 -05:00
}
else
{
<span>@Model.TimeRemaining</span>
2018-02-21 20:29:23 -05:00
}
2022-04-19 19:43:58 -04:00
</div>
2018-02-21 20:29:23 -05:00
</td>
2022-01-22 13:49:12 -05:00
</tr>