diff --git a/core/misc/collapse.js b/core/misc/collapse.js index 28281a1..006ae99 100644 --- a/core/misc/collapse.js +++ b/core/misc/collapse.js @@ -9,6 +9,7 @@ Drupal.toggleFieldset = function (fieldset) { var $content = $fieldset.find('> .fieldset-wrapper').hide(); $fieldset .removeClass('collapsed') + .addClass('expanded') .trigger({ type: 'collapsed', value: false }) .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Hide')); $content.slideDown({ @@ -28,6 +29,7 @@ Drupal.toggleFieldset = function (fieldset) { $fieldset.trigger({ type: 'collapsed', value: true }); $fieldset.find('> .fieldset-wrapper').slideUp('fast', function () { $fieldset + .removeClass('expanded') .addClass('collapsed') .find('> legend span.fieldset-legend-prefix').html(Drupal.t('Show')); fieldset.animating = false; diff --git a/core/modules/node/node.admin.css b/core/modules/node/node.admin.css index 5777b1f..d42333d 100644 --- a/core/modules/node/node.admin.css +++ b/core/modules/node/node.admin.css @@ -1,12 +1,350 @@ - /** * @file * Styles for administration pages. */ /** + * Resets. + * + * @todo These resets should be added to Drupal's core CSS. + */ +html, +button, +input, +select, +textarea { + font-family: sans-serif; +} +legend { + display: block; + float: left; + width: 100%; + white-space: normal; + *margin-left: -7px; +} + +/** + * Wrap clickable labels so the clickable region doesn't extend too far. + */ +label { + display: table; +} + +/** + * Labels with explicit associations are clickable. + */ +label[for] { + cursor: pointer; +} + +/** * Revisions overview screen. */ .revision-current { background: #ffc; } + +/** + * Styles for the new node add/edit form. + */ +#page { + padding-top: 0 !important; +} +.overlay #page { + padding: 0 0 0 2.5% !important; +} +#help, .edit-primary { + float: left; + width: 65.5%; +} +.overlay { + background: #f00; +} +.overlay #branding { + background: transparent; + left: 0; + padding-left: 2.5%; + padding-right: 2.5%; + position: absolute; + top: 0; + width: 60.5%; + z-index: 99; +} +.edit-primary { + margin-top: -2em; +} +.overlay .edit-primary { + margin-top: 3em; +} +.edit-secondary { + background-color: #eee; + border: 1px solid #dfdfdf; + position: relative; + margin-left: 68%; + margin-top: 2em; + width: 32%; +} +.overlay .edit-secondary { + margin-top: 0; + border: 0; +} + +/** + * Gradients on .edit-secondary look odd because they are drawn over by the + * .collapsible borders.Fix that with pseudo-elements whose z-index we can + * control. We can't use :after because it might interfere with clearfix. + */ +.overlay .edit-secondary:before, +.overlay .node-form > div:before { + bottom: 0; + content: ""; + pointer-events: none; /* Allow clicks. */ + position: absolute; + top: 0; +} +.overlay .edit-secondary:before { + background-image: -webkit-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -moz-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -ms-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + background-image: -o-linear-gradient(left, rgba(0, 0, 0, .05), transparent); + left: 0; + width: .75em; + z-index: 3; +} +.overlay .node-form > div:before { + background-image: -webkit-linear-gradient(left, transparent, rgba(0, 0, 0, .15)); + background-image: -moz-linear-gradient(left, transparent, rgba(0, 0, 0, .15)); + background-image: -ms-linear-gradient(left, transparent, rgba(0, 0, 0, .15)); + background-image: -o-linear-gradient(left, transparent, rgba(0, 0, 0, .15)); + border-right: .5em solid white; + right: 0; + width: .25em; + z-index: 2; +} +.edit-secondary .collapsible { + box-shadow: inset 0 1px .5em rgba(0, 0, 0, .15); + -moz-box-shadow: inset 0 1px .5em rgba(0, 0, 0, .15); + -webkit-box-shadow: inset 0 1px .5em rgba(0, 0, 0, .15); + padding: 1px 0; + border: 0; + background-color: #e2e2e2; + -moz-transition: background-color .1s; + -ms-transition: background-color .1s; + -o-transition: background-color .1s; + -webkit-transition: background-color .1s; +} +.edit-secondary .collapsed { + background-color: transparent; + border-top: 1px solid #fdfdfd; + border-bottom: 1px solid #dedede; + border-left: 0px; + border-right: 0px; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + padding: 0; +} +.edit-secondary .collapsible + .collapsible { + border-top: 1px solid #eee; + padding-top: 0; +} +.edit-secondary .collapsed + .collapsible { + border-top: 1px solid #bbb; +} +.edit-secondary .collapsed + .collapsed { + border-top: 1px solid white; + padding-top: 0; +} +.edit-secondary .collapsible .fieldset-legend { + background: none !important; /* Override system. */ + display: block; + left: 0; + margin: 0; + right: 0; + padding: 0 !important; /* Override system. */ + position: relative; +} + +/** + * Toggle anchor. + */ +.edit-secondary .collapsible .fieldset-title { + background: url(../../misc/menu-expanded.png) no-repeat 95% 50%; /* LTR */ + color: #004F80; + display: block; + padding: .85em 1.25em; + text-transform: none; +} +.overlay .edit-secondary .collapsible .fieldset-title { + background-position: 93% 50%; +} + +/** + * The legend is floated to force display. We need to clear it. + */ +.edit-secondary .collapsible .fieldset-wrapper { + clear: both; + padding: 0 1em 1.25em !important; +} +.edit-secondary .collapsed .fieldset-title { + background-image: url(../../misc/menu-collapsed.png); + color: #0074BD; +} +.edit-secondary .node-summary { + margin: 0 1.25em 1.25em 1.25em; + padding-top: .5em; + overflow: hidden; +} +.edit-secondary .button-duplicate { + margin-left: 10px; +} +.form-actions { + clear: both; +} +.description { + font-style: italic; + font-family: serif; +} +#edit-title { + width: 100%; +} +.fieldset-legend .summary { + display: none; +} +#edit-additional-settings { + border-top: 0; + border-bottom: 1px solid #fdfdfd; + border-left: 0px; + border-right: 0px; + margin: 0; + padding: 0; + text-shadow: 0px 1px 0px rgba(255, 255, 255, .75); +} +fieldset .form-wrapper { + margin: 0; +} +#edit-additional-settings, #edit-additional-settings > div.fieldset-wrapper { + padding: 0; +} +.node-form { + color: #464646; +} +ul.tips, div.description, .form-item div.description { + color: #464646; +} +.page-node-add #overlay-content, +.page-node-edit #overlay-content { + padding: 0; +} +.page-node-edit #help { + margin-top: 0; +} +.node-summary { + margin-bottom: 10px; + margin-top: 0; + padding-top: 0; +} +.node-summary p { + margin-top: -10px; + padding-top: 0; + font-size: 90%; +} +.node-summary ul, .node-summary li { + list-style: none; + margin-left: -20px; +} +.node-form .node-actions { + background: -moz-linear-gradient(top, #f1f1f1, #fafafa); + background: -ms-linear-gradient(top, #f1f1f1, #fafafa); + background: -o-linear-gradient(top, #f1f1f1, #fafafa); + background: -webkit-gradient(linear, left top, left bottom, from(#f1f1f1), to(#fafafa)); + background: -webkit-linear-gradient(top, #f1f1f1, #fafafa); + margin: 20px 0; + padding: 10px; +} +.node-form .node-actions input.form-submit { + background: -webkit-gradient(linear, left top, left bottom, from(#fefefe), to(#e0e0e0)); + background: -moz-linear-gradient(top, #fefefe, #e0e0e0); + background: -ms-linear-gradient(top, #fefefe, #e0e0e0); + background: -o-linear-gradient(top, #fefefe, #e0e0e0); + background: -webkit-linear-gradient(top, #fefefe, #e0e0e0); + border: 1px solid #c8c8c8; + border-radius: 3px; + -moz-border-radius: 3px; + margin: 0 10px 0 0; + min-width: 135px; + padding: 6px 0; +} +.node-form .node-actions input#edit-submit { + background: -webkit-gradient(linear, left top, left bottom, from(#4fa0ea), to(#3974ae)); + background: -webkit-linear-gradient(top, #4fa0ea, #3974ae); + background: -moz-linear-gradient(top, #4fa0ea, #3974ae); + background: -ms-linear-gradient(top, #4fa0ea, #3974ae); + background: -o-linear-gradient(top, #4fa0ea, #3974ae); + border-color: #3974ae; + color: white; + text-shadow: 0px 1px 0px rgba(0, 0, 0, .25); +} +.node-form input.form-autocomplete, +.node-form input.form-text, +.node-form input.form-tel, +.node-form input.form-email, +.node-form input.form-url, +.node-form input.form-search, +.node-form textarea.form-textarea, +.node-form select.form-select { + background: -moz-linear-gradient(top, #ececec, #fafafa); + background: -ms-linear-gradient(top, #ececec, #fafafa); + background: -o-linear-gradient(top, #ececec, #fafafa); + background: -webkit-gradient(linear, left top, left bottom, from(#ececec), to(#fafafa)); + background: -webkit-linear-gradient(top, #ececec, #fafafa); + border: 1px solid #c8c8c8; + box-sizing: border-box; + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + color: #424242; + font-family: serif; + font-size: 1.1em; + padding: 10px; + max-width: 100%; +} +.js .node-form input.form-autocomplete { + background-position: 100% 0; +} +.js .node-form input.throbbing { + background-position: 100% 0; +} +.node-form input.form-autocomplete:focus, +.node-form input.form-text:focus, +.node-form input.form-tel:focus, +.node-form input.form-email:focus, +.node-form input.form-url:focus, +.node-form input.form-search:focus, +.node-form textarea.form-textarea:focus, +.node-form select.form-select:focus { + border-color: #c8c8c8; + box-shadow: none; + -moz-box-shadow: none; + -webkit-box-shadow: none; + outline: 2px solid #c8c8c8; + transition: none; + -moz-transition: none; + -webkit-transition: none; +} +.node-form .form-item label { + margin-bottom: 10px; + font-size: 1.2em; +} +.node-form .edit-secondary input.form-autocomplete, +.node-form .edit-secondary input.form-text, +.node-form .edit-secondary input.form-tel, +.node-form .edit-secondary input.form-email, +.node-form .edit-secondary input.form-url, +.node-form .edit-secondary input.form-search { + width: 100%; +} +.node-form-revision-information { + border: 0; + background: none; + padding: 0; +} diff --git a/core/modules/node/node.pages.inc b/core/modules/node/node.pages.inc index 4e94b26..8427977 100644 --- a/core/modules/node/node.pages.inc +++ b/core/modules/node/node.pages.inc @@ -32,6 +32,7 @@ function node_add_page() { // Bypass the node/add listing if only one content type is available. if (count($content) == 1) { $item = array_shift($content); + drupal_goto($item['href']); } return theme('node_add_list', array('content' => $content)); @@ -118,6 +119,15 @@ function node_form_validate($form, &$form_state) { function node_form($form, &$form_state, $node) { global $user; + // Wrap main form components in a div + $form['edit_primary'] = array( + '#type' => 'markup', + '#prefix' => '
Last saved ' . format_date($node->changed) . '
'; + $node_summary .= '