<commit_before>@(u: User, email: Option[String], spy: lila.security.UserSpy, optionAggregateAssessment: Option[lila.evaluation.PlayerAggregateAssessment.WithGames], bans: Map[String, Int], history: List[lila.mod.Modlog])(implicit ctx: Context)

@import lila.evaluation.Display

<div class="actions clearfix">
  @if(isGranted(_.UserEvaluate)) {
  <form method="post" action="@routes.Mod.refreshUserAssess(u.username)" data-hint="Collect data and analyze if the user is suspicious." class="hint--bottom">
    <input class="button" type="submit" value="Evaluate" />
  </form>
  @if(isGranted(_.MarkTroll)) {
  <a class="button hint--bottom" href="@routes.Mod.communication(u.id)" data-hint="View communications">Coms</a>
  }
  <form method="post" action="@routes.Mod.notifySlack(u.id)" data-hint="Notify slack #tavern" class="hint--bottom">
    <input class="button" type="submit" value="Slack" />
  </form>
  •
  }
  @if(isGranted(_.MarkEngine)) {
  <form method="post" action="@routes.Mod.engine(u.username)" data-hint="This user is clearly cheating." class="hint--bottom">
    <input class="button@when(u.engine, " active")" type="submit" value="Engine" />
  </form>
  }
  @if(isGranted(_.MarkBooster)) {
  <form method="post" action="@routes.Mod.booster(u.username)" data-hint="Marks the user as a booster or sandbagger." class="hint--bottom">
    <input class="button@when(u.booster, " active")" type="submit" value="Booster" />
  </form>
  }
  @if(isGranted(_.MarkTroll)) {
  <form method="post" action="@routes.Mod.troll(u.username)?set=@(if (u.troll){0}else{1})" data-hint="@if(u.troll){Allows}else{Blocks} the user with communication features." class="hint--bottom">
    <input class="button@when(u.troll, " active")" type="submit" value="Shadowban" />
  </form>
  }
  @if(isGranted(_.IpBan)) {
  <form method="post" action="@routes.Mod.ban(u.username)" data-hint="Bans all @spy.ips.size IPs under this account from accessing this site." class="hint--bottom-left">
    <input class="button@when(u.ipBan, " active")" type="submit" value="IP ban @spy.ips.size" />
  </form>
  }
  @if(!u.disabled) {
  @if(isGranted(_.CloseAccount)) {
  <form method="post" action="@routes.Mod.closeAccount(u.username)" data-hint="Disables this account." class="hint--bottom-left">
    <input class="button" type="submit" value="Close" />
  </form>
  }
  } else {
  @if(isGranted(_.ReopenAccount)) {
  <form method="post" action="@routes.Mod.reopenAccount(u.username)" data-hint="Re-activates this account." class="hint--bottom-left">
    <input type="submit" class="button active" value="Closed" />
  </form>
  }
  }
  @if(isGranted(_.SetTitle)) {
  <br />
  <br />
  <form class="fide_title" method="post" action="@routes.Mod.setTitle(u.username)">
    @base.select(lila.user.DataForm.title.fill(u.title)("title"), lila.user.User.titles, "No title".some)
  </form>
  }
  @if(isGranted(_.SetEmail) && !isGranted(_.SetEmail, u)) {
  <form class="email" method="post" action="@routes.Mod.setEmail(u.username)">
    <input type="email" value="@email" name="email" placeholder="Email address" />
    <button type="submit" class="thin button" data-icon="E"></button>
  </form>
  }
</div>

<div class="user_spy">
  @optionAggregateAssessment.fold{
  <div class="evaluation">
    <p>
      No assessment available
      <br />
      <br />
    </p>
  </div>
  }{ pag =>
  <div class="evaluation results"><commit_msg>always show user email<commit_after>@(u: User, email: Option[String], spy: lila.security.UserSpy, optionAggregateAssessment: Option[lila.evaluation.PlayerAggregateAssessment.WithGames], bans: Map[String, Int], history: List[lila.mod.Modlog])(implicit ctx: Context)

@import lila.evaluation.Display

<div class="actions clearfix">
  @if(isGranted(_.UserEvaluate)) {
  <form method="post" action="@routes.Mod.refreshUserAssess(u.username)" data-hint="Collect data and analyze if the user is suspicious." class="hint--bottom">
    <input class="button" type="submit" value="Evaluate" />
  </form>
  @if(isGranted(_.MarkTroll)) {
  <a class="button hint--bottom" href="@routes.Mod.communication(u.id)" data-hint="View communications">Coms</a>
  }
  <form method="post" action="@routes.Mod.notifySlack(u.id)" data-hint="Notify slack #tavern" class="hint--bottom">
    <input class="button" type="submit" value="Slack" />
  </form>
  •
  }
  @if(isGranted(_.MarkEngine)) {
  <form method="post" action="@routes.Mod.engine(u.username)" data-hint="This user is clearly cheating." class="hint--bottom">
    <input class="button@when(u.engine, " active")" type="submit" value="Engine" />
  </form>
  }
  @if(isGranted(_.MarkBooster)) {
  <form method="post" action="@routes.Mod.booster(u.username)" data-hint="Marks the user as a booster or sandbagger." class="hint--bottom">
    <input class="button@when(u.booster, " active")" type="submit" value="Booster" />
  </form>
  }
  @if(isGranted(_.MarkTroll)) {
  <form method="post" action="@routes.Mod.troll(u.username)?set=@(if (u.troll){0}else{1})" data-hint="@if(u.troll){Allows}else{Blocks} the user with communication features." class="hint--bottom">
    <input class="button@when(u.troll, " active")" type="submit" value="Shadowban" />
  </form>
  }
  @if(isGranted(_.IpBan)) {
  <form method="post" action="@routes.Mod.ban(u.username)" data-hint="Bans all @spy.ips.size IPs under this account from accessing this site." class="hint--bottom-left">
    <input class="button@when(u.ipBan, " active")" type="submit" value="IP ban @spy.ips.size" />
  </form>
  }
  @if(!u.disabled) {
  @if(isGranted(_.CloseAccount)) {
  <form method="post" action="@routes.Mod.closeAccount(u.username)" data-hint="Disables this account." class="hint--bottom-left">
    <input class="button" type="submit" value="Close" />
  </form>
  }
  } else {
  @if(isGranted(_.ReopenAccount)) {
  <form method="post" action="@routes.Mod.reopenAccount(u.username)" data-hint="Re-activates this account." class="hint--bottom-left">
    <input type="submit" class="button active" value="Closed" />
  </form>
  }
  }
  @if(isGranted(_.SetTitle)) {
  <br />
  <br />
  <form class="fide_title" method="post" action="@routes.Mod.setTitle(u.username)">
    @base.select(lila.user.DataForm.title.fill(u.title)("title"), lila.user.User.titles, "No title".some)
  </form>
  }
  @if(isGranted(_.SetEmail)) {
  <form class="email" method="post" action="@routes.Mod.setEmail(u.username)">
    <input type="email" value="@email" name="email" placeholder="Email address" />
    <button type="submit" class="thin button" data-icon="E"></button>
  </form>
  }
</div>

<div class="user_spy">
  @optionAggregateAssessment.fold{
  <div class="evaluation">
    <p>
      No assessment available
      <br />
      <br />
    </p>
  </div>
  }{ pag =>
  <div class="evaluation results">
{'fraction_non_alphanumeric': 0.1977259303012404, 'fraction_numerical': 0.0005906674542232723, 'mean_word_length': 4.879340277777778, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 95, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7293619', 'n_tokens_mistral': 2412, 'n_tokens_neox': 2366, 'n_words': 428}