mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
ENHANCEMENT Show AssetAdmin breadcrumbs+tabs outside of search+editform panels
This commit is contained in:
parent
9981c929e0
commit
3670fe0530
@ -235,10 +235,9 @@ JS
|
|||||||
));
|
));
|
||||||
|
|
||||||
$fields->setForm($form);
|
$fields->setForm($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('center ss-tabset ' . $this->BaseCSSClasses());
|
$form->addExtraClass('cms-edit-form cms-panel-padded center ' . $this->BaseCSSClasses());
|
||||||
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
$form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
|
||||||
|
|
||||||
$this->extend('updateEditForm', $form);
|
$this->extend('updateEditForm', $form);
|
||||||
|
@ -16,6 +16,11 @@ class CMSFileAddController extends AssetAdmin {
|
|||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
public function Content() {
|
||||||
|
// Disable AssetAdmin layout including the search panel
|
||||||
|
return $this->renderWith('LeftAndMain_Content');
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Form
|
* @return Form
|
||||||
* @todo what template is used here? AssetAdmin_UploadContent.ss doesn't seem to be used anymore
|
* @todo what template is used here? AssetAdmin_UploadContent.ss doesn't seem to be used anymore
|
||||||
@ -45,7 +50,8 @@ class CMSFileAddController extends AssetAdmin {
|
|||||||
new FieldList()
|
new FieldList()
|
||||||
);
|
);
|
||||||
$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());
|
$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());
|
||||||
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
|
// Don't use AssetAdmin_EditForm, as it assumes a different panel structure
|
||||||
|
$form->setTemplate('LeftAndMain_EditForm');
|
||||||
$form->Fields()->push(
|
$form->Fields()->push(
|
||||||
new LiteralField(
|
new LiteralField(
|
||||||
'BackLink',
|
'BackLink',
|
||||||
@ -61,6 +67,9 @@ class CMSFileAddController extends AssetAdmin {
|
|||||||
return $form;
|
return $form;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Disable AssetAdmin search panel
|
||||||
|
*/
|
||||||
function Tools() {
|
function Tools() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
41
templates/Includes/AssetAdmin_Content.ss
Normal file
41
templates/Includes/AssetAdmin_Content.ss
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<div class="cms-content center ss-tabset $BaseCSSClasses" data-layout-type="border">
|
||||||
|
|
||||||
|
<div class="cms-content-header north">
|
||||||
|
<div>
|
||||||
|
<% control EditForm %>
|
||||||
|
<% if Backlink %>
|
||||||
|
<a class="backlink ss-ui-button cms-panel-link" data-icon="back" href="$Backlink">
|
||||||
|
<% _t('Back', 'Back') %>
|
||||||
|
</a>
|
||||||
|
<% end_if %>
|
||||||
|
|
||||||
|
<h2 id="page-title-heading">
|
||||||
|
<% control Controller %>
|
||||||
|
<% include CMSBreadcrumbs %>
|
||||||
|
<% end_control %>
|
||||||
|
</h2>
|
||||||
|
<% if Fields.hasTabset %>
|
||||||
|
<% with Fields.fieldByName('Root') %>
|
||||||
|
<div class="cms-content-header-tabs">
|
||||||
|
<ul>
|
||||||
|
<% control Tabs %>
|
||||||
|
<li><a href="#$id"<% if extraClass %> class="$extraClass"<% end_if %>>$Title</a></li>
|
||||||
|
<% end_control %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<% end_with %>
|
||||||
|
<% end_if %>
|
||||||
|
<% end_control %>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="cms-content-fields center ui-widget-content" data-layout-type="border">
|
||||||
|
|
||||||
|
$Tools
|
||||||
|
|
||||||
|
$EditForm
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
30
templates/Includes/AssetAdmin_EditForm.ss
Normal file
30
templates/Includes/AssetAdmin_EditForm.ss
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
<form $FormAttributes>
|
||||||
|
|
||||||
|
<% if Message %>
|
||||||
|
<p id="{$FormName}_error" class="message $MessageType">$Message</p>
|
||||||
|
<% else %>
|
||||||
|
<p id="{$FormName}_error" class="message $MessageType" style="display: none"></p>
|
||||||
|
<% end_if %>
|
||||||
|
|
||||||
|
<fieldset>
|
||||||
|
<% if Legend %><legend>$Legend</legend><% end_if %>
|
||||||
|
<% control Fields %>
|
||||||
|
$FieldHolder
|
||||||
|
<% end_control %>
|
||||||
|
<div class="clear"><!-- --></div>
|
||||||
|
</fieldset>
|
||||||
|
|
||||||
|
<% if Actions %>
|
||||||
|
<div class="Actions">
|
||||||
|
<% control Actions %>
|
||||||
|
$Field
|
||||||
|
<% end_control %>
|
||||||
|
<% if CurrentPage.PreviewLink %>
|
||||||
|
<a href="$CurrentPage.PreviewLink" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
|
||||||
|
<% _t('LeftAndMain.PreviewButton', 'Preview') %> »
|
||||||
|
</a>
|
||||||
|
<% end_if %>
|
||||||
|
</div>
|
||||||
|
<% end_if %>
|
||||||
|
|
||||||
|
</form>
|
Loading…
Reference in New Issue
Block a user