system-themes-page.html.twig 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {#
  2. /**
  3. * @file
  4. * Default theme implementation for the Appearance page.
  5. *
  6. * Available variables:
  7. * - attributes: HTML attributes for the main container.
  8. * - theme_groups: A list of theme groups. Each theme group contains:
  9. * - attributes: HTML attributes specific to this theme group.
  10. * - title: Title for the theme group.
  11. * - state: State of the theme group, e.g. installed or uninstalled.
  12. * - themes: A list of themes within the theme group. Each theme contains:
  13. * - attributes: HTML attributes specific to this theme.
  14. * - screenshot: A screenshot representing the theme.
  15. * - description: Description of the theme.
  16. * - name: Theme name.
  17. * - version: The theme's version number.
  18. * - is_default: Boolean indicating whether the theme is the default theme
  19. * or not.
  20. * - is_admin: Boolean indicating whether the theme is the admin theme or
  21. * not.
  22. * - notes: Identifies what context this theme is being used in, e.g.,
  23. * default theme, admin theme.
  24. * - incompatible: Text describing any compatibility issues.
  25. * - operations: A list of operation links, e.g., Settings, Enable, Disable,
  26. * etc. these links should only be displayed if the theme is compatible.
  27. *
  28. * @see template_preprocess_system_themes_page()
  29. *
  30. * @ingroup themeable
  31. */
  32. #}
  33. <div{{ attributes }}>
  34. {% for theme_group in theme_groups %}
  35. {%
  36. set theme_group_classes = [
  37. 'system-themes-list',
  38. 'system-themes-list-' ~ theme_group.state,
  39. 'clearfix',
  40. ]
  41. %}
  42. <div{{ theme_group.attributes.addClass(theme_group_classes) }}>
  43. <h2 class="system-themes-list__header">{{ theme_group.title }}</h2>
  44. {% for theme in theme_group.themes %}
  45. {%
  46. set theme_classes = [
  47. theme.is_default ? 'theme-default',
  48. theme.is_admin ? 'theme-admin',
  49. 'theme-selector',
  50. 'clearfix',
  51. ]
  52. %}
  53. <div{{ theme.attributes.addClass(theme_classes) }}>
  54. {% if theme.screenshot %}
  55. {{ theme.screenshot }}
  56. {% endif %}
  57. <div class="theme-info">
  58. <h3 class="theme-info__header">
  59. {{- theme.name }} {{ theme.version -}}
  60. {% if theme.notes %}
  61. ({{ theme.notes|safe_join(', ') }})
  62. {%- endif -%}
  63. </h3>
  64. <div class="theme-info__description">{{ theme.description }}</div>
  65. {# Display operation links if the theme is compatible. #}
  66. {% if theme.incompatible %}
  67. <div class="incompatible">{{ theme.incompatible }}</div>
  68. {% else %}
  69. {{ theme.operations }}
  70. {% endif %}
  71. </div>
  72. </div>
  73. {% endfor %}
  74. </div>
  75. {% endfor %}
  76. </div>