port error page to scalatags

more-scalatags
Niklas Fiekas 2019-04-04 08:02:07 +02:00
parent c2286d7093
commit 5ee02f5af1
2 changed files with 28 additions and 14 deletions

View File

@ -0,0 +1,28 @@
package views.html
package base
import lila.api.Context
import lila.app.templating.Environment._
import lila.app.ui.ScalatagsTemplate._
import controllers.routes
object errorPage {
def apply(ex: Throwable)(implicit ctx: Context) = {
layout(
title = "Internal server error",
responsive = true
) {
main(cls := "page-small box box-pad")(
h1("Something went wrong on this page"),
p(
"If the problem persists, please ",
a(href := s"${routes.Main.contact}#help-error-page")("report the bug"),
"."
),
code(ex.getMessage)
)
}
}.toHtml
}

View File

@ -1,14 +0,0 @@
@(ex: Throwable)(implicit ctx: Context)
@base.layout(title = "Internal server error") {
<div class="content_box small_box">
<h1>Something went wrong on this page.</h1>
<br />
<br />
<p>If the problem persists, please <a href="@routes.Main.contact#error-page">report the bug</a>.</p>
<br />
<br />
<code>@ex.getMessage</code>
</div>
}.toHtml