@using SharedLibraryCore.Dtos
@model IEnumerable<AuditInfo>
@{
    var loc = Utilities.CurrentLocalization.LocalizationIndex;
}

@foreach (var info in Model)
{
    <!-- desktop -->
    <tr class="d-none d-lg-table-row bg-dark-dm bg-light-lm">
        <td class="font-weight-bold">
            @info.Action
        </td>
        <td>
            <a asp-controller="Client" asp-action="Profile" asp-route-id="@info.OriginId">
                <color-code value="@info.OriginName"></color-code>
            </a>
        </td>
        <td>
            @if (info.TargetId != null)
            {
                <a asp-controller="Client" asp-action="Profile" asp-route-id="@info.TargetId">
                    <color-code value="@info.TargetName"></color-code>
                </a>
            }
            else
            {
                <span>&ndash;</span>
            }
        </td>
        <td>
        @info.Data
        <td class="text-force-break font-weight-light">
            @info.NewValue
        </td>
        <td class="text-right">
            @info.When.ToStandardFormat()
        </td>
    </tr>

    <!-- mobile -->
    <tr class="d-table-row d-lg-none d-flex bg-dark-dm bg-light-lm">
        <td class="bg-primary text-light text-right flex-grow-0 w-quarter d-flex flex-column">
            <div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_TYPE"]</div>
            <div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_ADMIN"]</div>
            <div class="mt-5 mb-5">@loc["WEBFRONT_PENALTY_TEMPLATE_NAME"]</div>
            <div class="mt-5 mb-5">@loc["WEBFRONT_ADMIN_AUDIT_LOG_INFO"]</div>
            <div class="mt-5 mb-5">@loc["WEBFRONT_ADMIN_AUDIT_LOG_CURRENT"]</div>
            <div class="mt-5 mb-5 mt-auto">@loc["WEBFRONT_ADMIN_AUDIT_LOG_TIME"]</div>
        </td>
        <td class="w-three-quarter d-flex flex-column">
            <div class="mt-5 mb-5">@info.Action</div>
            <div class="mt-5 mb-5">
                <a asp-controller="Client" asp-action="Profile" asp-route-id="@info.OriginId" class="link-inverse">
                    <color-code value="@info.OriginName"></color-code>
                </a>
            </div>
            @if (info.TargetId != null)
            {
                <div class="mt-5 mb-5">
                    <a asp-controller="Client" asp-action="Profile" asp-route-id="@info.TargetId">
                        <color-code value="@info.TargetName"></color-code>
                    </a>
                </div>
            }
            else
            {
                <div class="mt-5 mb-5">&ndash;</div>
            }
            <div class="mt-5 mb-5">@info.Data</div>
            <div class="mt-5 mb-5 text-force-break">@info.NewValue</div>
            <div class="mt-5 mb-5 text-muted">@info.When.ToStandardFormat()</div>
        </td>
    </tr>
}
