You are here

assets.html.twig in Devel 8

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

    <div class="sf-toolbar-info-piece">
        <b>CSS</b>
        <span>{{ collector.getcsscount }}</span>
    </div>
    <div class="sf-toolbar-info-piece">
        <b>JS</b>
        <span>{{ collector.getjscount }}</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="assets" type="text/template">
        <h2 class="panel__title">{{ 'Assets'|t }}</h2>
        <div class="tabs">
            <% if( data.js.length != 0){ %>
            <input class="tabs__radio" type="radio" id="js" name="tabs" checked/>
            <% } %>
            <% if( data.js.length != 0){ %>
            <input class="tabs__radio" type="radio" id="css" name="tabs"/>
            <% } %>
            <ul class="tabs__tabs list--inline">
                <% if( data.js.length != 0){ %>
                <li><label class="tabs__label" for="js">JS</label></li>
                <% } %>
                <% if( data.js.length != 0){ %>
                <li><label class="tabs__label" for="css">CSS</label></li>
                <% } %>
            </ul>
            <div class="tabs__panels">
                <div class="tabs__panel">
                    <% if( data.js.length != 0){ %>
                    <% _.each( data.js, function( item, key ){ %>
                    <% if( key === 'drupalSettings' ){ %>
                    <div class="panel__container">
                        <div class="panel__expand-header ">
                            <ul class="list--inline">
                                <li><b>asset</b> <%- key %></li>
                            </ul>
                            <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
                        </div>
                        <div class="panel__expand-content">
                            <% if(item.data && item.data.length != 0){ %>
                        <pre>
                            <code class="code--json "><%= JSON.stringify(item.data, null, 4) %></code>
                        </pre>
                            <% } %>
                            <table class="table--duo">
                                <% _.each( item, function( item, key ){ %>
                                <tr>
                                    <% if(key != 'data'){ %>
                                    <th><%- key %></th>
                                    <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
                                    <% } %>
                                </tr>
                                <% }); %>
                            </table>
                        </div>
                    </div>
                    <% } else { %>
                    <div class="panel__container">
                        <div class="panel__expand-header ">
                            <ul class="list--inline">
                                <li><b>asset</b> <%= Drupal.webprofiler.helpers.classLink({"file":
                                    data.assets.installation_path + key, "class": key, "line": 0}) %>
                                </li>
                                <li><b>version</b> <%- item.version %></li>
                                <li><b>scope</b> <%- item.scope %></li>
                            </ul>
                            <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
                        </div>
                        <div class="panel__expand-content">
                            <table class="table--duo">
                                <% _.each( item, function( item, key ){ %>
                                <tr>
                                    <th><%- key %></th>
                                    <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
                                </tr>
                                <% }); %>
                            </table>
                        </div>
                    </div>
                    <% } %>
                    <% }); %>
                    <% } %>
                </div>
                <div class="tabs__panel">
                    <% if( data.css.length != 0){ %>
                    <% _.each( data.css, function( item, key ){ %>
                    <div class="panel__container">
                        <div class="panel__expand-header ">
                            <ul class="list--inline">
                                <li><b>asset</b> <%= Drupal.webprofiler.helpers.classLink({"file":
                                    data.assets.installation_path + key, "class": key, "line": 0}) %>
                                </li>
                                <li><b>version</b> <%- item.version %></li>
                            </ul>
                            <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
                        </div>
                        <div class="panel__expand-content">
                            <table class="table--duo">
                                <% _.each( item, function( item, key ){ %>
                                <tr>
                                    <th><%- key %></th>
                                    <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
                                </tr>
                                <% }); %>
                            </table>
                        </div>
                    </div>
                    <% }); %>
                </div>
            </div>
        </div>

        <% } %>
    </script>
{% endblock %}

File

