From 67aca9f4e6edc1f0a08294ebe62523269ee6f80e Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Tue, 4 Oct 2016 17:34:16 +1300 Subject: [PATCH 1/6] Replace Layout classes with flexbox css classes --- .../CMS/Controllers/Includes/CMSMain_Content.ss | 9 +++++---- .../CMS/Controllers/Includes/CMSMain_EditForm.ss | 2 +- .../CMS/Controllers/Includes/CMSMain_Tools.ss | 4 ++-- .../Includes/CMSPageHistoryController_Tools.ss | 4 ++-- .../Controllers/Includes/CMSPagesController_Content.ss | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Content.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Content.ss index 80e776bc..5a71746b 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Content.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Content.ss @@ -1,4 +1,4 @@ -
+
@@ -42,8 +42,9 @@
- $Tools - - $EditForm +
+ $Tools + $EditForm +
diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_EditForm.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_EditForm.ss index 60a8c426..292cad1f 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_EditForm.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_EditForm.ss @@ -1,6 +1,6 @@
-
+
<% if $Message %>

$Message

<% else %> diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss index 77a291ba..9ead56dd 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_Tools.ss @@ -1,5 +1,5 @@ -
-
+
+
$SearchForm
diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSPageHistoryController_Tools.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSPageHistoryController_Tools.ss index bfcf02c8..d3f82f96 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSPageHistoryController_Tools.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSPageHistoryController_Tools.ss @@ -1,6 +1,6 @@ -
+
-
+
$VersionsForm
diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss index 236e3f06..869beb3a 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss @@ -1,4 +1,4 @@ -
+
From b8b35de82dd656991904bd3ba97dc79144edbbd4 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Wed, 5 Oct 2016 15:40:02 +1300 Subject: [PATCH 2/6] Replace Layout classes with Flexbox classes --- code/Controllers/CMSPageAddController.php | 2 +- .../CMS/Controllers/Includes/CMSMain_PreviewPanel.ss | 6 +++--- .../Controllers/Includes/CMSPageAddController_Content.ss | 6 +++--- .../CMS/Controllers/Includes/CMSPagesController_Content.ss | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/Controllers/CMSPageAddController.php b/code/Controllers/CMSPageAddController.php index 8602bcb2..829a5288 100644 --- a/code/Controllers/CMSPageAddController.php +++ b/code/Controllers/CMSPageAddController.php @@ -160,7 +160,7 @@ class CMSPageAddController extends CMSPageEditController { } return null; }); - $form->addExtraClass('cms-add-form cms-content center cms-edit-form ' . $this->BaseCSSClasses()); + $form->addExtraClass('flexbox-area-grow fill-height cms-add-form cms-content cms-edit-form ' . $this->BaseCSSClasses()); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); return $form; diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss index 7c112d3d..90999148 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss @@ -1,11 +1,11 @@ -
+
<%t CMSPageHistoryController_versions_ss.PREVIEW 'Website preview' %>
-
+
-
+
diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSPageAddController_Content.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSPageAddController_Content.ss index fde670f0..bac19e8a 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSPageAddController_Content.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSPageAddController_Content.ss @@ -1,7 +1,7 @@ -
+
<% with $AddForm %> -
+
-
+
<% if $Message %>

$Message

