Skip to content

Commit

Permalink
improve error page - allow long suggestion text, instead of short des…
Browse files Browse the repository at this point in the history
…cription only
  • Loading branch information
kevinpapst committed Sep 11, 2022
1 parent 502950b commit 908548e
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions templates/error.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,18 @@
{% set errorMessageTrans = errorMessageKey|trans({ '%status_code%': status_code }, 'TablerBundle') %}
{% endif %}

{% set errorSuggestionKey = "http_error_#{status_code}.suggestion" %}
{% set errorSuggestionTrans = errorSuggestionKey|trans({ '%status_code%': status_code }, 'TablerBundle') %}
{% if errorSuggestionKey == errorSuggestionTrans %}
{% set errorSuggestionKey = 'http_error.suggestion' %}
{% set errorSuggestionTrans = errorSuggestionKey|trans({ '%status_code%': status_code }, 'TablerBundle') %}
{% endif %}

{% if errorSuggestionKey != errorSuggestionTrans and errorMessageKey != errorMessageTrans %}
{% set errorTitleTrans = errorMessageTrans %}
{% set errorMessageTrans = errorSuggestionTrans %}
{% endif %}

<div class="container-tight py-4">
<div class="empty">
<div class="empty-header">{% block error_code %}{{ status_code }}{% endblock %}</div>
Expand All @@ -31,9 +43,7 @@
</p>
<p class="empty-subtitle text-muted">
{% block error_subtitle %}
{% if errorMessageKey != errorMessageTrans %}
{{ errorMessageTrans }}
{% endif %}
{{ errorMessageTrans }}
{% endblock %}
</p>
<div class="empty-action">
Expand Down

0 comments on commit 908548e

Please sign in to comment.