diff --git a/core/modules/system/system.admin.inc b/core/modules/system/system.admin.inc index f9c49c7..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,6 +168,10 @@ function template_preprocess_status_report(&$variables) { } $variables['requirements'][$i]['severity_title'] = $severity['title']; $variables['requirements'][$i]['severity_status'] = $severity['status']; + + 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..86fe0b5 100644 --- a/core/modules/system/templates/status-report.html.twig +++ b/core/modules/system/templates/status-report.html.twig @@ -11,6 +11,9 @@ * - description: (optional) The requirement's description. * - severity_title: The title of the severity. * - severity_status: Indicates the severity status. + * - error: The number of errors found. + * - warning: The number of warnings found. + * - info: The number of items which are neither errors nor warnings. * * @see template_preprocess_status_report() * diff --git a/core/themes/seven/css/components/counter.css b/core/themes/seven/css/components/counter.css new file mode 100644 index 0000000..312e4e5 --- /dev/null +++ b/core/themes/seven/css/components/counter.css @@ -0,0 +1,70 @@ +/** + * @file + * Styles for counter component. + */ + +.counter { + border: 1px solid #e6e4df; + border-radius: 5px; + height: 85px; + vertical-align: middle; + line-height: 85px; + font-size: 20px; + font-weight: bold; + display: inline-block; + width: 100%; +} + +.counter__status-title { + position: relative; + vertical-align: top; + width: 25%; + padding: 10px 6px; + box-sizing: border-box; + font-weight: normal; +} + +.counter__status-icon { + display: inline-block; + height: 85px; + border-right: 1px solid #e6e4df; /* LTR */ + border-left: 0; /* LTR */ +} +[dir="rtl"] .counter__status-icon { + border-right: 0; + border-left: 1px solid #e6e4df; +} +.counter__status-icon:before { + content: ""; + background-size: 35px; + background-position: 50% center; + background-repeat: no-repeat; + width: 100%; + height: 100%; + display: block; + float: left; /* LTR */ +} +[dir="rtl"] .counter__status-icon:before { + float: right; +} +.counter__status-icon:before { + margin-right: 10px; /* LTR */ +} +[dir="rtl"] .counter__status-icon:before { + margin-left: 10px; +} +.counter__status-icon--error:before { + background-image: url(../../../stable/images/core/icons/e32700/error.svg); +} +.counter__status-icon--warning:before { + background-image: url(../../../stable/images/core/icons/e29700/warning.svg); +} +.counter__status-icon--checked:before { + background-image: url(../../../stable/images/core/icons/73b355/check.svg); +} + +.counter__details { + display: inline-block; + padding: 0 5px; + height: 85px; +} diff --git a/core/themes/seven/css/components/system-status-report-counters.css b/core/themes/seven/css/components/system-status-report-counters.css new file mode 100644 index 0000000..6826a53 --- /dev/null +++ b/core/themes/seven/css/components/system-status-report-counters.css @@ -0,0 +1,31 @@ +/** + * @file + * Styles for the system status report counters. + */ + +.system-status-report-counters { + display: flex; + justify-content: space-between; +} + +.system-status-report-counters__item { + margin: 10px 0 20px 0; + width: 100%; +} +.system-status-report-counters__item--half-width { + width: 49%; +} +.system-status-report-counters__item--third-width { + width: 32%; +} + +@media screen and (max-width: 48em) { + .system-status-report-counters { + display: block; + } + .system-status-report-counters__item { + margin: 10px 0; + width: 100%; + } +} + diff --git a/core/themes/seven/css/components/system-status-report.css b/core/themes/seven/css/components/system-status-report.css index aeac1d3..6849d42 100644 --- a/core/themes/seven/css/components/system-status-report.css +++ b/core/themes/seven/css/components/system-status-report.css @@ -13,3 +13,10 @@ .system-status-report__entry:last-child { border-bottom: 1px solid #bebfb9; } + +@media screen and (max-width: 48em) { + .system-status-report { + table-layout: fixed; + word-wrap: break-word; + } +} diff --git a/core/themes/seven/seven.libraries.yml b/core/themes/seven/seven.libraries.yml index e68b75a..8d14442 100644 --- a/core/themes/seven/seven.libraries.yml +++ b/core/themes/seven/seven.libraries.yml @@ -11,6 +11,7 @@ global-styling: css/components/breadcrumb.css: {} css/components/buttons.css: {} css/components/colors.css: {} + css/components/counter.css: {} css/components/messages.css: {} css/components/dropbutton.component.css: {} css/components/entity-meta.css: {} @@ -28,6 +29,7 @@ global-styling: css/components/search-admin-settings.css: {} css/components/tablesort-indicator.css: {} css/components/system-status-report.css: {} + css/components/system-status-report-counters.css: {} css/components/tabs.css: {} css/components/views-ui.css: {} layout: diff --git a/core/themes/seven/templates/status-report.html.twig b/core/themes/seven/templates/status-report.html.twig new file mode 100644 index 0000000..a1510f8 --- /dev/null +++ b/core/themes/seven/templates/status-report.html.twig @@ -0,0 +1,77 @@ +{# +/** + * @file + * Theme override for the status report. + * + * Available variables: + * - requirements: Contains multiple requirement instances. + * Each requirement contains: + * - title: The title of the requirement. + * - value: (optional) The requirement's status. + * - description: (optional) The requirement's description. + * - severity_title: The title of the severity. + * - severity_status: Indicates the severity status. + * - error: The number of errors found. + * - warning: The number of warnings found. + * - info: The number of items which are neither errors nor warnings. + * + * @see template_preprocess_status_report() + */ +#} +{% if error != 0 and warning != 0 and info != 0 %} + {% set element_width_class = ' system-status-report-counters__item--third-width' %} +{% elseif error != 0 or warning != 0 %} + {% set element_width_class = ' system-status-report-counters__item--half-width' %} +{% endif %} +
+ {% if error %} +
+ + + + {{ error }} {{'error'|t }} + + +
+ {% endif %} + {% if warning %} +
+ + + + {{ warning }} {{ 'warning'|t }} + + +
+ {% endif %} +
+ + + + {{ info }} {{ 'checked'|t }} + + +
+
+ + + {% for requirement in requirements %} + + {% if requirement.severity_status in ['warning', 'error'] %} + + + + {% endfor %} + +
+ {{ requirement.severity_title }} + {% else %} + + {% endif %} + {{ requirement.title }} + + {{ requirement.value }} + {% if requirement.description %} +
{{ requirement.description }}
+ {% endif %} +
diff --git a/core/themes/stable/css/system/system.admin.css b/core/themes/stable/css/system/system.admin.css index c8e20cf..e6d57ae 100644 --- a/core/themes/stable/css/system/system.admin.css +++ b/core/themes/stable/css/system/system.admin.css @@ -200,39 +200,6 @@ small .admin-link:after { background-position: top 50% right 0; } -/* Status report. */ -.system-status-report__status-title { - position: relative; - vertical-align: top; - width: 25%; - padding: 10px 6px 10px 40px; /* LTR */ - box-sizing: border-box; - font-weight: normal; -} -[dir="rtl"] .system-status-report__status-title { - padding: 10px 40px 10px 6px; -} -.system-status-report__status-icon:before { - content: ""; - background-repeat: no-repeat; - height: 16px; - width: 16px; - display: block; - position: absolute; - left: 12px; /* LTR */ - top: 12px; -} -[dir="rtl"] .system-status-report__status-icon:before { - left: auto; - right: 12px; -} -.system-status-report__status-icon--error:before { - background-image: url(../../images/core/icons/e32700/error.svg); -} -.system-status-report__status-icon--warning:before { - background-image: url(../../images/core/icons/e29700/warning.svg); -} - /** * Appearance page. */ diff --git a/core/themes/stable/templates/admin/status-report.html.twig b/core/themes/stable/templates/admin/status-report.html.twig index 7f4c600..a7746ba 100644 --- a/core/themes/stable/templates/admin/status-report.html.twig +++ b/core/themes/stable/templates/admin/status-report.html.twig @@ -11,6 +11,9 @@ * - description: (optional) The requirement's description. * - severity_title: The title of the severity. * - severity_status: Indicates the severity status. + * - error: The number of errors found. + * - warning: The number of warnings found. + * - info: The number of items which are neither errors nor warnings. * * @see template_preprocess_status_report() */