diff --git a/core/modules/update/css/update.admin.theme.css b/core/modules/update/css/update.admin.theme.css index abf0a88243..19b4af2a25 100644 --- a/core/modules/update/css/update.admin.theme.css +++ b/core/modules/update/css/update.admin.theme.css @@ -8,10 +8,12 @@ font-size: 110%; } .project-update__status { + text-align: right; /* LTR */ float: right; /* LTR */ font-size: 110%; } [dir="rtl"] .project-update__status { + text-align: left; float: left; } .project-update__status--not-supported { @@ -32,12 +34,19 @@ padding-left: 0; padding-right: 0.5em; } +.project-update__status-icon img { + vertical-align: top; +} .project-update__details { padding: 1em 1em 0.25em 1em; } .project-update__version { - padding: 1em 0; + border-bottom: 1px solid #bfbfbf; + padding: 0.5em 0; +} +.project-update__version--installed { + border-bottom: none; } .project-update__version-date { white-space: nowrap; @@ -51,13 +60,12 @@ } .project-update__version-links { text-align: right; /* LTR */ - padding-right: 1em; /* LTR */ list-style-type: none; } [dir="rtl"] .project-update__version-links { text-align: left; - padding-left: 1em; } -.project-update__version--recommended-strong .project-update__version-title { +.project-update__version--recommended-strong .project-update__version-title, +.version-security .project-update__version-title { font-weight: bold; } diff --git a/core/modules/update/src/UpdateProcessor.php b/core/modules/update/src/UpdateProcessor.php index 25dfc7a004..9115357274 100644 --- a/core/modules/update/src/UpdateProcessor.php +++ b/core/modules/update/src/UpdateProcessor.php @@ -231,6 +231,9 @@ protected function parseXml($raw_xml) { foreach ($release->children() as $k => $v) { $data['releases'][$version][$k] = (string) $v; } + if ($release->security['covered']) { + $data['releases'][$version]['security_covered'] = TRUE; + } $data['releases'][$version]['terms'] = []; if ($release->terms) { foreach ($release->terms->children() as $term) { diff --git a/core/modules/update/templates/update-project-status.html.twig b/core/modules/update/templates/update-project-status.html.twig index 4cc9a19e8b..894379e785 100644 --- a/core/modules/update/templates/update-project-status.html.twig +++ b/core/modules/update/templates/update-project-status.html.twig @@ -47,24 +47,14 @@ -
{{ no_updates_message }}
{% endfor %} diff --git a/core/modules/update/templates/update-version.html.twig b/core/modules/update/templates/update-version.html.twig index c21c4f0ba4..79f47c1fd8 100644 --- a/core/modules/update/templates/update-version.html.twig +++ b/core/modules/update/templates/update-version.html.twig @@ -17,20 +17,24 @@ #}' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
'; + return '' . t('Here you can find information about available updates for your installed modules and themes. Note that each module or theme is part of a "project", which may or may not have the same name, and might include multiple modules or themes within it.') . '
' + . '' . t('Projects covered by Drupal’s security advisory policy will have security advisories responsibly disclosed when vulnerabilities are reported to Drupal’s security team. Projects from Drupal.org that are not covered may have publicly disclosed vulnerabilities.') . '
'; case 'system.modules_list': if (_update_manager_access()) { diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 7b14a05852..21f18c00e7 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -8,6 +8,8 @@ use Drupal\Component\Utility\Unicode; use Drupal\Core\Template\Attribute; use Drupal\Core\Url; +use Drupal\update\UpdateFetcherInterface; +use Drupal\update\UpdateManagerInterface; /** * Prepares variables for project status report templates. @@ -39,45 +41,38 @@ function template_preprocess_update_report(&$variables) { $variables['no_updates_message'] = _update_no_data(); } - $rows = []; - + $projects = []; foreach ($data as $project) { - $project_status = [ - '#theme' => 'update_project_status', - '#project' => $project, - ]; - - // Build project rows. - if (!isset($rows[$project['project_type']])) { - $rows[$project['project_type']] = [ - '#type' => 'table', - '#attributes' => ['class' => ['update']], - ]; - } - $row_key = !empty($project['title']) ? Unicode::strtolower($project['title']) : Unicode::strtolower($project['name']); - - // Add the project status row and details. - $rows[$project['project_type']][$row_key]['status'] = $project_status; - - // Add project status class attribute to the table row. + // Add the project status and details. switch ($project['status']) { - case UPDATE_CURRENT: - $rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-success']]; + case UpdateManagerInterface::CURRENT: + $class = 'color-success'; break; - case UPDATE_UNKNOWN: - case UPDATE_FETCH_PENDING: - case UPDATE_NOT_FETCHED: - case UPDATE_NOT_SECURE: - case UPDATE_REVOKED: - case UPDATE_NOT_SUPPORTED: - $rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-error']]; + + case UpdateFetcherInterface::UNKNOWN: + case UpdateFetcherInterface::FETCH_PENDING: + case UpdateFetcherInterface::NOT_FETCHED: + case UpdateManagerInterface::NOT_SECURE: + case UpdateManagerInterface::REVOKED: + case UpdateManagerInterface::NOT_SUPPORTED: + $class = 'color-error'; break; - case UPDATE_NOT_CHECKED: - case UPDATE_NOT_CURRENT: + + case UpdateManagerInterface::NOT_CURRENT: default: - $rows[$project['project_type']][$row_key]['#attributes'] = ['class' => ['color-warning']]; + $class = 'color-warning'; break; } + $projects[$project['project_type']][Unicode::strtolower(!empty($project['title']) ? $project['title'] : $project['name'])] = [ + '#theme' => 'admin_block', + '#block' => [ + 'content' => [ + '#theme' => 'update_project_status', + '#project' => $project, + ], + ], + '#attributes' => ['class' => [$class]], + ]; } $project_types = [ @@ -90,11 +85,11 @@ function template_preprocess_update_report(&$variables) { $variables['project_types'] = []; foreach ($project_types as $type_name => $type_label) { - if (!empty($rows[$type_name])) { - ksort($rows[$type_name]); + if (!empty($projects[$type_name])) { + ksort($projects[$type_name]); $variables['project_types'][] = [ 'label' => $type_label, - 'table' => $rows[$type_name], + 'content' => $projects[$type_name], ]; } } @@ -127,6 +122,7 @@ function template_preprocess_update_project_status(&$variables) { $versions_inner = []; $security_class = []; $version_class = []; + if (isset($project['recommended'])) { if ($project['status'] != UPDATE_CURRENT || $project['existing_version'] !== $project['recommended']) { @@ -159,7 +155,7 @@ function template_preprocess_update_project_status(&$variables) { $versions_inner[] = [ '#theme' => 'update_version', '#version' => $project['releases'][$project['recommended']], - '#title' => t('Recommended version:'), + '#title' => t('Recommended update:'), '#attributes' => ['class' => $version_class], ]; } @@ -210,6 +206,16 @@ function template_preprocess_update_project_status(&$variables) { } } + // Currently installed version. + if (isset($project['releases'][$project['version_normalized']])) { + $versions_inner[] = [ + '#theme' => 'update_version', + '#version' => $project['releases'][$project['version_normalized']], + '#title' => t('Installed version:'), + '#attributes' => ['class' => ['project-update__version--installed']], + ]; + } + if (!empty($versions_inner)) { $variables['versions'] = $versions_inner; } diff --git a/core/themes/stable/css/update/update.admin.theme.css b/core/themes/stable/css/update/update.admin.theme.css index abf0a88243..19b4af2a25 100644 --- a/core/themes/stable/css/update/update.admin.theme.css +++ b/core/themes/stable/css/update/update.admin.theme.css @@ -8,10 +8,12 @@ font-size: 110%; } .project-update__status { + text-align: right; /* LTR */ float: right; /* LTR */ font-size: 110%; } [dir="rtl"] .project-update__status { + text-align: left; float: left; } .project-update__status--not-supported { @@ -32,12 +34,19 @@ padding-left: 0; padding-right: 0.5em; } +.project-update__status-icon img { + vertical-align: top; +} .project-update__details { padding: 1em 1em 0.25em 1em; } .project-update__version { - padding: 1em 0; + border-bottom: 1px solid #bfbfbf; + padding: 0.5em 0; +} +.project-update__version--installed { + border-bottom: none; } .project-update__version-date { white-space: nowrap; @@ -51,13 +60,12 @@ } .project-update__version-links { text-align: right; /* LTR */ - padding-right: 1em; /* LTR */ list-style-type: none; } [dir="rtl"] .project-update__version-links { text-align: left; - padding-left: 1em; } -.project-update__version--recommended-strong .project-update__version-title { +.project-update__version--recommended-strong .project-update__version-title, +.version-security .project-update__version-title { font-weight: bold; } diff --git a/core/themes/stable/templates/admin/update-project-status.html.twig b/core/themes/stable/templates/admin/update-project-status.html.twig index 5a6d2ecea7..2c3308afd0 100644 --- a/core/themes/stable/templates/admin/update-project-status.html.twig +++ b/core/themes/stable/templates/admin/update-project-status.html.twig @@ -45,24 +45,14 @@{{ no_updates_message }}
{% endfor %} diff --git a/core/themes/stable/templates/admin/update-version.html.twig b/core/themes/stable/templates/admin/update-version.html.twig index 6c23584a68..d57ceedb80 100644 --- a/core/themes/stable/templates/admin/update-version.html.twig +++ b/core/themes/stable/templates/admin/update-version.html.twig @@ -15,20 +15,24 @@ #}