mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-08-01 08:44:48 +02:00
Added custom error pages, that assists users with common problems.
This commit is contained in:
parent
f36c618da9
commit
a0f5177533
7 changed files with 202 additions and 0 deletions
53
templates/bundles/TwigBundle/Exception/error.html.twig
Normal file
53
templates/bundles/TwigBundle/Exception/error.html.twig
Normal file
|
@ -0,0 +1,53 @@
|
|||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8"/>
|
||||
<meta name="robots" content="noindex,nofollow,noarchive" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
||||
<title>An Error Occurred: {{ status_text }}</title>
|
||||
<style>{% include "bundles/TwigBundle/Exception/assets/error.css.twig" %}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
|
||||
<h1 class="status_code">{% block status_code %}{{ status_code }}{% endblock %}</h1>
|
||||
<h2 class="status_text">{% block status_text %}{{ status_text }}{% endblock %}</h2>
|
||||
<h3 class="status_comment">
|
||||
{% block status_comment %}
|
||||
Consider yourself lucky. You found some rare error code. <br> You should maybe inform your administrator about it...
|
||||
{% endblock %}
|
||||
</h3>
|
||||
{% block further_actions %}<p class="help_text">You can try to <a href="javascript:history.back()">Go Back</a> or <a href="{{ path('homepage') }}">Visit the homepage</a>.</p>{% endblock %}
|
||||
{% block admin_contact %}<p class="help_text">If this error persists, please contact your
|
||||
{% if error_page_admin_email is not empty %}
|
||||
<a href="mailto:{{ error_page_admin_email }}">administrator.</a>
|
||||
{% else %}
|
||||
administrator.
|
||||
{% endif %}
|
||||
</p>
|
||||
{% endblock %}
|
||||
|
||||
{% if error_page_show_help %}
|
||||
<div class="dev_hint">
|
||||
<b>Infos for Admin:</b>
|
||||
{% block admin_info %}
|
||||
You could try to do following things, if this error is unexpected:
|
||||
<ul>
|
||||
<li>Check <code>var/log/prod.log</code> for additional informations</li>
|
||||
<li>Run <kbd>php bin/console cache:clear</kbd> to clear cache</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
<p>If you think that this is an error in Part-DB, open an Issue on <a href="https://github.com/Part-DB/Part-DB-symfony/issues" rel="noopener">GitHub</a>.</p>
|
||||
<p><small>You can disable these hints in <code>config/parameters.yaml</code> by setting <code>partdb.error_pages.show_help</code> to false.</small></p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="footer">
|
||||
{% block footer %}
|
||||
<span class="text-muted">This page was generated by <a href="https://github.com/Part-DB/Part-DB-symfony" rel="noopener">Part-DB</a> on {{ "now" | format_datetime("medium", "short") }} </span>.
|
||||
{% endblock %}
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue