mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Using new "tools" panel architecture to render CMS templates, which e.g. allows CMSPageEditController to reload the form without the tree in the side-by-side display variation, and hence avoids slowing down the loading and saving process
This commit is contained in:
parent
f88d4006f8
commit
38cf7e5c4d
@ -507,7 +507,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
$form->addExtraClass('cms-edit-form');
|
$form->addExtraClass('cms-edit-form');
|
||||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
||||||
// TODO Can't merge $FormAttributes in template at the moment
|
// TODO Can't merge $FormAttributes in template at the moment
|
||||||
$form->addExtraClass('cms-content center ss-tabset ' . $this->BaseCSSClasses());
|
$form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
|
||||||
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
|
|
||||||
if(!$record->canEdit() || $record->IsDeletedFromStage) {
|
if(!$record->canEdit() || $record->IsDeletedFromStage) {
|
||||||
|
@ -8,13 +8,4 @@ class CMSPageEditController extends CMSMain {
|
|||||||
static $url_segment = 'page/edit';
|
static $url_segment = 'page/edit';
|
||||||
static $url_rule = '/$Action/$ID/$OtherID';
|
static $url_rule = '/$Action/$ID/$OtherID';
|
||||||
static $url_priority = 41;
|
static $url_priority = 41;
|
||||||
|
|
||||||
public function getEditForm($id = null, $fields = null) {
|
|
||||||
$left = new SSViewer('CMSPageController_EditForm_Left');
|
|
||||||
|
|
||||||
$form = parent::getEditForm($id, $fields);
|
|
||||||
$form->Left = $left->process($this);
|
|
||||||
|
|
||||||
return $form;
|
|
||||||
}
|
|
||||||
}
|
}
|
@ -1,9 +0,0 @@
|
|||||||
<div class="cms-panel-content center">
|
|
||||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)">
|
|
||||||
$SiteTreeAsUL
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-panel-content-collapsed">
|
|
||||||
<h3 class="cms-panel-header">$SiteConfig.Title</h3>
|
|
||||||
</div>
|
|
17
templates/CMSPageEditController_Tools.ss
Normal file
17
templates/CMSPageEditController_Tools.ss
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
|
||||||
|
<div class="cms-content-header cms-panel-header north">
|
||||||
|
<h2><% _t('CMSPageEditController.Title','Pages') %></h2>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cms-panel-content center">
|
||||||
|
<div class="cms-tree" data-url-tree="$Link(getsubtree)">
|
||||||
|
$SiteTreeAsUL
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cms-panel-content-collapsed">
|
||||||
|
<h3 class="cms-panel-header">$SiteConfig.Title</h3>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
9
templates/Includes/AssetAdmin_EditFormTools.ss
Normal file
9
templates/Includes/AssetAdmin_EditFormTools.ss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}">
|
||||||
|
<div class="cms-panel-content center">
|
||||||
|
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
||||||
|
TODO
|
||||||
|
</div>
|
||||||
|
<div class="cms-panel-content-collapsed">
|
||||||
|
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -1,15 +0,0 @@
|
|||||||
<div class="cms-content center $BaseCSSClasses" data-layout="{type: 'border'}">
|
|
||||||
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
|
|
||||||
<div class="cms-content-header north">
|
|
||||||
<div>
|
|
||||||
<h2><% _t('CMSPageHistoryController.History','History') %></h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-panel-content cms-helper-hide-actions center">
|
|
||||||
$VersionsForm
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
$EditForm
|
|
||||||
</div>
|
|
11
templates/Includes/CMSPageHistoryController_Tools.ss
Normal file
11
templates/Includes/CMSPageHistoryController_Tools.ss
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<div class="cms-content-tools west cms-panel cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
|
||||||
|
<div class="cms-content-header north">
|
||||||
|
<div>
|
||||||
|
<h2><% _t('CMSPageHistoryController.History','History') %></h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cms-panel-content cms-helper-hide-actions center">
|
||||||
|
$VersionsForm
|
||||||
|
</div>
|
||||||
|
</div>
|
1
templates/Includes/CMSPageSettingsController_Tools.ss
Normal file
1
templates/Includes/CMSPageSettingsController_Tools.ss
Normal file
@ -0,0 +1 @@
|
|||||||
|
<% include CMSPageEditController_Tools %>
|
@ -22,15 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}">
|
$Tools
|
||||||
<div class="cms-panel-content center">
|
|
||||||
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
|
||||||
$SearchForm
|
|
||||||
</div>
|
|
||||||
<div class="cms-panel-content-collapsed">
|
|
||||||
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-content-fields center ui-widget-content">
|
<div class="cms-content-fields center ui-widget-content">
|
||||||
|
|
||||||
|
9
templates/Includes/CMSPagesController_Tools.ss
Normal file
9
templates/Includes/CMSPagesController_Tools.ss
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<div class="cms-content-tools west cms-panel cms-panel-layout collapsed" id="cms-content-tools" data-expandOnClick="true" data-layout="{type: 'border'}">
|
||||||
|
<div class="cms-panel-content center">
|
||||||
|
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
||||||
|
$SearchForm
|
||||||
|
</div>
|
||||||
|
<div class="cms-panel-content-collapsed">
|
||||||
|
<h3 class="cms-panel-header"><% _t('FILTER', 'Filter') %></h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -4,18 +4,7 @@
|
|||||||
<h2><% _t('REPORTS','Reports') %></h2>
|
<h2><% _t('REPORTS','Reports') %></h2>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
$Tools
|
||||||
<div class="cms-content-tools west">
|
|
||||||
|
|
||||||
<ul class="ui-widget-content">
|
|
||||||
<% control Reports %>
|
|
||||||
<li id="record-$ID">
|
|
||||||
<a href="admin/reports/show/$ID" title="$TreeDescription">$TreeTitle</a>
|
|
||||||
</li>
|
|
||||||
<% end_control %>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="cms-content-fields center ui-widget-content">
|
<div class="cms-content-fields center ui-widget-content">
|
||||||
$EditForm
|
$EditForm
|
||||||
|
11
templates/Includes/ReportAdmin_Tools.ss
Normal file
11
templates/Includes/ReportAdmin_Tools.ss
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<div class="cms-content-tools west">
|
||||||
|
|
||||||
|
<ul class="ui-widget-content">
|
||||||
|
<% control Reports %>
|
||||||
|
<li id="record-$ID">
|
||||||
|
<a href="admin/reports/show/$ID" title="$TreeDescription">$TreeTitle</a>
|
||||||
|
</li>
|
||||||
|
<% end_control %>
|
||||||
|
</ul>
|
||||||
|
|
||||||
|
</div>
|
Loading…
Reference in New Issue
Block a user