forked from lichess-org/lila
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmsg.scala
48 lines (42 loc) · 1.11 KB
/
msg.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
package views.html
import play.api.libs.json._
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.common.String.html.safeJsonValue
object msg {
def home(json: JsObject)(implicit ctx: Context) =
views.html.base.layout(
moreCss = frag(cssTag("msg")),
moreJs = frag(
jsAt(s"compiled/lichess.msg${isProd ?? ".min"}.js"),
embedJsUnsafe(
s"""$$(() =>LichessMsg.default(document.querySelector('.msg-app'), ${safeJsonValue(
Json.obj(
"data" -> json,
"i18n" -> jsI18n
)
)}))"""
)
),
title = "Lichess Inbox"
) {
main(cls := "box msg-app")
}
def jsI18n(implicit ctx: Context) = i18nJsObject(i18nKeys)
private val i18nKeys = List(
trans.inbox,
trans.challengeToPlay,
trans.block,
trans.unblock,
trans.blocked,
trans.delete,
trans.reportXToModerators,
trans.searchOrStartNewDiscussion,
trans.players,
trans.friends,
trans.discussions,
trans.today,
trans.yesterday
).map(_.key)
}