diff --git a/core/includes/form.inc b/core/includes/form.inc index 5634be8f92130e88b4e82c4b094b6f4788cf3796..ca5edb1bfc3a5d7e5f960d21858da624ed7c2f32 100644 --- a/core/includes/form.inc +++ b/core/includes/form.inc @@ -2795,10 +2795,15 @@ function theme_fieldset($variables) { element_set_attributes($element, array('id')); _form_set_attributes($element, array('form-wrapper')); + $legend_attributes = array(); + if (isset($element['#title_display']) && $element['#title_display'] == 'invisible') { + $legend_attributes['class'][] = 'element-invisible'; + } + $output = ''; if (!empty($element['#title'])) { // Always wrap fieldset legends in a SPAN for CSS positioning. - $output .= '' . $element['#title'] . ''; + $output .= '' . $element['#title'] . ''; } $output .= '
'; if (!empty($element['#description'])) { diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 215ad81e4a9df6aaca7f7178a40f495a533edf67..4fe33cb5e38b89042d1e38a14d642f3ee4daaabb 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -109,19 +109,51 @@ public function form(array $form, array &$form_state, EntityInterface $node) { ); $form['additional_settings'] = array( - '#type' => 'vertical_tabs', + '#type' => 'fieldset', '#weight' => 99, ); + // Build variables for use in the node settings summary. + $publish_state = ''; + $last_saved = ''; + $author = ''; + if (!$node->isNew()) { + $publish_state = (isset($node->status) && $node->status == 1) ? t('Published') : t('Not published'); + $last_saved = '' . t('Last saved') . ': ' .format_date($node->changed); + $author = '' . t('Author') . ': ' . user_format_name(user_load($node->uid)); + } + else { + $publish_state = t('Not published'); + $last_saved = t('Not saved yet'); + $author = '' . t('Author') . ': ' . user_format_name($GLOBALS['user']); + } + // Create the node settings summary that appears (by default) at the top + // of the settings region. Always contains publish state, date/time last + // saved, and author. + $form['settings_summary'] = array ( + '#type' => 'fieldset', + 'publish_state' => array( + '#type' => 'item', + '#markup' => $publish_state, + ), + 'last_saved' => array( + '#type' => 'item', + '#markup' => $last_saved, + ), + 'author' => array( + '#type' => 'item', + '#markup' => $author, + ), + ); + // Add a log field if the "Create new revision" option is checked, or if the // current user has the ability to check that option. $form['revision_information'] = array( '#type' => 'fieldset', '#title' => t('Revision information'), - '#collapsible' => TRUE, - // Collapsed by default when "Create new revision" is unchecked. - '#collapsed' => !$node->isNewRevision(), - '#group' => 'additional_settings', + '#title_display' => 'invisible', + '#collapsible' => FALSE, + '#group' => 'settings_summary', '#attributes' => array( 'class' => array('node-form-revision-information'), ), @@ -139,23 +171,18 @@ public function form(array $form, array &$form_state, EntityInterface $node) { '#access' => user_access('administer nodes'), ); - // Check the revision log checkbox when the log textarea is filled in. - // This must not happen if "Create new revision" is enabled by default, - // since the state would auto-disable the checkbox otherwise. - if (!$node->isNewRevision()) { - $form['revision_information']['revision']['#states'] = array( - 'checked' => array( - 'textarea[name="log"]' => array('empty' => FALSE), - ), - ); - } - $form['revision_information']['log'] = array( '#type' => 'textarea', '#title' => t('Revision log message'), '#rows' => 4, '#default_value' => !empty($node->log) ? $node->log : '', '#description' => t('Briefly describe the changes you have made.'), + '#attributes' => array('name' => 'log'), + '#states' => array( + 'visible' => array( + ':input[name="revision"]' => array('checked' => TRUE), + ), + ), ); // Node author information for administrators. @@ -203,7 +230,7 @@ public function form(array $form, array &$form_state, EntityInterface $node) { $form['options'] = array( '#type' => 'fieldset', '#access' => user_access('administer nodes'), - '#title' => t('Publishing options'), + '#title' => t('Promotion options'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#group' => 'additional_settings', diff --git a/core/modules/node/node.js b/core/modules/node/node.js index 7d5688c9a2b8dc647a56ca67f5913d3f79d5ee65..5bf1cc0e1f4885888cfbec050b8ab950f88c029d 100644 --- a/core/modules/node/node.js +++ b/core/modules/node/node.js @@ -38,14 +38,15 @@ Drupal.behaviors.nodeFieldsetSummaries = { var $context = $(context); var vals = []; - $context.find('input:checked').parent().each(function () { - vals.push(Drupal.checkPlain($.trim($(this).text()))); - }); - - if (!$context.find('.form-item-status input').is(':checked')) { - vals.unshift(Drupal.t('Not published')); + if ($context.find('input').is(':checked')) { + $context.find('input:checked').parent().each(function () { + vals.push(Drupal.checkPlain($.trim($(this).text()))); + }); + return vals.join(', '); + } + else { + return Drupal.t('Not promoted'); } - return vals.join(', '); }); $context.find('fieldset.node-translation-options').drupalSetSummary(function (context) { diff --git a/core/modules/system/system.base.css b/core/modules/system/system.base.css index c50b0853fc43d98cafe59038945805762876ecc9..35c290adf45986a81ad38bd31b6ff5ae149ab3c5 100644 --- a/core/modules/system/system.base.css +++ b/core/modules/system/system.base.css @@ -55,7 +55,9 @@ fieldset.collapsible { position: relative; } fieldset.collapsible .fieldset-legend { + box-sizing: border-box; display: block; + width: 100%; } /** diff --git a/core/themes/seven/style-rtl.css b/core/themes/seven/style-rtl.css index 4974785ae60fe1ca4b5d1de9dd84fd898dfa1c9a..f373257d00a1438b3c082004e2058dc80cf0d9d1 100644 --- a/core/themes/seven/style-rtl.css +++ b/core/themes/seven/style-rtl.css @@ -109,9 +109,6 @@ fieldset .fieldset-legend { padding-right: 15px; right: 0; } -fieldset .fieldset-wrapper { - padding: 0 15px 13px 13px; -} /* Filter */ .filter-wrapper .form-item, diff --git a/core/themes/seven/style.css b/core/themes/seven/style.css index e8ad0cf93c94970a9c3cd5720e133158d785c82b..035f1c77773475e41b4e95da88297178e88013bf 100644 --- a/core/themes/seven/style.css +++ b/core/themes/seven/style.css @@ -524,7 +524,7 @@ fieldset .fieldset-legend { text-transform: uppercase; } fieldset .fieldset-wrapper { - padding: 0 13px 13px 15px; /* LTR */ + padding: 0 18px 13px 18px; } fieldset.collapsed { background-color: transparent; @@ -1449,3 +1449,110 @@ fieldset.fieldset-no-legend { /* @end */ /* @end */ + +/** + * Node add/edit screen + */ +[id="edit-settings-summary"], +[id="edit-additional-settings"] { + background-color: #f2f2f2; + border: 1px solid #a5a5a5; +} +[id="edit-settings-summary"] { + box-shadow: inset 0 2px 4px rgba(0, 0, 0, .1); + margin-bottom: 0; + overflow: hidden; + padding: 0; +} +[id="edit-settings-summary"] > .fieldset-wrapper { + padding: 16px; +} +[id="edit-settings-summary"] .label { + font-weight: bold; +} +[id="edit-settings-summary"] .form-item { + font-size: 1em; + margin: 0; + padding: 0; +} +#edit-publish-state { + font-size: 1.231em; + font-weight: bold; + margin-bottom: 0; + margin-top: .25em; + text-shadow: 0 1px 0 white; +} +#edit-last-saved { + font-style: italic; + margin-bottom: .5em; +} +#edit-last-saved .label { + font-weight: normal; +} +.node-form-revision-information { + padding: 0; + background: transparent; + margin-bottom: .5em; +} +.node-form-revision-information > .fieldset-wrapper { + padding: 0; +} +[id="edit-settings-summary"] .form-item-log { + margin-top: .5em; +} + +[id="edit-additional-settings"] { + border-bottom: 0; + border-top: 0; + margin-top: 0; + padding-top: 0; +} +[id="edit-additional-settings"] > .fieldset-wrapper { + padding: 0; +} +[id="edit-additional-settings"] .collapsible { + background-color: #e2e2e2; + border-bottom: 1px solid #959595; + border-left: 0; + border-right: 0; + border-top: 0; + -moz-box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5); + -webkit-box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5); + box-shadow: inset 0 1px 0px rgba(255, 255, 255, .5); + margin: 0; + padding-top: 3.25em; + -moz-transition: background-color .1s; + -ms-transition: background-color .1s; + -o-transition: background-color .1s; + -webkit-transition: background-color .1s; + transition: background-color .1s; +} +[id="edit-additional-settings"] .collapsible .summary { + color: #858585; +} +[id="edit-additional-settings"] .collapsible .fieldset-legend { + margin-top: .875em; + text-shadow: 0 1px 0 white; +} +/* Expanded, with top inner shadow */ +[id="edit-additional-settings"] .collapsible:first-child, +[id="edit-additional-settings"] .collapsed + .collapsible { + -moz-box-shadow: inset 0 3px 3px rgba(0, 0, 0, .14); + -webkit-box-shadow: inset 0 3px 3px rgba(0, 0, 0, .14); + box-shadow: inset 0 3px 3px rgba(0, 0, 0, .14); +} +/* Override all expanded variants (!really) */ +[id="edit-additional-settings"] .collapsed { + background-color: transparent !important; + background-image: none !important; + border-bottom: 1px solid #a5a5a5 !important; + -moz-box-shadow: inset 0 1px 0px white !important; + -webkit-box-shadow: inset 0 1px 0px white !important; + box-shadow: inset 0 1px 0px white !important; +} +[id="edit-additional-settings"] .collapsible a { + color: #005E99; +} +[id="edit-additional-settings"] .collapsed a { + color: #0074BD; +}