diff --git a/core/modules/update/images/shield-icon.svg b/core/modules/update/images/shield-icon.svg new file mode 100644 index 0000000..9ed6476 --- /dev/null +++ b/core/modules/update/images/shield-icon.svg @@ -0,0 +1,88 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/core/modules/update/tests/modules/update_test/bbb_update_test.1_0.xml b/core/modules/update/tests/modules/update_test/bbb_update_test.1_0.xml index 8d705b5..fa091f6 100644 --- a/core/modules/update/tests/modules/update_test/bbb_update_test.1_0.xml +++ b/core/modules/update/tests/modules/update_test/bbb_update_test.1_0.xml @@ -16,11 +16,11 @@ bbb_update_test 8.x-1.0 8.x-1.0 - DRUPAL-7--1-0 + 8.x-1.0 1 0 published - http://example.com/bbb_update_test-7-x-1-0-release + http://example.com/bbb_update_test-8-x-1-0-release http://example.com/bbb_update_test-8.x-1.0.tar.gz 1250424521 b966255555d9c9b86d480ca08cfaa98e @@ -29,6 +29,26 @@ Release typeNew features Release typeBug fixes + covered + + + bbb_update_test 8.x-1.0-beta1 + 8.x-1.0-beta1 + 8.x-1.0-beta1 + 1 + 0 + beta1 + published + http://example.com/bbb_update_test-8-x-1-0-beta1 + http://example.com/bbb_update_test-8.x-1.0-beta1.tar.gz + 1250424521 + 7da7b18ce17cef2122f5cbca1bfe626a + 1073751331 + + Release typeNew features + Release typeBug fixes + + not covered diff --git a/core/modules/update/update.module b/core/modules/update/update.module index 349f694..7f8a9c4 100644 --- a/core/modules/update/update.module +++ b/core/modules/update/update.module @@ -200,7 +200,7 @@ function update_theme() { // We are using template instead of '#type' => 'table' here to keep markup // out of preprocess and allow for easier changes to markup. 'update_version' => array( - 'variables' => array('version' => NULL, 'title' => NULL, 'attributes' => array()), + 'variables' => array('version' => NULL, 'title' => NULL, 'security_icon' => NULL, 'attributes' => array()), 'file' => 'update.report.inc', ), ); diff --git a/core/modules/update/update.report.inc b/core/modules/update/update.report.inc index 5f198d9..20d93bb 100644 --- a/core/modules/update/update.report.inc +++ b/core/modules/update/update.report.inc @@ -127,6 +127,14 @@ function template_preprocess_update_project_status(&$variables) { $versions_inner = array(); $security_class = array(); $version_class = array(); + $security_icon = array( + '#theme' => 'image', + '#width' => 18, + '#height' => 18, + '#uri' => 'core/modules/update/images/shield-icon.svg', + '#alt' => t('shield'), + '#title' => t('shield'), + ); if (isset($project['recommended'])) { if ($project['status'] != UPDATE_CURRENT || $project['existing_version'] !== $project['recommended']) { @@ -160,6 +168,7 @@ function template_preprocess_update_project_status(&$variables) { '#theme' => 'update_version', '#version' => $project['releases'][$project['recommended']], '#title' => t('Recommended version:'), + '#security_icon' => $security_icon, '#attributes' => array('class' => $version_class), ); } @@ -172,6 +181,7 @@ function template_preprocess_update_project_status(&$variables) { '#theme' => 'update_version', '#version' => $security_update, '#title' => t('Security update:'), + '#security_icon' => $security_icon, '#attributes' => array('class' => $security_class), ); } @@ -183,6 +193,7 @@ function template_preprocess_update_project_status(&$variables) { '#theme' => 'update_version', '#version' => $project['releases'][$project['latest_version']], '#title' => t('Latest version:'), + '#security_icon' => $security_icon, '#attributes' => array('class' => array('version-latest')), ); } diff --git a/core/themes/stable/templates/admin/update-version.html.twig b/core/themes/stable/templates/admin/update-version.html.twig index 6c23584..2ac12ca 100644 --- a/core/themes/stable/templates/admin/update-version.html.twig +++ b/core/themes/stable/templates/admin/update-version.html.twig @@ -6,6 +6,7 @@ * Available variables: * - attributes: HTML attributes suitable for a container element. * - title: The title of the project. + * - security_icon: The security coverage icon. * - version: A list of data about the latest released version, containing: * - version: The version number. * - date: The date of the release. @@ -19,6 +20,11 @@
{{ version.version }} ({{ version.date|date('Y-M-d') }}) + {% if version.security == 'covered' %} + + {{ security_icon }} + + {% endif %}