lila/app/views/account/bits.scala

34 lines
1.1 KiB
Scala
Raw Normal View History

2018-12-16 21:37:54 -07:00
package views.html
package account
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import lila.pref.PrefCateg
import lila.user.User
import controllers.routes
2018-12-16 21:37:54 -07:00
object bits {
def data(u: User)(implicit ctx: Context) =
account.layout(title = s"${u.username} - personal data", active = "security") {
div(cls := "account security personal-data box box-pad")(
h1("My personal data"),
div(cls := "personal-data__header")(
p("Here is all personal information Lichess has about ", userLink(u)),
a(cls := "button", href := s"${routes.Account.data}?user=${u.id}&text=1", downloadAttr)(
trans.downloadRaw()
)
)
)
}
2020-05-05 22:11:15 -06:00
def categName(categ: lila.pref.PrefCateg)(implicit ctx: Context): String =
categ match {
case PrefCateg.GameDisplay => trans.preferences.gameDisplay.txt()
case PrefCateg.ChessClock => trans.preferences.chessClock.txt()
case PrefCateg.GameBehavior => trans.preferences.gameBehavior.txt()
case PrefCateg.Site => "Site settings"
2020-05-05 22:11:15 -06:00
}
2018-12-16 21:37:54 -07:00
}