webprofiler/templates/Collector/assets.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'assets'}) }}" title="{{ 'Assets'|t }}">
  4. <img width="20" height="28" alt="{{ 'Assets'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getcsscount + collector.getjscount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>CSS</b>
  12. <span>{{ collector.getcsscount }}</span>
  13. </div>
  14. <div class="sf-toolbar-info-piece">
  15. <b>JS</b>
  16. <span>{{ collector.getjscount }}</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="assets" type="text/template">
  26. <h2 class="panel__title">{{ 'Assets'|t }}</h2>
  27. <div class="tabs">
  28. <% if( data.js.length != 0){ %>
  29. <input class="tabs__radio" type="radio" id="js" name="tabs" checked/>
  30. <% } %>
  31. <% if( data.js.length != 0){ %>
  32. <input class="tabs__radio" type="radio" id="css" name="tabs"/>
  33. <% } %>
  34. <ul class="tabs__tabs list--inline">
  35. <% if( data.js.length != 0){ %>
  36. <li><label class="tabs__label" for="js">JS</label></li>
  37. <% } %>
  38. <% if( data.js.length != 0){ %>
  39. <li><label class="tabs__label" for="css">CSS</label></li>
  40. <% } %>
  41. </ul>
  42. <div class="tabs__panels">
  43. <div class="tabs__panel">
  44. <% if( data.js.length != 0){ %>
  45. <% _.each( data.js, function( item, key ){ %>
  46. <% if( key === 'drupalSettings' ){ %>
  47. <div class="panel__container">
  48. <div class="panel__expand-header ">
  49. <ul class="list--inline">
  50. <li><b>asset</b> <%- key %></li>
  51. </ul>
  52. <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
  53. </div>
  54. <div class="panel__expand-content">
  55. <% if(item.data && item.data.length != 0){ %>
  56. <pre>
  57. <code class="code--json "><%= JSON.stringify(item.data, null, 4) %></code>
  58. </pre>
  59. <% } %>
  60. <table class="table--duo">
  61. <% _.each( item, function( item, key ){ %>
  62. <tr>
  63. <% if(key != 'data'){ %>
  64. <th><%- key %></th>
  65. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  66. <% } %>
  67. </tr>
  68. <% }); %>
  69. </table>
  70. </div>
  71. </div>
  72. <% } else { %>
  73. <div class="panel__container">
  74. <div class="panel__expand-header ">
  75. <ul class="list--inline">
  76. <li><b>asset</b> <%= Drupal.webprofiler.helpers.classLink({"file":
  77. data.assets.installation_path + key, "class": key, "line": 0}) %>
  78. </li>
  79. <li><b>version</b> <%- item.version %></li>
  80. <li><b>scope</b> <%- item.scope %></li>
  81. </ul>
  82. <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
  83. </div>
  84. <div class="panel__expand-content">
  85. <table class="table--duo">
  86. <% _.each( item, function( item, key ){ %>
  87. <tr>
  88. <th><%- key %></th>
  89. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  90. </tr>
  91. <% }); %>
  92. </table>
  93. </div>
  94. </div>
  95. <% } %>
  96. <% }); %>
  97. <% } %>
  98. </div>
  99. <div class="tabs__panel">
  100. <% if( data.css.length != 0){ %>
  101. <% _.each( data.css, function( item, key ){ %>
  102. <div class="panel__container">
  103. <div class="panel__expand-header ">
  104. <ul class="list--inline">
  105. <li><b>asset</b> <%= Drupal.webprofiler.helpers.classLink({"file":
  106. data.assets.installation_path + key, "class": key, "line": 0}) %>
  107. </li>
  108. <li><b>version</b> <%- item.version %></li>
  109. </ul>
  110. <div class="button--flat l-right js--panel-toggle">{{ 'Data'|t }}</div>
  111. </div>
  112. <div class="panel__expand-content">
  113. <table class="table--duo">
  114. <% _.each( item, function( item, key ){ %>
  115. <tr>
  116. <th><%- key %></th>
  117. <td><%= Drupal.webprofiler.helpers.frm(item) %></td>
  118. </tr>
  119. <% }); %>
  120. </table>
  121. </div>
  122. </div>
  123. <% }); %>
  124. </div>
  125. </div>
  126. </div>
  127. <% } %>
  128. </script>
  129. {% endblock %}