You are here

blocks.html.twig in Devel 4.x

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

    <div class="sf-toolbar-info-piece">
        <b>{{ 'Loaded'|t }}</b>
        <span>{{ collector.loadedBlocksCount }}</span>
    </div>
    <div class="sf-toolbar-info-piece">
        <b>{{ 'Rendered'|t }}</b>
        <span>{{ collector.renderedBlocksCount }}</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="blocks" type="text/template">
        <h2 class="panel__title">{{ 'Blocks'|t }}</h2>

        <form class="panel__toolbar">
            <div class="panel__filter--text">
                <input id="edit-sid" class="js--live-filter" placeholder="{{ 'ID'|t }}" type="text"/>
                <label for="edit-sid" class="panel__filter-label">{{ 'ID'|t }}</label>
            </div>
            <div class="panel__filter--text">
                <input id="edit-label" class="js--live-filter" placeholder="{{ 'Label'|t }}" type="text"/>
                <label for="edit-label" class="panel__filter-label">{{ 'Label'|t }}</label>
            </div>
            <div class="panel__filter--text">
                <input id="edit-region" class="js--live-filter" placeholder="{{ 'Region'|t }}" type="text"/>
                <label for="edit-region" class="panel__filter-label">{{ 'Region'|t }}</label>
            </div>
            <div class="panel__filter--text">
                <input id="edit-provider" class="js--live-filter" placeholder="{{ 'Provider'|t }}" type="text"/>
                <label for="edit-provider" class="panel__filter-label">{{ 'Provider'|t }}</label>
            </div>
            <div class="panel__filter--select">
                <select id="edit-rendered" class="js--live-filter">
                    <option value="">{{ 'Any'|t }}</option>
                    <option value="1">{{ 'Yes'|t }}</option>
                    <option value="0">{{ 'No'|t }}</option>
                </select>
                <label for="edit-rendered" class="panel__filter-label">{{ 'Rendered'|t }}</label>
            </div>
        </form>

        <% _.each( data.blocks.loaded, function( item ){ %>

        <div class="panel__container"
             data-wp-sid="<%- item.id %>"
             data-wp-label="<%= item.settings.label %>"
             data-wp-region="<%= item.region %>"
             data-wp-provider="<%= item.settings.provider %>"
             data-wp-rendered="<%- (data.blocks.rendered[item.id]) ? '1' : '0' %>">

            <div class="panel__expand-header">
                <ul class="list--inline">
                    <li>
                        <b>{{ 'ID'|t }}</b> <%- item.id %>
                    </li>
                    <li>
                        <b>{{ 'Label'|t }}</b> <%= item.settings.label %>
                    </li>
                    <li>
                        <b>{{ 'Region'|t }}</b> <%= (item.region == -1) ? '{{ 'No region'|t }}' : item.region %>
                    </li>
                    <li>
                        <b><%- (data.blocks.rendered[item.id]) ? '' : '{{ 'Not rendered'|t }}' %></b>
                    </li>
                </ul>
                <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
                <a class="button--flat l-right " href="<%- item.route %>">{{ 'Edit'|t }}</a>

            </div>

            <div class="panel__expand-content">
                <div class="wp-query-arguments">
                    <table class="table--duo">
                        <tr>
                            <th>{{ 'Provider'|t }}</th>
                            <td><%- item.settings.provider %></td>
                        </tr>
                        <tr>
                            <th>{{ 'Theme'|t }}</th>
                            <td><%- item.theme %></td>
                        </tr>
                        <tr>
                            <th>{{ 'Status'|t }}</th>
                            <td><%- (item.status) ? '{{ 'Enabled'|t }}' : '{{ 'Disabled'|t }}' %></td>
                        </tr>
                        <tr>
                            <th>{{ 'Plugin'|t }}</th>
                            <td><%- item.plugin %></td>
                        </tr>
                    </table>
                </div>
            </div>
        </div>
        <% }); %>

    </script>
{% endblock %}

File

