events.html.twig 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  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><%= Drupal.webprofiler.helpers.classLink(listener.clazz) %></td>
  42. <% } else { %>
  43. <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
  44. <% } %>
  45. <td><%= priority_value %></td>
  46. </tr>
  47. <% }); %>
  48. <% }); %>
  49. <% }); %>
  50. </tbody>
  51. </table>
  52. <table class="table--duo">
  53. <thead>
  54. <th>{{ 'Not called listeners'|t }}</th>
  55. <th>{{ 'Service'|t }}</th>
  56. <th>{{ 'Priority'|t }}</th>
  57. </thead>
  58. <tbody>
  59. <% _.each( data.not_called_listeners, function( events, event_name ){ %>
  60. <% _.each( events, function( priority, priority_value ){ %>
  61. <% _.each( priority, function( listener ){ %>
  62. <tr>
  63. <td><%= event_name %></td>
  64. <td><%= listener.service[0] %>::<%= listener.service[1] %></td>
  65. <td><%= priority_value %></td>
  66. </tr>
  67. <% }); %>
  68. <% }); %>
  69. <% }); %>
  70. </tbody>
  71. </table>
  72. </div>
  73. </script>
  74. {% endblock %}