diff --git a/core/modules/system/src/Controller/SystemController.php b/core/modules/system/src/Controller/SystemController.php index 43ab34e..5f2ca3f 100644 --- a/core/modules/system/src/Controller/SystemController.php +++ b/core/modules/system/src/Controller/SystemController.php @@ -200,6 +200,7 @@ public function themesPage() { continue; } $theme->is_default = ($theme->getName() == $theme_default); + $theme->is_admin = ($theme->getName() == $admin_theme || ($theme->is_default && $admin_theme == '0')); // Identify theme screenshot. $theme->screenshot = NULL; @@ -284,13 +285,10 @@ public function themesPage() { // Add notes to default and administration theme. $theme->notes = array(); - $theme->classes = array(); if ($theme->is_default) { - $theme->classes[] = 'theme-default'; $theme->notes[] = $this->t('default theme'); } - if ($theme->getName() == $admin_theme || ($theme->is_default && $admin_theme == '0')) { - $theme->classes[] = 'theme-admin'; + if ($theme->is_admin) { $theme->notes[] = $this->t('admin theme'); } diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index 57edc26..ad8908e 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -53,11 +53,7 @@ function _system_is_incompatible(&$incompatible, $files, Extension $file) { */ function template_preprocess_admin_block_content(&$variables) { if (!empty($variables['content'])) { - $compact = system_admin_compact_mode(); - $variables['attributes'] = array('class' => array('admin-list')); - if ($compact) { - $variables['attributes']['class'][] = 'compact'; - } + $variables['compact'] = system_admin_compact_mode(); foreach ($variables['content'] as $key => $item) { $variables['content'][$key]['link'] = \Drupal::linkGenerator()->generateFromUrl($item['title'], $item['url']); if (!$compact && isset($item['description'])) { @@ -164,19 +160,19 @@ function template_preprocess_status_report(&$variables) { $severities = array( REQUIREMENT_INFO => array( 'title' => t('Info'), - 'class' => 'info', + 'status' => 'info', ), REQUIREMENT_OK => array( 'title' => t('OK'), - 'class' => 'ok', + 'status' => 'ok', ), REQUIREMENT_WARNING => array( 'title' => t('Warning'), - 'class' => 'warning', + 'status' => 'warning', ), REQUIREMENT_ERROR => array( 'title' => t('Error'), - 'class' => 'error', + 'status' => 'error', ), ); @@ -194,8 +190,8 @@ function template_preprocess_status_report(&$variables) { else { $severity = $severities[REQUIREMENT_INFO]; } - $variables['requirements'][$i]['severity_class'] = $severity['class']; $variables['requirements'][$i]['severity_title'] = $severity['title']; + $variables['requirements'][$i]['severity_status'] = $severity['status']; } } @@ -374,7 +370,7 @@ function template_preprocess_system_themes_page(&$variables) { $theme_group['state'] = $state; $theme_group['title'] = $title; $theme_group['themes'] = array(); - $theme_group['attributes'] = new Attribute(array('class' => array('system-themes-list', 'system-themes-list-' . $state, 'clearfix'))); + $theme_group['attributes'] = new Attribute(); foreach ($theme_groups[$state] as $theme) { $current_theme = array(); @@ -402,13 +398,12 @@ function template_preprocess_system_themes_page(&$variables) { // Localize the theme description. $current_theme['description'] = t($theme->info['description']); - // Style theme info. - $theme->classes[] = 'theme-selector'; - $theme->classes[] = 'clearfix'; - $current_theme['attributes'] = new Attribute(array('class' => $theme->classes)); + $current_theme['attributes'] = new Attribute(); $current_theme['name'] = $theme->info['name']; $current_theme['version'] = isset($theme->info['version']) ? $theme->info['version'] : ''; $current_theme['notes'] = $theme->notes; + $current_theme['is_default'] = $theme->is_default; + $current_theme['is_admin'] = $theme->is_admin; // Make sure to provide feedback on compatibility. $current_theme['incompatible'] = ''; diff --git a/core/modules/system/templates/admin-block-content.html.twig b/core/modules/system/templates/admin-block-content.html.twig index a49bf10..e70e565 100644 --- a/core/modules/system/templates/admin-block-content.html.twig +++ b/core/modules/system/templates/admin-block-content.html.twig @@ -9,14 +9,21 @@ * contain the keys 'title', 'link_path', and 'localized_options', which are * passed to l(). A 'description' key may also be provided. * - attributes: HTML attributes to be added to the element. + * - compact: Boolean indicating whether compact mode is turned on or not. * * @see template_preprocess_admin_block_content() * * @ingroup themeable */ #} +{% + set classes = [ + 'admin-list', + compact ? 'compact', + ] +%} {% if content %} - + {% for item in content %}
{{ item.link }}
{% if item.description %} diff --git a/core/modules/system/templates/status-report.html.twig b/core/modules/system/templates/status-report.html.twig index 7d0d96d..89f12d4 100644 --- a/core/modules/system/templates/status-report.html.twig +++ b/core/modules/system/templates/status-report.html.twig @@ -10,7 +10,7 @@ * - value: (optional) The requirement's status. * - description: (optional) The requirement's description. * - severity_title: The title of the severity. - * - severity_class: The HTML class of the severity. + * - severity_status: Indicates the severity status. * * @see template_preprocess_status_report() * @@ -25,7 +25,7 @@ {% for requirement in requirements %} - +
{{ requirement.severity_title }} diff --git a/core/modules/system/templates/system-themes-page.html.twig b/core/modules/system/templates/system-themes-page.html.twig index 9d55c21..1d8936e 100644 --- a/core/modules/system/templates/system-themes-page.html.twig +++ b/core/modules/system/templates/system-themes-page.html.twig @@ -15,6 +15,10 @@ * - description: Description of the theme. * - name: Theme name. * - version: The theme's version number. + * - is_default: Boolean indicating whether the theme is default theme or + * not. + * - is_admin: Boolean indicating whether the theme is the admin theme or + * not. * - notes: Identifies what context this theme is being used in, e.g., * default theme, admin theme. * - incompatible: Text describing any compatibility issues. @@ -28,10 +32,25 @@ #} {% for theme_group in theme_groups %} - + {% + set theme_group_classes = [ + 'system-themes-list', + 'system-themes-list-' ~ theme_group.state, + 'clearfix', + ] + %} +

{{ theme_group.title }}

{% for theme in theme_group.themes %} - + {% + set theme_classes = [ + theme.is_default ? 'theme-default', + theme.is_admin ? 'theme-admin', + 'theme-selector', + 'clearfix', + ] + %} + {% if theme.screenshot %} {{ theme.screenshot }} {% endif %} diff --git a/core/themes/seven/templates/admin-block-content.html.twig b/core/themes/seven/templates/admin-block-content.html.twig index 7dc0a92..6515df1 100644 --- a/core/themes/seven/templates/admin-block-content.html.twig +++ b/core/themes/seven/templates/admin-block-content.html.twig @@ -11,13 +11,20 @@ * - title: Short name of the section. * - description: Description of the administrative menu item. * - attributes: HTML attributes to be added to the element. + * - compact: True if compact mode is turned on. * * @see template_preprocess_admin_block_content() * @see seven_preprocess_admin_block_content() */ #} +{% + set classes = [ + 'admin-list', + compact ? 'compact', + ] +%} {% if content %} - + {% for item in content %}
  • {{ item.title }}
    {{ item.description }}
  • {% endfor %}