8000 TwigBundle exception/deprecation tweaks by ro0NL · Pull Request #24244 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

TwigBundle exception/deprecation tweaks #24244

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Sep 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load 10000 comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@
</div>
</div>

<div class="tab {{ logger is empty ? 'disabled' }}">
{% if logger %}
<div class="tab {{ logger.logs is empty ? 'disabled' }}">
<h3 class="tab-title">
Logs
{% if logger.counterrors ?? false %}<span class="badge status-error">{{ logger.counterrors }}</span>{% endif %}
</h3>

<div class="tab-content">
{% if logger %}
{% if logger.logs %}
{{ include('@Twig/Exception/logs.html.twig', { logs: logger.logs }, with_context = false) }}
{% else %}
<div class="empty">
Expand All @@ -70,6 +71,7 @@
{% endif %}
</div>
</div>
{% endif %}

<div class="tab">
<h3 class="tab-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,15 @@

<tbody>
{% for log in logs %}
<tr class="status-{{ log.priority >= 400 ? 'error' : log.priority >= 300 ? 'warning' : 'normal' }}">
{% if log.priority >= 400 %}
{% set status = 'error' %}
{% elseif log.priority >= 300 %}
{% set status = 'warning' %}
{% else %}
{% set severity = log.context.exception.severity|default(false) %}
{% set status = severity is constant('E_DEPRECATED') or severity is constant('E_USER_DEPRECATED') ? 'warning' : 'normal' %}
{% endif %}
<tr class="status-{{ status }}">
<td class="text-small" nowrap>
<span class="colored text-bold">{{ log.priorityName }}</span>
<span class="text-muted newline">{{ log.timestamp|date('H:i:s') }}</span>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@
};
})();

Sfjs.addEventListener(window, 'load', function() {
Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
Sfjs.createTabs();
Sfjs.createToggles();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@
};
})();

Sfjs.addEventListener(window, 'load', function() {
Sfjs.addEventListener(document, 'DOMContentLoaded', function() {
Sfjs.createTabs();
Sfjs.createToggles();
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,6 +832,8 @@ tr.status-warning td {
.tab-navigation li .badge.status-warning { background: {{ colors.warning|raw }}; color: #FFF; }
.tab-navigation li .badge.status-error { background: {{ colors.error|raw }}; color: #FFF; }

.sf-tabs .tab:not(:first-child) { display: none; }

{# Toggles
========================================================================= #}
.sf-toggle-content {
Expand Down
0