You are here

views.html.twig in Devel 8

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

    <div class="sf-toolbar-info-piece">
        <b>{{ 'Views'|t }}</b>
        <span>{{ collector.getViewsCount }}</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="views" type="text/template">
        <h2 class="panel__title">{{ 'Views'|t }}</h2>
        <div class="panel__container">
            <% if( data.views.length != 0){ %>
            <table class="table--duo">
                <thead>
                <tr>
                    <th>{{ 'name'|t }}</th>
                    <th>{{ 'display'|t }}</th>
                    <th>{{ 'build time'|t }}</th>
                    <th>{{ 'execute time'|t }}</th>
                    <th>{{ 'render time'|t }}</th>
                    <th>{{ 'Action'|t }}</th>
                </tr>
                </thead>
                <tbody>
                <% _.each( data.views, function( item ){ %>
                <tr>
                    <td><%- item.id %></td>
                    <td><%- item.current_display %></td>
                    <td><%- Drupal.webprofiler.helpers.printTime(item.build_time, 's') %></td>
                    <td><%- Drupal.webprofiler.helpers.printTime(item.execute_time, 's') %></td>
                    <td><%- Drupal.webprofiler.helpers.printTime(item.render_time, 's') %></td>
                    <td><a href="<%- item.route %>">{{ 'Edit'|t }}</a></td>
                </tr>
                <% }); %>
                </tbody>
            </table>
            <% } else { %>
            <p>{{ 'No results'|t }}</p>
            <% } %>
        </div>

    </script>
{% endblock %}

File

webprofiler/templates/Collector/views.html.twig
View source
  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 %}