Merge branch 'master' of github.com:ornicar/lila
* 'master' of github.com:ornicar/lila: instanciate analysis replay (TODO: cache) and pass divisions to JS
This commit is contained in:
commit
ac7f7d4d56
|
@ -55,10 +55,16 @@ object Analyse extends LilaController {
|
|||
Env.game.pgnDump(pov.game) zip
|
||||
(env.analyser get pov.game.id) zip
|
||||
(pov.game.tournamentId ?? lila.tournament.TournamentRepo.byId) zip
|
||||
(GameRepo initialFen pov.game.id) zip
|
||||
Env.game.crosstableApi(pov.game) flatMap {
|
||||
case (((pgn, analysis), tour), crosstable) =>
|
||||
case ((((pgn, analysis), tour), initialFen), crosstable) =>
|
||||
Env.api.roundApi.watcher(pov, Env.api.version, tv = none, analysis.map(pgn -> _)) map { data =>
|
||||
val opening = gameOpening(pov.game)
|
||||
val replay = chess.Replay(
|
||||
pgn = pov.game.pgnMoves mkString " ",
|
||||
initialFen = initialFen,
|
||||
variant = pov.game.variant
|
||||
).toOption
|
||||
Ok(html.analyse.replay(
|
||||
pov,
|
||||
data,
|
||||
|
@ -68,7 +74,8 @@ object Analyse extends LilaController {
|
|||
analysis filter (_.done) map { a => AdvantageChart(a.infoAdvices, pov.game.pgnMoves) },
|
||||
tour,
|
||||
new TimeChart(pov.game, pov.game.pgnMoves),
|
||||
crosstable))
|
||||
crosstable,
|
||||
replay))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
@(pov: Pov, data: play.api.libs.json.JsObject, pgn: String, opening: Option[chess.OpeningExplorer.Opening], analysis: Option[lila.analyse.Analysis], advantageChart: Option[String], tour: Option[lila.tournament.Tournament], timeChart: lila.analyse.TimeChart, cross: Option[lila.game.Crosstable])(implicit ctx: Context)
|
||||
@(pov: Pov, data: play.api.libs.json.JsObject, pgn: String, opening: Option[chess.OpeningExplorer.Opening], analysis: Option[lila.analyse.Analysis], advantageChart: Option[String], tour: Option[lila.tournament.Tournament], timeChart: lila.analyse.TimeChart, cross: Option[lila.game.Crosstable], replay: Option[chess.Replay])(implicit ctx: Context)
|
||||
|
||||
@import pov._
|
||||
|
||||
|
@ -81,6 +81,14 @@ openGraph = povOpenGraph(pov)) {
|
|||
@analysis.map { a =>
|
||||
@advantageChart.map { chart =>
|
||||
<div
|
||||
@replay.map { replay =>
|
||||
@chess.Divider(replay) match {
|
||||
case (mid, end) => {
|
||||
data-division-mid="@mid.getOrElse("null")"
|
||||
data-division-end="@end.getOrElse("null")"
|
||||
}
|
||||
}
|
||||
}
|
||||
id="adv_chart"
|
||||
data-title="Advantage (up: white, down: black)"
|
||||
data-max="@lila.analyse.AdvantageChart.max"
|
||||
|
|
Loading…
Reference in a new issue