@(pov: Pov, data: play.api.libs.json.JsObject, tour: Option[lila.tournament.TourMiniView], simul: Option[lila.simul.Simul], cross: Option[lila.game.Crosstable.WithMatchup], playing: List[Pov], chatOption: Option[lila.chat.Chat.GameOrEvent], bookmarked: Boolean)(implicit ctx: Context) @import pov._ @title = @{ s"${trans.play.txt()} ${playerText(pov.opponent)} in $gameId" } @moreJs = { @roundTag @embedJs { window.customWS = true; window.onload = function() { LichessRound.boot({ data: @safeJson(data), i18n: @jsI18n(pov.game), userId: @jsUserId, @tour.map { t => tour: @toJson(tour.flatMap(_.top).map(lila.tournament.JsonView.top(_, lightUser))), } chat: @jsOrNull(chatOption.map(_.either).map { case Left(c) => { chat.ChatJsData.restricted(c, name = trans.chatRoom.txt(), timeout = false, withNote = ctx.isAuth, public = false) } case Right(c) => { chat.ChatJsData.json(c.chat, name = trans.chatRoom.txt(), timeout = c.timeout, public = true) } }) }, document.getElementById('lichess')); }; } } @atom = { } @underchat = { @views.html.game.watchers() @round.blurs(pov.game) @round.holdAlerts(pov.game) } @round.layout( title = title, side = views.html.game.side(pov, (data\"game"\"initialFen").asOpt[String], tour.map(_.tour), simul, bookmarked = bookmarked), chat = chatOption.isDefined.option(chat.dom()), underchat = underchat.some, moreJs = moreJs, moreCss = cssTag("chat.css"), openGraph = povOpenGraph(pov).some, chessground = false, playing = true, atom = atom.some) {
@board.domPreload(pov.some)
@cross.map { c =>
@views.html.game.crosstable(ctx.userId.fold(c)(c.fromPov), pov.gameId.some)
}
@if(playing.nonEmpty || simul.nonEmpty) {
@others(playing, simul)
} }