show user notable preferences to mods

This commit is contained in:
Thibault Duplessis 2016-08-08 13:16:46 +02:00
parent d5eea5f855
commit 017d25eaa5
3 changed files with 15 additions and 5 deletions

View file

@ -194,10 +194,11 @@ object User extends LilaController {
(Env.security userSpy user.id) zip
(Env.mod.assessApi.getPlayerAggregateAssessmentWithGames(user.id)) zip
Env.mod.logApi.userHistory(user.id) zip
Env.plan.api.recentChargesOf(user) flatMap {
case ((((email, spy), playerAggregateAssessment), history), charges) =>
Env.plan.api.recentChargesOf(user) zip
Env.pref.api.getPref(user) flatMap {
case (((((email, spy), playerAggregateAssessment), history), charges), pref) =>
(Env.playban.api bans spy.usersSharingIp.map(_.id)) map { bans =>
html.user.mod(user, email, spy, playerAggregateAssessment, bans, history, charges)
html.user.mod(user, email, spy, playerAggregateAssessment, bans, history, charges, pref)
}
}
}

View file

@ -1,6 +1,7 @@
@(u: User, email: Option[String], spy: lila.security.UserSpy, optionAggregateAssessment: Option[lila.evaluation.PlayerAggregateAssessment.WithGames], bans: Map[String, Int], history: List[lila.mod.Modlog], charges: List[lila.plan.Charge])(implicit ctx: Context)
@(u: User, email: Option[String], spy: lila.security.UserSpy, optionAggregateAssessment: Option[lila.evaluation.PlayerAggregateAssessment.WithGames], bans: Map[String, Int], history: List[lila.mod.Modlog], charges: List[lila.plan.Charge], pref: lila.pref.Pref)(implicit ctx: Context)
@import lila.evaluation.Display
@import lila.pref.Pref
<div class="actions clearfix">
@if(isGranted(_.UserEvaluate)) {
@ -67,11 +68,16 @@
@if(isGranted(_.ChangePermission) || (isGranted(_.Admin) && u.roles.nonEmpty)) {
<div class="mod_roles">
<@if(isGranted(_.ChangePermission)){a href="@routes.Mod.powaaa(u.username)"}else{span}>
<strong class="text" data-icon="">Mod permissions:</strong>
<strong class="text inline" data-icon="">Mod permissions:</strong>
@if(u.roles.isEmpty) { Add some } else { @u.roles.mkString(", ") }
</@if(isGranted(_.ChangePermission)){a}else{span}>
</div>
}
<div class="preferences">
<strong class="text inline" data-icon="%">Notable preferences:</strong>
@if(pref.keyboardMove != Pref.KeyboardMove.NO) { [keyboard moves] }
@if(pref.blindfold != Pref.Blindfold.NO) { [blindfold] }
</div>
@optionAggregateAssessment.fold{
<div class="evaluation">
<p>

View file

@ -408,6 +408,9 @@ div.user_show .mod_zone strong {
display: block;
margin-top: 0.5em;
}
div.user_show .mod_zone strong.inline {
display: inline;
}
div.user_show .mod_zone .plan_charges ul {
max-height: 100px;
overflow: auto;