84 lines
2.7 KiB
HTML
84 lines
2.7 KiB
HTML
@(reports: List[lila.report.Report.WithUserAndNotes], filter: String, counts: lila.report.Room.Counts)(implicit ctx: Context)
|
|
|
|
@import lila.report.Report.{WithUser,WithUserAndNotes}
|
|
|
|
@title = @{ "Reports" }
|
|
|
|
@tab(reports: List[WithUserAndNotes], room: lila.report.Room) = {
|
|
<a href="@routes.Report.listWithFilter(room.key)"
|
|
class="@when(counts.value.contains(room), "new") @filter.active(room.key)">
|
|
<count>@counts.get(room)</count>@room.name</a>
|
|
}
|
|
|
|
@mod.layout(
|
|
title = title,
|
|
active = "report",
|
|
moreCss = cssTag("report.css")) {
|
|
|
|
<div id="report_list" class="content_box no_padding">
|
|
<div class="header">
|
|
<i class="icon"></i>
|
|
<span class="tabs">
|
|
<a href="@routes.Report.listWithFilter("all")"
|
|
class="@when(counts.sum > 0, "new") @filter.active("all")">
|
|
<count>@if(counts.sum > 0) {@counts.sum}</count>All</a>
|
|
@lila.report.Room.all.map { r =>
|
|
@tab(reports, r)
|
|
}
|
|
</span>
|
|
</div>
|
|
<table class="slist see">
|
|
<thead>
|
|
<tr>
|
|
<th>Author</th>
|
|
<th>Reported</th>
|
|
<th>For</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@reports.map {
|
|
case WithUserAndNotes(WithUser(r, u, _, accuracy), notes) if (!r.isTrollOrInsult || isGranted(_.MarkTroll)) => {
|
|
<tr class="@r.unprocessed.fold("new", "")">
|
|
<td>
|
|
@userIdLink(r.createdBy.some)<br />
|
|
@momentFromNow(r.createdAt)
|
|
@if(accuracy.isDefined) {
|
|
<br /><strong>@accuracy%</strong> accuracy
|
|
}
|
|
</td>
|
|
<td>@userLink(u, params = "?mod")<br />@showBestPerf(u)</td>
|
|
<td>
|
|
<div class="text@if(r.text.size > 200 || r.text.lines.size > 5){ large}">
|
|
<strong>@r.reason.name.capitalize</strong>
|
|
- @autoLink(r.text)
|
|
@if(notes.nonEmpty) {
|
|
<br />
|
|
<a href="@routes.User.show(u.username)?notes=1">
|
|
<strong>@pluralize("note", notes.size) by @notes.map(_.from).map(usernameOrId).mkString(", ")</strong>
|
|
</a>
|
|
}
|
|
</div>
|
|
</td>
|
|
<td>@r.processedBy.map { u =>
|
|
<form action="@routes.Report.inquiry(r.id)" method="post" class="reopen">
|
|
<button type="submit" data-icon="G" class="text button">Re-open</button>
|
|
</form>
|
|
}.getOrElse {
|
|
<form action="@routes.Report.inquiry(r.id)" method="post" class="inquiry">
|
|
<button type="submit" data-icon="G" class="button"></button>
|
|
</form>
|
|
<form action="@routes.Report.process(r.id)" method="post" class="cancel">
|
|
<button type="submit" class="thin button">Dismiss</button>
|
|
</form>
|
|
}
|
|
</td>
|
|
</tr>
|
|
}
|
|
case _ => {}
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
}
|