<commit_before>@(games: Seq[Game], user: Option[User] = None, ownerLink: Boolean = false, mini: Boolean = false)(implicit ctx: Context)

@gamePlayer(player: Player) = {
<div class="player @player.color.name">
  @player.playerUser.map { playerUser =>
  <a href="@routes.User.show(playerUser.id)" class="user_link ulpt">@usernameOrId(playerUser.id)</a><br />
  @playerUser.rating @playerUser.ratingDiff.map(showRatingDiff)
  }.getOrElse {
  <span>@player.nameSplit match {
    case Some((name, rating)) => {
    <span>@name</span><br />@rating
    }
    case _ => {<span class="anon">@User.anonymous</span>}
    }</span>
  }
</div>
}

@games.map { g =>
<div class="game_row paginated_element clearfix">
  @defining(user flatMap g.player) { fromPlayer =>
  @defining(fromPlayer | g.firstPlayer ) { firstPlayer =>
  @gameFen(g, firstPlayer.color, ownerLink, withTitle = false)
  <div class="infos" @if(g.imported) {
    data-icon="/"
    } else {
    @g.perfType.map { p => data-icon="@p.iconChar"}
    }>
    @bookmark.toggle(g)
    <div class="header">
      <strong>
        @g.clock.fold(trans.unlimited.str())(_.show)
        • @g.perfType.map(_.name)
        • @g.rated.fold(trans.rated(), trans.casual())
      </strong>
      @g.pgnImport.flatMap(_.date).getOrElse(momentFormat(g.createdAt))
    </div>
    <div class="versus">
      @gamePlayer(g.whitePlayer)
      <div class="swords" data-icon="U"></div>
      @gamePlayer(g.blackPlayer)
    </div>
    <div class="result">
      @if(g.isBeingPlayed) {@trans.playingRightNow()} else {
      @if(g.finishedOrAborted) {
      <span class="@{ g.winner.flatMap(w => fromPlayer.map(p => (p == w).fold("up", "down"))) }">
        @gameEndStatus(g)@g.winner.map { winner =>, @winner.color.fold(trans.whiteIsVictorious(), trans.blackIsVictorious()) }
      </span>
      } else {
      @g.turnColor.fold(trans.whitePlays(), trans.blackPlays())
      }
      }
    </div>
    @if(g.turns > 0) {
    @defining(g openingPgnMoves 20) { pgnMoves =>
    @chess.OpeningExplorer.openingOf(pgnMoves).map { opening =>
    <div class="opening">@opening.name</div>
    }
    <div class="pgn">@pgnMoves.take(6).grouped(2).zipWithIndex.map {
      case (List(w, b), i) => {@(i+1). @w @b}
      case (List(w), i) => {@(i+1). @w}
      case _ => {}
      }.mkString(" ")@if(g.turns > 6) { ... @g.turns moves }
    </div>
    }
    }
    <div class="metadata">
      @if(g.metadata.analysed) {<span data-icon="A"> Computer analysis available</span><br />}
      @g.pgnImport.flatMap(_.user).map { user =>
      PGN import by @userIdLinkMini(user)<br />
      }
      @g.tournamentId.map { tourId =>
      @tournamentLink(tourId)<br />
      }
      @g.poolId.flatMap(poolSetups.get).map { p =>
      <a data-icon="," href="@routes.Pool.show(p.id)">&nbsp;@p.name Pool</a><br />
      }
    </div>
  </div>
  }<commit_msg>show from position variant in game lists<commit_after>@(games: Seq[Game], user: Option[User] = None, ownerLink: Boolean = false, mini: Boolean = false)(implicit ctx: Context)

@gamePlayer(player: Player) = {
<div class="player @player.color.name">
  @player.playerUser.map { playerUser =>
  <a href="@routes.User.show(playerUser.id)" class="user_link ulpt">@usernameOrId(playerUser.id)</a><br />
  @playerUser.rating @playerUser.ratingDiff.map(showRatingDiff)
  }.getOrElse {
  <span>@player.nameSplit match {
    case Some((name, rating)) => {
    <span>@name</span><br />@rating
    }
    case _ => {<span class="anon">@User.anonymous</span>}
    }</span>
  }
</div>
}

@games.map { g =>
<div class="game_row paginated_element clearfix">
  @defining(user flatMap g.player) { fromPlayer =>
  @defining(fromPlayer | g.firstPlayer ) { firstPlayer =>
  @gameFen(g, firstPlayer.color, ownerLink, withTitle = false)
  <div class="infos" @if(g.imported) {
    data-icon="/"
    } else {
    @g.perfType.map { p => data-icon="@p.iconChar"}
    }>
    @bookmark.toggle(g)
    <div class="header">
      <strong>
        @g.clock.fold(trans.unlimited.str())(_.show)
        • @g.perfType.map(_.name).getOrElse {@chess.Variant.FromPosition.name}
        • @g.rated.fold(trans.rated(), trans.casual())
      </strong>
      @g.pgnImport.flatMap(_.date).getOrElse(momentFormat(g.createdAt))
    </div>
    <div class="versus">
      @gamePlayer(g.whitePlayer)
      <div class="swords" data-icon="U"></div>
      @gamePlayer(g.blackPlayer)
    </div>
    <div class="result">
      @if(g.isBeingPlayed) {@trans.playingRightNow()} else {
      @if(g.finishedOrAborted) {
      <span class="@{ g.winner.flatMap(w => fromPlayer.map(p => (p == w).fold("up", "down"))) }">
        @gameEndStatus(g)@g.winner.map { winner =>, @winner.color.fold(trans.whiteIsVictorious(), trans.blackIsVictorious()) }
      </span>
      } else {
      @g.turnColor.fold(trans.whitePlays(), trans.blackPlays())
      }
      }
    </div>
    @if(!g.fromPosition && g.turns > 0) {
    @defining(g openingPgnMoves 20) { pgnMoves =>
    @chess.OpeningExplorer.openingOf(pgnMoves).map { opening =>
    <div class="opening">@opening.name</div>
    }
    <div class="pgn">@pgnMoves.take(6).grouped(2).zipWithIndex.map {
      case (List(w, b), i) => {@(i+1). @w @b}
      case (List(w), i) => {@(i+1). @w}
      case _ => {}
      }.mkString(" ")@if(g.turns > 6) { ... @g.turns moves }
    </div>
    }
    } else {
    <br /><br />
    }
    <div class="metadata">
      @if(g.metadata.analysed) {<span data-icon="A"> Computer analysis available</span><br />}
      @g.pgnImport.flatMap(_.user).map { user =>
      PGN import by @userIdLinkMini(user)<br />
      }
      @g.tournamentId.map { tourId =>
      @tournamentLink(tourId)<br />
      }
      @g.poolId.flatMap(poolSetups.get).map { p =>
      <a data-icon="," href="@routes.Pool.show(p.id)">&nbsp;@p.name Pool</a><br />
      }
    </div>
  </div>
  }
{'fraction_non_alphanumeric': 0.2017167381974249, 'fraction_numerical': 0.0027467811158798285, 'mean_word_length': 3.094167252283907, 'pattern_counts': {'":': 0, '<': 87, '<?xml version=': 0, '>': 127, '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': '6064402', 'n_tokens_mistral': 2212, 'n_tokens_neox': 2162, 'n_words': 339}