webprofiler/templates/Collector/blocks.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'blocks'}) }}" title="{{ 'Blocks'|t }}">
  4. <img width="20" height="28" alt="{{ 'Blocks'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.renderedBlocksCount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>{{ 'Loaded'|t }}</b>
  12. <span>{{ collector.loadedBlocksCount }}</span>
  13. </div>
  14. <div class="sf-toolbar-info-piece">
  15. <b>{{ 'Rendered'|t }}</b>
  16. <span>{{ collector.renderedBlocksCount }}</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="blocks" type="text/template">
  26. <h2 class="panel__title">{{ 'Blocks'|t }}</h2>
  27. <form class="panel__toolbar">
  28. <div class="panel__filter--text">
  29. <input id="edit-sid" class="js--live-filter" placeholder="{{ 'ID'|t }}" type="text"/>
  30. <label for="edit-sid" class="panel__filter-label">{{ 'ID'|t }}</label>
  31. </div>
  32. <div class="panel__filter--text">
  33. <input id="edit-label" class="js--live-filter" placeholder="{{ 'Label'|t }}" type="text"/>
  34. <label for="edit-label" class="panel__filter-label">{{ 'Label'|t }}</label>
  35. </div>
  36. <div class="panel__filter--text">
  37. <input id="edit-region" class="js--live-filter" placeholder="{{ 'Region'|t }}" type="text"/>
  38. <label for="edit-region" class="panel__filter-label">{{ 'Region'|t }}</label>
  39. </div>
  40. <div class="panel__filter--text">
  41. <input id="edit-provider" class="js--live-filter" placeholder="{{ 'Provider'|t }}" type="text"/>
  42. <label for="edit-provider" class="panel__filter-label">{{ 'Provider'|t }}</label>
  43. </div>
  44. <div class="panel__filter--select">
  45. <select id="edit-rendered" class="js--live-filter">
  46. <option value="">{{ 'Any'|t }}</option>
  47. <option value="1">{{ 'Yes'|t }}</option>
  48. <option value="0">{{ 'No'|t }}</option>
  49. </select>
  50. <label for="edit-rendered" class="panel__filter-label">{{ 'Rendered'|t }}</label>
  51. </div>
  52. </form>
  53. <% _.each( data.blocks.loaded, function( item ){ %>
  54. <div class="panel__container"
  55. data-wp-sid="<%- item.id %>"
  56. data-wp-label="<%= item.settings.label %>"
  57. data-wp-region="<%= item.region %>"
  58. data-wp-provider="<%= item.settings.provider %>"
  59. data-wp-rendered="<%- (data.blocks.rendered[item.id]) ? '1' : '0' %>">
  60. <div class="panel__expand-header">
  61. <ul class="list--inline">
  62. <li>
  63. <b>{{ 'ID'|t }}</b> <%- item.id %>
  64. </li>
  65. <li>
  66. <b>{{ 'Label'|t }}</b> <%= item.settings.label %>
  67. </li>
  68. <li>
  69. <b>{{ 'Region'|t }}</b> <%= (item.region == -1) ? '{{ 'No region'|t }}' : item.region %>
  70. </li>
  71. <li>
  72. <b><%- (data.blocks.rendered[item.id]) ? '' : '{{ 'Not rendered'|t }}' %></b>
  73. </li>
  74. </ul>
  75. <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
  76. <a class="button--flat l-right " href="<%- item.route %>">{{ 'Edit'|t }}</a>
  77. </div>
  78. <div class="panel__expand-content">
  79. <div class="wp-query-arguments">
  80. <table class="table--duo">
  81. <tr>
  82. <th>{{ 'Provider'|t }}</th>
  83. <td><%- item.settings.provider %></td>
  84. </tr>
  85. <tr>
  86. <th>{{ 'Theme'|t }}</th>
  87. <td><%- item.theme %></td>
  88. </tr>
  89. <tr>
  90. <th>{{ 'Status'|t }}</th>
  91. <td><%- (item.status) ? '{{ 'Enabled'|t }}' : '{{ 'Disabled'|t }}' %></td>
  92. </tr>
  93. <tr>
  94. <th>{{ 'Plugin'|t }}</th>
  95. <td><%- item.plugin %></td>
  96. </tr>
  97. </table>
  98. </div>
  99. </div>
  100. </div>
  101. <% }); %>
  102. </script>
  103. {% endblock %}