refactor/fix: css organization and error rendering (#3117)

* fix: php notice

* refactor/feat: merge HtmlFormat.css into style.css

Also improve ux of error rendering.

* fix: center-align footer text
This commit is contained in:
Dag 2022-10-29 10:46:37 +02:00 committed by GitHub
parent 1b45a53402
commit 23f8c81646
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 445 additions and 568 deletions

View file

@ -1,14 +1,36 @@
<div style="width: 60%; margin: 30px auto">
<div class="error">
<h1>Something went wrong</h1>
<h1>Application Error</h1>
<p>
<?= e($message) ?>
</p>
<p>The application could not run because of the following error:</p>
<h2>Stacktrace</h2>
<h2>Details</h2>
<?php foreach ($trace as $i => $frame) : ?>
<div style="margin-bottom: 15px">
<div>
<strong>Type:</strong> <?= e(get_class($e)) ?>
</div>
<div>
<strong>Code:</strong> <?= e($e->getCode()) ?>
</div>
<div>
<strong>Message:</strong> <?= e($e->getMessage()) ?>
</div>
<div>
<strong>File:</strong> <?= e(trim_path_prefix($e->getFile())) ?>
</div>
<div>
<strong>Line:</strong> <?= e($e->getLine()) ?>
</div>
</div>
<h2>Trace</h2>
<?php foreach (trace_from_exception($e) as $i => $frame) : ?>
<code>
#<?= $i ?> <?= e(frame_to_call_point($frame)) ?>
</code>
@ -19,17 +41,24 @@
<h2>Context</h2>
<p>
Query string: <?= e(urldecode($_SERVER['QUERY_STRING'] ?? '')) ?>
</p>
<p>
Version: <?= raw(Configuration::getVersion()) ?>
</p>
<p>
OS: <?= raw(PHP_OS_FAMILY) ?>
</p>
<p>
PHP version: <?= raw(PHP_VERSION ?: 'Unknown') ?>
</p>
<div>
<strong>Query:</strong> <?= e(urldecode($_SERVER['QUERY_STRING'] ?? '')) ?>
</div>
<div>
<strong>Version:</strong> <?= raw(Configuration::getVersion()) ?>
</div>
<div>
<strong>OS:</strong> <?= raw(PHP_OS_FAMILY) ?>
</div>
<div>
<strong>PHP:</strong> <?= raw(PHP_VERSION ?: 'Unknown') ?>
</div>
<br>
<a href="/">Go back</a>
</div>