Skip to content

Commit 7dff3e2

Browse files
committed
error template redesign
1 parent 800508d commit 7dff3e2

File tree

1 file changed

+18
-9
lines changed

1 file changed

+18
-9
lines changed

src/Application/templates/error.phtml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,30 @@ $messages = [
1818
$message = isset($messages[$code]) ? $messages[$code] : $messages[0];
1919

2020
?>
21-
<!DOCTYPE html>
21+
<!DOCTYPE html><!-- "' --></textarea></script></style></pre></xmp></a></audio></button></canvas></datalist></details></dialog></iframe></listing></meter></noembed></noframes></noscript></optgroup></option></progress></rp></select></table></template></title></video>
2222
<meta charset="utf-8">
2323
<meta name=robots content=noindex>
2424
<meta name=generator content="Nette Framework">
25+
<title><?= $message[0] ?></title>
26+
2527
<style>
26-
body { color: #333; background: white; width: 500px; margin: 100px auto }
27-
h1 { font: bold 47px/1.5 sans-serif; margin: .6em 0 }
28-
p { font: 21px/1.5 Georgia,serif; margin: 1.5em 0 }
29-
small { font-size: 70%; color: gray }
28+
#nette-error { all: initial; position: absolute; top: 0; left: 0; right: 0; height: 70vh; min-height: 400px; display: flex; align-items: center; justify-content: center; z-index: 1000 }
29+
#nette-error div { all: initial; max-width: 550px; background: white; color: #333; display: block }
30+
#nette-error h1 { all: initial; font: bold 50px/1.1 sans-serif; display: block; margin: 40px }
31+
#nette-error p { all: initial; font: 20px/1.4 sans-serif; margin: 40px; display: block }
32+
#nette-error small { color: gray }
3033
</style>
3134

32-
<title><?= $message[0] ?></title>
35+
<div id=nette-error>
36+
<div>
37+
<h1><?= $message[0] ?></h1>
3338

34-
<h1><?= $message[0] ?></h1>
39+
<p><?= $message[1] ?></p>
3540

36-
<p><?= $message[1] ?></p>
41+
<?php if ($code): ?><p><small>error <?= $code ?></small></p><?php endif ?>
42+
</div>
43+
</div>
3744

38-
<?php if ($code): ?><p><small>error <?= $code ?></small></p><?php endif ?>
45+
<script>
46+
document.body.insertBefore(document.getElementById('nette-error'), document.body.firstChild);
47+
</script>

0 commit comments

Comments
 (0)