You are here

mail.html.twig in Devel 8.3

{% block toolbar %}
    {% set icon %}
    <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: "mail"}) }}" title="{{ 'Mail'|t }}">
        <img height="28" alt="{{ 'Mail'|t }}"
             src="data:image/png;base64,{{ collector.icon }}"/>
        <span class="sf-toolbar-status">{{ collector.mailsent }}</span>
    </a>
    {% endset %}
    {% set text %}
    <div class="sf-toolbar-info-piece">
        <b>Mail sent</b>
        <span>{{ collector.mailsent }}</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="mail" type="text/template">
        <h2 class="panel__title">{{ 'Mail dashboard'|t }}</h2>

        <% if( data.mail.length != 0){ %>
        <% _.each( data.mail, function( item ) { %>
        <div class="panel__container">
            <div class="panel__expand-header">
                <ul class="list--inline">
                    <li>
                        <b>{{ 'Plugin'|t }}</b>: <%= Drupal.webprofiler.helpers.classLink(item.method) %>
                    </li>
                    <li>
                        <b>{{ 'ID'|t }}</b>: <%- item.message.id %>
                    </li>
                    <li>
                        <b>{{ 'To'|t }}</b>: <%- item.message.to %>
                    </li>
                    <li>
                        <b>{{ 'Subject'|t }}</b>: <%- item.message.subject %>
                    </li>
                </ul>
                <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
            </div>

            <div class="panel__expand-content">
                <table class="table--duo">
                <% _.each( item.message, function( message, key ) { %>
                <% if( key != 'params' && key != 'headers' ){ %>
                <tr>
                    <th><%- key %></th>
                    <td><%- message %></td>
                </tr>
                <% } %>
                <% }); %>
                </table>
                <table class="table--duo">
                    <% _.each( item.message.headers, function( header, key ) { %>
                    <tr>
                        <th><%- key %></th>
                        <td><%- header %></td>
                    </tr>
                    <% }); %>
                </table>
            </div>

        </div>
        <% }); %>
        <% } else { %>
        <div class="panel__container">
            <p>{{ 'No mail sent'|t }}</p>
        </div>
        <% } %>
    </script>
{% endblock %}

File

webprofiler/templates/Collector/mail.html.twig
View source
  1. {% block toolbar %}
  2. {% set icon %}
  3. <a href="{{ url("webprofiler.dashboard", {profile: token}, {fragment: "mail"}) }}" title="{{ 'Mail'|t }}">
  4. <img height="28" alt="{{ 'Mail'|t }}"
  5. src="data:image/png;base64,{{ collector.icon }}"/>
  6. <span class="sf-toolbar-status">{{ collector.mailsent }}</span>
  7. </a>
  8. {% endset %}
  9. {% set text %}
  10. <div class="sf-toolbar-info-piece">
  11. <b>Mail sent</b>
  12. <span>{{ collector.mailsent }}</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="mail" type="text/template">
  22. <h2 class="panel__title">{{ 'Mail dashboard'|t }}</h2>
  23. <% if( data.mail.length != 0){ %>
  24. <% _.each( data.mail, function( item ) { %>
  25. <div class="panel__container">
  26. <div class="panel__expand-header">
  27. <ul class="list--inline">
  28. <li>
  29. <b>{{ 'Plugin'|t }}</b>: <%= Drupal.webprofiler.helpers.classLink(item.method) %>
  30. </li>
  31. <li>
  32. <b>{{ 'ID'|t }}</b>: <%- item.message.id %>
  33. </li>
  34. <li>
  35. <b>{{ 'To'|t }}</b>: <%- item.message.to %>
  36. </li>
  37. <li>
  38. <b>{{ 'Subject'|t }}</b>: <%- item.message.subject %>
  39. </li>
  40. </ul>
  41. <div class="button--flat l-right js--panel-toggle">{{ 'Info'|t }}</div>
  42. </div>
  43. <div class="panel__expand-content">
  44. <table class="table--duo">
  45. <% _.each( item.message, function( message, key ) { %>
  46. <% if( key != 'params' && key != 'headers' ){ %>
  47. <tr>
  48. <th><%- key %></th>
  49. <td><%- message %></td>
  50. </tr>
  51. <% } %>
  52. <% }); %>
  53. </table>
  54. <table class="table--duo">
  55. <% _.each( item.message.headers, function( header, key ) { %>
  56. <tr>
  57. <th><%- key %></th>
  58. <td><%- header %></td>
  59. </tr>
  60. <% }); %>
  61. </table>
  62. </div>
  63. </div>
  64. <% }); %>
  65. <% } else { %>
  66. <div class="panel__container">
  67. <p>{{ 'No mail sent'|t }}</p>
  68. </div>
  69. <% } %>
  70. </script>
  71. {% endblock %}