You are here

forms.html.twig in Devel 8.3

{% block toolbar %}
    {% set icon %}
    <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'forms'}) }}" title="{{ 'Forms'|t }}">
        <img width="21" height="28" alt="{{ 'Forms'|t }}"
             src="data:image/png;base64,{{ collector.icon }}">
        <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getFormsCount }}</span>
    </a>
    {% endset %}
    {% set text %}
    {% spaceless %}
        <div class="sf-toolbar-info-piece">
            {% for keys, form in collector.getForms %}
                <b>{{ keys }}</b>
                <div><a href="{{ idelink(form.class.file, form.class.line)|raw }}">{{ abbr(form.class.class)|raw }}
                        ::{{ form.class.method }}</a></div>
            {% endfor %}
        </div>
    {% endspaceless %}
    {% 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="forms" type="text/template">
        <h2 class="panel__title">{{ 'Forms'|t }}</h2>
        <% if( data.forms && data.forms.length != 0){ %>
            <% _.each( data.forms, function( item, key ){ %>
                <div class="panel__container">

                    <ul class="list--inline">
                        <li><b>ID</b> <%= key %></li>
                        <li><b>class</b> <%= Drupal.webprofiler.helpers.classLink(item.class) %></li>
                    </ul>

                    <table class="table--compact">
                        <thead>
                        <tr>
                            <th>{{ 'form'|t }}</th>
                            <th>{{ 'title'|t }}</th>
                            <th>{{ 'access'|t }}</th>
                            <th>{{ 'type'|t }}</th>
                        </tr>
                        </thead>
                        <tbody>
                        <% _.each( item.form, function( value , key ){ %>
                        <tr>
                            <td><%= key %></td>
                            <td><% if(value['#title'] == null ){ %> {{ '-' }} <% } else { %> <%= value['#title'] %><% } %></td>
                            <td><% if(value['#access'] == null ){ %> {{ 'null' }} <% } else { %> <%= value['#access'] %><% } %></td>
                            <td><% if(value['#type'] == null ){ %> {{ 'null' }} <% } else { %> <%= value['#type'] %><% } %></td>
                        </tr>
                        <% }); %>
                        </tbody>
                    </table>
                </div>
            <% }); %>
        <% } else { %>
            <div class="panel__container">
                <p>{{ 'No results'|t }}</p>
            </div>
        <% } %>
    </script>
{% endblock %}

File

webprofiler/templates/Collector/forms.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: 'forms'}) }}" title="{{ 'Forms'|t }}">
  4. <img width="21" height="28" alt="{{ 'Forms'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}">
  6. <span class="sf-toolbar-info-piece-additional sf-toolbar-status">{{ collector.getFormsCount }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. {% spaceless %}
  11. <div class="sf-toolbar-info-piece">
  12. {% for keys, form in collector.getForms %}
  13. <b>{{ keys }}</b>
  14. <div><a href="{{ idelink(form.class.file, form.class.line)|raw }}">{{ abbr(form.class.class)|raw }}
  15. ::{{ form.class.method }}</a></div>
  16. {% endfor %}
  17. </div>
  18. {% endspaceless %}
  19. {% endset %}
  20. <div class="sf-toolbar-block">
  21. <div class="sf-toolbar-icon">{{ icon|default('') }}</div>
  22. <div class="sf-toolbar-info">{{ text|default('') }}</div>
  23. </div>
  24. {% endblock %}
  25. {% block panel %}
  26. <script id="forms" type="text/template">
  27. <h2 class="panel__title">{{ 'Forms'|t }}</h2>
  28. <% if( data.forms && data.forms.length != 0){ %>
  29. <% _.each( data.forms, function( item, key ){ %>
  30. <div class="panel__container">
  31. <ul class="list--inline">
  32. <li><b>ID</b> <%= key %></li>
  33. <li><b>class</b> <%= Drupal.webprofiler.helpers.classLink(item.class) %></li>
  34. </ul>
  35. <table class="table--compact">
  36. <thead>
  37. <tr>
  38. <th>{{ 'form'|t }}</th>
  39. <th>{{ 'title'|t }}</th>
  40. <th>{{ 'access'|t }}</th>
  41. <th>{{ 'type'|t }}</th>
  42. </tr>
  43. </thead>
  44. <tbody>
  45. <% _.each( item.form, function( value , key ){ %>
  46. <tr>
  47. <td><%= key %></td>
  48. <td><% if(value['#title'] == null ){ %> {{ '-' }} <% } else { %> <%= value['#title'] %><% } %></td>
  49. <td><% if(value['#access'] == null ){ %> {{ 'null' }} <% } else { %> <%= value['#access'] %><% } %></td>
  50. <td><% if(value['#type'] == null ){ %> {{ 'null' }} <% } else { %> <%= value['#type'] %><% } %></td>
  51. </tr>
  52. <% }); %>
  53. </tbody>
  54. </table>
  55. </div>
  56. <% }); %>
  57. <% } else { %>
  58. <div class="panel__container">
  59. <p>{{ 'No results'|t }}</p>
  60. </div>
  61. <% } %>
  62. </script>
  63. {% endblock %}