From 27724c0829ec9685c04680cc14070e1f539a93dd Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Wed, 19 Oct 2016 13:20:31 +1300 Subject: [PATCH 01/28] Remove set width of toolbar-content as it extends further than 100% --- admin/client/src/components/Toolbar/Toolbar.scss | 1 - 1 file changed, 1 deletion(-) diff --git a/admin/client/src/components/Toolbar/Toolbar.scss b/admin/client/src/components/Toolbar/Toolbar.scss index 4407bf404..349f2fa6d 100644 --- a/admin/client/src/components/Toolbar/Toolbar.scss +++ b/admin/client/src/components/Toolbar/Toolbar.scss @@ -4,7 +4,6 @@ .toolbar--south { @include make-container(); height: $toolbar-total-height; - width: 100%; .btn-toolbar { // TODO Remove '.cms .btn-toolbar' override From 6254f186b19c1961a081713784afa48163c11672 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Wed, 19 Oct 2016 13:20:58 +1300 Subject: [PATCH 02/28] Remove border on left of preview mode --- admin/client/dist/styles/bundle.css | 5 ++++- admin/client/src/styles/legacy/_style.scss | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index a4d8ddfa1..d18b9f0e0 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -9361,6 +9361,10 @@ body.cms{ display:none; } +.cms-container--preview-mode .cms-preview{ + border-left:0; +} + .cms-content-header{ padding-left:1.5385rem; padding-right:1.5385rem; @@ -15416,7 +15420,6 @@ div.grid-field__sort-field+.form__fieldgroup-item{ padding-left:1.5385rem; padding-right:1.5385rem; height:53px; - width:100%; } .toolbar--content .btn-toolbar,.toolbar--north .btn-toolbar,.toolbar--south .btn-toolbar,.toolbar .btn-toolbar{ diff --git a/admin/client/src/styles/legacy/_style.scss b/admin/client/src/styles/legacy/_style.scss index 7f4957ee1..0ce98079e 100644 --- a/admin/client/src/styles/legacy/_style.scss +++ b/admin/client/src/styles/legacy/_style.scss @@ -65,6 +65,10 @@ body.cms { .cms-content { display: none; } + + .cms-preview { + border-left: 0; + } } // .cms-preview, From 364ab957e6d94ecac8f13a625a2ded6c36c9deff Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Thu, 20 Oct 2016 12:07:28 +1300 Subject: [PATCH 03/28] improve spacing of sitetree for smaller screens --- admin/client/dist/styles/bundle.css | 4 +++- admin/client/src/styles/legacy/_tree.scss | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index d18b9f0e0..c90c61308 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -11252,11 +11252,13 @@ form.small .cms-file-info-data .field .middleColumn{ .cms li.jstree-open>ul,.TreeDropdownField .treedropdownfield-panel li.jstree-open>ul{ display:block; - margin-left:-13px; + margin-left:-15px; + margin-right:-20px; } .cms li.jstree-open>ul li ul,.TreeDropdownField .treedropdownfield-panel li.jstree-open>ul li ul{ margin-left:2px; + margin-right:0; } .cms li.jstree-closed>ul,.TreeDropdownField .treedropdownfield-panel li.jstree-closed>ul{ diff --git a/admin/client/src/styles/legacy/_tree.scss b/admin/client/src/styles/legacy/_tree.scss index b23aa341b..145dd2b34 100644 --- a/admin/client/src/styles/legacy/_tree.scss +++ b/admin/client/src/styles/legacy/_tree.scss @@ -164,11 +164,15 @@ li.jstree-open > ul { display: block; - margin-left: -13px; + margin-left: -15px; + margin-right: -20px; + li ul { - margin-left:2px; + margin-left: 2px; + margin-right: 0; } } + li.jstree-closed > ul { display: none; } From 96964be39d3c9e1f14b238c4d714b07d83f70aab Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Thu, 20 Oct 2016 16:19:19 +1300 Subject: [PATCH 04/28] Sitetree scroll moved so whole area scrolls excluding actions --- admin/client/dist/styles/bundle.css | 20 ++++++++++++++++---- admin/client/src/styles/legacy/_style.scss | 15 +++++++-------- admin/client/src/styles/legacy/_tree.scss | 12 ++++++++++++ 3 files changed, 35 insertions(+), 12 deletions(-) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index c90c61308..38657011b 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -9484,7 +9484,7 @@ body.cms{ .view-controls{ float:right; - margin-top:4px; + margin-top:5px; } .view-controls .icon-button-group .icon-button{ @@ -9575,8 +9575,6 @@ body.cms{ } .cms a.icon-button.font-icon-search.active,.cms a.icon-button.font-icon-search:active,.cms a.icon-button.font-icon-search:focus,.cms a.icon-button.font-icon-search:hover,.cms button.ss-ui-button.icon-button.font-icon-search.active,.cms button.ss-ui-button.icon-button.font-icon-search:active,.cms button.ss-ui-button.icon-button.font-icon-search:focus,.cms button.ss-ui-button.icon-button.font-icon-search:hover{ - background:none; - box-shadow:none; color:#4f5861; } @@ -10644,7 +10642,12 @@ form.member-profile-form #Permissions .optionset li{ margin-top:-5px; } -.cms .cms-panel-padded .cms-content-view,.CMSPageAddController .cms-panel-padded{ +.cms .cms-panel-padded .cms-content-view{ + padding:1.5385rem; + height:100%; +} + +.CMSPageAddController .cms-panel-padded{ padding:1.5385rem; } @@ -11678,6 +11681,15 @@ form.small .cms-file-info-data .field .middleColumn{ display:block; } +.cms-tree-holder{ + overflow-x:auto; + height:calc(100% - 13px); + padding-left:20px; + padding-right:20px; + margin-left:-20px; + margin-right:-20px; +} + .jstree-apple a .jstree-icon,.jstree-classic a .jstree-icon,.jstree-default-rtl a .jstree-icon,.jstree-default a .jstree-icon{ background-position:-60px -19px; } diff --git a/admin/client/src/styles/legacy/_style.scss b/admin/client/src/styles/legacy/_style.scss index 0ce98079e..511b92996 100644 --- a/admin/client/src/styles/legacy/_style.scss +++ b/admin/client/src/styles/legacy/_style.scss @@ -215,15 +215,15 @@ body.cms { font-weight: normal; } - .breadcrumbs-wrapper { - float: left; - padding-top: $spacer-xs / 2; - } + .breadcrumbs-wrapper { + float: left; + padding-top: $spacer-xs / 2; + } } .view-controls { float: right; - margin-top: 4px; + margin-top: 5px; .icon-button-group { .icon-button { @@ -348,8 +348,6 @@ body.cms { &:active, &:focus, &:hover { - background: none; - box-shadow: none; color: darken($color-text, 10%); } @@ -1586,7 +1584,8 @@ form.member-profile-form { } .cms .cms-panel-padded .cms-content-view { - padding: $panel-padding-y $panel-padding-x; + padding: $panel-padding-y $panel-padding-x; + height: 100%; // For horizontal scrollbar on Pages sitetree at smaller sizes } .CMSPageAddController .cms-panel-padded { diff --git a/admin/client/src/styles/legacy/_tree.scss b/admin/client/src/styles/legacy/_tree.scss index 145dd2b34..280c84730 100644 --- a/admin/client/src/styles/legacy/_tree.scss +++ b/admin/client/src/styles/legacy/_tree.scss @@ -600,6 +600,18 @@ } } + +// Scroll horizontal for sitetree +// so scrollbar is fixed to bottom of panel, and tree actions remain fixed at top +.cms-tree-holder { + overflow-x: auto; + height: calc(100% - 13px); // Magic number, need to investigate why its needed (possibly scroll bar height) + padding-left: 20px; + padding-right: 20px; + margin-left: -20px; + margin-right: -20px; +} + // Override thirdparty themes .jstree-default a .jstree-icon, .jstree-default-rtl a .jstree-icon, From a95781e66ebb2fa1944379ebeb6851bceb9a6d69 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Thu, 20 Oct 2016 16:19:44 +1300 Subject: [PATCH 05/28] Search and batch actions to have same selected state --- admin/client/src/styles/legacy/_forms.scss | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/admin/client/src/styles/legacy/_forms.scss b/admin/client/src/styles/legacy/_forms.scss index d51ccb64c..67d714146 100644 --- a/admin/client/src/styles/legacy/_forms.scss +++ b/admin/client/src/styles/legacy/_forms.scss @@ -540,7 +540,7 @@ button.loading { &.active, &:active { - box-shadow: 0 0 3px rgba(191, 194, 196, .9) inset; + box-shadow: 0 0 1px rgba(191, 194, 196, .9) inset; background: #dee3e8; color: darken($color-text, 10%); border: 0; @@ -833,6 +833,8 @@ div.switch-states{ padding-right: 0; } +.ui-button-text-only .ui-button-text { padding: 0; } + // Align buttons with input .urlsegment .update, .urlsegment .cancel { From 50af94099ec32132f05f550e7887fa024a65bdd9 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Thu, 20 Oct 2016 16:20:37 +1300 Subject: [PATCH 06/28] Remove some legacy layout styles --- admin/client/src/styles/_layout.scss | 81 ++++++++++++---------------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/admin/client/src/styles/_layout.scss b/admin/client/src/styles/_layout.scss index c0621622d..81246bfbb 100644 --- a/admin/client/src/styles/_layout.scss +++ b/admin/client/src/styles/_layout.scss @@ -1,19 +1,28 @@ -.cms-content__inner { - height: 100%; +// INITIATE FLEXBOX LAYOUT +// TODO Convert layout to BEM + +*, +*:before, +*:after { + -moz-box-sizing: border-box; + -webkit-box-sizing: border-box; + box-sizing: border-box; } -.cms-content__right, -.cms-content__left { +html, +body { + width: 100%; height: 100%; - overflow: hidden; - background-color: $body-bg; - transition: width .2s; + margin: 0; + padding: 0; + display: -ms-flexbox; + display: flex; } -// .cms-content can be split into different left/right zones -// Exampale modifier: --left-sm = small left side panel with right panel width set to auto. -.cms-content__split { - height: 100%; +@include media-breakpoint-down(md) { + .cms-content.has-panel .cms-content-tools { + display: none; + } } .campaign-items { @@ -23,7 +32,7 @@ } } -.campaigns { +.campaigns { // TODO move to campaign container position: relative; height: 100%; @@ -58,16 +67,16 @@ } @include media-breakpoint-up(lg) { - // padding-left: $cms-panel-sm; + padding-left: $cms-panel-sm; - .cms-content__left { - width: $cms-panel-sm; - } - - .cms-content__right { - display: block; - border-left: 1px solid $border-color; - } + // .cms-content__left { + // width: $cms-panel-sm; + // } + // + // .cms-content__right { + // display: block; + // border-left: 1px solid $border-color; + // } .cms-content__back-btn { display: none; @@ -75,11 +84,11 @@ } @include media-breakpoint-up(xl) { - // padding-left: $cms-panel-md; + padding-left: $cms-panel-md; - .cms-content__left { - width: $cms-panel-md; - } + // .cms-content__left { + // width: $cms-panel-md; + // } } } @@ -136,28 +145,6 @@ } -// TEMPORY FLEXBOX STYLES -// Reference https://css-tricks.com/boxes-fill-height-dont-squish/ -// Reference http://codepen.io/clarkepaul/pen/qaNWAY - -*, -*:before, -*:after { - -moz-box-sizing: border-box; - -webkit-box-sizing: border-box; - box-sizing: border-box; -} - -html, -body { - width: 100%; - height: 100%; - margin: 0; - padding: 0; - display: -ms-flexbox; - display: flex; -} - // Flex magic // Nested items take up height .fill-height { From 25783db020b0d33cc1a31afa93bf073bd5719b29 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Thu, 20 Oct 2016 16:21:15 +1300 Subject: [PATCH 07/28] toolbar-north to be 100%, removed from toolbar-content --- admin/client/dist/styles/bundle.css | 66 ++++++++----------- .../src/components/Toolbar/Toolbar.scss | 2 +- 2 files changed, 28 insertions(+), 40 deletions(-) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index 38657011b..a0c0f1446 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -9063,7 +9063,7 @@ button.loading.ss-ui-action-constructive .ui-icon,input.loading.ss-ui-action-con } .ss-ui-button.ss-ui-button-constructive[class*=font-icon-].active,.ss-ui-button.ss-ui-button-constructive[class*=font-icon-]:active,.ss-ui-button[class*=font-icon-].active,.ss-ui-button[class*=font-icon-]:active,.ss-ui-button[class^=font-icon-].active,.ss-ui-button[class^=font-icon-]:active{ - box-shadow:inset 0 0 3px hsla(204,4%,76%,.9); + box-shadow:inset 0 0 1px hsla(204,4%,76%,.9); background:#dee3e8; color:#4f5861; border:0; @@ -9317,6 +9317,10 @@ div.switch-states .switch a.active span{ padding-right:0; } +.ui-button-text-only .ui-button-text{ + padding:0; +} + .urlsegment .cancel,.urlsegment .update{ margin-top:3px; } @@ -15447,6 +15451,7 @@ div.grid-field__sort-field+.form__fieldgroup-item{ border-bottom:1px solid #d9dee2; z-index:60; position:relative; + width:100%; } .toolbar a.btn{ @@ -15935,20 +15940,24 @@ input.checkbox,input.radio,input[type=checkbox],input[type=radio]{ color:#d40404; } -.cms-content__inner{ - height:100%; +*,:after,:before{ + box-sizing:border-box; } -.cms-content__left,.cms-content__right{ +body,html{ + width:100%; height:100%; - overflow:hidden; - background-color:#f6f7f8; - -webkit-transition:width .2s; - transition:width .2s; + margin:0; + padding:0; + display:-ms-flexbox; + display:-webkit-box; + display:flex; } -.cms-content__split{ - height:100%; +@media (max-width:991px){ + .cms-content.has-panel .cms-content-tools{ + display:none; + } } @media (max-width:991px){ @@ -15992,13 +16001,8 @@ input.checkbox,input.radio,input[type=checkbox],input[type=radio]{ } @media (min-width:992px){ - .campaigns .cms-content__left{ - width:300px; - } - - .campaigns .cms-content__right{ - display:block; - border-left:1px solid #d9dee2; + .campaigns{ + padding-left:300px; } .campaigns .cms-content__back-btn{ @@ -16007,8 +16011,8 @@ input.checkbox,input.radio,input[type=checkbox],input[type=radio]{ } @media (min-width:1200px){ - .campaigns .cms-content__left{ - width:448px; + .campaigns{ + padding-left:448px; } } @@ -16054,24 +16058,8 @@ input.checkbox,input.radio,input[type=checkbox],input[type=radio]{ box-shadow:0 16px 28px 0 rgba(0,0,0,.3),0 25px 55px 0 rgba(0,0,0,.3); } -*,:after,:before{ - box-sizing:border-box; -} - -body,html{ - width:100%; - margin:0; - padding:0; -} - -.fill-height,body,html{ - height:100%; - display:-ms-flexbox; - display:-webkit-box; - display:flex; -} - .fill-height{ + height:100%; min-height:0; -ms-flex-direction:column; -webkit-box-orient:vertical; @@ -16079,14 +16067,14 @@ body,html{ } .fill-height,.fill-width{ + display:-ms-flexbox; + display:-webkit-box; + display:flex; -webkit-box-direction:normal; } .fill-width{ width:100%; - display:-ms-flexbox; - display:-webkit-box; - display:flex; -ms-flex-direction:row; -webkit-box-orient:horizontal; flex-direction:row; diff --git a/admin/client/src/components/Toolbar/Toolbar.scss b/admin/client/src/components/Toolbar/Toolbar.scss index 349f2fa6d..b92a94a8e 100644 --- a/admin/client/src/components/Toolbar/Toolbar.scss +++ b/admin/client/src/components/Toolbar/Toolbar.scss @@ -14,12 +14,12 @@ // Northern bar containing breadcrumb, tabs etc. .toolbar--north { - // display: block; background-image: none; background-color: $background-darker; border-bottom: 1px solid $border-color; z-index: 60; position: relative; + width: 100%; } // TEMP overrides color of links in JqueryUI widgets From 0885a3178e121d212df6da1185a2cdb95d54775d Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 12:08:19 +1300 Subject: [PATCH 08/28] Adjust button padding so they all have the same height --- admin/client/src/styles/_variables.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/client/src/styles/_variables.scss b/admin/client/src/styles/_variables.scss index c8ca20f4c..87b62ac46 100644 --- a/admin/client/src/styles/_variables.scss +++ b/admin/client/src/styles/_variables.scss @@ -277,7 +277,7 @@ $table-border-color: $gray-lighter; // For each of Bootstrap's buttons, define text, background and border color. $btn-padding-x: .7692rem; // 10px -$btn-padding-y: .4615rem; // 6px +$btn-padding-y: .3846rem; // 5px $btn-font-weight: normal; $btn-primary-color: $white; From d761075fd3447e153cf7ec9fbf120853f1da73b7 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 12:08:53 +1300 Subject: [PATCH 09/28] Move mock back button --- admin/client/src/components/Preview/Preview.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin/client/src/components/Preview/Preview.js b/admin/client/src/components/Preview/Preview.js index e69a69097..fd6e5ccfb 100644 --- a/admin/client/src/components/Preview/Preview.js +++ b/admin/client/src/components/Preview/Preview.js @@ -64,8 +64,11 @@ class Preview extends SilverStripeComponent { return (
{body} -
+
{toolbarButtons}
From 3fd5a6d4e6b138d6538a767ab550ace6f9412688 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 12:09:22 +1300 Subject: [PATCH 10/28] Add left border to preview and bg --- admin/client/src/components/Preview/Preview.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/admin/client/src/components/Preview/Preview.scss b/admin/client/src/components/Preview/Preview.scss index eca89d338..d7a29ca2f 100644 --- a/admin/client/src/components/Preview/Preview.scss +++ b/admin/client/src/components/Preview/Preview.scss @@ -1,5 +1,7 @@ .preview { position: relative; + background-color: $tab-panel-texture-color; + border-left: 1px solid $border-color-dark; // Overlay preview at smaller sizes @include media-breakpoint-down(md) { @@ -7,6 +9,7 @@ right: 0; z-index: 2; width: 100%; + border-left: 0; } } From 4ce2bcc360b09c3aeb75084d258be6991adde4c2 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 12:11:28 +1300 Subject: [PATCH 11/28] Add back button style if it has text --- admin/client/src/components/Toolbar/Toolbar.scss | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/admin/client/src/components/Toolbar/Toolbar.scss b/admin/client/src/components/Toolbar/Toolbar.scss index b92a94a8e..c9eb97a6b 100644 --- a/admin/client/src/components/Toolbar/Toolbar.scss +++ b/admin/client/src/components/Toolbar/Toolbar.scss @@ -73,12 +73,18 @@ background-color: $background-main; } -.toolbar__back-button, -.cms-backlink .toolbar__back-button { // TEMP: Needed for anchor buttons to override legacy styles +.toolbar__back-button { float: left; margin: $spacer-xs $spacer-x / 2 $spacer-xs #{-$spacer-xs}; padding-left: $spacer-x / 4; - padding-right: $spacer-x / 4; - border: 0; color: $body-color-light; // TEMP: Needed for anchor buttons to override legacy styles + + .toolbar--south & { + margin-top: 0; + margin-right: 5px; + } + + &.btn--no-text { + padding-right: $spacer-x / 4; + } } From 5257c92fcdc9e60b8f575af9c8f362cdface3995 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 13:08:41 +1300 Subject: [PATCH 12/28] Remove legacy class --- admin/client/src/components/Preview/Preview.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/client/src/components/Preview/Preview.js b/admin/client/src/components/Preview/Preview.js index fd6e5ccfb..16fd83025 100644 --- a/admin/client/src/components/Preview/Preview.js +++ b/admin/client/src/components/Preview/Preview.js @@ -62,7 +62,7 @@ class Preview extends SilverStripeComponent { // Combine elements return ( -
+
{body}
); From 5350fcf650764dc98aa401cbb3a99aae79a887e8 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 25 Oct 2016 13:10:57 +1300 Subject: [PATCH 14/28] Delete legacy styles in Layout, move rest to CampaignAdmin. Convert to BEM --- admin/client/dist/js/bundle.js | 27 +++-- admin/client/dist/styles/bundle.css | 98 +++++++------------ .../CampaignAdmin/CampaignAdmin.scss | 16 +++ .../CampaignAdmin/CampaignAdminList.js | 8 +- admin/client/src/styles/_layout.scss | 69 +------------ 5 files changed, 68 insertions(+), 150 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index ed9eb1f10..1472d67e5 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -2414,12 +2414,10 @@ case"create":e=this.renderCreateView() break default:e=this.renderIndexView()}return e}},{key:"renderIndexView",value:function f(){var e=this.props.sectionConfig.form.EditForm.schemaUrl,t={title:S["default"]._t("Campaigns.ADDCAMPAIGN"),icon:"plus", handleClick:this.addCampaign.bind(this)},n={createFn:this.campaignListCreateFn.bind(this),schemaUrl:e} -return p["default"].createElement("div",{className:"fill-height cms-campaigns","aria-expanded":"true"},p["default"].createElement(x["default"],null,p["default"].createElement(C["default"],{multiline:!0, -crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow"},p["default"].createElement("div",{className:"toolbar toolbar--content" -},p["default"].createElement("div",{className:"btn-toolbar"},p["default"].createElement(O["default"],t))),p["default"].createElement("div",{className:"campaign-admin"},p["default"].createElement(A["default"],n)))) - -}},{key:"renderItemListView",value:function h(){var e={sectionConfig:this.props.sectionConfig,campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi, -handleBackButtonClick:this.handleBackButtonClick.bind(this)} +return p["default"].createElement("div",{className:"fill-height","aria-expanded":"true"},p["default"].createElement(x["default"],null,p["default"].createElement(C["default"],{multiline:!0,crumbs:this.props.breadcrumbs +})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow"},p["default"].createElement("div",{className:"toolbar toolbar--content"},p["default"].createElement("div",{ +className:"btn-toolbar"},p["default"].createElement(O["default"],t))),p["default"].createElement(A["default"],n)))}},{key:"renderItemListView",value:function h(){var e={sectionConfig:this.props.sectionConfig, +campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)} return p["default"].createElement(F["default"],e)}},{key:"renderDetailEditView",value:function m(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t=e this.props.params.id>0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:t} @@ -2487,17 +2485,17 @@ var a=[] handleClickArg:i.ID},h["default"].createElement(M["default"],{item:i,campaign:e.props.record})))}),a.push(h["default"].createElement(S["default"],{key:f,groupid:f,title:d},c))}) var s=[this.props.config.absoluteBaseUrl,this.props.config.sections["SilverStripe\\CMS\\Controllers\\CMSPagesController"].url].join(""),l=a.length?h["default"].createElement(O["default"],null,a):h["default"].createElement("div",{ className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on"," ","the ",h["default"].createElement("a",{ -href:s},"edit page screen"),"."),u=["panel","panel--padded","panel--scrollable","flexbox-area-grow","campaign-items"] -return h["default"].createElement("div",{className:"fill-width campaigns"},h["default"].createElement("div",{className:"fill-height campaign-items cms-content__left cms-campaigns","aria-expanded":"true" +href:s},"edit page screen"),"."),u=["panel","panel--padded","panel--scrollable","flexbox-area-grow"] +return h["default"].createElement("div",{className:"fill-width campaign-admin__campaign"},h["default"].createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true" },h["default"].createElement(A["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{ className:u.join(" ")},l),h["default"].createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t}))}},{key:"handleItemSelected", value:function l(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"renderButtonToolbar",value:function u(){var e=this.getItems() if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar"}) var t={} return"open"===this.props.record.State?t=c(t,{title:$["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket" -}):"published"===this.props.record.State&&(t=c(t,{title:$["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"default",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{className:"btn-toolbar" -},h["default"].createElement(F["default"],t))}},{key:"getItems",value:function p(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{key:"groupItemsForSet", -value:function m(){var e={},t=this.getItems() +}):"published"===this.props.record.State&&(t=c(t,{title:$["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"secondary-outline",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{ +className:"btn-toolbar"},h["default"].createElement(F["default"],t))}},{key:"getItems",value:function p(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{ +key:"groupItemsForSet",value:function m(){var e={},t=this.getItems() return t?(t.forEach(function(t){var n=t.BaseClass e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function g(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId) @@ -2591,8 +2589,7 @@ return this.props.itemLinks&&this.props.itemLinks.edit&&(i=this.props.itemLinks. className:"btn__title"},d["default"]._t("Preview.EDIT","Edit"))))),e=this.props.itemId?t?n&&0===n.indexOf("image/")?u["default"].createElement("div",{className:"preview__file-container panel--scrollable" },u["default"].createElement("img",{alt:t,className:"preview__file--fits-space",src:t})):u["default"].createElement("iframe",{className:"flexbox-area-grow preview__iframe",src:t}):u["default"].createElement("div",{ className:"preview__overlay"},u["default"].createElement("h3",{className:"preview__overlay-text"},"There is no preview available for this item.")):u["default"].createElement("div",{className:"preview__overlay" -},u["default"].createElement("h3",{className:"preview__overlay-text"},"No preview available.")),u["default"].createElement("div",{className:"flexbox-area-grow fill-height cms-content__right preview"},e,u["default"].createElement("a",{ -href:"",className:"cms-content__back-btn font-icon-left-open-big"}),u["default"].createElement("div",{className:"toolbar toolbar--south"},u["default"].createElement("div",{className:"btn-toolbar"},o))) - -}}]),t}(p["default"]) +},u["default"].createElement("h3",{className:"preview__overlay-text"},"No preview available.")),u["default"].createElement("div",{className:"flexbox-area-grow fill-height preview"},e,u["default"].createElement("div",{ +className:"toolbar toolbar--south"},u["default"].createElement("button",{className:"btn btn-secondary font-icon-left-open-big toolbar__back-button hidden-lg-up",type:"button"},"Back"),u["default"].createElement("div",{ +className:"btn-toolbar"},o)))}}]),t}(p["default"]) h.propTypes={itemLinks:u["default"].PropTypes.object,itemId:u["default"].PropTypes.number},t["default"]=h}]) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index a0c0f1446..6f287b7a0 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -3745,7 +3745,7 @@ pre code{ -ms-user-select:none; user-select:none; border:1px solid transparent; - padding:.4615rem .7692rem; + padding:.3846rem .7692rem; font-size:1rem; line-height:1.539; border-radius:.23rem; @@ -9027,7 +9027,7 @@ button.loading.ss-ui-action-constructive .ui-icon,input.loading.ss-ui-action-con } .ss-ui-button.ss-ui-button-constructive[class*=font-icon-],.ss-ui-button[class*=font-icon-],.ss-ui-button[class^=font-icon-]{ - padding:.4615rem .7692rem; + padding:.3846rem .7692rem; vertical-align:middle; box-shadow:none; border:0; @@ -15085,7 +15085,7 @@ fieldset+.btn-toolbar{ } button.close{ - padding:.4615rem .7692rem; + padding:.3846rem .7692rem; } .btn--top-right{ @@ -15243,8 +15243,8 @@ th:only-child .grid-field__sort{ vertical-align:bottom; margin:0; float:right; - margin-top:-.4615rem; - margin-bottom:-.4615rem; + margin-top:-.3846rem; + margin-bottom:-.3846rem; } .grid-field .grid-field__filter-clear,.grid-field .grid-field__filter-submit{ @@ -15377,6 +15377,8 @@ div.grid-field__sort-field+.form__fieldgroup-item{ .preview{ position:relative; + background-color:#f6f7f8; + border-left:1px solid #ced3d9; } @media (max-width:991px){ @@ -15385,6 +15387,7 @@ div.grid-field__sort-field+.form__fieldgroup-item{ right:0; z-index:2; width:100%; + border-left:0; } } @@ -15494,15 +15497,22 @@ div.grid-field__sort-field+.form__fieldgroup-item{ background-color:#f6f7f8; } -.cms-backlink .toolbar__back-button,.toolbar__back-button{ +.toolbar__back-button{ float:left; margin:.76925rem .6154rem .76925rem -.76925rem; padding-left:.3077rem; - padding-right:.3077rem; - border:0; color:#66727d; } +.toolbar--south .toolbar__back-button{ + margin-top:0; + margin-right:5px; +} + +.toolbar__back-button.btn--no-text{ + padding-right:.3077rem; +} + .nav-tabs{ margin-bottom:1.5385rem; } @@ -15960,62 +15970,6 @@ body,html{ } } -@media (max-width:991px){ - .campaign-items{ - width:100%; - z-index:1; - } -} - -.campaigns{ - position:relative; - height:100%; -} - -.campaigns .cms-content--selected{ - display:block; -} - -.campaigns .cms-content__back-btn{ - width:36px; - height:36px; - background-color:rgba(79,88,97,.8); - display:block; - position:absolute; - top:8px; - left:12px; - content:"5"; - font-size:16px; - line-height:20px; - color:#fff; - padding:8px; - border-radius:50%; - font-family:silverstripe; - z-index:1; - cursor:pointer; -} - -.campaigns .cms-content__back-btn:hover{ - background-color:#4f5861; - text-decoration:none; -} - -@media (min-width:992px){ - .campaigns{ - padding-left:300px; - } - - .campaigns .cms-content__back-btn{ - display:none; - } -} - -@media (min-width:1200px){ - .campaigns{ - padding-left:448px; - } -} - .panel{ margin-left:auto; margin-right:auto; @@ -16092,6 +16046,22 @@ body,html{ display:flex; } +.campaign-admin__campaign{ + position:relative; + height:100%; +} + +.campaign-admin__campaign-items{ + width:100%; + z-index:1; +} + +@media (min-width:992px){ + .campaign-admin__campaign-items{ + width:300px; + } +} + .campaign-admin__item-links--has-links,.campaign-admin__item-links--is-linked{ color:#29abe2; float:right; diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss index 044e69dfa..6c951d67f 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss @@ -1,3 +1,19 @@ +// Required for preview position +.campaign-admin__campaign { + position: relative; + height: 100%; +} + +.campaign-admin__campaign-items { + width: 100%; + z-index: 1; + + @include media-breakpoint-up(lg) { + width: $cms-panel-sm; + } +} + + // Campaign items which have linked associations .campaign-admin__item-links--has-links, .campaign-admin__item-links--is-linked { diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js index 919e0de00..6d7444cc9 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js @@ -147,12 +147,12 @@ class CampaignAdminList extends SilverStripeComponent {
); const bodyClass = [ - 'panel', 'panel--padded', 'panel--scrollable', 'flexbox-area-grow', 'campaign-items', + 'panel', 'panel--padded', 'panel--scrollable', 'flexbox-area-grow', ]; return ( -
-
+
@@ -209,7 +209,7 @@ class CampaignAdminList extends SilverStripeComponent { // TODO Implement "revert" feature actionProps = Object.assign(actionProps, { title: i18n._t('Campaigns.REVERTCAMPAIGN'), - bootstrapButtonStyle: 'default', + bootstrapButtonStyle: 'secondary-outline', icon: 'back-in-time', disabled: true, }); diff --git a/admin/client/src/styles/_layout.scss b/admin/client/src/styles/_layout.scss index 81246bfbb..57fa95b28 100644 --- a/admin/client/src/styles/_layout.scss +++ b/admin/client/src/styles/_layout.scss @@ -19,79 +19,14 @@ body { display: flex; } + +// TODO move out of layout @include media-breakpoint-down(md) { .cms-content.has-panel .cms-content-tools { display: none; } } -.campaign-items { - @include media-breakpoint-down(md) { - width: 100%; - z-index: 1; - } -} - -.campaigns { // TODO move to campaign container - position: relative; - height: 100%; - - // Overlay preview if there isn't enough space for both items and preview - .cms-content--selected { - display: block; - } - - // Back button for smaller screens, closes preview - .cms-content__back-btn { - width: 36px; - height: 36px; - background-color: rgba($gray-dark, 0.8); - display: block; - position: absolute; - top: 8px; - left: 12px; - content: "5"; - font-size: 16px; - line-height: 20px; - color: $white; - padding: 8px; - border-radius: 50%; - font-family: silverstripe; - z-index: 1; - cursor: pointer; - - &:hover { - background-color: $gray-dark; - text-decoration: none; - } - } - - @include media-breakpoint-up(lg) { - padding-left: $cms-panel-sm; - - // .cms-content__left { - // width: $cms-panel-sm; - // } - // - // .cms-content__right { - // display: block; - // border-left: 1px solid $border-color; - // } - - .cms-content__back-btn { - display: none; - } - } - - @include media-breakpoint-up(xl) { - padding-left: $cms-panel-md; - - // .cms-content__left { - // width: $cms-panel-md; - // } - } -} - // Panels, basic holder for CMS content areas // Use .container-fluid if you want only padding left and right From debb1a947e8120d4c0ed0ea40455b6a417feab75 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Wed, 26 Oct 2016 17:12:19 +1300 Subject: [PATCH 15/28] Add responsive class for Campaign list Fix back button in preview Fix add to campaign in pages section --- admin/client/dist/js/bundle.js | 130 ++++++++++-------- admin/client/dist/styles/bundle.css | 11 ++ .../FormBuilderModal/FormBuilderModal.js | 3 + .../client/src/components/Preview/Preview.js | 15 ++ .../containers/CampaignAdmin/CampaignAdmin.js | 1 - .../CampaignAdmin/CampaignAdmin.scss | 11 ++ .../CampaignAdmin/CampaignAdminList.js | 22 +-- admin/client/src/legacy/AddToCampaignForm.js | 9 +- 8 files changed, 129 insertions(+), 73 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index 1472d67e5..637353f9c 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -127,7 +127,7 @@ return Q=t.runOnLoop||t.runOnContext,u()}catch(r){return f()}}function m(e,t){va void 0===r[oe]&&M(r) var o=i._state return o?!function(){var e=n[o-1] -Y(function(){return I(o,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this +Y(function(){return A(o,r,e,i._result)})}():j(i,r,e,t),r}function g(e){var t=this if(e&&"object"==typeof e&&e.constructor===t)return e var n=new t(v) return P(n,e),n}function v(){}function y(){return new TypeError("You cannot resolve a promise with itself")}function b(){return new TypeError("A promises callback cannot return that same promise.")}function w(e){ @@ -138,9 +138,9 @@ i||(i=!0,S(e,t))},"Settle: "+(e._label||" unknown promise")) }function P(t,n){t===n?S(t,y()):e(n)?E(t,n,w(n)):k(t,n)}function O(e){e._onerror&&e._onerror(e._result),x(e)}function k(e,t){e._state===ae&&(e._result=t,e._state=se,0!==e._subscribers.length&&Y(x,e))}function S(e,t){ e._state===ae&&(e._state=le,e._result=t,Y(O,e))}function j(e,t,n,i){var r=e._subscribers,o=r.length e._onerror=null,r[o]=t,r[o+se]=n,r[o+le]=i,0===o&&e._state&&Y(x,e)}function x(e){var t=e._subscribers,n=e._state -if(0!==t.length){for(var i=void 0,r=void 0,o=e._result,a=0;a127?"x":F[M] -if(!D.match(b)){var U=A.slice(0,k),L=A.slice(k+1),B=F.match(w) +if(!D.match(b)){var U=I.slice(0,k),L=I.slice(k+1),B=F.match(w) B&&(U.push(B[1]),L.unshift(B[2])),L.length&&(s="/"+L.join(".")+s),this.hostname=U.join(".") break}}}this.hostname.length>y?this.hostname="":this.hostname=this.hostname.toLowerCase(),R||(this.hostname=l.toASCII(this.hostname)) var H=this.port?":"+this.port:"",$=this.hostname||"" -this.host=$+H,this.href+=this.host,R&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==s[0]&&(s="/"+s))}if(!_[h])for(var k=0,I=m.length;k1&&(i=n[0]+"@",e=n[1]),e=e.replace(I,".") +n.length>1&&(i=n[0]+"@",e=n[1]),e=e.replace(A,".") var r=e.split("."),o=s(r,t).join(".") return i+o}function u(e){for(var t=[],n=0,i=e.length,r,o;n=55296&&r<=56319&&nC-o&&a("overflow"),o+=M(r/i),r%=i,t.splice(r for(e=u(e),v=e.length,t=j,n=0,o=S,s=0;s=t&&mM((C-n)/y)&&a("overflow"),n+=(l-t)*y,t=l,s=0;sC&&a("overflow"),m==t){for(c=n,d=T;h=d<=o?E:d>=o+P?P:d-o,!(c= 0x80 (not a basic code point)", +var _,C=2147483647,T=36,E=1,P=26,O=38,k=700,S=72,j=128,x="-",R=/^xn--/,I=/[^\x20-\x7E]/,A=/[\x2E\u3002\uFF0E\uFF61]/g,F={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)", "invalid-input":"Invalid input"},D=T-E,M=Math.floor,N=String.fromCharCode,U _={version:"1.3.2",ucs2:{decode:u,encode:c},decode:h,encode:m,toASCII:v,toUnicode:g},i=function(){return _}.call(t,n,t,e),!(void 0!==i&&(e.exports=i))}(this)}).call(t,n(17)(e),function(){return this}()) @@ -1094,7 +1098,7 @@ t.length&&t.remove(),n=$.path.addSearchParams(n,{tempid:e,BackURL:window.locatio }}),$(".leftandmain-logindialog").entwine({onmatch:function j(){this._super(),this.ssdialog({iframeUrl:this.data("url"),dialogClass:"leftandmain-logindialog-dialog",autoOpen:!0,minWidth:500,maxWidth:500, minHeight:370,maxHeight:400,closeOnEscape:!1,open:function e(){$(".ui-widget-overlay").addClass("leftandmain-logindialog-overlay")},close:function t(){$(".ui-widget-overlay").removeClass("leftandmain-logindialog-overlay") -}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function A(){this.ssdialog("close")},toggle:function I(e){this.is(":visible")?this.close():this.open()},reauthenticate:function F(e){ +}})},onunmatch:function x(){this._super()},open:function R(){this.ssdialog("open")},close:function I(){this.ssdialog("close")},toggle:function A(e){this.is(":visible")?this.close():this.open()},reauthenticate:function F(e){ "undefined"!=typeof e.SecurityID&&$(":input[name=SecurityID]").val(e.SecurityID),"undefined"!=typeof e.TempID&&$("body").data("member-tempid",e.TempID),this.close()}}),$("form.loading,.cms-content.loading,.cms-content-fields.loading,.cms-content-view.loading").entwine({ onmatch:function D(){this.append('
'),this._super()},onunmatch:function M(){this.find(".cms-content-loading-overlay,.cms-content-loading-spinner").remove(), this._super()}}),$('.cms input[type="submit"], .cms button, .cms input[type="reset"], .cms .ss-ui-button').entwine({onadd:function N(){this.addClass("ss-ui-button"),this.data("button")||this.button(),this._super() @@ -1355,9 +1359,9 @@ var o=i.find("li") o.length?o.first().find("a").click():document.location.href=r,i.select()}}}),e(".cms-menu-list li .toggle-children").entwine({onclick:function S(e){var t=this.closest("li") return t.toggle(),!1}}),e(".cms .profile-link").entwine({onclick:function j(){return e(".cms-container").loadPanel(this.attr("href")),e(".cms-menu-list li").removeClass("current").close(),!1}}),e(".cms-menu .sticky-toggle").entwine({ onadd:function x(){var t=!!e(".cms-menu").getPersistedStickyState() -this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function A(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") +this.toggleCSS(t),this.toggleIndicator(t),this._super()},toggleCSS:function R(e){this[e?"addClass":"removeClass"]("active")},toggleIndicator:function I(e){this.next(".sticky-status-indicator").text(e?"fixed":"auto") -},onclick:function I(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n +},onclick:function A(){var e=this.closest(".cms-menu"),t=e.getPersistedCollapsedState(),n=e.getPersistedStickyState(),i=void 0===n?!this.hasClass("active"):!n void 0===t?e.setPersistedCollapsedState(e.hasClass("collapsed")):void 0!==t&&i===!1&&e.clearPersistedCollapsedState(),e.setPersistedStickyState(i),this.toggleCSS(i),this.toggleIndicator(i),this._super() }})})},function(e,t,n){"use strict" @@ -1425,9 +1429,9 @@ changeVisibleState:function j(e){this.find('[data-name="'+e+'"]').addClass("acti var n=e(this).attr("data-name") this.addClass("active").siblings().removeClass("active"),e(".cms-preview").changeState(n),t.preventDefault()}}}),e(".preview-mode-selector").entwine({changeVisibleMode:function R(e){this.find("select").val(e).trigger("chosen:updated")._addIcon() -}}),e(".preview-mode-selector select").entwine({onchange:function A(t){this._super(t),t.preventDefault() +}}),e(".preview-mode-selector select").entwine({onchange:function I(t){this._super(t),t.preventDefault() var n=e(this).val() -e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function I(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), +e(".cms-preview").changeMode(n)}}),e(".cms-container--content-mode").entwine({onmatch:function A(){e(".cms-preview .result-selected").hasClass("font-icon-columns")&&statusMessage(s["default"]._t("LeftAndMain.DISABLESPLITVIEW","Screen too small to show site preview in split mode"),"error"), this._super()}}),e(".preview-size-selector").entwine({changeVisibleSize:function F(e){this.find("select").val(e).trigger("chosen:updated")._addIcon()}}),e(".preview-size-selector select").entwine({onchange:function D(t){ t.preventDefault() var n=e(this).val() @@ -1507,13 +1511,13 @@ o["default"].entwine("ss",function(e){e(".TreeDropdownField").entwine({"from .cm "use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r),a=n(98),s=i(a),l=n(4),u=i(l),c=n(106),d=i(c),f=n(35),p=n(107),h=i(p) o["default"].entwine("ss",function(e){e(".cms-content-actions .add-to-campaign-action,#add-to-campaign__action").entwine({onclick:function t(){var t=e("#add-to-campaign__dialog-wrapper") -return t.length||(t=e('
'),e("body").append(t)),t.open(),!1}}),e("#add-to-campaign__dialog-wrapper").entwine({open:function n(){this._renderModal()},close:function i(){ -this._clearModal()},_renderModal:function r(){var t=this,n=function l(){return t._clearModal()},i=function c(){return t._handleSubmitModal.apply(t,arguments)},r=e("form.cms-edit-form :input[name=ID]").val(),o=window.ss.store,a=o.getState().config.sections["SilverStripe\\CMS\\Controllers\\CMSPageEditController"],s=a.form.AddToCampaignForm.schemaUrl+"/"+r +return t.length||(t=e('
'),e("body").append(t)),t.open(),!1}}),e("#add-to-campaign__dialog-wrapper").entwine({onunmatch:function n(){this.close()},open:function i(){ +this._renderModal()},close:function r(){this._clearModal()},_renderModal:function o(){var t=this,n=function l(){return t._clearModal()},i=function c(){return t._handleSubmitModal.apply(t,arguments)},r=e("form.cms-edit-form :input[name=ID]").val(),o=window.ss.store,a=o.getState().config.sections["SilverStripe\\CMS\\Controllers\\CMSPageEditController"],s=a.form.AddToCampaignForm.schemaUrl+"/"+r d["default"].render(u["default"].createElement(f.Provider,{store:o},u["default"].createElement(h["default"],{show:!0,handleSubmit:i,handleHide:n,schemaUrl:s,bodyClassName:"modal__dialog",responseClassBad:"modal__response modal__response--error", -responseClassGood:"modal__response modal__response--good"})),this[0])},_clearModal:function o(){d["default"].unmountComponentAtNode(this[0])},_handleSubmitModal:function a(e,t,n){return e.preventDefault(), -t.Campaign?n():(alert(s["default"]._t("AddToCampaigns.ErrorCampaignNotSelected","There was no campaign selected to be added to")),null)}})})},,function(e,t){e.exports=FormBuilderModal},function(e,t,n){ +responseClassGood:"modal__response modal__response--good"})),this[0])},_clearModal:function a(){d["default"].unmountComponentAtNode(this[0])},_handleSubmitModal:function l(e,t,n){return event.preventDefault(), +e.Campaign?n():(alert(s["default"]._t("AddToCampaigns.ErrorCampaignNotSelected","There was no campaign selected to be added to")),null)}})})},,function(e,t){e.exports=FormBuilderModal},function(e,t,n){ "use strict" function i(e){return e&&e.__esModule?e:{"default":e}}var r=n(1),o=i(r) n(92),n(109) @@ -1747,8 +1751,8 @@ var s=!0 i.setCurrentXhr(null),o.jstree("destroy").bind("loaded.jstree",function(e,r){t.each(i.getValue(),function(e,t){r.inst.check_node(o.find("*[data-id="+t+"]"))}),s=!1,n&&n.apply(i)}).jstree(i.getTreeConfig()).bind("uncheck_node.jstree check_node.jstree",function(e,n){ var r=n.inst.get_checked(null,!0) i.setValue(t.map(r,function(e,n){return t(e).data("id")})),i.setTitle(t.map(r,function(e,t){return n.inst.get_text(e)})),i.data("metadata",t.map(r,function(e,n){return{id:t(e).data("id"),metadata:t(e).getMetaData() -}}))})}}),this.setCurrentXhr(a)},getValue:function A(){var e=this._super() -return e.split(/ *, */)},setValue:function I(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ +}}))})}}),this.setCurrentXhr(a)},getValue:function I(){var e=this._super() +return e.split(/ *, */)},setValue:function A(e){this._super(t.isArray(e)?e.join(","):e)},setTitle:function F(e){this._super(t.isArray(e)?e.join(", "):e)},updateTitle:function D(){}}),t(".TreeDropdownField input[type=hidden]").entwine({ onadd:function M(){this._super(),this.bind("change.TreeDropdownField",function(){t(this).getField().updateTitle()})},onremove:function N(){this._super(),this.unbind(".TreeDropdownField")}})})}).call(t,n(1)) },,,function(module,exports,__webpack_require__){"use strict" @@ -1824,7 +1828,7 @@ e.insertLink(this.getLinkAttributes())})},removeLink:function j(){this.modifySel n.length&&(t._trigger("destroy",null,{context:n}),e.find(".ss-uploadfield-addfile").removeClass("borderTop"))},addAnchorSelector:function R(){if(!this.find(":input[name=AnchorSelector]").length){var t=this,n=e('') -this.find(":input[name=Anchor]").parent().append(n),this.updateAnchorSelector(),n.change(function(n){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function A(){var t=this.find(":input[name=LinkType]:checked").val(),n=e.Deferred() +this.find(":input[name=Anchor]").parent().append(n),this.updateAnchorSelector(),n.change(function(n){t.find(':input[name="Anchor"]').val(e(this).val())})}},getAnchors:function I(){var t=this.find(":input[name=LinkType]:checked").val(),n=e.Deferred() switch(t){case"anchor":var i=[],r=this.getEditor() @@ -1837,7 +1841,7 @@ l?e.ajax({url:e.path.addSearchParams(this.attr("action").replace("LinkForm","get }}):n.resolve([]) break -default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function I(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() +default:n.reject(_i18n2["default"]._t("HtmlEditorField.ANCHORSNOTSUPPORTED","Anchors are not supported for this link type."))}return n.promise()},updateAnchorSelector:function A(){var t=this,n=this.find(":input[name=AnchorSelector]"),i=this.getAnchors() n.empty(),n.append(e('")),i.done(function(t){if(n.empty(),n.append(e('")), @@ -2001,7 +2005,7 @@ this.val()&&(e.addClass("filtered"),t.addClass("filtered")),this._super()},onunm if("13"==e.keyCode){var i=this.closest(".filter-header").find(".ss-gridfield-button-filter"),r="show" return!this.hasClass("ss-gridfield-button-close")&&this.closest(".grid-field").hasClass("show-filter")||(r="hidden"),this.getGridField().reload({data:[{name:i.attr("name"),value:i.val(),filter:r}]}),!1 -}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function A(t){this.autocomplete({source:function n(t,i){var r=e(this.element),o=e(this.element).closest("form") +}t.addClass("hover-alike"),n.addClass("hover-alike")}}}),e(".grid-field .relation-search").entwine({onfocusin:function I(t){this.autocomplete({source:function n(t,i){var r=e(this.element),o=e(this.element).closest("form") e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("searchUrl"),data:encodeURIComponent(r.attr("name"))+"="+encodeURIComponent(r.val()),success:i,error:function a(e){alert(s["default"]._t("GRIDFIELD.ERRORINTRANSACTION","An error occured while fetching data from the server\n Please try again later.")) @@ -2009,7 +2013,7 @@ e.ajax({headers:{"X-Pjax":"Partial"},dataType:"json",type:"GET",url:e(r).data("s }})},select:function i(t,n){var i=e('') i.val(n.item.id),e(this).closest(".grid-field").find(".action_gridfield_relationfind").replaceWith(i) var r=e(this).closest(".grid-field").find(".action_gridfield_relationadd") -r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function I(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() +r.data("button")?r.button("enable"):r.removeAttr("disabled")}})}}),e(".grid-field .pagination-page-number input").entwine({onkeydown:function A(t){if(13==t.keyCode){var n=parseInt(e(this).val(),10),i=e(this).getGridField() return i.setState("GridFieldPaginator",{currentPage:n}),i.reload(),!1}}})})},function(e,t,n){"use strict" @@ -2025,7 +2029,7 @@ var e={},t=(0,l.combineReducers)(g["default"].getAll()),n=[c["default"]],i=h["de var u=o(l.createStore),p=u(t,e) p.dispatch(y.setConfig(h["default"].getAll())),window.ss=window.ss||{},window.ss.store=p var m=new s["default"](p) -m.start(window.location.pathname)}var a=n(129),s=r(a),l=n(36),u=n(151),c=r(u),d=n(37),f=n(150),p=n(73),h=r(p),m=n(152),g=r(m),v=n(153),y=i(v),b=n(155),w=r(b),_=n(157),C=r(_),T=n(158),E=r(T),P=n(159),O=r(P),k=n(161),S=r(k),j=n(162),x=r(j),R=n(178),A=r(R),I=n(9),F=r(I) +m.start(window.location.pathname)}var a=n(129),s=r(a),l=n(36),u=n(151),c=r(u),d=n(37),f=n(150),p=n(73),h=r(p),m=n(152),g=r(m),v=n(153),y=i(v),b=n(155),w=r(b),_=n(157),C=r(_),T=n(158),E=r(T),P=n(159),O=r(P),k=n(161),S=r(k),j=n(162),x=r(j),R=n(178),I=r(R),A=n(9),F=r(A) F["default"].polyfill(),window.onload=o},function(e,t,n){"use strict" @@ -2123,11 +2127,11 @@ for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}, t["default"]=r},function(e,t,n){"use strict" function i(e){return e&&e.__esModule?e:{"default":e}}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}) var o=function(){function e(e,t){for(var n=0;n1){var t=this.props.breadcrumbs[this.props.breadcrumbs.length-2] -if(t&&t.href)return e.preventDefault(),void this.props.router.push(t.href)}}},{key:"render",value:function u(){var e=null +t&&t.href&&(e.preventDefault(),this.props.router.push(t.href))}}},{key:"render",value:function u(){var e=null switch(this.props.params.view){case"show":e=this.renderItemListView() break case"edit":e=this.renderDetailEditView() @@ -2416,18 +2420,18 @@ default:e=this.renderIndexView()}return e}},{key:"renderIndexView",value:functio handleClick:this.addCampaign.bind(this)},n={createFn:this.campaignListCreateFn.bind(this),schemaUrl:e} return p["default"].createElement("div",{className:"fill-height","aria-expanded":"true"},p["default"].createElement(x["default"],null,p["default"].createElement(C["default"],{multiline:!0,crumbs:this.props.breadcrumbs })),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow"},p["default"].createElement("div",{className:"toolbar toolbar--content"},p["default"].createElement("div",{ -className:"btn-toolbar"},p["default"].createElement(O["default"],t))),p["default"].createElement(A["default"],n)))}},{key:"renderItemListView",value:function h(){var e={sectionConfig:this.props.sectionConfig, +className:"btn-toolbar"},p["default"].createElement(O["default"],t))),p["default"].createElement(I["default"],n)))}},{key:"renderItemListView",value:function h(){var e={sectionConfig:this.props.sectionConfig, campaignId:this.props.params.id,itemListViewEndpoint:this.props.sectionConfig.itemListViewEndpoint,publishApi:this.publishApi,handleBackButtonClick:this.handleBackButtonClick.bind(this)} return p["default"].createElement(F["default"],e)}},{key:"renderDetailEditView",value:function m(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t=e this.props.params.id>0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignEditCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, -crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(A["default"],n)))}},{key:"renderCreateView", +crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(I["default"],n)))}},{key:"renderCreateView", value:function g(){var e=this.props.sectionConfig.form.DetailEditForm.schemaUrl,t=e this.props.params.id>0&&(t=e+"/"+this.props.params.id) var n={createFn:this.campaignAddCreateFn.bind(this),schemaUrl:t} return p["default"].createElement("div",null,p["default"].createElement(x["default"],{showBackButton:!0,handleBackButtonClick:this.handleBackButtonClick},p["default"].createElement(C["default"],{multiline:!0, -crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(A["default"],n)))}},{key:"campaignEditCreateFn", +crumbs:this.props.breadcrumbs})),p["default"].createElement("div",{className:"panel panel--padded panel--scrollable flexbox-area-grow form--inline"},p["default"].createElement(I["default"],n)))}},{key:"campaignEditCreateFn", value:function v(e,t){var n=this,i=this.props.sectionConfig.url if("action_cancel"===t.name){var r=c({},t,{handleClick:function o(e){e.preventDefault(),n.props.router.push(i)}}) return p["default"].createElement(e,c({key:t.id},r))}return p["default"].createElement(e,c({key:t.id},t))}},{key:"campaignAddCreateFn",value:function b(e,t){var n=this,i=this.props.sectionConfig.url @@ -2465,39 +2469,40 @@ var i=Object.getOwnPropertyDescriptor(e,t) if(void 0===i){var r=Object.getPrototypeOf(e) return null===r?void 0:q(r,t,n)}if("value"in i)return i.value var o=i.get -if(void 0!==o)return o.call(n)},p=n(4),h=r(p),m=n(36),g=n(35),v=n(180),y=i(v),b=n(52),w=i(b),_=n(184),C=i(_),T=n(20),E=r(T),P=n(185),O=r(P),k=n(186),S=r(k),j=n(188),x=r(j),R=n(182),A=r(R),I=n(177),F=r(I),D=n(189),M=r(D),N=n(181),U=r(N),L=n(190),B=r(L),H=n(98),$=r(H),V=function(e){ +if(void 0!==o)return o.call(n)},p=n(4),h=r(p),m=n(36),g=n(35),v=n(180),y=i(v),b=n(52),w=i(b),_=n(184),C=i(_),T=n(20),E=r(T),P=n(185),O=r(P),k=n(186),S=r(k),j=n(188),x=r(j),R=n(182),I=r(R),A=n(177),F=r(A),D=n(189),M=r(D),N=n(181),U=r(N),L=n(190),B=r(L),H=n(98),$=r(H),V=function(e){ function t(e){o(this,t) var n=a(this,(t.__proto__||Object.getPrototypeOf(t)).call(this,e)) -return n.handlePublish=n.handlePublish.bind(n),n.handleItemSelected=n.handleItemSelected.bind(n),n.setBreadcrumbs=n.setBreadcrumbs.bind(n),n}return s(t,e),d(t,[{key:"componentDidMount",value:function n(){ -var e=this.props.itemListViewEndpoint.url.replace(/:id/,this.props.campaignId) +return n.handlePublish=n.handlePublish.bind(n),n.handleItemSelected=n.handleItemSelected.bind(n),n.setBreadcrumbs=n.setBreadcrumbs.bind(n),n.handleCloseItem=n.handleCloseItem.bind(n),n}return s(t,e),d(t,[{ +key:"componentDidMount",value:function n(){var e=this.props.itemListViewEndpoint.url.replace(/:id/,this.props.campaignId) f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this),this.setBreadcrumbs(),Object.keys(this.props.record).length||this.props.recordActions.fetchRecord(this.props.treeClass,"get",e).then(this.setBreadcrumbs) }},{key:"setBreadcrumbs",value:function i(){if(this.props.record){var e=[{text:$["default"]._t("Campaigns.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}] -e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"render",value:function r(){var e=this,t=this.props.campaign.changeSetItemId,n=null,i=this.props.campaignId,r=this.props.record,o=this.groupItemsForSet(),a=[] +e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"render",value:function r(){var e=this,t=this.props.campaign.changeSetItemId,n=null,i=t?"":"campaign-admin__campaign--no-selected-item",r=this.props.campaignId,o=this.props.record,a=this.groupItemsForSet(),s=[] -Object.keys(o).forEach(function(s){var l=o[s],u=l.items.length,c=[],d=u+" "+(1===u?l.singular:l.plural),f="Set_"+i+"_Group_"+s +Object.keys(a).forEach(function(i){var l=a[i],u=l.items.length,c=[],d=u+" "+(1===u?l.singular:l.plural),f="Set_"+r+"_Group_"+i l.items.forEach(function(i){t||(t=i.ID) -var o=t===i.ID -o&&i._links&&(n=i._links) +var r=t===i.ID +r&&i._links&&(n=i._links) var a=[] -"none"!==i.ChangeType&&"published"!==r.State||a.push("list-group-item--inactive"),o&&a.push("active"),c.push(h["default"].createElement(x["default"],{key:i.ID,className:a.join(" "),handleClick:e.handleItemSelected, -handleClickArg:i.ID},h["default"].createElement(M["default"],{item:i,campaign:e.props.record})))}),a.push(h["default"].createElement(S["default"],{key:f,groupid:f,title:d},c))}) -var s=[this.props.config.absoluteBaseUrl,this.props.config.sections["SilverStripe\\CMS\\Controllers\\CMSPagesController"].url].join(""),l=a.length?h["default"].createElement(O["default"],null,a):h["default"].createElement("div",{ -className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting"," ",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on"," ","the ",h["default"].createElement("a",{ -href:s},"edit page screen"),"."),u=["panel","panel--padded","panel--scrollable","flexbox-area-grow"] -return h["default"].createElement("div",{className:"fill-width campaign-admin__campaign"},h["default"].createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true" -},h["default"].createElement(A["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{ -className:u.join(" ")},l),h["default"].createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t}))}},{key:"handleItemSelected", -value:function l(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"renderButtonToolbar",value:function u(){var e=this.getItems() +"none"!==i.ChangeType&&"published"!==o.State||a.push("list-group-item--inactive"),r&&a.push("active"),c.push(h["default"].createElement(x["default"],{key:i.ID,className:a.join(" "),handleClick:e.handleItemSelected, +handleClickArg:i.ID},h["default"].createElement(M["default"],{item:i,campaign:e.props.record})))}),s.push(h["default"].createElement(S["default"],{key:f,groupid:f,title:d},c))}) +var l=[this.props.config.absoluteBaseUrl,this.props.config.sections["SilverStripe\\CMS\\Controllers\\CMSPagesController"].url].join(""),u=s.length?h["default"].createElement(O["default"],null,s):h["default"].createElement("div",{ +className:"alert alert-warning",role:"alert"},h["default"].createElement("strong",null,"This campaign is empty.")," You can add pages by selecting",h["default"].createElement("em",null,"Add to campaign")," from within the ",h["default"].createElement("em",null,"More Options")," popup on the ",h["default"].createElement("a",{ +href:l},"edit page screen"),"."),c=["panel","panel--padded","panel--scrollable","flexbox-area-grow"] +return h["default"].createElement("div",{className:"fill-width campaign-admin__campaign "+i},h["default"].createElement("div",{className:"fill-height campaign-admin__campaign-items","aria-expanded":"true" +},h["default"].createElement(I["default"],{showBackButton:!0,handleBackButtonClick:this.props.handleBackButtonClick},h["default"].createElement(U["default"],{multiline:!0,crumbs:this.props.breadcrumbs})),h["default"].createElement("div",{ +className:c.join(" ")},u),h["default"].createElement("div",{className:"toolbar toolbar--south"},this.renderButtonToolbar())),h["default"].createElement(B["default"],{itemLinks:n,itemId:t,onBack:this.handleCloseItem +}))}},{key:"handleItemSelected",value:function l(e,t){this.props.campaignActions.selectChangeSetItem(t)}},{key:"handleCloseItem",value:function u(){this.props.campaignActions.selectChangeSetItem(null)} +},{key:"renderButtonToolbar",value:function p(){var e=this.getItems() if(!e||!e.length)return h["default"].createElement("div",{className:"btn-toolbar"}) var t={} return"open"===this.props.record.State?t=c(t,{title:$["default"]._t("Campaigns.PUBLISHCAMPAIGN"),bootstrapButtonStyle:"primary",loading:this.props.campaign.isPublishing,handleClick:this.handlePublish,icon:"rocket" }):"published"===this.props.record.State&&(t=c(t,{title:$["default"]._t("Campaigns.REVERTCAMPAIGN"),bootstrapButtonStyle:"secondary-outline",icon:"back-in-time",disabled:!0})),h["default"].createElement("div",{ -className:"btn-toolbar"},h["default"].createElement(F["default"],t))}},{key:"getItems",value:function p(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{ -key:"groupItemsForSet",value:function m(){var e={},t=this.getItems() +className:"btn-toolbar"},h["default"].createElement(F["default"],t))}},{key:"getItems",value:function m(){return this.props.record&&this.props.record._embedded?this.props.record._embedded.items:null}},{ +key:"groupItemsForSet",value:function g(){var e={},t=this.getItems() return t?(t.forEach(function(t){var n=t.BaseClass -e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function g(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId) +e[n]||(e[n]={singular:t.Singular,plural:t.Plural,items:[]}),e[n].items.push(t)}),e):e}},{key:"handlePublish",value:function v(e){e.preventDefault(),this.props.campaignActions.publishCampaign(this.props.publishApi,this.props.treeClass,this.props.campaignId) }}]),t}(E["default"]) V.propTypes={campaign:h["default"].PropTypes.shape({isPublishing:h["default"].PropTypes.bool.isRequired,changeSetItemId:h["default"].PropTypes.number}),breadcrumbsActions:h["default"].PropTypes.object.isRequired, @@ -2581,7 +2586,10 @@ e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,wri value:!0}) var s=function(){function e(e,t){for(var n=0;nBack
{toolbarButtons} @@ -81,6 +95,7 @@ class Preview extends SilverStripeComponent { Preview.propTypes = { itemLinks: React.PropTypes.object, itemId: React.PropTypes.number, + onBack: React.PropTypes.func, }; export default Preview; diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js index 7f0421dd0..7674a29fa 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.js @@ -83,7 +83,6 @@ class CampaignAdmin extends SilverStripeComponent { if (last && last.href) { event.preventDefault(); this.props.router.push(last.href); - return; } } } diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss index 6c951d67f..af4aaee9d 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdmin.scss @@ -4,6 +4,17 @@ height: 100%; } +@include media-breakpoint-down(md) { + .campaign-admin__campaign--no-selected-item { + .preview { + display: none; + } + .list-group-item.active { + background-color: inherit; + color: inherit; + } + } +} .campaign-admin__campaign-items { width: 100%; z-index: 1; diff --git a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js index 6d7444cc9..5f12d9d4c 100644 --- a/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js +++ b/admin/client/src/containers/CampaignAdmin/CampaignAdminList.js @@ -27,6 +27,7 @@ class CampaignAdminList extends SilverStripeComponent { this.handlePublish = this.handlePublish.bind(this); this.handleItemSelected = this.handleItemSelected.bind(this); this.setBreadcrumbs = this.setBreadcrumbs.bind(this); + this.handleCloseItem = this.handleCloseItem.bind(this); } componentDidMount() { @@ -72,6 +73,7 @@ class CampaignAdminList extends SilverStripeComponent { render() { let itemId = this.props.campaign.changeSetItemId; let itemLinks = null; + const selectedClass = (!itemId) ? 'campaign-admin__campaign--no-selected-item' : ''; const campaignId = this.props.campaignId; const campaign = this.props.record; @@ -141,8 +143,8 @@ class CampaignAdminList extends SilverStripeComponent { ? ({accordionBlocks}) : ( ); @@ -151,10 +153,8 @@ class CampaignAdminList extends SilverStripeComponent { ]; return ( -
-
+
+
@@ -165,7 +165,7 @@ class CampaignAdminList extends SilverStripeComponent { {this.renderButtonToolbar()}
- +
); } @@ -180,6 +180,10 @@ class CampaignAdminList extends SilverStripeComponent { this.props.campaignActions.selectChangeSetItem(itemId); } + handleCloseItem() { + this.props.campaignActions.selectChangeSetItem(null); + } + renderButtonToolbar() { const items = this.getItems(); @@ -231,7 +235,7 @@ class CampaignAdminList extends SilverStripeComponent { } /** - * @return {Array} + * @return {array} */ getItems() { if (this.props.record && this.props.record._embedded) { @@ -244,7 +248,7 @@ class CampaignAdminList extends SilverStripeComponent { /** * Group items for changeset display * - * @return array + * @return {object} */ groupItemsForSet() { const groups = {}; diff --git a/admin/client/src/legacy/AddToCampaignForm.js b/admin/client/src/legacy/AddToCampaignForm.js index aa2ad32e9..9277a3d08 100644 --- a/admin/client/src/legacy/AddToCampaignForm.js +++ b/admin/client/src/legacy/AddToCampaignForm.js @@ -33,6 +33,11 @@ jQuery.entwine('ss', ($) => { */ $('#add-to-campaign__dialog-wrapper').entwine({ + onunmatch() { + // solves errors given by ReactDOM "no matched root found" error. + this.close(); + }, + open() { this._renderModal(); }, @@ -71,10 +76,10 @@ jQuery.entwine('ss', ($) => { // this.empty(); }, - _handleSubmitModal(event, fieldValues, submitFn) { + _handleSubmitModal(data, action, submitFn) { event.preventDefault(); - if (!fieldValues.Campaign) { + if (!data.Campaign) { // TODO invisible submit disable, remove this when validation is implemented // eslint-disable-next-line no-alert alert(i18n._t( From 4373eb6801bfe820c3b8f4a1c47f55d4e5047336 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Fri, 28 Oct 2016 10:30:13 +1300 Subject: [PATCH 16/28] Hide sitetree in smaller screens for setting and pages --- admin/client/src/styles/_layout.scss | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/admin/client/src/styles/_layout.scss b/admin/client/src/styles/_layout.scss index 57fa95b28..b064f2b0d 100644 --- a/admin/client/src/styles/_layout.scss +++ b/admin/client/src/styles/_layout.scss @@ -22,8 +22,11 @@ body { // TODO move out of layout @include media-breakpoint-down(md) { - .cms-content.has-panel .cms-content-tools { - display: none; + .CMSPageEditController, + .CMSPageSettingsController { + &.has-panel .cms-content-tools { + display: none; + } } } From 71a4eb7d222a4f0fd861f1c7b2a3496790a9a4c1 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Fri, 28 Oct 2016 10:32:31 +1300 Subject: [PATCH 17/28] Hide preview in campaigns, override list styles for mobile --- admin/client/dist/js/bundle.js | 8 ++++---- admin/client/dist/styles/bundle.css | 17 +++++++++++----- .../src/components/ListGroup/ListGroup.scss | 2 +- .../client/src/components/Preview/Preview.js | 2 +- .../CampaignAdmin/CampaignAdmin.scss | 20 +++++++++++++------ .../CampaignAdmin/CampaignAdminList.js | 2 +- 6 files changed, 33 insertions(+), 18 deletions(-) diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index 637353f9c..8457af88b 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -2477,7 +2477,7 @@ key:"componentDidMount",value:function n(){var e=this.props.itemListViewEndpoint f(t.prototype.__proto__||Object.getPrototypeOf(t.prototype),"componentDidMount",this).call(this),this.setBreadcrumbs(),Object.keys(this.props.record).length||this.props.recordActions.fetchRecord(this.props.treeClass,"get",e).then(this.setBreadcrumbs) }},{key:"setBreadcrumbs",value:function i(){if(this.props.record){var e=[{text:$["default"]._t("Campaigns.CAMPAIGN","Campaigns"),href:this.props.sectionConfig.url}] -e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"render",value:function r(){var e=this,t=this.props.campaign.changeSetItemId,n=null,i=t?"":"campaign-admin__campaign--no-selected-item",r=this.props.campaignId,o=this.props.record,a=this.groupItemsForSet(),s=[] +e.push({text:this.props.record.Name,href:this.props.sectionConfig.url+"/set/"+this.props.campaignId+"/show"}),this.props.breadcrumbsActions.setBreadcrumbs(e)}}},{key:"render",value:function r(){var e=this,t=this.props.campaign.changeSetItemId,n=null,i=t?"":"campaign-admin__campaign--hide-preview",r=this.props.campaignId,o=this.props.record,a=this.groupItemsForSet(),s=[] Object.keys(a).forEach(function(i){var l=a[i],u=l.items.length,c=[],d=u+" "+(1===u?l.singular:l.plural),f="Set_"+r+"_Group_"+i @@ -2597,7 +2597,7 @@ return this.props.itemLinks&&this.props.itemLinks.edit&&(i=this.props.itemLinks. className:"btn__title"},d["default"]._t("Preview.EDIT","Edit"))))),e=this.props.itemId?t?n&&0===n.indexOf("image/")?u["default"].createElement("div",{className:"preview__file-container panel--scrollable" },u["default"].createElement("img",{alt:t,className:"preview__file--fits-space",src:t})):u["default"].createElement("iframe",{className:"flexbox-area-grow preview__iframe",src:t}):u["default"].createElement("div",{ className:"preview__overlay"},u["default"].createElement("h3",{className:"preview__overlay-text"},"There is no preview available for this item.")):u["default"].createElement("div",{className:"preview__overlay" -},u["default"].createElement("h3",{className:"preview__overlay-text"},"No preview available.")),u["default"].createElement("div",{className:"flexbox-area-grow fill-height preview"},e,u["default"].createElement("div",{ -className:"toolbar toolbar--south"},u["default"].createElement("button",{className:"btn btn-secondary font-icon-left-open-big toolbar__back-button hidden-lg-up",type:"button",onClick:this.handleBackClick -},"Back"),u["default"].createElement("div",{className:"btn-toolbar"},o)))}}]),t}(p["default"]) +},u["default"].createElement("h3",{className:"preview__overlay-text"},"No preview available.")),u["default"].createElement("div",{className:"flexbox-area-grow fill-height preview campaign-admin__campaign-preview" +},e,u["default"].createElement("div",{className:"toolbar toolbar--south"},u["default"].createElement("button",{className:"btn btn-secondary font-icon-left-open-big toolbar__back-button hidden-lg-up",type:"button", +onClick:this.handleBackClick},"Back"),u["default"].createElement("div",{className:"btn-toolbar"},o)))}}]),t}(p["default"]) h.propTypes={itemLinks:u["default"].PropTypes.object,itemId:u["default"].PropTypes.number,onBack:u["default"].PropTypes.func},t["default"]=h}]) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index a46c7a44b..26fe3df92 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -15965,7 +15965,7 @@ body,html{ } @media (max-width:991px){ - .cms-content.has-panel .cms-content-tools{ + .CMSPageEditController.has-panel .cms-content-tools,.CMSPageSettingsController.has-panel .cms-content-tools{ display:none; } } @@ -16052,13 +16052,20 @@ body,html{ } @media (max-width:991px){ - .campaign-admin__campaign--no-selected-item .preview{ + .campaign-admin__campaign.campaign-admin__campaign--hide-preview .campaign-admin__campaign-preview{ display:none; } - .campaign-admin__campaign--no-selected-item .list-group-item.active{ - background-color:inherit; - color:inherit; + .campaign-admin__campaign .list-group-item.active{ + background-color:#fff; + color:#4f5861; + z-index:0; + } + + .campaign-admin__campaign .list-group-item.active:hover{ + background-color:#f5f5f5; + color:#4f5861; + border-color:#ddd; } } diff --git a/admin/client/src/components/ListGroup/ListGroup.scss b/admin/client/src/components/ListGroup/ListGroup.scss index e67fb0ca3..c5a800c6c 100644 --- a/admin/client/src/components/ListGroup/ListGroup.scss +++ b/admin/client/src/components/ListGroup/ListGroup.scss @@ -34,7 +34,7 @@ color: $white; opacity: 1; } - } + } } .list-group-item-heading { diff --git a/admin/client/src/components/Preview/Preview.js b/admin/client/src/components/Preview/Preview.js index e4c19aece..4e7db7c61 100644 --- a/admin/client/src/components/Preview/Preview.js +++ b/admin/client/src/components/Preview/Preview.js @@ -75,7 +75,7 @@ class Preview extends SilverStripeComponent { // Combine elements return ( -
+
{body}
+ ); + // Combine elements return (
{body}
- + { backButton }
{toolbarButtons}
diff --git a/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js index 3328c63a6..542cb31a4 100644 --- a/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js +++ b/admin/client/src/containers/FormBuilderLoader/FormBuilderLoader.js @@ -73,25 +73,38 @@ class FormBuilderLoader extends Component { * @param submitFn * @returns {Promise} */ - handleSubmit(dataWithAction, action, submitFn) { - return submitFn() - .then(formSchema => { - this.props.schemaActions.setSchema(formSchema); - return formSchema; - }) - // TODO Suggest storing messages in a separate redux store rather than throw an error - // ref: https://github.com/erikras/redux-form/issues/94#issuecomment-143398399 - .then(formSchema => { - if (!formSchema.state) { - return formSchema; - } - const messages = this.getMessages(formSchema.state); + handleSubmit(data, action, submitFn) { + let promise = null; + if (typeof this.props.handleSubmit === 'function') { + promise = this.props.handleSubmit(data, action, submitFn); + } else { + promise = submitFn(); + } - if (Object.keys(messages).length) { - throw new SubmissionError(messages); - } - return formSchema; - }); + if (promise) { + promise + .then(formSchema => { + this.props.schemaActions.setSchema(formSchema); + return formSchema; + }) + // TODO Suggest storing messages in a separate redux store rather than throw an error + // ref: https://github.com/erikras/redux-form/issues/94#issuecomment-143398399 + .then(formSchema => { + if (!formSchema.state) { + return formSchema; + } + const messages = this.getMessages(formSchema.state); + + if (Object.keys(messages).length) { + throw new SubmissionError(messages); + } + return formSchema; + }); + } else { + throw new Error('Promise was not returned for submitting'); + } + + return promise; } /** From bb2cb3d487643a671efde3ed2b5d1f7e7cdc5dcc Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Sat, 29 Oct 2016 00:51:44 +1300 Subject: [PATCH 27/28] Fix webpack css config, removes duplicate css files that were generated --- admin/client/dist/AssetUploadField.css | 50 ------------------------ admin/client/dist/GridField_print.css | 50 ------------------------ admin/client/dist/UploadField.css | 50 ------------------------ admin/client/dist/bundle.css | 50 ------------------------ admin/client/dist/editor.css | 50 ------------------------ admin/client/dist/js/bundle.js | 7 ++-- admin/client/dist/main.css | 53 -------------------------- webpack.config.js | 28 +++++--------- 8 files changed, 14 insertions(+), 324 deletions(-) delete mode 100644 admin/client/dist/AssetUploadField.css delete mode 100644 admin/client/dist/GridField_print.css delete mode 100644 admin/client/dist/UploadField.css delete mode 100644 admin/client/dist/bundle.css delete mode 100644 admin/client/dist/editor.css delete mode 100644 admin/client/dist/main.css diff --git a/admin/client/dist/AssetUploadField.css b/admin/client/dist/AssetUploadField.css deleted file mode 100644 index 86a4d2417..000000000 --- a/admin/client/dist/AssetUploadField.css +++ /dev/null @@ -1,50 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/admin/client/dist/GridField_print.css b/admin/client/dist/GridField_print.css deleted file mode 100644 index 86a4d2417..000000000 --- a/admin/client/dist/GridField_print.css +++ /dev/null @@ -1,50 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/admin/client/dist/UploadField.css b/admin/client/dist/UploadField.css deleted file mode 100644 index 86a4d2417..000000000 --- a/admin/client/dist/UploadField.css +++ /dev/null @@ -1,50 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/admin/client/dist/bundle.css b/admin/client/dist/bundle.css deleted file mode 100644 index 86a4d2417..000000000 --- a/admin/client/dist/bundle.css +++ /dev/null @@ -1,50 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/admin/client/dist/editor.css b/admin/client/dist/editor.css deleted file mode 100644 index 86a4d2417..000000000 --- a/admin/client/dist/editor.css +++ /dev/null @@ -1,50 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; - -/******/ // The require function -/******/ function __webpack_require__(moduleId) { - -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; - -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; - -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); - -/******/ // Flag the module as loaded -/******/ module.loaded = true; - -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } - - -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; - -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; - -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; - -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports) { - - // removed by extract-text-webpack-plugin - -/***/ } -/******/ ]); \ No newline at end of file diff --git a/admin/client/dist/js/bundle.js b/admin/client/dist/js/bundle.js index 5db54314d..ee97d2946 100644 --- a/admin/client/dist/js/bundle.js +++ b/admin/client/dist/js/bundle.js @@ -355,10 +355,11 @@ n.handleSubmit=n.handleSubmit.bind(n),n.handleAction=n.handleAction.bind(n),n.bu m["default"])()) var t=e.currentTarget.name e.isPropagationStopped()||this.setState({submittingAction:t})}},{key:"handleSubmit",value:function i(e){var t=this,n=this.state.submittingAction?this.state.submittingAction:this.props.schema.schema.actions[0].name,i=l({},e,r({},n,1)),o={ -"X-Formschema-Request":"state,schema","X-Requested-With":"XMLHttpRequest"},a=function u(e){return t.submitApi(e||i,o).then(function(e){return t.setState({submittingAction:null}),e})["catch"](function(e){ +"X-Formschema-Request":"state,schema","X-Requested-With":"XMLHttpRequest"},a=function s(e){return t.submitApi(e||i,o).then(function(e){return t.setState({submittingAction:null}),e})["catch"](function(e){ throw t.setState({submittingAction:null}),e})} -if("function"==typeof this.props.handleSubmit){var s=this.props.handleSubmit(i,n,a) -return s}return a()}},{key:"buildComponent",value:function c(e){var t=e,n=null!==t.schemaComponent?b["default"].getComponentByName(t.schemaComponent):b["default"].getComponentByDataType(t.type) +return"function"==typeof this.props.handleSubmit?this.props.handleSubmit(i,n,a):a()}},{key:"buildComponent",value:function c(e){var t=e,n=null!==t.schemaComponent?b["default"].getComponentByName(t.schemaComponent):b["default"].getComponentByDataType(t.type) + + if(null===n)return null if(null!==t.schemaComponent&&void 0===n)throw Error("Component not found in injector: "+t.schemaComponent) t=l({},t,t.input),delete t.input diff --git a/admin/client/dist/main.css b/admin/client/dist/main.css deleted file mode 100644 index f282db8df..000000000 --- a/admin/client/dist/main.css +++ /dev/null @@ -1,53 +0,0 @@ -/******/ (function(modules) { // webpackBootstrap -/******/ // The module cache -/******/ var installedModules = {}; -/******/ -/******/ // The require function -/******/ function __webpack_require__(moduleId) { -/******/ -/******/ // Check if module is in cache -/******/ if(installedModules[moduleId]) -/******/ return installedModules[moduleId].exports; -/******/ -/******/ // Create a new module (and put it into the cache) -/******/ var module = installedModules[moduleId] = { -/******/ exports: {}, -/******/ id: moduleId, -/******/ loaded: false -/******/ }; -/******/ -/******/ // Execute the module function -/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); -/******/ -/******/ // Flag the module as loaded -/******/ module.loaded = true; -/******/ -/******/ // Return the exports of the module -/******/ return module.exports; -/******/ } -/******/ -/******/ -/******/ // expose the modules object (__webpack_modules__) -/******/ __webpack_require__.m = modules; -/******/ -/******/ // expose the module cache -/******/ __webpack_require__.c = installedModules; -/******/ -/******/ // __webpack_public_path__ -/******/ __webpack_require__.p = ""; -/******/ -/******/ // Load entry module and return exports -/******/ return __webpack_require__(0); -/******/ }) -/************************************************************************/ -/******/ ([ -/* 0 */ -/***/ function(module, exports, __webpack_require__) { - - (function webpackMissingModule() { throw new Error("Cannot find module \"—watch\""); }()); - (function webpackMissingModule() { throw new Error("Cannot find module \"—profile\""); }()); - - -/***/ } -/******/ ]); -/*# sourceMappingURL=main.css.map*/ \ No newline at end of file diff --git a/webpack.config.js b/webpack.config.js index 36e50d68b..9717dd6a1 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -152,7 +152,7 @@ const config = [ 'UploadField': `${PATHS.ADMIN_CSS_SRC}/legacy/UploadField.scss`, }, output: { - path: 'admin/client/dist', + path: 'admin/client/dist/styles', filename: '[name].css', }, module: { @@ -164,26 +164,22 @@ const config = [ 'postcss?sourceMap', 'resolve-url', 'sass?sourceMap', - ], { - publicPath: '../', // needed because bundle.css is in a subfolder - }), + ]), }, { test: /\.css$/, loader: ExtractTextPlugin.extract([ 'css?sourceMap&minimize&-core&discardComments', 'postcss?sourceMap', - ], { - publicPath: '../', // needed because bundle.css is in a subfolder - }), + ]), }, { test: /\.(png|gif|jpg|svg)$/, - loader: `url?limit=10000&name=images/[name].[ext]`, + loader: `url?limit=10000&name=../images/[name].[ext]`, }, { test: /\.(woff|eot|ttf)$/, - loader: `file?name=fonts/[name].[ext]`, + loader: `file?name=../fonts/[name].[ext]`, }, ], }, @@ -191,7 +187,7 @@ const config = [ autoprefixer({ browsers: SUPPORTED_BROWSERS }), ], plugins: [ - new ExtractTextPlugin('styles/[name].css', { allChunks: true }), + new ExtractTextPlugin('[name].css', { allChunks: true }), ], }, { @@ -213,26 +209,22 @@ const config = [ 'postcss?sourceMap', 'resolve-url', 'sass?sourceMap', - ], { - publicPath: '../', // needed because bundle.css is in a subfolder - }), + ]), }, { test: /\.css$/, loader: ExtractTextPlugin.extract([ 'css?sourceMap&minimize&-core&discardComments', 'postcss?sourceMap', - ], { - publicPath: '../', // needed because bundle.css is in a subfolder - }), + ]), }, { test: /\.(png|gif|jpg|svg)$/, - loader: `url?limit=10000&name=images/[name].[ext]`, + loader: `url?limit=10000&name=../images/[name].[ext]`, }, { test: /\.(woff|eot|ttf)$/, - loader: `file?name=fonts/[name].[ext]`, + loader: `file?name=../fonts/[name].[ext]`, }, ], }, From 76d3fb80e3c8d9a0f2ee4c02ae269ea49edb17fe Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Mon, 31 Oct 2016 13:36:41 +1300 Subject: [PATCH 28/28] Nicer pattern for showing list view of pages --- admin/client/dist/styles/bundle.css | 4 ++-- .../src/components/GridField/GridField.scss | 23 +++++++++---------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/admin/client/dist/styles/bundle.css b/admin/client/dist/styles/bundle.css index 574da1102..53a3f14d2 100644 --- a/admin/client/dist/styles/bundle.css +++ b/admin/client/dist/styles/bundle.css @@ -15350,11 +15350,11 @@ div.grid-field__sort-field+.form__fieldgroup-item{ } @media (max-width:767px){ - :not(div.cms-list) .grid-field__table td,:not(div.cms-list) .grid-field__table th{ + .grid-field__table td,.grid-field__table th{ display:none; } - :not(div.cms-list) .grid-field__table td.grid-field__action-placeholder,:not(div.cms-list) .grid-field__table td.grid-field__cell--actions,:not(div.cms-list) .grid-field__table td:first-child,:not(div.cms-list) .grid-field__table th.grid-field__action-placeholder,:not(div.cms-list) .grid-field__table th.grid-field__cell--actions,:not(div.cms-list) .grid-field__table th:first-child{ + .cms-list .grid-field__table td,.cms-list .grid-field__table th,.grid-field__table td.grid-field__action-placeholder,.grid-field__table td.grid-field__cell--actions,.grid-field__table td:first-child,.grid-field__table th.grid-field__action-placeholder,.grid-field__table th.grid-field__cell--actions,.grid-field__table th:first-child{ display:table-cell; } } diff --git a/admin/client/src/components/GridField/GridField.scss b/admin/client/src/components/GridField/GridField.scss index 724839912..65af79cbd 100644 --- a/admin/client/src/components/GridField/GridField.scss +++ b/admin/client/src/components/GridField/GridField.scss @@ -241,20 +241,19 @@ div.grid-field__sort-field + .form__fieldgroup-item { // Responsive grid-field // Todo: add .text-truncate for overflowing cells -:not(div.cms-list) { - @include media-breakpoint-down(sm) { - .grid-field__table td, - .grid-field__table th { - display: none; +@include media-breakpoint-down(sm) { + .grid-field__table td, + .grid-field__table th { + display: none; - &:first-child { - display: table-cell; - } + &:first-child, + .cms-list & { + display: table-cell; + } - &.grid-field__cell--actions, - &.grid-field__action-placeholder { - display: table-cell; - } + &.grid-field__cell--actions, + &.grid-field__action-placeholder { + display: table-cell; } } }