From 5f9362e7424ce71cde850d5ba87b03cb0c795458 Mon Sep 17 00:00:00 2001 From: Ryan Wachtl Date: Fri, 17 Aug 2012 03:05:39 -0500 Subject: [PATCH 1/9] BUG Visual cue that URLSegment is updating Added a loading class on .field.urlsegment to indicate that the URLSegment is updating its value, set before and after self.suggest(). --- css/screen.css | 4 ++-- images/loading.gif | Bin 0 -> 847 bytes javascript/SiteTreeURLSegmentField.js | 2 ++ scss/_CMSMain.scss | 8 ++------ 4 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 images/loading.gif diff --git a/css/screen.css b/css/screen.css index bcf6069d..677cb1a0 100644 --- a/css/screen.css +++ b/css/screen.css @@ -21,7 +21,7 @@ .cms-content-tools #cms-content-treeview .cms-tree a:hover > .text > .badge, .cms-content-tools #cms-content-treeview .cms-tree .jstree-clicked > .text > .badge { display: inline-block; } /** ------------------------------------------------------------------ URLSegment field ----------------------------------------------------------------- */ -.field.urlsegment.disabled { color: #444; padding-left: 0px; margin-left: 0px; background: none; border-color: transparent; } +.field.urlsegment.loading { background: url(../images/loading.gif) no-repeat 162px 8px; } .field.urlsegment .prefix, .field.urlsegment .preview { padding-top: 8px; display: inline-block; } .field.urlsegment .prefix { color: #777; } .field.urlsegment .cancel, .field.urlsegment .update, .field.urlsegment .edit { margin-left: 7px; } @@ -41,7 +41,7 @@ .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-state-active.content-treeview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-active.content-treeview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-active.content-treeview a { background-position: 1px -40px; } .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-state-active.content-galleryview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-active.content-galleryview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-active.content-galleryview a { background-position: -161px -40px; } .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-state-active.content-listview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-content .ui-state-active.content-listview a, .cms .AssetAdmin .cms-content-header-tabs .ui-tabs-nav .ui-widget-header .ui-state-active.content-listview a { background-position: -38px -40px; } -.cms .AssetAdmin .cms-content-toolbar .cms-page-add-button { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f3f3f3), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(#f3f3f3, #d9d9d9); background-image: -moz-linear-gradient(#f3f3f3, #d9d9d9); background-image: -o-linear-gradient(#f3f3f3, #d9d9d9); background-image: -ms-linear-gradient(#f3f3f3, #d9d9d9); background-image: linear-gradient(#f3f3f3, #d9d9d9); border-color: #c0c0c2; } +.cms .AssetAdmin .cms-content-toolbar .cms-page-add-button { background-image: -webkit-gradient(linear, 50% 0%, 50% 100%, color-stop(0%, #f3f3f3), color-stop(100%, #d9d9d9)); background-image: -webkit-linear-gradient(#f3f3f3, #d9d9d9); background-image: -moz-linear-gradient(#f3f3f3, #d9d9d9); background-image: -o-linear-gradient(#f3f3f3, #d9d9d9); background-image: linear-gradient(#f3f3f3, #d9d9d9); border-color: #c0c0c2; } .cms .AssetAdmin .cms-content-toolbar .cms-page-add-button span.btn-icon-add { height: 17px; } .cms .AssetAdmin .cms-content-toolbar .cms-page-add-button span.ui-button-text { color: #393939; text-shadow: white 0 1px 1px; } .cms .AssetAdmin #Root_TreeView .cms-tree ul .class-Folder a span.text span.jstree-foldericon { background: url(../images/blue-folder-horizontal.png) no-repeat; width: 16px; height: 16px; float: left; display: block; margin-right: 4px; } diff --git a/images/loading.gif b/images/loading.gif new file mode 100644 index 0000000000000000000000000000000000000000..e21f078cd94c501559b857037062191963304b85 GIT binary patch literal 847 zcmZ?wbhEHb6krfw_`<;O|Nnoks7XJ5{kE@L*|Gi!qD9xAyjgwhrhLZi>Saf= zXYYOb_S2j_mrmS#=HIa)X5uymQh?%rZa>$MU}whwS0gxd8la%imy$Vesewq2qE<`7s!Q9jnmP@hQ9l-`Bz@TBF=>KD%L-F9*@{ln zYy}%(kx!MfN8k55VY4JdL7~h2Qcs4K)X@hkRye4*)*d);@Y+!(j-DwEsTm?dJO>Xb zI0$n29BBBE9O&N6W)@!3wc;ix&1fW(%BGc4XkT z2{1Qcx8Y=IFyM=1v(Vz@Y*$vqW_be8hsvKPXxtL<(Be80Ai}A;q}}knaU++N^Jzox zEgmgR57|8QW~kiUSjoU4uO4tMw>85S9MaEi6+81y+^;p)p4@Ot)^ zC)D1woSCIYC7U-!lb@#>tEEAZU~N#C!el6N)L})lvmDzR@nhNDO>-C(ot`AvGc;~z z+BZSjwaKE&DKMfTd3WxjGHxNIg$geZEly}mXyXlaTP9g_N0M)8!E4RWY5yCrS_ASM zF!okB@VFWZ96BkH8!K^qr-Vn(g|-_S>;hdZCQJ&?HFPAFxhW=kFhm5;;AqS>U9y!i z$;D#}8^fxdiAg$KeX0!w#$w4wlsBmV;C-XSZenI0pr#d}-=NXctAf?ic&McwK#y@O zb1-2zwCR|mlIKK@4YL*|aM Date: Mon, 27 Aug 2012 11:47:12 +0200 Subject: [PATCH 2/9] NEW Re-added SilverStripeNavigator styling --- code/controllers/ContentController.php | 2 +- css/SilverStripeNavigator.css | 25 +++++++ scss/SilverStripeNavigator.scss | 90 ++++++++++++++++++++++++++ 3 files changed, 116 insertions(+), 1 deletion(-) create mode 100644 css/SilverStripeNavigator.css create mode 100644 scss/SilverStripeNavigator.scss diff --git a/code/controllers/ContentController.php b/code/controllers/ContentController.php index 847a54a8..98b1743f 100644 --- a/code/controllers/ContentController.php +++ b/code/controllers/ContentController.php @@ -314,7 +314,7 @@ class ContentController extends Controller {
-
$viewPageIn
+ $viewPageIn $items
diff --git a/css/SilverStripeNavigator.css b/css/SilverStripeNavigator.css new file mode 100644 index 00000000..24d390cc --- /dev/null +++ b/css/SilverStripeNavigator.css @@ -0,0 +1,25 @@ +#SilverStripeNavigator { position: fixed; bottom: 0; left: 0; width: 100%; border-top: 2px solid #d4d0c8; background-color: #81858d; height: 22px; } + +#SilverStripeNavigator * { font-family: Arial,Helvetica,sans-serif; font-size: 10px !important; } + +#SilverStripeNavigator .holder { text-align: center; padding-top: 4px; padding-left: 3px; padding-right: 6px; color: white; border-top: 1px solid #555555; } + +#SilverStripeNavigator #logInStatus { float: right; } + +#SilverStripeNavigator #switchView { float: left; } + +#SilverStripeNavigator a { color: #fff; background-color: transparent; text-decoration: underline; } + +#SilverStripeNavigator a:hover { background-color: transparent; } + +#SilverStripeNavigator .bottomTabs a { margin-right: 8px; text-decoration: underline; } + +#SilverStripeNavigator .bottomTabs a.current { font-weight: bold; text-decoration: none; } + +#SilverStripeNavigatorMessage { font-family: 'Lucida Grande', Verdana, Arial, 'sans-serif'; position: absolute; right: 20px; top: 40px; padding: 10px; border-color: #c99; color: #fff; background-color: #c00; border: 1px solid #000; } + +#SilverStripeNavigatorLinkPopup { display: none; position: absolute; top: -60px; height: 50px; width: 350px; left: 200px; background-color: white; border: 1px solid black; z-index: 100; color: black; padding: 5px; } + +#SilverStripeNavigatorLinkPopup input { width: 250px; } + +#SilverStripeNavigatorLinkPopup a.close { color: blue; text-align: right; width: 80%; border: none !important; cursor: pointer; } diff --git a/scss/SilverStripeNavigator.scss b/scss/SilverStripeNavigator.scss new file mode 100644 index 00000000..029bc1bf --- /dev/null +++ b/scss/SilverStripeNavigator.scss @@ -0,0 +1,90 @@ + +#SilverStripeNavigator { + position: fixed; + bottom: 0; + left: 0; + width: 100%; + border-top: 2px solid #d4d0c8; + background-color:#81858d; + height: 22px; +} + +#SilverStripeNavigator * { + font-family: Arial,Helvetica,sans-serif; + font-size: 10px !important; +} + +#SilverStripeNavigator .holder { + text-align: center; + padding-top : 4px; + padding-left : 3px; + padding-right : 6px; + color: white; + border-top: 1px solid #555555; +} +#SilverStripeNavigator #logInStatus { + float: right; +} +#SilverStripeNavigator #switchView { + float: left; + +} + +#SilverStripeNavigator a { + color: #fff; + background-color: transparent; + text-decoration: underline; +} +#SilverStripeNavigator a:hover { + background-color: transparent; +} + +#SilverStripeNavigator .bottomTabs a { + margin-right: 8px; + text-decoration: underline; +} + +#SilverStripeNavigator .bottomTabs a.current { + font-weight:bold; + text-decoration: none; +} + +#SilverStripeNavigatorMessage { + font-family: 'Lucida Grande', Verdana, Arial, 'sans-serif'; + position: absolute; + right: 20px; + top: 40px; + padding: 10px; + border-color: #c99; + color: #fff; + background-color: #c00; + border: 1px solid #000; +} + +#SilverStripeNavigatorLinkPopup { + display: none; + position: absolute; + top: -60px; + height: 50px; + width: 350px; + left: 200px; + background-color: white; + border: 1px solid black; + z-index: 100; + color: black; + padding: 5px; +} + +#SilverStripeNavigatorLinkPopup input { + width: 250px; +} + +#SilverStripeNavigatorLinkPopup a.close { + color: blue; + text-align: right; + width: 80%; + border: none !important; + cursor: pointer; +} + + From e59aec3f6f6c1215d2a83e1e404e0988b69815b9 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 27 Aug 2012 14:19:40 +0200 Subject: [PATCH 3/9] BUG Redirect to edit view after page revert in CMS (fixes #7391) --- code/controllers/CMSMain.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 8672db4b..9285259e 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -1061,8 +1061,12 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr // Can be used in different contexts: In normal page edit view, in which case the redirect won't have any effect. // Or in history view, in which case a revert causes the CMS to re-load the edit view. + // The X-Pjax header forces a "full" content refresh on redirect. $url = Controller::join_links(singleton('CMSPageEditController')->Link('show'), $record->ID); $this->response->addHeader('X-ControllerURL', $url); + $this->request->addHeader('X-Pjax', 'Content'); + $this->response->addHeader('X-Pjax', 'Content'); + return $this->getResponseNegotiator()->respond($this->request); } From 11b85e988e3ac346c1daaeca09f8e48512e23452 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 27 Aug 2012 16:04:31 +0200 Subject: [PATCH 4/9] Fixed "from"/"to" filter field widths Removed ineffective FieldGroup->subfieldParam setting, replaced with a specialised template, as well as a new "stacked" styling (both added to framework codebase) --- code/controllers/CMSMain.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 9285259e..edd62a82 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -284,7 +284,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr ) // new TextField('MetaTags', _t('CMSMain.SearchMetaTags', 'Meta tags')) ); - $dateGroup->subfieldParam = 'FieldHolder'; + $dateGroup->setFieldHolderTemplate('FieldGroup_DefaultFieldHolder')->addExtraClass('stacked'); $dateFrom->setConfig('showcalendar', true); $dateTo->setConfig('showcalendar', true); $classDropdown->setEmptyString(_t('CMSMain.PAGETYPEANYOPT','Any')); From 62783c75a9568b0c22d504d145b3aa9d1f5995b3 Mon Sep 17 00:00:00 2001 From: Ingo Schommer Date: Mon, 27 Aug 2012 18:20:56 +0200 Subject: [PATCH 5/9] BUG Prevent overwriting of draft/live preview form fields By renaming fields to "StageLink" and "LiveLink", which means they don't get influenced by the model getters on Form->loadDataFrom(). Its also a more accurate name for the field value, since it contains a full (nested) URL rather than just a segment. Only used internally, so no API change. --- code/controllers/CMSMain.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index edd62a82..dccb354c 100644 --- a/code/controllers/CMSMain.php +++ b/code/controllers/CMSMain.php @@ -574,17 +574,18 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $fields->push($idField = new HiddenField("ID", false, $id)); // Necessary for different subsites $fields->push($liveURLField = new HiddenField("AbsoluteLink", false, $record->AbsoluteLink())); - $fields->push($liveURLField = new HiddenField("LiveURLSegment")); - $fields->push($stageURLField = new HiddenField("StageURLSegment")); + $fields->push($liveURLField = new HiddenField("LiveLink")); + $fields->push($stageURLField = new HiddenField("StageLink")); $fields->push(new HiddenField("TreeTitle", false, $record->TreeTitle)); $fields->push(new HiddenField('Sort','', $record->Sort)); if($record->ID && is_numeric( $record->ID ) ) { $liveRecord = Versioned::get_one_by_stage('SiteTree', 'Live', "\"SiteTree\".\"ID\" = $record->ID"); - if($liveRecord) $liveURLField->setValue($liveRecord->AbsoluteLink()); + if($liveRecord) { + $liveURLField->setValue(Controller::join_links($liveRecord->AbsoluteLink(), '?stage=Live')); + } } - if(!$deletedFromStage) { $stageURLField->setValue(Controller::join_links($record->AbsoluteLink(), '?stage=Stage')); } @@ -615,7 +616,6 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr $form = new Form($this, "EditForm", $fields, $actions, $validator); $form->loadDataFrom($record); - $stageURLField->setValue(Controller::join_links($record->getStageURLSegment(), '?stage=Stage')); $form->disableDefaultAction(); $form->addExtraClass('cms-edit-form'); $form->setTemplate($this->getTemplatesWithSuffix('_EditForm')); From cbadd3ef9bd862987033e318ae06649e909f097e Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Tue, 28 Aug 2012 13:55:49 +1200 Subject: [PATCH 6/9] FIX Config frag legacycmsroutes doesnt need to come after _everything_ --- _config/routes.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/_config/routes.yml b/_config/routes.yml index 1baa48fb..9a6a595f 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -8,8 +8,8 @@ Director: '$URLSegment//$Action/$ID/$OtherID': 'ModelAsController' --- Name: legacycmsroutes -After: '*' +After: framework/routes#adminroutes --- Director: rules: - 'admin/cms': '->admin/pages' \ No newline at end of file + 'admin/cms': '->admin/pages' From d45dd34db95a131d0ab95db0f9630b9c52708a90 Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Tue, 28 Aug 2012 15:13:57 +1200 Subject: [PATCH 7/9] FIX VirtualPageTest failing on apps with no $db on Page VirtualPageTest was adding fields to Page via a decorator, but Page might not have any fields itself. This changed Page from not having a table to having a table, which then caused a problem on tearDown --- tests/model/VirtualPageTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/model/VirtualPageTest.php b/tests/model/VirtualPageTest.php index ba4ef7ad..cd47dfbb 100644 --- a/tests/model/VirtualPageTest.php +++ b/tests/model/VirtualPageTest.php @@ -10,7 +10,7 @@ class VirtualPageTest extends SapphireTest { ); protected $requiredExtensions = array( - 'Page' => array('VirtualPageTest_PageExtension') + 'SiteTree' => array('VirtualPageTest_PageExtension') ); function setUp() { From 2637e6d9b2e3aea8f017c5502def632b685771e5 Mon Sep 17 00:00:00 2001 From: Hamish Friedlander Date: Tue, 28 Aug 2012 15:46:33 +1200 Subject: [PATCH 8/9] FIX Dont refer to framework module in config rules Might be called sapphire instead, in which case routing rules will end up in the wrong place --- _config/routes.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/_config/routes.yml b/_config/routes.yml index 9a6a595f..deed433b 100644 --- a/_config/routes.yml +++ b/_config/routes.yml @@ -1,6 +1,7 @@ --- Name: modelascontrollerroutes -After: framework/routes#rootroutes +Before: '*' +After: '#rootroutes' --- Director: rules: @@ -8,7 +9,7 @@ Director: '$URLSegment//$Action/$ID/$OtherID': 'ModelAsController' --- Name: legacycmsroutes -After: framework/routes#adminroutes +After: '#adminroutes' --- Director: rules: From 62cfd871b61531d1e8d3b41f3b96843d934f9226 Mon Sep 17 00:00:00 2001 From: jean Date: Tue, 28 Aug 2012 16:43:54 +1200 Subject: [PATCH 9/9] FIX 7819 Check if the current folder ID is in the url before assuming the list should not filter by folder ID --- code/controllers/AssetAdmin.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/controllers/AssetAdmin.php b/code/controllers/AssetAdmin.php index e71e6498..429454ee 100644 --- a/code/controllers/AssetAdmin.php +++ b/code/controllers/AssetAdmin.php @@ -95,7 +95,7 @@ JS // Don't filter list when a detail view is requested, // to avoid edge cases where the filtered list wouldn't contain the requested // record due to faulty session state (current folder not always encoded in URL, see #7408). - if($this->request->param('ID') == 'field') { + if(!$folder->ID && ($this->request->param('ID') == 'field')) { return $list; }