bug #30078 [Messenger] Fix DataCollector template (ottaviano)

This PR was merged into the 4.2 branch.

Discussion
----------

[Messenger] Fix DataCollector template

| Q             | A
| ------------- | ---
| Branch?       | 4.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

It's for adding a closing DIV tag on L96 (+ re-indent the HTML code)

Commits
-------

146ae74fac [Messenger] Fix DataCollector template
This commit is contained in:
Nicolas Grekas 2019-02-07 08:55:22 +01:00
commit 2d66fe7d5c

View File

@ -30,15 +30,15 @@
{% endblock %} {% endblock %}
{% block menu %} {% block menu %}
<span class="label{{ collector.exceptionsCount ? ' label-status-error' }}{{ collector.messages is empty ? ' disabled' }}"> <span class="label{{ collector.exceptionsCount ? ' label-status-error' }}{{ collector.messages is empty ? ' disabled' }}">
<span class="icon">{{ include('@WebProfiler/Icon/messenger.svg') }}</span> <span class="icon">{{ include('@WebProfiler/Icon/messenger.svg') }}</span>
<strong>Messages</strong> <strong>Messages</strong>
{% if collector.exceptionsCount > 0 %} {% if collector.exceptionsCount > 0 %}
<span class="count"> <span class="count">
<span>{{ collector.exceptionsCount }}</span> <span>{{ collector.exceptionsCount }}</span>
</span> </span>
{% endif %} {% endif %}
</span> </span>
{% endblock %} {% endblock %}
{% block head %} {% block head %}
@ -71,31 +71,31 @@
<p>No messages have been collected.</p> <p>No messages have been collected.</p>
</div> </div>
{% else %} {% else %}
<div class="sf-tabs message-bus">
<div class="tab">
{% set messages = collector.messages %}
{% set exceptionsCount = collector.exceptionsCount %}
<h3 class="tab-title">All<span class="badge {{ exceptionsCount ? exceptionsCount == messages|length ? 'status-error' : 'status-some-errors' }}">{{ messages|length }}</span></h3>
<div class="sf-tabs message-bus"> <div class="tab-content">
<div class="tab"> <p class="text-muted">Ordered list of dispatched messages across all your buses</p>
{% set messages = collector.messages %} {{ helper.render_bus_messages(messages, true) }}
{% set exceptionsCount = collector.exceptionsCount %} </div>
<h3 class="tab-title">All<span class="badge {{ exceptionsCount ? exceptionsCount == messages|length ? 'status-error' : 'status-some-errors' }}">{{ messages|length }}</span></h3>
<div class="tab-content">
<p class="text-muted">Ordered list of dispatched messages across all your buses</p>
{{ helper.render_bus_messages(messages, true) }}
</div> </div>
</div>
{% for bus in collector.buses %} {% for bus in collector.buses %}
<div class="tab message-bus"> <div class="tab message-bus">
{% set messages = collector.messages(bus) %} {% set messages = collector.messages(bus) %}
{% set exceptionsCount = collector.exceptionsCount(bus) %} {% set exceptionsCount = collector.exceptionsCount(bus) %}
<h3 class="tab-title">{{ bus }}<span class="badge {{ exceptionsCount ? exceptionsCount == messages|length ? 'status-error' : 'status-some-errors' }}">{{ messages|length }}</span></h3> <h3 class="tab-title">{{ bus }}<span class="badge {{ exceptionsCount ? exceptionsCount == messages|length ? 'status-error' : 'status-some-errors' }}">{{ messages|length }}</span></h3>
<div class="tab-content"> <div class="tab-content">
<p class="text-muted">Ordered list of messages dispatched on the <code>{{ bus }}</code> bus</p> <p class="text-muted">Ordered list of messages dispatched on the <code>{{ bus }}</code> bus</p>
{{ helper.render_bus_messages(messages) }} {{ helper.render_bus_messages(messages) }}
</div> </div>
</div>
{% endfor %}
</div> </div>
{% endfor %}
{% endif %} {% endif %}
{% endblock %} {% endblock %}
@ -105,24 +105,24 @@
{% for dispatchCall in messages %} {% for dispatchCall in messages %}
<table class="message-item"> <table class="message-item">
<thead> <thead>
<tr> <tr>
<th colspan="2" class="sf-toggle" <th colspan="2" class="sf-toggle"
data-toggle-selector="#message-item-{{ discr }}-{{ loop.index0 }}-details" data-toggle-selector="#message-item-{{ discr }}-{{ loop.index0 }}-details"
data-toggle-initial="{{ loop.first ? 'display' }}" data-toggle-initial="{{ loop.first ? 'display' }}"
> >
<span class="dump-inline">{{ profiler_dump(dispatchCall.message.type) }}</span> <span class="dump-inline">{{ profiler_dump(dispatchCall.message.type) }}</span>
{% if showBus %} {% if showBus %}
<span class="label">{{ dispatchCall.bus }}</span> <span class="label">{{ dispatchCall.bus }}</span>
{% endif %} {% endif %}
{% if dispatchCall.exception is defined %} {% if dispatchCall.exception is defined %}
<span class="label status-error">exception</span> <span class="label status-error">exception</span>
{% endif %} {% endif %}
<a class="toggle-button"> <a class="toggle-button">
<span class="icon icon-close">{{ include('@Twig/images/icon-minus-square.svg') }}</span> <span class="icon icon-close">{{ include('@Twig/images/icon-minus-square.svg') }}</span>
<span class="icon icon-open">{{ include('@Twig/images/icon-plus-square.svg') }}</span> <span class="icon icon-open">{{ include('@Twig/images/icon-plus-square.svg') }}</span>
</a> </a>
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody id="message-item-{{ discr }}-{{ loop.index0 }}-details" class="sf-toggle-content"> <tbody id="message-item-{{ discr }}-{{ loop.index0 }}-details" class="sf-toggle-content">
<tr> <tr>
@ -133,7 +133,7 @@
{% set link = caller.file|file_link(caller.line) %} {% set link = caller.file|file_link(caller.line) %}
{% if link %} {% if link %}
<a href="{{ link }}" title="{{ caller.file }}">{{ caller.name }}</a> <a href="{{ link }}" title="{{ caller.file }}">{{ caller.name }}</a>
{% else %} {% else %}
<abbr title="{{ caller.file }}">{{ caller.name }}</abbr> <abbr title="{{ caller.file }}">{{ caller.name }}</abbr>
{% endif %} {% endif %}
{% else %} {% else %}
@ -150,10 +150,10 @@
</td> </td>
</tr> </tr>
{% if showBus %} {% if showBus %}
<tr> <tr>
<td class="text-bold">Bus</td> <td class="text-bold">Bus</td>
<td>{{ dispatchCall.bus }}</td> <td>{{ dispatchCall.bus }}</td>
</tr> </tr>
{% endif %} {% endif %}
<tr> <tr>
<td class="text-bold">Message</td> <td class="text-bold">Message</td>
@ -170,12 +170,12 @@
</td> </td>
</tr> </tr>
{% if dispatchCall.exception is defined %} {% if dispatchCall.exception is defined %}
<tr> <tr>
<td class="text-bold">Exception</td> <td class="text-bold">Exception</td>
<td> <td>
{{ profiler_dump(dispatchCall.exception.value, maxDepth=1) }} {{ profiler_dump(dispatchCall.exception.value, maxDepth=1) }}
</td> </td>
</tr> </tr>
{% endif %} {% endif %}
</tbody> </tbody>
</table> </table>