diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index db5c1e2..52b0137 100644 --- a/core/modules/system/system.admin.inc +++ b/core/modules/system/system.admin.inc @@ -146,6 +146,12 @@ function template_preprocess_status_report(&$variables) { ), ); + // Count number of items with different severity for summary. + $counters = array('error', 'warning', 'info'); + foreach ($counters as $counter) { + $variables[$counter] = 0; + } + foreach ($variables['requirements'] as $i => $requirement) { // Always use the explicit requirement severity, if defined. Otherwise, // default to REQUIREMENT_OK in the installer to visually confirm that @@ -162,20 +168,9 @@ function template_preprocess_status_report(&$variables) { } $variables['requirements'][$i]['severity_title'] = $severity['title']; $variables['requirements'][$i]['severity_status'] = $severity['status']; - } - // Foreach for count the error,warning and checked modules. - $variables['error'] = 0; - $variables['warning'] = 0; - $variables['checked'] = 0; - foreach( $variables['requirements'] as $i => $requirement) { - if ($variables['requirements'][$i]['severity_status'] == 'error' ) { - $variables['error'] = $variables['error'] + 1; - } - if ($variables['requirements'][$i]['severity_status'] == 'warning' ) { - $variables['warning'] = $variables['warning'] + 1; - } - if ($variables['requirements'][$i]['severity_status'] == 'info' ) { - $variables['checked'] = $variables['checked'] + 1; + + if (in_array($severity['status'], $counters)) { + $variables[$severity['status']]++; } } } diff --git a/core/modules/system/templates/status-report.html.twig b/core/modules/system/templates/status-report.html.twig index b6ad739..d7e581a 100644 --- a/core/modules/system/templates/status-report.html.twig +++ b/core/modules/system/templates/status-report.html.twig @@ -11,12 +11,53 @@ * - description: (optional) The requirement's description. * - severity_title: The title of the severity. * - severity_status: Indicates the severity status. + * - error: number of errors found if any + * - warning: number of warnings found if any + * - info: number of items which are neither errors nor warnings * * @see template_preprocess_status_report() * * @ingroup themeable */ #} +{% if error != 0 and warning != 0 and info != 0 %} + + + + {{ error }} {{'error'|t }} + + + + + + {{ warning }} {{ 'warning'|t }} + + + + + + {{ info }} {{ 'checked'|t }} + + +{% elseif error != 0 and checked != 0 %} + + {{ error }} {{'error'|t }} + + + {{ info }} {{ 'checked'|t }} + +{% elseif warning != 0 and checked != 0 %} + + {{ warning }} {{ 'warning'|t }} + + + {{ info }} {{ 'checked'|t }} + +{% else %} + + {{ info }} {{ 'checked'|t }} + +{% endif %} {% for requirement in requirements %} diff --git a/core/themes/stable/css/system/system.admin.css b/core/themes/stable/css/system/system.admin.css index 34cf79f..d8930c9 100644 --- a/core/themes/stable/css/system/system.admin.css +++ b/core/themes/stable/css/system/system.admin.css @@ -6,7 +6,7 @@ /** * Reusable layout styles. */ - .layout-container { +.layout-container { margin: 0 1.5em; } .layout-container:after { @@ -48,7 +48,7 @@ * Panel. * Used to visually group items together. */ - .panel { +.panel { padding: 5px 5px 15px; } .panel__description { @@ -59,14 +59,14 @@ /** * System compact link: to toggle the display of description text. */ - .compact-link { +.compact-link { margin: 0 0 0.5em 0; } /** * Quick inline admin links. */ - small .admin-link:before { +small .admin-link:before { content: ' ['; } small .admin-link:after { @@ -76,7 +76,7 @@ small .admin-link:after { /** * Modules page. */ - .system-modules thead > tr { +.system-modules thead > tr { border: 0; } .system-modules div.incompatible { @@ -203,7 +203,7 @@ small .admin-link:after { /** * Appearance page. */ - .theme-info__header { +.theme-info__header { margin-bottom: 0; font-weight: normal; } @@ -248,7 +248,7 @@ small .admin-link:after { /** * Theme display without vertical toolbar. */ - @media screen and (min-width: 45em) { +@media screen and (min-width: 45em) { body:not(.toolbar-vertical) .system-themes-list-installed .screenshot, body:not(.toolbar-vertical) .system-themes-list-installed .no-screenshot { float: left; /* LTR */ @@ -281,7 +281,7 @@ small .admin-link:after { /** * Theme display with vertical toolbar. */ - @media screen and (min-width: 60em) { +@media screen and (min-width: 60em) { .toolbar-vertical .system-themes-list-installed .screenshot, .toolbar-vertical .system-themes-list-installed .no-screenshot { float: left; /* LTR */ @@ -394,7 +394,7 @@ small .admin-link:after { } .system-status-report-counter { border: 1px solid #e6e4df; - margin: 10px 15px 20px 0; + margin: 10px 15px 20px 0; /* LTR */ border-radius: 5px; height: 85px; vertical-align: middle; @@ -402,6 +402,9 @@ small .admin-link:after { font-size: 20px; font-weight: bold; } +[dir="rtl"].system-status-report-counter { + margin: 10px 0 20px 15px; +} [dir="ltr"] .system-status-report-counter:nth-child(3) { margin-right: 0; } @@ -423,8 +426,8 @@ span.all-exits.system-status-report-counter { .system-status-report-counter .system-status-report__status-icon { display: inline-block; height: 85px; - border-right: 1px solid #e6e4df; - border-left: 0; + border-right: 1px solid #e6e4df; /* LTR */ + border-left: 0; /* LTR */ } [dir="rtl"] .system-status-report-counter .system-status-report__status-icon { border-right: 0; diff --git a/core/themes/stable/templates/admin/status-report.html.twig b/core/themes/stable/templates/admin/status-report.html.twig index a63f8e3..8ce6814 100644 --- a/core/themes/stable/templates/admin/status-report.html.twig +++ b/core/themes/stable/templates/admin/status-report.html.twig @@ -11,11 +11,14 @@ * - description: (optional) The requirement's description. * - severity_title: The title of the severity. * - severity_status: Indicates the severity status. + * - error: number of errors found if any + * - warning: number of warnings found if any + * - info: number of items which are neither errors nor warnings * * @see template_preprocess_status_report() */ #} -{% if error != 0 or warning != 0 or checked != 0 %} +{% if error != 0 and warning != 0 and info != 0 %} @@ -31,26 +34,26 @@ - {{ checked }} {{ 'checked'|t }} + {{ info }} {{ 'checked'|t }} - {% elseif error != 0 or checked != 0 %} - + {% elseif error != 0 and checked != 0 %} + {{ error }} {{'error'|t }} - - {{ checked }} {{ 'checked'|t }} + + {{ info }} {{ 'checked'|t }} - {% elseif warning != 0 or checked != 0 %} - + {% elseif warning != 0 and checked != 0 %} + {{ warning }} {{ 'warning'|t }} - {{ checked }} {{ 'checked'|t }} + {{ info }} {{ 'checked'|t }} {% else %} - {{ checked }} {{ 'checked'|t }} + {{ info }} {{ 'checked'|t }} {% endif %}