You are here

events.html.twig in Devel 8

{% block toolbar %}
    {% set icon %}
        <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'events'}) }}" title="{{ 'Events'|t }}">
            <img width="20" height="28" alt="{{ 'Events'|t }}"
                 src="data:image/png;base64,{{ collector.icon }}">
            <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getCalledListenersCount }}</span>
        </a>
    {% endset %}

    {% set text %}
        <div class="sf-toolbar-info-piece">
            <b>{{ 'Called'|t }}</b>
            <span>{{ collector.getCalledListenersCount }}</span>
        </div>

        <div class="sf-toolbar-info-piece">
            <b>{{ 'Not called'|t }}</b>
            <span>{{ collector.getNotCalledListenersCount }}</span>
        </div>
    {% endset %}

    <div class="sf-toolbar-block">
        <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
        <div class="sf-toolbar-info">{{ text|default('') }}</div>
    </div>
{% endblock %}

{% block panel %}
    <script id="events" type="text/template">

        <h2 class="panel__title">{{ 'Events'|t }}</h2>
        <div class="panel__container">

            <table class="table--duo">
                <thead>
                <th>{{ 'Called listeners'|t }}</th>
                <th>{{ 'Class'|t }}</th>
                <th>{{ 'Priority'|t }}</th>
                </thead>
                <tbody>
                <% _.each( data.called_listeners, function( events, event_name ){ %>
                    <% _.each( events, function( priority, priority_value ){ %>
                        <% _.each( priority, function( listener ){ %>
                            <tr>
                                <td><%= event_name %></td>
                                <% if( listener.clazz ) { %>
                                    <td>
                                        <% if( listener.class == "Closure" ) { %>
                                            <%= "Closure" %>
                                        <% } else { %>
                                            <%= Drupal.webprofiler.helpers.classLink(listener.clazz) %>
                                        <% } %>
                                    </td>
                                <% } else { %>
                                    <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
                                <% } %>
                                <td><%= priority_value %></td>
                            </tr>
                        <% }); %>
                    <% }); %>
                <% }); %>
                </tbody>
            </table>

            <table class="table--duo">
                <thead>
                <th>{{ 'Not called listeners'|t }}</th>
                <th>{{ 'Service'|t }}</th>
                <th>{{ 'Priority'|t }}</th>
                </thead>
                <tbody>
                <% _.each( data.not_called_listeners, function( events, event_name ){ %>
                <% _.each( events, function( priority, priority_value ){ %>
                <% _.each( priority, function( listener ){ %>
                <tr>
                    <td><%= event_name %></td>
                    <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
                    <td><%= priority_value %></td>
                </tr>
                <% }); %>
                <% }); %>
                <% }); %>
                </tbody>
            </table>
        </div>

    </script>
{% endblock %}

File

webprofiler/templates/Collector/events.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'events'}) }}" title="{{ 'Events'|t }}">
  4. <img width="20" height="28" alt="{{ 'Events'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}">
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getCalledListenersCount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>{{ 'Called'|t }}</b>
  12. <span>{{ collector.getCalledListenersCount }}</span>
  13. </div>
  14. <div class="sf-toolbar-info-piece">
  15. <b>{{ 'Not called'|t }}</b>
  16. <span>{{ collector.getNotCalledListenersCount }}</span>
  17. </div>
  18. {% endset %}
  19. <div class="sf-toolbar-block">
  20. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  21. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  22. </div>
  23. {% endblock %}
  24. {% block panel %}
  25. <script id="events" type="text/template">
  26. <h2 class="panel__title">{{ 'Events'|t }}</h2>
  27. <div class="panel__container">
  28. <table class="table--duo">
  29. <thead>
  30. <th>{{ 'Called listeners'|t }}</th>
  31. <th>{{ 'Class'|t }}</th>
  32. <th>{{ 'Priority'|t }}</th>
  33. </thead>
  34. <tbody>
  35. <% _.each( data.called_listeners, function( events, event_name ){ %>
  36. <% _.each( events, function( priority, priority_value ){ %>
  37. <% _.each( priority, function( listener ){ %>
  38. <tr>
  39. <td><%= event_name %></td>
  40. <% if( listener.clazz ) { %>
  41. <td>
  42. <% if( listener.class == "Closure" ) { %>
  43. <%= "Closure" %>
  44. <% } else { %>
  45. <%= Drupal.webprofiler.helpers.classLink(listener.clazz) %>
  46. <% } %>
  47. </td>
  48. <% } else { %>
  49. <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
  50. <% } %>
  51. <td><%= priority_value %></td>
  52. </tr>
  53. <% }); %>
  54. <% }); %>
  55. <% }); %>
  56. </tbody>
  57. </table>
  58. <table class="table--duo">
  59. <thead>
  60. <th>{{ 'Not called listeners'|t }}</th>
  61. <th>{{ 'Service'|t }}</th>
  62. <th>{{ 'Priority'|t }}</th>
  63. </thead>
  64. <tbody>
  65. <% _.each( data.not_called_listeners, function( events, event_name ){ %>
  66. <% _.each( events, function( priority, priority_value ){ %>
  67. <% _.each( priority, function( listener ){ %>
  68. <tr>
  69. <td><%= event_name %></td>
  70. <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
  71. <td><%= priority_value %></td>
  72. </tr>
  73. <% }); %>
  74. <% }); %>
  75. <% }); %>
  76. </tbody>
  77. </table>
  78. </div>
  79. </script>
  80. {% endblock %}