ENHANCEMENT New panel styling for AssetAdmin and CMSFileAddController (SSF-24)

This commit is contained in:
Ingo Schommer 2012-02-15 19:35:11 +01:00
parent 93b3fe8a23
commit 68e9e91a78
6 changed files with 34 additions and 90 deletions

View File

@ -72,6 +72,36 @@ JS
CMSBatchActionHandler::register('delete', 'AssetAdmin_DeleteBatchAction', 'Folder');
}
public function getEditForm($id = null, $fields = null) {
$form = parent::getEditForm($id, $fields);
$fields = $form->Fields();
$fields->findOrMakeTab('Root.TreeView', _t('AssetAdmin.TreeView', 'Tree View'));
$fields->addFieldToTab('Root.TreeView',
// TODO Replace with lazy loading on client to avoid performance hit of rendering potentially unused views
new LiteralField(
'Tree',
FormField::createTag(
'div',
array(
'class' => 'cms-tree',
'data-url' => $this->Link('getsubtree'),
'data-url-savetreenode' => $this->Link('savetreenode')
),
$this->SiteTreeAsUL()
)
)
);
$form->addExtraClass('cms-edit-form');
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
// TODO Can't merge $FormAttributes in template at the moment
$form->addExtraClass('center ss-tabset ' . $this->BaseCSSClasses());
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
return $form;
}
public function AddForm() {
$form = parent::AddForm();

View File

@ -35,11 +35,14 @@ class CMSFileAddController extends AssetAdmin {
}
$form = new Form($this, 'getEditForm', new FieldList($uploadField), new FieldList());
$form->addExtraClass('cms-content center cms-edit-form ' . $this->BaseCSSClasses());
$form->addExtraClass('center cms-edit-form ' . $this->BaseCSSClasses());
$form->setTemplate($this->getTemplatesWithSuffix('_EditForm'));
return $form;
}
function Tools() {
return false;
}
}

View File

@ -1,51 +0,0 @@
<div class="cms-content center ss-tabset $BaseCSSClasses" data-layout="{type: 'border'}">
<div class="cms-content-header north">
<div>
<h2>
<% include CMSBreadcrumbs %>
</h2>
<div class="cms-content-header-tabs">
<ul>
<li>
<a href="#cms-content-listview"><% _t('AssetAdmin.ListView', 'List View') %></a>
</li>
<li>
<a href="#cms-content-galleryview"><% _t('AssetAdmin.GalleryView', 'Gallery View') %></a>
</li>
<li>
<a href="#cms-content-treeview"><% _t('AssetAdmin.TreeView', 'Tree View') %></a>
</li>
</ul>
</div>
</div>
</div>
<div class="cms-content-tools cms-panel west cms-panel-layout" data-expandOnClick="true" data-layout="{type: 'border'}">
<div class="cms-panel-content center">
<h3 class="cms-panel-header north"></h3>
<div class="cms-content-tools-actions ui-widget-content">
$AddForm
</div>
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)">
$SiteTreeAsUL
</div>
</div>
</div>
<div class="cms-content-fields center">
<div id="cms-content-listview">
$EditForm
</div>
<div id="cms-content-treeview">
<i>Not implemented yet</i>
</div>
<div id="cms-content-galleryview">
<i>Not implemented yet</i>
</div>
</div>
</div>

View File

@ -1 +0,0 @@
<% include Form %>

View File

@ -1,37 +0,0 @@
<% with EditForm %>
<form $FormAttributes data-layout="{type: 'border'}">
<div class="cms-content-header north">
<div>
<h2><% _t('CMSAddPageController.Title','Add pages') %></h2>
</div>
</div>
<div class="cms-content-fields center cms-panel-content cms-panel-padded">
<% 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 %>
</fieldset>
</div>
<div class="cms-content-actions south">
<% if Actions %>
<div class="Actions">
<% control Actions %>
$Field
<% end_control %>
</div>
<% end_if %>
</div>
</form>
<% end_with %>