You are here

pm-dashboard.html.twig in Drupal PM (Project Management) 4.x

{% set first_col = [] %}
{% set second_col = [] %}
{% for item in items %}
  {% set panel %}
    <div class="panel">
      <h3 class="panel__title">{{ item.label }}</h3>
      <div class="panel__content">
        <dl class="admin-list--panel admin-list">
          {% for sub_item in item.items %}
            <div class="admin-item">
              <a href="{{ sub_item.link.url }}" title="Configure default user account settings, including fields, registration requirements, and email messages." class="admin-item__link">{{ sub_item.link.label }}</a>
              <dt class="admin-item__title">{{ sub_item.label }}</dt>
              <dd class="admin-item__description">{{ sub_item.description }}</dd>
            </div>
          {% endfor %}
        </dl>
      </div>
    </div>
  {% endset %}
  {% if loop.index is odd %}
    {% set first_col = first_col|merge([{panel: panel}]) %}
  {% else %}
    {% set second_col = second_col|merge([{panel: panel}]) %}
  {% endif %}
{% endfor %}
<div class="layout-row clearfix">
  {% if first_col is not empty %}
    <div class="layout-column layout-column--half">
      {% for item in first_col %}
        {{ item.panel }}
      {% endfor %}
    </div>
  {% endif %}
  {% if second_col is not empty %}
    <div class="layout-column layout-column--half">
      {% for item in second_col %}
        {{ item.panel }}
      {% endfor %}
    </div>
  {% endif %}

</div>

File

templates/pm-dashboard.html.twig
View source
  1. {% set first_col = [] %}
  2. {% set second_col = [] %}
  3. {% for item in items %}
  4. {% set panel %}
  5. <div class="panel">
  6. <h3 class="panel__title">{{ item.label }}</h3>
  7. <div class="panel__content">
  8. <dl class="admin-list--panel admin-list">
  9. {% for sub_item in item.items %}
  10. <div class="admin-item">
  11. <a href="{{ sub_item.link.url }}" title="Configure default user account settings, including fields, registration requirements, and email messages." class="admin-item__link">{{ sub_item.link.label }}</a>
  12. <dt class="admin-item__title">{{ sub_item.label }}</dt>
  13. <dd class="admin-item__description">{{ sub_item.description }}</dd>
  14. </div>
  15. {% endfor %}
  16. </dl>
  17. </div>
  18. </div>
  19. {% endset %}
  20. {% if loop.index is odd %}
  21. {% set first_col = first_col|merge([{panel: panel}]) %}
  22. {% else %}
  23. {% set second_col = second_col|merge([{panel: panel}]) %}
  24. {% endif %}
  25. {% endfor %}
  26. <div class="layout-row clearfix">
  27. {% if first_col is not empty %}
  28. <div class="layout-column layout-column--half">
  29. {% for item in first_col %}
  30. {{ item.panel }}
  31. {% endfor %}
  32. </div>
  33. {% endif %}
  34. {% if second_col is not empty %}
  35. <div class="layout-column layout-column--half">
  36. {% for item in second_col %}
  37. {{ item.panel }}
  38. {% endfor %}
  39. </div>
  40. {% endif %}
  41. </div>