events.html.twig 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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 %}