From f4787d8e4fff377cc847908b41cc9d5a7031b399 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 28 Sep 2011 11:44:30 +1300 Subject: [PATCH 1/6] MINOR: gitignore of mac .DS_Store files --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 9ba470db..5cd3d290 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ -.sass-cache \ No newline at end of file +.sass-cache +.DS_Store \ No newline at end of file From ebcc1f324eadb6a1f801f03b07383af35d4a2ab2 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Wed, 28 Sep 2011 11:48:36 +1300 Subject: [PATCH 2/6] BUGFIX: "Parent Page" dropdown isn't hidden in "Edit Page" -> Settings (SSO-15) --- javascript/CMSMain.EditForm.js | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/javascript/CMSMain.EditForm.js b/javascript/CMSMain.EditForm.js index 85b9305a..2aa16f92 100644 --- a/javascript/CMSMain.EditForm.js +++ b/javascript/CMSMain.EditForm.js @@ -243,5 +243,32 @@ return confirm(message); } }); + + /** + * Class: .cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked + * + * Showing the "Page location" "Parent page" chooser only when the "Sub-page underneath a parent page" + * radio button is selected + */ + $('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').entwine({ + + /** + * Function: onclick + * + * Parameters: + * (Event) e + */ + onchange: function(e) { + var parentTreeDropDown = $('.cms-edit-form.CMSPageSettingsController #ParentID'); + + if (e.target.id == 'Form_EditForm_ParentType_root') parentTreeDropDown.slideUp(); + else parentTreeDropDown.slideDown(); + } + }); + + //trigger an initial change event to do the initial hiding of the element, if necessary + if ($('.cms-edit-form.CMSPageSettingsController input[name="ParentType"]:checked').attr('id') == 'Form_EditForm_ParentType_root') { + $('.cms-edit-form.CMSPageSettingsController #ParentID').hide(); //quick hide on first run + } }); }(jQuery)); \ No newline at end of file From 2c4b1271c71ba745697cb04f59074259ae732869 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Thu, 29 Sep 2011 13:10:47 +1300 Subject: [PATCH 3/6] ENHANCEMENT: CSS styling of "Create Page" dialog box and adjusting dialog title to be consistent with label of button that creates it (SSO-8) --- code/controllers/CMSMain.php | 2 +- css/CMSMain.css | 27 ++++++++ scss/CMSMain.scss | 68 ++++++++++++++++++- .../Includes/CMSPagesController_Content.ss | 2 +- 4 files changed, 96 insertions(+), 3 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 6837b1f9..0ba0fb3d 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1040,7 +1040,7 @@ JS; // TODO Should be part of the form attribute, but not possible in current form API $hintsField = new LiteralField('Hints', sprintf('', $this->SiteTreeHints())), $parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Parent page'), 'SiteTree'), - new OptionsetField("PageType", "", $pageTypes, 'Page') + new OptionsetField("PageType", _t('CMSMain.PageType', 'Page type'), $pageTypes, 'Page') ); $parentField->setValue(($record) ? $record->ID : null); diff --git a/css/CMSMain.css b/css/CMSMain.css index cf6b0185..196e7fc5 100644 --- a/css/CMSMain.css +++ b/css/CMSMain.css @@ -1,5 +1,32 @@ /** Style custom to the CMSMain admin interface. CMSMain extends the built in sapphire admin section styles. As much as possible we want to use those built in styles. If anything in this file can be implemented in a generic way then it should be include in the admin scss files. @package cms */ /** ------------------------------------------------------------------ Page History Section. ----------------------------------------------------------------- */ +/* line 15, ../scss/CMSMain.scss */ #cms-page-history-versions tr.loading { color: #999; } +/* line 20, ../scss/CMSMain.scss */ #cms-page-history-versions tr.loading td:hover { cursor: none; } +/* line 27, ../scss/CMSMain.scss */ #cms-page-history-versions td:hover { cursor: pointer; } + +/** ------------------------------------------------------------------ +* Add Page pop-up Section. +* ----------------------------------------------------------------- */ +/* line 38, ../scss/CMSMain.scss */ +#cms-page-add-form { background: url("../../sapphire/admin/images/textures/bg_cms_main_content.png") repeat scroll left top #f0f3f4; /* Labels for all the sections of the pop-up form */ /* Exception for a label that is inline with the selector dropdown box */ } +/* line 42, ../scss/CMSMain.scss */ +#cms-page-add-form #PageType .middleColumn { margin: 0; padding: 0; } +/* line 46, ../scss/CMSMain.scss */ +#cms-page-add-form #PageType .middleColumn .optionset li { width: 100%; } +/* line 54, ../scss/CMSMain.scss */ +#cms-page-add-form #PageType li.selected { background-color: rgba(255, 255, 153, 0.5); /*background-color: #FFFF99;*/ } +/* line 61, ../scss/CMSMain.scss */ +#cms-page-add-form .field label.left { font-size: 14px; font-weight: bold; width: 100%; float: none; color: #5f6160; } +/* line 71, ../scss/CMSMain.scss */ +#cms-page-add-form #ParentID label.left { padding: 8px 0 8px 0; float: right !important; } +/* line 77, ../scss/CMSMain.scss */ +#cms-page-add-form .Actions { float: right; margin: 0; } + +/** ------------------------------------------------------------------ +* Titlebar for pop-up dialog. +* ----------------------------------------------------------------- */ +/* line 89, ../scss/CMSMain.scss */ +.ui-dialog-titlebar.ui-widget-header { font-size: 14px; background-color: #b0bec7; padding: 8px 8px 6px 16px; border-bottom: 2px solid #8399a7; border-radius: 4px 4px 0 0; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ced7dc), color-stop(100%, #92a5b2)); background-image: -webkit-linear-gradient(#ced7dc, #92a5b2); background-image: -moz-linear-gradient(#ced7dc, #92a5b2); background-image: -o-linear-gradient(#ced7dc, #92a5b2); background-image: -ms-linear-gradient(#ced7dc, #92a5b2); background-image: linear-gradient(#ced7dc, #92a5b2); } diff --git a/scss/CMSMain.scss b/scss/CMSMain.scss index 3402d063..c3128b18 100644 --- a/scss/CMSMain.scss +++ b/scss/CMSMain.scss @@ -28,4 +28,70 @@ cursor: pointer; } } -} \ No newline at end of file +} + +/** ------------------------------------------------------------------ +* Add Page pop-up Section. +* ----------------------------------------------------------------- */ +$SectionHeaderColor: #5F6160; +$SectionHeaderFontSize: 14px; +#cms-page-add-form { + background: url("../../sapphire/admin/images/textures/bg_cms_main_content.png") repeat scroll left top #F0F3F4; + + #PageType { + .middleColumn { + margin: 0; + padding: 0; + + .optionset li { + width: 100%; + + + } + } + + li { + &.selected { + background-color: rgba(255,255,153, 0.5); /*background-color: #FFFF99;*/ + } + } + } + + /* Labels for all the sections of the pop-up form */ + .field label.left { + font-size: $SectionHeaderFontSize; + font-weight: bold; + width: 100%; + float: none; + color: $SectionHeaderColor; + } + + /* Exception for a label that is inline with the selector dropdown box */ + #ParentID { + label.left { + padding: 8px 0 8px 0; + float: right !important; + } + } + + .Actions { + float: right; + margin: 0; + } +} + +/** ------------------------------------------------------------------ +* Titlebar for pop-up dialog. +* ----------------------------------------------------------------- */ +@import "compass"; +@import "compass/css3"; +@import "compass/utilities"; +.ui-dialog-titlebar.ui-widget-header { + font-size: $SectionHeaderFontSize; + background-color: #b0bec7; + padding: 8px 8px 6px 16px; + + border-bottom: 2px solid #8399a7; + border-radius: 4px 4px 0 0; + @include background-image(linear-gradient(#ced7dc, #92a5b2)); +} diff --git a/templates/Includes/CMSPagesController_Content.ss b/templates/Includes/CMSPagesController_Content.ss index 5c2c6a39..81cae01b 100644 --- a/templates/Includes/CMSPagesController_Content.ss +++ b/templates/Includes/CMSPagesController_Content.ss @@ -41,7 +41,7 @@ $SiteTreeAsUL -
+
$AddForm
From 28e63efd5e9a41aa88ee742016770062528429d4 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Thu, 29 Sep 2011 17:11:35 +1300 Subject: [PATCH 4/6] ENHANCEMENT: moving the bulk of the styling for the "Create Page" dialog to Sapphire module (SSO-8) --- css/CMSMain.css | 24 ----------------- scss/CMSMain.scss | 65 ----------------------------------------------- 2 files changed, 89 deletions(-) diff --git a/css/CMSMain.css b/css/CMSMain.css index 196e7fc5..a2063bfb 100644 --- a/css/CMSMain.css +++ b/css/CMSMain.css @@ -6,27 +6,3 @@ #cms-page-history-versions tr.loading td:hover { cursor: none; } /* line 27, ../scss/CMSMain.scss */ #cms-page-history-versions td:hover { cursor: pointer; } - -/** ------------------------------------------------------------------ -* Add Page pop-up Section. -* ----------------------------------------------------------------- */ -/* line 38, ../scss/CMSMain.scss */ -#cms-page-add-form { background: url("../../sapphire/admin/images/textures/bg_cms_main_content.png") repeat scroll left top #f0f3f4; /* Labels for all the sections of the pop-up form */ /* Exception for a label that is inline with the selector dropdown box */ } -/* line 42, ../scss/CMSMain.scss */ -#cms-page-add-form #PageType .middleColumn { margin: 0; padding: 0; } -/* line 46, ../scss/CMSMain.scss */ -#cms-page-add-form #PageType .middleColumn .optionset li { width: 100%; } -/* line 54, ../scss/CMSMain.scss */ -#cms-page-add-form #PageType li.selected { background-color: rgba(255, 255, 153, 0.5); /*background-color: #FFFF99;*/ } -/* line 61, ../scss/CMSMain.scss */ -#cms-page-add-form .field label.left { font-size: 14px; font-weight: bold; width: 100%; float: none; color: #5f6160; } -/* line 71, ../scss/CMSMain.scss */ -#cms-page-add-form #ParentID label.left { padding: 8px 0 8px 0; float: right !important; } -/* line 77, ../scss/CMSMain.scss */ -#cms-page-add-form .Actions { float: right; margin: 0; } - -/** ------------------------------------------------------------------ -* Titlebar for pop-up dialog. -* ----------------------------------------------------------------- */ -/* line 89, ../scss/CMSMain.scss */ -.ui-dialog-titlebar.ui-widget-header { font-size: 14px; background-color: #b0bec7; padding: 8px 8px 6px 16px; border-bottom: 2px solid #8399a7; border-radius: 4px 4px 0 0; background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #ced7dc), color-stop(100%, #92a5b2)); background-image: -webkit-linear-gradient(#ced7dc, #92a5b2); background-image: -moz-linear-gradient(#ced7dc, #92a5b2); background-image: -o-linear-gradient(#ced7dc, #92a5b2); background-image: -ms-linear-gradient(#ced7dc, #92a5b2); background-image: linear-gradient(#ced7dc, #92a5b2); } diff --git a/scss/CMSMain.scss b/scss/CMSMain.scss index c3128b18..2fa3e906 100644 --- a/scss/CMSMain.scss +++ b/scss/CMSMain.scss @@ -30,68 +30,3 @@ } } -/** ------------------------------------------------------------------ -* Add Page pop-up Section. -* ----------------------------------------------------------------- */ -$SectionHeaderColor: #5F6160; -$SectionHeaderFontSize: 14px; -#cms-page-add-form { - background: url("../../sapphire/admin/images/textures/bg_cms_main_content.png") repeat scroll left top #F0F3F4; - - #PageType { - .middleColumn { - margin: 0; - padding: 0; - - .optionset li { - width: 100%; - - - } - } - - li { - &.selected { - background-color: rgba(255,255,153, 0.5); /*background-color: #FFFF99;*/ - } - } - } - - /* Labels for all the sections of the pop-up form */ - .field label.left { - font-size: $SectionHeaderFontSize; - font-weight: bold; - width: 100%; - float: none; - color: $SectionHeaderColor; - } - - /* Exception for a label that is inline with the selector dropdown box */ - #ParentID { - label.left { - padding: 8px 0 8px 0; - float: right !important; - } - } - - .Actions { - float: right; - margin: 0; - } -} - -/** ------------------------------------------------------------------ -* Titlebar for pop-up dialog. -* ----------------------------------------------------------------- */ -@import "compass"; -@import "compass/css3"; -@import "compass/utilities"; -.ui-dialog-titlebar.ui-widget-header { - font-size: $SectionHeaderFontSize; - background-color: #b0bec7; - padding: 8px 8px 6px 16px; - - border-bottom: 2px solid #8399a7; - border-radius: 4px 4px 0 0; - @include background-image(linear-gradient(#ced7dc, #92a5b2)); -} From a7527eef9cf3d79115b036a59e18741cec2c5d61 Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Fri, 30 Sep 2011 12:48:34 +1300 Subject: [PATCH 5/6] ENHANCEMENT: using CSS3 to do number label in dialog box (SSO-8) --- code/controllers/CMSMain.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 0ba0fb3d..0011736d 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1034,14 +1034,22 @@ JS; ); $pageTypes[$type->getField('ClassName')] = $html; } - + + $labelTriangle = ''; $fields = new FieldSet( // new HiddenField("ParentID", false, ($this->parentRecord) ? $this->parentRecord->ID : null), // TODO Should be part of the form attribute, but not possible in current form API $hintsField = new LiteralField('Hints', sprintf('', $this->SiteTreeHints())), + $label1 = new LabelField("1", _t('CMSMain.1', '1').$labelTriangle), $parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Parent page'), 'SiteTree'), + $label2 = new LabelField("1", _t('CMSMain.2', '2').$labelTriangle), new OptionsetField("PageType", _t('CMSMain.PageType', 'Page type'), $pageTypes, 'Page') ); + $label1->addExtraClass("numeric-label"); + $label1->setAllowHTML(true); + $label2->addExtraClass("numeric-label"); + $label2->setAllowHTML(true); + $parentField->setValue(($record) ? $record->ID : null); $actions = new FieldSet( From 1bf34b3bfbc8e26802c7c9dfaabbd79d9008a08d Mon Sep 17 00:00:00 2001 From: Julian Seidenberg Date: Fri, 30 Sep 2011 12:49:34 +1300 Subject: [PATCH 6/6] MINOR: changing label text to match design --- code/controllers/CMSMain.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 0011736d..080237aa 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1041,9 +1041,9 @@ JS; // TODO Should be part of the form attribute, but not possible in current form API $hintsField = new LiteralField('Hints', sprintf('', $this->SiteTreeHints())), $label1 = new LabelField("1", _t('CMSMain.1', '1').$labelTriangle), - $parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Parent page'), 'SiteTree'), + $parentField = new TreeDropdownField("ParentID", _t('CMSMain.AddFormParentLabel', 'Choose parent'), 'SiteTree'), $label2 = new LabelField("1", _t('CMSMain.2', '2').$labelTriangle), - new OptionsetField("PageType", _t('CMSMain.PageType', 'Page type'), $pageTypes, 'Page') + new OptionsetField("PageType", _t('CMSMain.ChoosePageType', 'Choose page type'), $pageTypes, 'Page') ); $label1->addExtraClass("numeric-label"); $label1->setAllowHTML(true);