<% else %> diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss index 869beb3a..3bbc3f54 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSPagesController_Content.ss @@ -1,4 +1,4 @@ -
+
From 2b00bdfdd6b53d70df4b1c596d875f196965782f Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Thu, 6 Oct 2016 09:05:35 +1300 Subject: [PATCH 3/6] adjust toggle to not display block when showing --- client/dist/js/bundle.js | 3 ++- client/src/legacy/CMSPageHistoryController.js | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/dist/js/bundle.js b/client/dist/js/bundle.js index 94e543e6..dc5b2d05 100644 --- a/client/dist/js/bundle.js +++ b/client/dist/js/bundle.js @@ -140,7 +140,8 @@ s=r["default"].sprintf(this.data("linkTmplShow"),i,l) t(".cms-container").loadPanel(s,"",{pjax:"CurrentForm"})}}),t("#Form_VersionsForm input[name=ShowUnpublished]").entwine({onmatch:function a(){this.toggle(),this._super()},onunmatch:function o(){this._super() },onchange:function s(){this.toggle()},toggle:function d(){var e=t(this),n=e.parents("form") -e.attr("checked")?n.find("tr[data-published=false]").show():n.find("tr[data-published=false]").hide()._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function l(t){var e,n +e.attr("checked")?n.find("tr[data-published=false]").css("display",""):n.find("tr[data-published=false]").css("display","none")._unselect()}}),t("#Form_VersionsForm tbody tr").entwine({onclick:function l(t){ +var e,n return e=this.parents("form").find(":input[name=CompareMode]").attr("checked"),n=this.siblings(".active"),e&&this.hasClass("active")?void this._unselect():e?n.length>1?alert(r["default"]._t("ONLYSELECTTWO","You can only compare two versions at this time.")):(this._select(), void(1==n.length&&this.parents("form").submit())):(this._select(),n._unselect(),this.parents("form").submit(),void 0)},_unselect:function c(){this.removeClass("active"),this.find(":input[type=checkbox]").attr("checked",!1) diff --git a/client/src/legacy/CMSPageHistoryController.js b/client/src/legacy/CMSPageHistoryController.js index f9817ab1..577a9eb3 100644 --- a/client/src/legacy/CMSPageHistoryController.js +++ b/client/src/legacy/CMSPageHistoryController.js @@ -96,9 +96,9 @@ $.entwine('ss', function($){ var form = self.parents('form'); if(self.attr('checked')) { - form.find('tr[data-published=false]').show(); + form.find('tr[data-published=false]').css('display', ''); } else { - form.find("tr[data-published=false]").hide()._unselect(); + form.find("tr[data-published=false]").css('display', 'none')._unselect(); } } }); From 4c61868e593365b60e6bd079722f84ab16e1b2e3 Mon Sep 17 00:00:00 2001 From: Paul Clarke Date: Fri, 7 Oct 2016 12:19:28 +1300 Subject: [PATCH 4/6] move preview fallback message --- .../CMS/Controllers/Includes/CMSMain_PreviewPanel.ss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss index 90999148..2b376abb 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss @@ -1,6 +1,6 @@
-
<%t CMSPageHistoryController_versions_ss.PREVIEW 'Website preview' %>
+
<%t CMSPageHistoryController_versions_ss.PREVIEW 'Website preview' %>
From 38b095ca2c56c2c0b2836fc9d4e1803a20530f47 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Fri, 7 Oct 2016 23:11:21 +1300 Subject: [PATCH 5/6] moved preview overlay to template, added area grow to preview panel --- .../CMS/Controllers/Includes/CMSMain_PreviewPanel.ss | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss index 2b376abb..9500d96b 100644 --- a/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss +++ b/templates/SilverStripe/CMS/Controllers/Includes/CMSMain_PreviewPanel.ss @@ -1,4 +1,4 @@ -
+
<%t CMSPageHistoryController_versions_ss.PREVIEW 'Website preview' %>
@@ -8,4 +8,5 @@
+
From 712849c732d3e0998a35f492c73eaf8137630b20 Mon Sep 17 00:00:00 2001 From: Christopher Joe Date: Tue, 11 Oct 2016 10:12:46 +1300 Subject: [PATCH 6/6] Fix page form layout --- code/Controllers/CMSMain.php | 1 + 1 file changed, 1 insertion(+) diff --git a/code/Controllers/CMSMain.php b/code/Controllers/CMSMain.php index 4e99dfaa..6486e2b0 100644 --- a/code/Controllers/CMSMain.php +++ b/code/Controllers/CMSMain.php @@ -734,6 +734,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr if ($record instanceof CMSPreviewable) { $form->addExtraClass('cms-previewable'); } + $form->addExtraClass('fill-height flexbox-area-grow'); if(!$record->canEdit() || $deletedFromStage) { $readonlyFields = $form->Fields()->makeReadonly();