diff --git a/_config/routes.yml b/_config/routes.yml index 1baa48fb..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,8 +9,8 @@ Director: '$URLSegment//$Action/$ID/$OtherID': 'ModelAsController' --- Name: legacycmsroutes -After: '*' +After: '#adminroutes' --- Director: rules: - 'admin/cms': '->admin/pages' \ No newline at end of file + 'admin/cms': '->admin/pages' 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; } diff --git a/code/controllers/CMSMain.php b/code/controllers/CMSMain.php index 8672db4b..dccb354c 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')); @@ -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')); @@ -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); } 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/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 00000000..e21f078c Binary files /dev/null and b/images/loading.gif differ diff --git a/javascript/SiteTreeURLSegmentField.js b/javascript/SiteTreeURLSegmentField.js index 2605ac5a..fc0a183b 100644 --- a/javascript/SiteTreeURLSegmentField.js +++ b/javascript/SiteTreeURLSegmentField.js @@ -94,10 +94,12 @@ } if (currentVal != updateVal) { + self.addClass('loading'); self.suggest(updateVal, function(data) { var newVal = decodeURIComponent(data.value); field.val(newVal); self.edit(title); + self.removeClass('loading'); }); } else { self.edit(); 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; +} + + diff --git a/scss/_CMSMain.scss b/scss/_CMSMain.scss index 0ed6607b..3ee1b5db 100644 --- a/scss/_CMSMain.scss +++ b/scss/_CMSMain.scss @@ -93,12 +93,8 @@ * ----------------------------------------------------------------- */ .field.urlsegment { - &.disabled { - color: #444; - padding-left: 0px; - margin-left: 0px; - background: none; - border-color: transparent; + &.loading { + background: url(../images/loading.gif) no-repeat 162px 8px; } .prefix, 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() {