diff --git a/core/modules/system/system.install b/core/modules/system/system.install index a1db970..47a1fba 100644 --- a/core/modules/system/system.install +++ b/core/modules/system/system.install @@ -497,7 +497,7 @@ function system_requirements($phase) { ]; } $cron_url = \Drupal::url('system.cron', ['key' => \Drupal::state()->get('system.cron_key'), ['absolute' => TRUE]]); - $requirements['cron']['description'][] = [ + $requirements['cron']['run_cron'][] = [ [ '#type' => 'link', '#title' => t('Run cron'), @@ -506,6 +506,15 @@ function system_requirements($phase) { ], '#url' => Url::fromRoute('system.run_cron'), ], + ]; + $requirements['cron']['cron_settings'][] = [ + [ + '#type' => 'link', + '#title' => t('more information'), + '#url' => Url::fromRoute('system.cron_settings'), + ], + ]; + $requirements['cron']['description'][] = [ [ '#prefix' => '
', '#markup' => t('To run cron from outside the site, go to @cron', [':url' => $cron_url, '@cron' => $cron_url]), diff --git a/core/themes/seven/css/components/system-status-counter.css b/core/themes/seven/css/components/system-status-counter.css index 6c28986..da57149 100644 --- a/core/themes/seven/css/components/system-status-counter.css +++ b/core/themes/seven/css/components/system-status-counter.css @@ -35,7 +35,7 @@ display: block; } .system-status-counter__status-icon:before { - margin-right: 10px; /* LTR */ + margin-right: 0; /* LTR */ } [dir="rtl"] .system-status-counter__status-icon:before { margin-left: 10px; diff --git a/core/themes/seven/css/components/system-status-report.css b/core/themes/seven/css/components/system-status-report.css index a14bc1e..cd7e7a2 100644 --- a/core/themes/seven/css/components/system-status-report.css +++ b/core/themes/seven/css/components/system-status-report.css @@ -53,11 +53,10 @@ background-size: 30px; } - .system-status-general-info__item-details { box-sizing: border-box; display: inline-block; - max-width: 80%; + width: 80%; padding-left: 10px; position: relative; } @@ -87,14 +86,17 @@ .system-status-general-info__item:nth-child(5) { border-left: 1px solid #ccc; } - .system-status-general-info__run-cron { - position: absolute; - top: 1em; - right: 1em; - margin-top: 0; + [dir="rtl"] .system-status-general-info__item:nth-child(1), + [dir="rtl"] .system-status-general-info__item:nth-child(3) { + border-left: 1px solid #ccc; + } + [dir="rtl"] .system-status-general-info__item:nth-child(2), + [dir="rtl"] .system-status-general-info__item:nth-child(5) { + border-left: 0; } [dir="rtl"] .system-status-general-info__run-cron { left: 1em; + right: auto; } } @media screen and (min-width: 60em) { @@ -124,7 +126,7 @@ padding: 1em 1em 1em 3em; box-sizing: border-box; } -a.details-title { +.details-title { color: inherit; text-transform: none; } @@ -134,7 +136,7 @@ html:not(.details) .system-status-report__status-title { .system-status-report__status-title .details-title { padding-left: 3em; } -[dir="rtl"] a.details-title { +[dir="rtl"] .details-title { padding-right: 3em; padding-left: 0; } @@ -147,6 +149,12 @@ html[dir="rtl"].details .system-status-report__status-title { .system-status-report__status-title::-webkit-details-marker { float: right; } +[dir="rtl"] .collapse-processed > .system-status-report__status-title:before { + float: left; +} +[dir="rtl"] .system-status-report__status-title::-webkit-details-marker { + float: left; +} .system-status-report summary:first-child ~ * { display: none; } @@ -172,7 +180,7 @@ html[dir="rtl"].details .system-status-report__status-title { [dir="rtl"] .system-status-report__status-title .details-title:before, html[dir="rtl"].details .system-status-report__status-title:before { left: auto; - right: 10px; + right: 0px; } .system-status-report__status-icon--error .details-title:before, .details .system-status-report__status-icon--error:before { @@ -188,7 +196,7 @@ html[dir="rtl"].details .system-status-report__status-title:before { padding: 0 1em 1em 3em; } [dir="rtl"] .system-status-report__entry__value { - padding: 0 3em 1em 1em; + padding: 1em 3em 1em 1em; } @media screen and (max-width: 48em) { @@ -221,7 +229,7 @@ html[dir="rtl"].details .system-status-report__status-title:before { padding-top: 1em; } [dir="rtl"] .system-status-report__entry__value { - padding-left: 3em; - padding-right: 0; + padding-left: 0; + padding-right: 3em; } } diff --git a/core/themes/seven/js/responsive-details.js b/core/themes/seven/js/responsive-details.js index 58d29d1..a4404f1 100644 --- a/core/themes/seven/js/responsive-details.js +++ b/core/themes/seven/js/responsive-details.js @@ -1,11 +1,18 @@ /** * @file - * Responsive details elements + * Provides responsive behaviors to HTML details elements */ + (function ($, Drupal) { 'use strict'; + /** + * Initialize the responsiveness for details elements. + * Includes resizing, closing all elements, open all elements + * + * @param context + */ function init(context) { var $statusDetails = $(context).find('.system-status-report__entry'); @@ -36,7 +43,12 @@ } /** - * Initialise the details JS. + * Initializes the responsive behaviors for details elements + * + * @type {Drupal~behavior} + * + * @prop {Drupal-behaviorAttach} attach + * Only calls the init behavior, which handles all processing */ Drupal.behaviors.responsiveDetails = { attach: function (context, settings) { diff --git a/core/themes/seven/seven.theme b/core/themes/seven/seven.theme index 8846764..b2358b4 100644 --- a/core/themes/seven/seven.theme +++ b/core/themes/seven/seven.theme @@ -149,8 +149,6 @@ function seven_preprocess_maintenance_page(&$variables) { */ function seven_preprocess_status_report(&$variables) { - $variables = _seven_alter_cron_description($variables); - $severities = [ REQUIREMENT_INFO => [ 'title' => t('Info'), @@ -292,44 +290,3 @@ function seven_form_node_form_alter(&$form, FormStateInterface $form_state) { $form['revision_information']['#type'] = 'container'; $form['revision_information']['#group'] = 'meta'; } - -/** - * Remove the cron button from the cron.description render array - * and add it as separate variable. - * - * @todo Only one sanity check is performed. Might be prudent to also - * return unchanged if either index has a count > 1 - */ -function _seven_alter_cron_description($variables) { - // find the Cron element - $cron = array_filter($variables['requirements'], function($requirement) { - return _seven_get_variable_index_by_title_string($requirement, 'title', 'Cron maintenance tasks'); - }); - $cron_index = current(array_keys($cron)); - - // Within Cron element, find the Run Cron link - $existing_run_cron_link = array_filter($variables['requirements'][$cron_index]['description'][0], function($render_element) { - return _seven_get_variable_index_by_title_string($render_element, '#title', 'Run cron'); - }); - $run_cron_index = current(array_keys($existing_run_cron_link)); - - // For sanity: if we don't have successful indexes return $variables unchanged - if (FALSE === $cron_index || FALSE === $run_cron_index) { - return $variables; - } - - // Remove the existing link that is nested in description and provide a new element - $new_link = $variables['requirements'][$cron_index]['description'][0][$run_cron_index]; - unset($variables['requirements'][$cron_index]['description'][0][$run_cron_index]); - $variables['requirements'][$cron_index]['run_cron'] = $new_link; - - return $variables; -} - -function _seven_get_variable_index_by_title_string($var, $key, $string) { - if (!array_key_exists($key, $var) || !method_exists($var[$key], 'getUntranslatedString')) { - return FALSE; - } - - return $var[$key]->getUntranslatedString() == $string; -} \ No newline at end of file diff --git a/core/themes/seven/templates/status-report.html.twig b/core/themes/seven/templates/status-report.html.twig index 7452c53..f9776b3 100644 --- a/core/themes/seven/templates/status-report.html.twig +++ b/core/themes/seven/templates/status-report.html.twig @@ -86,11 +86,14 @@

Last Cron Run

{{ cron.value }} + {% if cron.cron_settings %} +
({{ cron.cron_settings }}) + {% endif %} {% if cron.run_cron %}
{{ cron.run_cron }}
{% endif %} {% if cron.description %} -
{{ cron.description }}
+
{{ cron.description }}
{% endif %}