2019-04-20 21:11:23 -06:00
|
|
|
package views.html.mod
|
|
|
|
|
|
|
|
import lila.api.Context
|
|
|
|
import lila.app.templating.Environment._
|
|
|
|
import lila.app.ui.ScalatagsTemplate._
|
|
|
|
|
|
|
|
import controllers.routes
|
|
|
|
|
|
|
|
object chatPanic {
|
|
|
|
|
|
|
|
def apply(state: Option[org.joda.time.DateTime])(implicit ctx: Context) = {
|
|
|
|
val title = "Chat Panic"
|
|
|
|
views.html.base.layout(
|
|
|
|
title = title,
|
2019-04-21 08:33:50 -06:00
|
|
|
moreCss = cssTag("mod.misc")
|
2019-04-20 21:11:23 -06:00
|
|
|
) {
|
2019-12-13 07:30:20 -07:00
|
|
|
main(cls := "page-menu")(
|
|
|
|
views.html.mod.menu("panic"),
|
|
|
|
div(id := "chat-panic", cls := "page-menu__content box box-pad")(
|
|
|
|
h1(title),
|
|
|
|
p(
|
|
|
|
"When Chat Panic is enabled, restrictions apply to public chats (tournament, simul) and PM",
|
|
|
|
br,
|
|
|
|
"Only players 24h old, and with 10 games played, can write messages."
|
|
|
|
),
|
|
|
|
p(
|
|
|
|
"Current state: ",
|
|
|
|
state.map { s =>
|
|
|
|
frag(
|
2021-06-14 01:13:27 -06:00
|
|
|
goodTag(cls := "text", dataIcon := "")(strong("ENABLED")),
|
2019-12-13 07:30:20 -07:00
|
|
|
". Expires ",
|
|
|
|
momentFromNow(s)
|
|
|
|
)
|
2021-06-14 01:13:27 -06:00
|
|
|
} getOrElse badTag(cls := "text", dataIcon := "")(strong("DISABLED"))
|
2019-12-13 07:30:20 -07:00
|
|
|
),
|
|
|
|
div(cls := "forms")(
|
|
|
|
if (state.isDefined)
|
|
|
|
frag(
|
2021-02-08 07:25:21 -07:00
|
|
|
postForm(action := s"${routes.Mod.chatPanicPost}?v=0")(
|
2021-06-14 01:13:27 -06:00
|
|
|
submitButton(cls := "button button-fat button-red text", dataIcon := "")("Disable")
|
2019-04-20 21:11:23 -06:00
|
|
|
),
|
2021-02-08 07:25:21 -07:00
|
|
|
postForm(action := s"${routes.Mod.chatPanicPost}?v=1")(
|
2021-06-14 01:13:27 -06:00
|
|
|
submitButton(cls := "button button-fat button-green text", dataIcon := "")(
|
2019-12-13 07:30:20 -07:00
|
|
|
"Renew for two hours"
|
|
|
|
)
|
2019-04-20 21:11:23 -06:00
|
|
|
)
|
2019-08-11 04:34:05 -06:00
|
|
|
)
|
2019-12-13 07:30:20 -07:00
|
|
|
else
|
2021-02-08 07:25:21 -07:00
|
|
|
postForm(action := s"${routes.Mod.chatPanicPost}?v=1")(
|
2021-06-14 01:13:27 -06:00
|
|
|
submitButton(cls := "button button-fat text", dataIcon := "")("Enable")
|
2019-04-20 21:11:23 -06:00
|
|
|
)
|
|
|
|
)
|
|
|
|
)
|
2019-12-13 07:30:20 -07:00
|
|
|
)
|
|
|
|
}
|
2019-04-20 21:11:23 -06:00
|
|
|
}
|
|
|
|
}
|