show games against best reporter

pull/3876/head
Thibault Duplessis 2017-12-05 18:30:43 -05:00
parent a3df870f2f
commit 1409b45446
2 changed files with 6 additions and 1 deletions

View File

@ -71,7 +71,9 @@
</div>
</div>
<div class="links">
<a href="@routes.User.games(in.user.id, "search")?players.b=@in.report.recentAtom.by.value">View<br />Games</a>
@in.report.bestAtomByHuman.map { atom =>
<a href="@routes.User.games(in.user.id, "search")?players.b=@atom.by.value">View<br />Games</a>
}
@if(isGranted(_.MarkTroll)) {
<a href="@routes.Mod.communicationPublic(in.user.id)">View<br />Comms</a>
}

View File

@ -52,6 +52,7 @@ case class Report(
} take nb
def onlyAtom: Option[Atom] = atoms.tail.isEmpty option atoms.head
def atomBy(reporterId: ReporterId): Option[Atom] = atoms.toList.find(_.by == reporterId)
def bestAtomByHuman: Option[Atom] = bestAtoms(10).toList.find(_.byHuman)
def unprocessedCheat = open && isCheat
def unprocessedOther = open && isOther
@ -91,6 +92,8 @@ object Report {
at: DateTime
) {
def simplifiedText = text.lines.filterNot(_ startsWith "[AUTOREPORT]") mkString "\n"
def byHuman = by.value != "lichess" && by.value != "irwin"
}
case class Inquiry(mod: User.ID, seenAt: DateTime)