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
|
2020-08-14 02:55:32 -06:00
|
|
|
import lila.user.User
|
|
|
|
import controllers.routes
|
2018-12-16 21:37:54 -07:00
|
|
|
|
|
|
|
object bits {
|
|
|
|
|
2021-04-10 03:19:14 -06:00
|
|
|
def data(u: User)(implicit ctx: Context) =
|
2020-08-14 02:55:32 -06:00
|
|
|
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)),
|
2021-04-10 03:19:14 -06:00
|
|
|
a(cls := "button", href := s"${routes.Account.data}?user=${u.id}&text=1", downloadAttr)(
|
|
|
|
trans.downloadRaw()
|
|
|
|
)
|
2020-08-14 02:55:32 -06:00
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
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()
|
2021-10-21 05:25:39 -06:00
|
|
|
case PrefCateg.Site => "Site settings"
|
2020-05-05 22:11:15 -06:00
|
|
|
}
|
2018-12-16 21:37:54 -07:00
|
|
|
}
|