@(data: play.api.libs.json.JsObject, userTimeline: Vector[lila.timeline.Entry], forumRecent: List[lila.forum.MiniForumPost], tours: List[Tournament], events: List[lila.event.Event], simuls: List[lila.simul.Simul], featured: Option[Game], leaderboard: List[User.LightPerf], tournamentWinners: List[lila.tournament.Winner], puzzle: Option[lila.puzzle.DailyPuzzle], streams: lila.streamer.LiveStreams.WithTitles, lastPost: List[lila.blog.MiniPost], playban: Option[lila.playban.TempBan], currentGame: Option[lila.app.mashup.Preload.CurrentGame], nbRounds: Int)(implicit ctx: Context)
@import play.api.libs.json.Json
@underchat = {
@featured.map { g =>
@gameFen(Pov.first(g), tv = true)
@game.vstext(Pov.first(g))(ctx.some)
}
}
@side = {
@NotForKids {
@streamer.liveStreams(streams)
}
@events.map { e =>
@event.homepageSpotlight(e)
}
@lila.tournament.Spotlight.select(tours, ctx.me, 3).map { tour =>
@tournament.homepageSpotlight(tour)
}
@simuls.find(_.spotlightable).take(2).map { s =>
@simul.homepageSpotlight(s)
}
@ctx.me.map { u =>
@timeline.entries(userTimeline)
}.getOrElse {
}
}
@baseline = {
@trans.nbPlayers(Html("-,---"))
@trans.nbGamesInPlay.plural(nbRounds, Html(s"${nbRounds}"))
@if(ctx.isMobileBrowser) {
@if(lila.common.HTTPRequest.isAndroid(ctx.req)) {
@mobile.googlePlayButton()
} else {
@if(lila.common.HTTPRequest.isIOS(ctx.req)) {
@mobile.appleStoreButton()
}
}
}
}
@moreJs = {
@jsAt(s"compiled/lichess.lobby${isProd??(".min")}.js", async = true)
@embedJs {
window.customWS = true;
lichess_lobby = {
data: @safeJson(data),
playban: @htmlOrNull(playban) { pb =>
@safeJson(Json.obj("minutes" -> pb.mins, "remainingSeconds" -> (pb.remainingSeconds + 3)))
},
currentGame: @htmlOrNull(currentGame) { cg =>
@safeJson(cg.json)
},
i18n: @jsI18n()
};
}
}
@base.layout(
title = "",
fullTitle = Some("lichess.org • " + trans.freeOnlineChess.txt()),
baseline = baseline.some,
side = side.some,
moreJs = moreJs,
moreCss = cssTag("home.css"),
underchat = underchat.some,
chessground = false,
openGraph = lila.app.ui.OpenGraph(
image = staticUrl("images/large_tile.png").some,
title = "The best free, adless Chess server",
url = netBaseUrl,
description = trans.siteDescription.txt()
).some,
asyncJs = true) {
@currentGame.map(currentGameInfo(_))
@playban.map(ban => playbanInfo(ban.remainingSeconds))
@puzzle.map { p =>
@p.html
@trans.puzzleOfTheDay()
@p.color.fold(trans.whitePlays, trans.blackPlays)()
}
@tournament.enterable(tours)
@simul.allCreated(simuls)
@NotForKids {
}
@if(lastPost.nonEmpty) {
@lastPost.map { post =>
@defining(routes.Blog.show(post.id, post.slug)) { url =>
@semanticDate(post.date)
@post.title
@post.shortlede
}
}
}
}