mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Show dismissed case count on cases page
This commit is contained in:
parent
22fc2ead98
commit
7cafbcd9cf
2 changed files with 4 additions and 1 deletions
|
@ -7,7 +7,7 @@
|
|||
Model.Title = "Cases";
|
||||
}
|
||||
|
||||
<p>There are @Model.CaseCount total cases.</p>
|
||||
<p>There are @Model.CaseCount total cases, @Model.DismissedCaseCount of which have been dismissed.</p>
|
||||
|
||||
<form action="/moderation/cases/0">
|
||||
<div class="ui icon input">
|
||||
|
|
|
@ -15,6 +15,7 @@ public class CasePage : BaseLayout
|
|||
|
||||
public List<ModerationCase> Cases;
|
||||
public int CaseCount;
|
||||
public int DismissedCaseCount;
|
||||
|
||||
public int PageAmount;
|
||||
public int PageNumber;
|
||||
|
@ -35,7 +36,9 @@ public class CasePage : BaseLayout
|
|||
.Include(c => c.Dismisser)
|
||||
.OrderByDescending(c => c.CaseId)
|
||||
.ToListAsync();
|
||||
|
||||
this.CaseCount = await this.Database.Cases.CountAsync(c => c.Reason.Contains(this.SearchValue));
|
||||
this.DismissedCaseCount = await this.Database.Cases.CountAsync(c => c.Reason.Contains(this.SearchValue) && c.DismissedAt != null);
|
||||
|
||||
this.PageNumber = pageNumber;
|
||||
this.PageAmount = Math.Max(1, (int)Math.Ceiling((double)this.CaseCount / ServerStatics.PageSize));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue