status-report-grouped.html.twig 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. {#
  2. /**
  3. * @file
  4. * Theme override to display status report.
  5. *
  6. * - grouped_requirements: Contains grouped requirements.
  7. * Each group contains:
  8. * - title: The title of the group.
  9. * - type: The severity of the group.
  10. * - items: The requirement instances.
  11. * Each requirement item contains:
  12. * - title: The title of the requirement.
  13. * - value: (optional) The requirement's status.
  14. * - description: (optional) The requirement's description.
  15. * - severity_title: The title of the severity.
  16. * - severity_status: Indicates the severity status.
  17. */
  18. #}
  19. {{ attach_library('core/drupal.collapse') }}
  20. {{ attach_library('mediteran/drupal.responsive-detail') }}
  21. <div class="system-status-report">
  22. {% for group in grouped_requirements %}
  23. <div class="system-status-report__requirements-group">
  24. <h2 id="{{ group.type }}">{{ group.title }}</h2>
  25. {% for requirement in group.items %}
  26. <details class="system-status-report__entry system-status-report__entry--{{ group.type }} color-{{ group.type }}" open>
  27. {%
  28. set summary_classes = [
  29. 'system-status-report__status-title',
  30. group.type in ['warning', 'error'] ? 'system-status-report__status-icon system-status-report__status-icon--' ~ group.type
  31. ]
  32. %}
  33. <summary{{ create_attribute({'class': summary_classes}) }} role="button">
  34. {% if requirement.severity_title %}
  35. <span class="visually-hidden">{{ requirement.severity_title }}</span>
  36. {% endif %}
  37. {{ requirement.title }}
  38. </summary>
  39. <div class="system-status-report__entry__value">
  40. {{ requirement.value }}
  41. {% if requirement.description %}
  42. <div class="description">{{ requirement.description }}</div>
  43. {% endif %}
  44. </div>
  45. </details>
  46. {% endfor %}
  47. </div>
  48. {% endfor %}
  49. </div>