diff --git a/wagtail/wagtailadmin/static_src/wagtailadmin/scss/layouts/page-editor.scss b/wagtail/wagtailadmin/static_src/wagtailadmin/scss/layouts/page-editor.scss index 36a8529129..405c977d4a 100644 --- a/wagtail/wagtailadmin/static_src/wagtailadmin/scss/layouts/page-editor.scss +++ b/wagtail/wagtailadmin/static_src/wagtailadmin/scss/layouts/page-editor.scss @@ -1,6 +1,7 @@ @import "wagtailadmin/scss/variables.scss"; @import "wagtailadmin/scss/mixins.scss"; @import "wagtailadmin/scss/grid.scss"; +@import "wagtailadmin/scss/components/streamfield.scss"; .page-editor { .content-wrapper{ @@ -186,364 +187,27 @@ } } + /* cursory styling for streamfield. Main styling in components/streamfield.scss */ &.stream-field { - padding:0; - - label{ - white-space: nowrap; - } + padding-left:0; + padding-right:0; &.required .field > label:after{ display:none; } + /* Undo column widths usually applied to the contents of a field panel */ > fieldset{ - @include column(12); + width:100%; max-width:none; - padding-left:0; - padding-right:0; - } - - .fields > li > .field > label{ - display:none; } - /* Despite "BlockField" being generic and available for use outside StreamField, - this is the most unique handle available to undo the width set on .field-content - everywhere else in wagtail. If other types of field become available for use as - a direct child of Streamfield, this will need updating */ .block_field > .field-content{ width:100%; display:block; } - - .sequence{ - position:relative; - @include clearfix; - } - - .sequence-member{ - @include clearfix; - position:relative; - - .sequence-member-inner{ - @include clearfix; - position:relative; - padding:1.5em 50px; - - > .sequence .sequence-inner{ - @include column(10); - padding-left:0; - padding-right:0; - } - - > .struct-block > label, - > .char_field > label, - .sequence > label{ - /* TODO: tidy this */ - /* - @include transition(opacity 0.2s ease); - opacity:0; - display:block; - font-style:italic; - font-weight:normal; - position:absolute; - top:1em; right:4em; - float:none; - width:auto; - padding:0; - color:$color-grey-2; - line-height:2.2em; - */ - display:none; - } - } - - &:hover{ - background-color:$color-input-focus; - } - - &:hover .sequence-member-inner{ - > .struct-block > label, - > .char_field > label, - .sequence > label{ - opacity:1; - } - } - } - - .struct-block > ul > li{ /* duplicates forms.scss ln.568 */ - @include clearfix(); - padding-top:0.5em; - padding-bottom:1.2em; - } - - .struct-block .widget-text_input > label, - .struct-block .widget-textarea > label, - .struct-block .widget-admin_auto_height_text_input > label{ - display:none; - } - - .widget-admin_image_chooser{ - label{ - display:none; - } - .field-content{ - display:block; - float:none; - width:100%; - text-align:center; - max-width:500px; - margin:auto; - border:1px solid $color-grey-4; - padding:1em; - } - .chooser{ - .chosen{ - padding:0; - } - .unchosen{ - &:before{ - float:none; - font-size:4em; - margin:0; - } - } - .preview-image{ - float:none; - margin:0; - } - } - } - - /* - Text inputs, rich text fields and textareas that are direct children of streamfield - should be borderless and full-width - */ - .stream-member-inner > .widget-text_input > .field-content > .input > input, - .stream-member-inner > .field > .field-content > .input > .richtext, - .stream-member-inner > .field > .field-content > .input > textarea{ - border:0; - padding:0; - background-color:transparent; - max-width:1024px; - } - } - /* Object controls */ - .stream-controls, - .list-controls{ - @include border-radius(5px); - @include transition(opacity 0.2s ease); - opacity:0; - visibility:hidden; - position:absolute; - top:-1.5em; right:1em; - z-index:1; - overflow:visible; - background-color:$color-input-focus; - padding:0.2rem 1em; - - h3{ - margin:0; - text-transform:uppercase; - font-size:0.7rem; - display:inline-block; - margin-right:1em; - } - - .buttons{ - display:inline-block; - opacity:0.4; - } - &:hover .buttons{ - opacity:1; - } - - button.icon.text-replace{ - @include border-radius(50%); - width:1.4rem; - height:1.4rem; - - &:before{ - line-height:1.3em; - font-size:0.9rem; - } - } - - .disabled{ - display:none; - } - } - - /* Menu of other blocks to be added at each position */ - .stream-menu{ - @include transition(all 0.2s ease); - @include box-shadow(inset 0 0 45px rgba(0,0,0,0.3)); - position:relative; - background-color:$color-grey-1; - opacity:1; - z-index:5; - - .toggle{ - @include transition(color 0.2s ease); - @include border-radius(50px); - position:absolute; - top:-0.5em; - left:0; - right:0; - margin:0 auto; - cursor:pointer; - font-size:1.7em; - width:1em; - height:1em; - display:block; - z-index:5; - color:$color-grey-1; - background-color:white; - - span{ - @include visuallyhidden(); - } - - &:before{ - @include transform(rotate(-45deg)); - position:absolute; - font-family:wagtail; - content:"B"; - line-height:1em; - text-align:center; - } - } - - .stream-menu-inner{ - max-width:50em; - margin: auto; - overflow:hidden; - } - - ul{ - @include transition(all 0.2s ease); - @include transform(scale(1)); - @include clearfix; - visibility:visible; - opacity:1; - padding:1em 1em 0 1em; - overflow:hidden; - } - - li{ - @include column(3); - padding-bottom:$grid-gutter-width; - padding-left:0; - padding-right:0; - - &:nth-child(4n+1){ - clear:left; - } - } - - - button{ - @include transition(all 0.2s ease); - background-color:transparent; - border:0; - color:darken($color-grey-3, 5%); - height:auto; - display:block; - width:100%; - padding:0 0 0.5em 0; - outline:$color-teal; - - span{ - text-transform:none; - white-space: pre-wrap; - width:100%; - display:block; - overflow:hidden; - padding:0 1em; - box-sizing: border-box; - } - - &:before{ - display:block; - font-family:wagtail; - font-size:2em; - width:100%; - height:2em; - line-height:2em; - text-align:center; - } - - &:hover, - &:focus{ - background-color:$color-teal; - color:white; - } - } - - - &.stream-menu-closed{ - @include box-shadow(none); - - .stream-menu-inner ul{ - @include transform(scale(0.9)); - opacity:0; - } - - .toggle{ - color:$color-grey-3; - background-color:white; - &:before{ - @include transform(rotate(0deg)); - } - &:focus{ - color:$color-teal; - } - } - - &:hover{ - border-top-color:$color-teal; - - .toggle{ - color:$color-teal; - } - } - } - - @media screen and (min-width: $breakpoint-mobile){ - li{ - @include column(2); - &:nth-child(4n+1){ - clear:none; - } - &:nth-child(6n+1){ - clear:left; - } - } - } - } - .sequence-member .stream-menu{ - margin:auto auto 0em auto; - } - .sequence-member .stream-menu-closed{ - opacity:0; - visibility:hidden; - } - .sequence-member:hover{ - .stream-controls, - .list-controls{ - visibility:visible; - opacity:1; - } - .stream-menu{ - visibility:visible; - opacity:1; - } - } - - /* special panel for the publishing fields, requires a bit more pizzazz */ &.publishing{ h2:before{ diff --git a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/list.html b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/list.html index dc53caf671..0049dc98e7 100644 --- a/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/list.html +++ b/wagtail/wagtailadmin/templates/wagtailadmin/block_forms/list.html @@ -1,6 +1,14 @@ {% extends "wagtailadmin/block_forms/sequence.html" %} {% load i18n %} +{% block sequence_type_class %}list{% endblock %} + +{% block header %} + {% if help_text %} +