<commit_before>package views.html.mod

import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.mod.Gamify.Period

import controllers.routes

object gamify {

  def index(leaderboards: lila.mod.Gamify.Leaderboards, history: List[lila.mod.Gamify.HistoryMonth])(implicit ctx: Context) = {
    val title = "Moderator hall of fame"
    def yearHeader(year: Int) = tr(cls := "year")(
      th(year),
      th("Champions of the past"),
      th("Score"),
      th("Actions taken"),
      th("Reports closed")
    )

    views.html.base.layout(
      title = title,
      moreCss = responsiveCssTag("mod.gamify")
    ) {
        main(cls := "page-menu")(
          views.html.mod.menu("gamify"),
          div(cls := "mod-gamify", cls := "page-menu__content index box")(
            h1(title),
            div(cls := "champs")(
              champion(leaderboards.daily.headOption, "reward1", Period.Day),
              champion(leaderboards.weekly.headOption, "reward2", Period.Week),
              champion(leaderboards.monthly.headOption, "reward3", Period.Month)
            ),
            table(cls := "slist slist-pad history")(
              tbody(
                history.headOption.filterNot(_.date.getMonthOfYear == 12).map { h =>
                  yearHeader(h.date.getYear)
                },
                history.map { h =>
                  frag(
                    h.date.getMonthOfYear == 12 option yearHeader(h.date.getYear),
                    tr(
                      th(h.date.monthOfYear.getAsText),
                      th(userIdLink(h.champion.modId.some, withOnline = false)),
                      td(cls := "score")(h.champion.score.localize),
                      td(h.champion.action.localize),
                      td(h.champion.report.localize)
                    )<commit_msg>fix mod hall of fame UI<commit_after>package views.html.mod

import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.mod.Gamify.Period

import controllers.routes

object gamify {

  def index(leaderboards: lila.mod.Gamify.Leaderboards, history: List[lila.mod.Gamify.HistoryMonth])(implicit ctx: Context) = {
    val title = "Moderator hall of fame"
    def yearHeader(year: Int) = tr(cls := "year")(
      th(year),
      th("Champions of the past"),
      th("Score"),
      th("Actions taken"),
      th("Reports closed")
    )

    views.html.base.layout(
      title = title,
      moreCss = responsiveCssTag("mod.gamify")
    ) {
        main(cls := "page-menu")(
          views.html.mod.menu("gamify"),
          div(id := "mod-gamify", cls := "page-menu__content index box")(
            h1(title),
            div(cls := "champs")(
              champion(leaderboards.daily.headOption, "reward1", Period.Day),
              champion(leaderboards.weekly.headOption, "reward2", Period.Week),
              champion(leaderboards.monthly.headOption, "reward3", Period.Month)
            ),
            table(cls := "slist slist-pad history")(
              tbody(
                history.headOption.filterNot(_.date.getMonthOfYear == 12).map { h =>
                  yearHeader(h.date.getYear)
                },
                history.map { h =>
                  frag(
                    h.date.getMonthOfYear == 12 option yearHeader(h.date.getYear),
                    tr(
                      th(h.date.monthOfYear.getAsText),
                      th(userIdLink(h.champion.modId.some, withOnline = false)),
                      td(cls := "score")(h.champion.score.localize),
                      td(h.champion.action.localize),
                      td(h.champion.report.localize)
                    )
{'fraction_non_alphanumeric': 0.12917000266880171, 'fraction_numerical': 0.004270082732852949, 'mean_word_length': 1.9009287925696594, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '3595425', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1136, 'n_words': 191}