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

78 lines
3.1 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-{(int)Model.PunisherLevel}" : "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="link-inverse">
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()">
@Model.PenaltyType
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">
<td class="bg-primary text-light text-right">
<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>
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</div>
<div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_TIME"]</div>
2018-02-21 20:29:23 -05:00
</td>
2022-04-19 19:43:58 -04:00
<td class="flex-fill">
<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()">
@Model.PenaltyType
</div>
<div class="mt-5 mb-5">
<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>
<div class="mt-5 mb-5">
@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>