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.12 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, given }
import lila.app.templating.Environment.{ given, * }
import lila.app.ui.ScalatagsTemplate.{ *, given }
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(
jsModule("msg"),
embedJsUnsafeLoadThen(
s"""LichessMsg(${safeJsonValue(
Json.obj(
"data" -> json,
"i18n" -> jsI18n
)
)})"""
)
),
title = trans.inbox.txt(),
csp = defaultCsp.withInlineIconFont.some
) {
main(cls := "box msg-app")
}
def jsI18n(implicit ctx: Context) = i18nJsObject(i18nKeys)
private val i18nKeys = List(
trans.inbox,
trans.challenge.challengeToPlay,
trans.block,
trans.unblock,
trans.blocked,
trans.delete,
trans.reportXToModerators,
trans.searchOrStartNewDiscussion,
trans.players,
trans.friends,
trans.discussions,
trans.today,
trans.yesterday
)