40 lines
923 B
HTML
40 lines
923 B
HTML
@(u: User, ui: String, question: play.api.libs.json.JsObject, stale: Boolean)(implicit ctx: Context)
|
|
|
|
@moreJs = {
|
|
@highchartsLatestTag
|
|
@jsAt("vendor/multiple-select/multiple-select.js")
|
|
@jsAt(s"compiled/lichess.insight${isProd??(".min")}.js")
|
|
@jsTag("insight-refresh.js")
|
|
@embedJs {
|
|
$(function() {
|
|
LichessInsight(document.getElementById('insight'), {
|
|
ui: @Html(ui),
|
|
initialQuestion: @Html(toJson(question)),
|
|
i18n: @jsI18n(),
|
|
userId: "@u.id",
|
|
username: "@u.username",
|
|
pageUrl: "@routes.Insight.index(u.username)",
|
|
postUrl: "@routes.Insight.json(u.username)"
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
@moreCss = {
|
|
@cssTag("insight.css")
|
|
@cssVendorTag("multiple-select/multiple-select.css")
|
|
}
|
|
|
|
@insight.layout(u,
|
|
title = s"${u.username} chess insights",
|
|
moreJs = moreJs,
|
|
moreCss = moreCss) {
|
|
<div id="insight"></div>
|
|
@if(stale) {
|
|
<div class="insight-stale none">
|
|
<p>There are new games to learn from!</p>
|
|
@refreshForm(u, "Update insights")
|
|
</div>
|
|
}
|
|
}
|