diff --git a/core/modules/node/lib/Drupal/node/NodeFormController.php b/core/modules/node/lib/Drupal/node/NodeFormController.php index 80823229ee5b29d4471b86222b2c5d9b9aaa8394..104c3352a5508660dfb17276017d43657ce4d7c5 100644 --- a/core/modules/node/lib/Drupal/node/NodeFormController.php +++ b/core/modules/node/lib/Drupal/node/NodeFormController.php @@ -56,6 +56,7 @@ protected function prepareEntity(EntityInterface $node) { * Overrides Drupal\Core\Entity\EntityFormController::form(). */ public function form(array $form, array &$form_state, EntityInterface $node) { + $user_config = config('user.settings'); // Some special stuff when previewing a node. if (isset($form_state['node_preview'])) { diff --git a/core/modules/node/node.edit.admin.css b/core/modules/node/node.edit.admin.css new file mode 100644 index 0000000000000000000000000000000000000000..1f92354589cc7bf0322716da2fb9e0d96cd75682 --- /dev/null +++ b/core/modules/node/node.edit.admin.css @@ -0,0 +1,69 @@ +/** + * @file + * Styles for administration pages. + */ + +/** + * Node add/edit form layout + */ + +/* Narrow screens */ +.layout-region { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; +} + +/* Wide screens */ +@media + screen and (min-width: 780px), + (orientation: landscape) and (min-device-height: 780px) { + + .layout-region-node-main, + .layout-region-node-footer { + float: left; /* LTR */ + width: 65%; + padding-right: 2em; + } + + .layout-region-node-secondary { + float: right; /* LTR */ + width: 35%; + } + + /* @todo File an issue to add a standard class to all text-like inputs */ + .layout-region-node-secondary .form-autocomplete, + .layout-region-node-secondary .form-text, + .layout-region-node-secondary .form-tel, + .layout-region-node-secondary .form-email, + .layout-region-node-secondary .form-url, + .layout-region-node-secondary .form-search, + .layout-region-node-secondary .form-number, + .layout-region-node-secondary .form-color, + .layout-region-node-secondary textarea { + -webkit-box-sizing: border-box; + -moz-box-sizing: border-box; + box-sizing: border-box; + width: 100%; + max-width: 100%; + } +} + +/** + * The vertical toolbar mode gets triggered for narrow screens, which throws off + * the intent of media queries written for the viewport width. When the vertical + * toolbar is on, we need to suppress layout for the original media width + the + * toolbar width (240px). In this case, 240px + 780px. + */ +@media + screen and (max-width: 1020px), + (orientation: landscape) and (max-device-height: 1020px) { + + .toolbar-vertical .layout-region-node-main, + .toolbar-vertical .layout-region-node-footer, + .toolbar-vertical .layout-region-node-secondary { + float: none; + width: auto; + padding-right: 0; + } +} diff --git a/core/modules/node/node.module b/core/modules/node/node.module index f2206a088568b2ab8c3eceb2edb365e27b2442cd..b16949943b4a576fa329c8107622cd704cb40557 100644 --- a/core/modules/node/node.module +++ b/core/modules/node/node.module @@ -171,6 +171,11 @@ function node_theme() { 'node_recent_content' => array( 'variables' => array('node' => NULL), ), + 'node_edit_form' => array( + 'render element' => 'form', + 'path' => drupal_get_path('module', 'node') . '/templates', + 'template' => 'node-edit-form', + ), ); } diff --git a/core/modules/node/templates/node-edit-form.tpl.php b/core/modules/node/templates/node-edit-form.tpl.php new file mode 100644 index 0000000000000000000000000000000000000000..7b766839078b61c053ea7c166f061c8aeb93a508 --- /dev/null +++ b/core/modules/node/templates/node-edit-form.tpl.php @@ -0,0 +1,27 @@ + +