forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
201 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@(in: lila.mod.Inquiry)(implicit ctx: Context) | ||
|
||
<div class="inquiry"> | ||
<i class="icon"></i> | ||
<div class="meat"> | ||
<h2 class="user"> | ||
@Html(userLink(in.user, withBestRating = true).body.replace("<a ", "<a data-pt-pos=\"se\" ")) | ||
</h2> | ||
<div class="report"> | ||
<h3>Reported by @userIdLink(in.report.createdBy.some, withOnline = false) for @in.report.reason.name</h3> | ||
<p>@autoLink(in.report.text.replace("\n", " "))</p> | ||
</div> | ||
</div> | ||
<div class="links"> | ||
@if(isGranted(_.MarkTroll)) { | ||
<a href="@routes.Mod.communication(in.user.id)">View Coms</a> | ||
} | ||
<a href="@routes.User.show(in.user.username)?mod">Mod tools</a> | ||
</div> | ||
<div class="actions"> | ||
@if(isGranted(_.MarkEngine)) { | ||
<form method="post" action="@routes.Mod.engine(in.user.username)" data-hint="This user is clearly cheating." class="hint--bottom-left"> | ||
<input class="fbt@when(in.user.engine, " active")" type="submit" value="Engine" /> | ||
</form> | ||
} | ||
@if(isGranted(_.MarkBooster)) { | ||
<form method="post" action="@routes.Mod.booster(in.user.username)" data-hint="Marks the user as a booster or sandbagger." class="hint--bottom-left"> | ||
<input class="fbt@when(in.user.booster, " active")" type="submit" value="Booster" /> | ||
</form> | ||
} | ||
@if(isGranted(_.MarkTroll)) { | ||
<form method="post" action="@routes.Mod.troll(in.user.username)?set=@(if (in.user.troll){0}else{1})" data-hint="@if(in.user.troll){En}else{Dis}able communication features for this user." class="hint--bottom-left"> | ||
<input class="fbt@when(in.user.troll, " active")" type="submit" value="Shadowban" /> | ||
</form> | ||
} | ||
</div> | ||
<div class="actions close"> | ||
<form action="@routes.Report.process(in.report.id)" method="post" data-hint="Dismiss this report as processed." class="hint--bottom-left"> | ||
<button type="submit" data-icon="E" class="fbt"></button> | ||
</form> | ||
<form action="@routes.Report.inquiry(in.report.id)" method="post" data-hint="Cancel the inquiry, re-instore the report" class="hint--bottom-left"> | ||
<button type="submit" data-icon="L" class="fbt"></button> | ||
</form> | ||
</div> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package lila.mod | ||
|
||
import play.api.libs.json._ | ||
|
||
import lila.common.LightUser | ||
import lila.report.{ Report, ReportApi } | ||
import lila.user.{ User, UserRepo } | ||
|
||
case class Inquiry( | ||
mod: LightUser, | ||
report: Report, | ||
user: User | ||
) | ||
|
||
final class InquiryApi(reportApi: ReportApi) { | ||
|
||
def forMod(mod: User): Fu[Option[Inquiry]] = | ||
lila.security.Granter(_.Hunter)(mod).?? { | ||
reportApi.inquiries.ofModId(mod.id).flatMap { | ||
_ ?? { report => | ||
UserRepo named report.user map { | ||
_ ?? { user => | ||
Inquiry(mod.light, report, user).some | ||
} | ||
} | ||
} | ||
} | ||
} | ||
|
||
import lila.common.LightUser.lightUserWrites | ||
import lila.report.JsonView.reportWrites | ||
import lila.user.JsonView.modWrites | ||
val inquiryWrites = Json.writes[Inquiry] | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
.inquiry { | ||
height: 40px; | ||
background: #444; | ||
color: #f0f0f0!important; | ||
display: flex; | ||
flex-flow: row nowrap; | ||
justify-content: space-between; | ||
border-bottom: 1px solid #666; | ||
margin-bottom: 5px; | ||
box-shadow: 2px 5px 6px rgba(0, 0, 0, 0.3); | ||
} | ||
.inquiry > .icon { | ||
flex: 0 0 160px; | ||
height: 160px; | ||
width: 160px; | ||
margin: -80px 0 0 -80px; | ||
background: #444 no-repeat url(../images/icons/octopus.svg); | ||
background-size: 37% 37%; | ||
background-position: 82% 82%; | ||
border-radius: 0 0 50% 0; | ||
border: 2px solid #666; | ||
box-shadow: 3px 3px 6px rgba(0, 0, 0, 0.3); | ||
} | ||
.inquiry a { | ||
color: #f0f0f0!important; | ||
} | ||
.inquiry .meat { | ||
flex: 1 1 100%; | ||
height: 100%; | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
overflow: hidden; | ||
} | ||
.inquiry h2 .user_link { | ||
font-size: 1.3em; | ||
} | ||
.inquiry .report { | ||
margin: 0 20px; | ||
opacity: 0.8; | ||
} | ||
.inquiry .report h3 { | ||
margin: 0; | ||
} | ||
.inquiry .report p { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
font-style: italic; | ||
} | ||
.inquiry .actions, | ||
.inquiry .links { | ||
margin-right: 10px; | ||
white-space: nowrap; | ||
height: 100%; | ||
display: flex; | ||
flex-flow: row nowrap; | ||
align-items: center; | ||
} | ||
.inquiry .actions:not(.close), | ||
.inquiry .links { | ||
padding-right: 10px; | ||
border-right: 1px solid #666; | ||
} | ||
.inquiry .actions form { | ||
height: 100%; | ||
} | ||
.inquiry .fbt { | ||
height: 100%; | ||
background: #444; | ||
color: #f0f0f0!important; | ||
} | ||
.inquiry .fbt.active { | ||
color: #fff!important; | ||
} | ||
.inquiry .links { | ||
padding: 0 10px; | ||
border-left: 1px solid #666; | ||
} | ||
.inquiry .links a { | ||
padding: 10px 13px; | ||
} | ||
.inquiry .links a:hover { | ||
color: #3893E8!important; | ||
} |