views.html.twig 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'views'}) }}" title="{{ 'Views'|t }}">
  4. <img width="20" height="28" alt="{{ 'Views'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getViewsCount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>{{ 'Views'|t }}</b>
  12. <span>{{ collector.getViewsCount }}</span>
  13. </div>
  14. {% endset %}
  15. <div class="sf-toolbar-block">
  16. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  17. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  18. </div>
  19. {% endblock %}
  20. {% block panel %}
  21. <script id="views" type="text/template">
  22. <h2 class="panel__title">{{ 'Views'|t }}</h2>
  23. <div class="panel__container">
  24. <% if( data.views.length != 0){ %>
  25. <table class="table--duo">
  26. <thead>
  27. <tr>
  28. <th>{{ 'name'|t }}</th>
  29. <th>{{ 'display'|t }}</th>
  30. <th>{{ 'build time'|t }}</th>
  31. <th>{{ 'execute time'|t }}</th>
  32. <th>{{ 'render time'|t }}</th>
  33. <th>{{ 'Action'|t }}</th>
  34. </tr>
  35. </thead>
  36. <tbody>
  37. <% _.each( data.views, function( item ){ %>
  38. <tr>
  39. <td><%- item.id %></td>
  40. <td><%- item.current_display %></td>
  41. <td><%- Drupal.webprofiler.helpers.printTime(item.build_time, 's') %></td>
  42. <td><%- Drupal.webprofiler.helpers.printTime(item.execute_time, 's') %></td>
  43. <td><%- Drupal.webprofiler.helpers.printTime(item.render_time, 's') %></td>
  44. <td><a href="<%- item.route %>">{{ 'Edit'|t }}</a></td>
  45. </tr>
  46. <% }); %>
  47. </tbody>
  48. </table>
  49. <% } else { %>
  50. <p>{{ 'No results'|t }}</p>
  51. <% } %>
  52. </div>
  53. </script>
  54. {% endblock %}