112 lines
4.0 KiB
HTML
112 lines
4.0 KiB
HTML
@(pov: Pov, data: play.api.libs.json.JsObject, initialFen: Option[String], pgn: String, analysis: Option[lila.analyse.Analysis], analysisInProgress: Option[lila.fishnet.Work.InProgress], simul: Option[lila.simul.Simul], cross: Option[lila.game.Crosstable], userTv: Option[User], chatOption: Option[lila.chat.UserChat.Mine], bookmarked: Boolean)(implicit ctx: Context)
|
|
|
|
@import pov._
|
|
|
|
@title = @{ s"${playerText(pov.game.whitePlayer)} vs ${playerText(pov.game.blackPlayer)} in $gameId : ${game.opening.fold(trans.analysis.str())(_.opening.ecoName)}" }
|
|
|
|
@moreCss = {
|
|
@cssTag("analyse.css")
|
|
}
|
|
|
|
@moreJs = {
|
|
@jsAt(s"compiled/lichess.analyse${isProd??(".min")}.js")
|
|
@embedJs {
|
|
lichess = lichess || {};
|
|
lichess.analyse = {
|
|
data: @Html(J.stringify(data)),
|
|
i18n: @jsI18n(),
|
|
userId: @jsUserId,
|
|
chat: @jsOrNull(chatOption map { c =>
|
|
chat.ChatJsData.json(c.chat, name = trans.spectatorRoom.str(), timeout = c.timeout, withNote = ctx.isAuth)
|
|
}),
|
|
explorer: {
|
|
endpoint: "@explorerEndpoint",
|
|
tablebaseEndpoint: "@tablebaseEndpoint"
|
|
}
|
|
};
|
|
}
|
|
}
|
|
|
|
@atom = {
|
|
<link href="@routes.Round.atom(pov.gameId, pov.color.name)" type="application/atom+xml" rel="alternate" title="Game feed" />
|
|
}
|
|
|
|
@underchat = {
|
|
@views.html.game.watchers()
|
|
@round.blurs(game)
|
|
@round.holdAlerts(game)
|
|
}
|
|
|
|
@analyse.layout(
|
|
title = title,
|
|
side = views.html.game.side(pov, initialFen, none, simul = simul, userTv = userTv, bookmarked = bookmarked).some,
|
|
chat = chat.dom().some,
|
|
underchat = underchat.some,
|
|
moreCss = moreCss,
|
|
moreJs = moreJs,
|
|
openGraph = povOpenGraph(pov).some,
|
|
chessground = false,
|
|
atom = atom.some) {
|
|
<div class="analyse cg-512">@miniBoardContent</div>
|
|
<div class="underboard_content none">
|
|
<div class="analysis_panels">
|
|
@if(game.analysable) {
|
|
<div class="panel computer_analysis">
|
|
@if(analysis.isDefined || analysisInProgress.isDefined) {
|
|
<div id="adv_chart"></div>
|
|
} else {
|
|
<form class="future_game_analysis@if(ctx.isAnon){ must_login}" action="@routes.Analyse.requestAnalysis(gameId)" method="post">
|
|
<button type="submit" class="button text"><span class="is3 text" data-icon="">@trans.requestAComputerAnalysis()</span></button>
|
|
</form>
|
|
}
|
|
</div>
|
|
}
|
|
<div class="panel fen_pgn">
|
|
<div><strong>FEN</strong><input type="input" readonly="true" spellcheck="false" class="copyable autoselect fen" /></div>
|
|
<div class="pgn_options">
|
|
<strong>PGN</strong>
|
|
<div>
|
|
<a data-icon="x" class="text" rel="nofollow" href="@routes.Export.pgn(game.id)">@trans.downloadAnnotated()</a>
|
|
@if(analysis.isDefined) {
|
|
<a data-icon="x" class="text" rel="nofollow" href="@routes.Export.pgn(game.id)?as=raw">@trans.downloadRaw()</a>
|
|
}
|
|
@if(game.isPgnImport) {
|
|
<a data-icon="x" class="text" rel="nofollow" href="@routes.Export.pgn(game.id)?as=imported">@trans.downloadImported()</a>
|
|
}
|
|
@if(false && lila.game.Game.visualisableVariants(game.variant)) {
|
|
<a data-icon="=" class="text" target="_blank" href="@routes.Export.visualizer(game.id)">Generate images</a>
|
|
}
|
|
<a data-icon="=" class="text embed_howto" target="_blank">Embed in your website</a>
|
|
</div>
|
|
</div>
|
|
<div class="pgn">@Html(nl2br(escapeHtml(pgn)))</div>
|
|
</div>
|
|
<div class="panel move_times">
|
|
@if(game.turns > 3) {
|
|
<div id="movetimes_chart"></div>
|
|
}
|
|
</div>
|
|
@cross.map { c =>
|
|
<div class="panel crosstable">
|
|
@views.html.game.crosstable(pov.player.userId.fold(c)(c.fromPov), pov.gameId.some)
|
|
</div>
|
|
}
|
|
</div>
|
|
<div class="analysis_menu">
|
|
@if(game.analysable) {
|
|
<a data-panel="computer_analysis" class="computer_analysis"
|
|
@analysis.map { a => title="Provided by @usernameOrId(a.providedBy)" }>@trans.computerAnalysis()</a>
|
|
}
|
|
@if(!game.isPgnImport) {
|
|
@if(game.turns > 3) {
|
|
<a data-panel="move_times" class="move_times">@trans.moveTimes()</a>
|
|
}
|
|
@if(cross.isDefined) {
|
|
<a data-panel="crosstable" class="crosstable">@trans.crosstable()</a>
|
|
}
|
|
}
|
|
<a data-panel="fen_pgn" class="fen_pgn">FEN & PGN</a>
|
|
</div>
|
|
</div>
|
|
}
|