51 lines
2.5 KiB
Plaintext
51 lines
2.5 KiB
Plaintext
|
|
@page
|
||
|
|
@model JobsMedical.Web.Pages.Admin.ReportsModel
|
||
|
|
@{
|
||
|
|
ViewData["Title"] = "گزارشهای تخلف";
|
||
|
|
string TypeLabel(ReportTargetType t) => t switch
|
||
|
|
{
|
||
|
|
ReportTargetType.Shift => "شیفت", ReportTargetType.Job => "استخدام",
|
||
|
|
ReportTargetType.Facility => "مرکز", _ => "کاربر"
|
||
|
|
};
|
||
|
|
string StatusLabel(ReportStatus s) => s switch
|
||
|
|
{
|
||
|
|
ReportStatus.Open => "باز", ReportStatus.Resolved => "رسیدگیشده", _ => "ردشده"
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
<div class="page-head">
|
||
|
|
<div class="container">
|
||
|
|
<h1>گزارشهای تخلف</h1>
|
||
|
|
<p class="muted"><a asp-page="/Admin/Overview">← داشبورد</a> · <a asp-page="/Admin/Users">کاربران</a></p>
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
|
||
|
|
<div class="container section">
|
||
|
|
@if (Model.Reports.Count == 0)
|
||
|
|
{
|
||
|
|
<div class="card empty-state">گزارشی ثبت نشده است.</div>
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
foreach (var r in Model.Reports)
|
||
|
|
{
|
||
|
|
<div class="card card-pad" style="margin-bottom:10px; @(r.Status == ReportStatus.Open ? "" : "opacity:.6;")">
|
||
|
|
<div class="row" style="display:flex; justify-content:space-between; align-items:center; gap:8px; flex-wrap:wrap;">
|
||
|
|
<strong>@TypeLabel(r.TargetType): @(r.TargetLabel ?? ("#" + r.TargetId))</strong>
|
||
|
|
<span class="badge @(r.Status == ReportStatus.Open ? "badge-day" : "badge-type")">@StatusLabel(r.Status)</span>
|
||
|
|
</div>
|
||
|
|
<p style="margin:8px 0;">«@r.Reason»</p>
|
||
|
|
<div class="muted" style="font-size:12px;">@JalaliDate.ToLongDate(DateOnly.FromDateTime(r.CreatedAt)) · گزارشدهنده: @(r.ReporterUserId is not null ? "کاربر #" + r.ReporterUserId : "مهمان")</div>
|
||
|
|
<div style="display:flex; gap:8px; margin-top:10px;">
|
||
|
|
<a class="btn btn-outline" style="padding:6px 12px;" href="@JobsMedical.Web.Pages.Admin.ReportsModel.TargetUrl(r)" target="_blank">مشاهده مورد</a>
|
||
|
|
@if (r.Status == ReportStatus.Open)
|
||
|
|
{
|
||
|
|
<form method="post"><button asp-page-handler="Resolve" asp-route-id="@r.Id" class="btn btn-outline" style="padding:6px 12px;">رسیدگی شد</button></form>
|
||
|
|
<form method="post"><button asp-page-handler="Dismiss" asp-route-id="@r.Id" class="btn btn-outline" style="padding:6px 12px;">رد گزارش</button></form>
|
||
|
|
}
|
||
|
|
</div>
|
||
|
|
</div>
|
||
|
|
}
|
||
|
|
}
|
||
|
|
</div>
|