lila/app/views/tv/index.scala

60 lines
1.7 KiB
Scala
Raw Normal View History

2019-02-24 00:02:59 -07:00
package views.html
package tv
2018-12-04 23:21:45 -07:00
2019-04-22 02:45:52 -06:00
import play.api.libs.json.Json
2018-12-04 23:21:45 -07:00
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.common.String.html.safeJsonValue
import controllers.routes
object index {
def apply(
2019-12-13 07:30:20 -07:00
channel: lila.tv.Tv.Channel,
champions: lila.tv.Tv.Champions,
pov: lila.game.Pov,
data: play.api.libs.json.JsObject,
cross: Option[lila.game.Crosstable.WithMatchup],
history: List[lila.game.Pov]
2018-12-04 23:21:45 -07:00
)(implicit ctx: Context) =
views.html.round.bits.layout(
2019-02-26 05:30:25 -07:00
variant = pov.game.variant,
2018-12-04 23:21:45 -07:00
title = s"${channel.name} TV: ${playerText(pov.player)} vs ${playerText(pov.opponent)}",
moreJs = frag(
roundTag,
2020-09-04 08:10:30 -06:00
embedJsUnsafeLoadThen(
s"""LichessRound.boot(${safeJsonValue(
2019-12-13 07:30:20 -07:00
Json.obj(
2019-04-22 02:45:52 -06:00
"data" -> data,
"i18n" -> views.html.round.jsI18n(pov.game)
2019-12-13 07:30:20 -07:00
)
2020-09-04 08:10:30 -06:00
)})"""
2019-04-22 02:45:52 -06:00
)
2018-12-04 23:21:45 -07:00
),
2019-04-21 08:33:50 -06:00
moreCss = cssTag("tv.single"),
2018-12-04 23:21:45 -07:00
chessground = false,
2019-12-13 07:30:20 -07:00
openGraph = lila.app.ui
.OpenGraph(
title = s"Watch the best ${channel.name.toLowerCase} games of lichess.org",
description =
2020-03-30 11:12:23 -06:00
s"Sit back, relax, and watch the best ${channel.name.toLowerCase} Lichess players compete on Lichess TV",
2019-12-13 07:30:20 -07:00
url = s"$netBaseUrl${routes.Tv.onChannel(channel.key)}"
)
.some,
2018-12-04 23:21:45 -07:00
robots = true
2019-04-06 19:10:19 -06:00
)(
2019-12-13 07:30:20 -07:00
main(cls := "round tv-single")(
st.aside(cls := "round__side")(
side.meta(pov),
),
2020-08-16 06:42:29 -06:00
views.html.round.bits.roundAppPreload(pov, controls = false),
2019-12-13 07:30:20 -07:00
div(cls := "round__underboard")(
2021-11-15 11:37:23 -07:00
views.html.round.bits.crosstable(cross, pov.game)
2019-04-06 19:10:19 -06:00
)
)
2019-12-13 07:30:20 -07:00
)
2018-12-04 23:21:45 -07:00
}