Skip to content

Commit

Permalink
BUGFIX: fixing the look of Settings tab in the CMS if it has multiple…
Browse files Browse the repository at this point in the history
… tabs
  • Loading branch information
Julian Seidenberg committed May 18, 2012
1 parent aa7bc23 commit 7112032
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
9 changes: 5 additions & 4 deletions code/controllers/CMSSettingsController.php
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php <?php
class CMSSettingsController extends CMSMain { class CMSSettingsController extends LeftAndMain {


static $url_segment = 'settings'; static $url_segment = 'settings';
static $url_rule = '/$Action/$ID/$OtherID'; static $url_rule = '/$Action/$ID/$OtherID';
Expand All @@ -16,9 +16,9 @@ function getEditForm($id = null, $fields = null) {
$actions = $siteConfig->getCMSActions(); $actions = $siteConfig->getCMSActions();
$form = new Form($this, 'EditForm', $fields, $actions); $form = new Form($this, 'EditForm', $fields, $actions);
$form->addExtraClass('root-form'); $form->addExtraClass('root-form');
$form->addExtraClass('cms-edit-form');
// TODO Can't merge $FormAttributes in template at the moment $form->addExtraClass('cms-edit-form cms-panel-padded center');
$form->addExtraClass('cms-content center ss-tabset cms-panel-padded');
if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet'); if($form->Fields()->hasTabset()) $form->Fields()->findOrMakeTab('Root')->setTemplate('CMSTabSet');
$form->setHTMLID('Form_EditForm'); $form->setHTMLID('Form_EditForm');
$form->loadDataFrom($siteConfig); $form->loadDataFrom($siteConfig);
Expand All @@ -33,6 +33,7 @@ function getEditForm($id = null, $fields = null) {
return $form; return $form;
} }



/** /**
* Save the current sites {@link SiteConfig} into the database * Save the current sites {@link SiteConfig} into the database
* *
Expand Down
34 changes: 33 additions & 1 deletion templates/Includes/CMSSettingsController_Content.ss
Original file line number Original file line Diff line number Diff line change
@@ -1 +1,33 @@
$EditForm <div class="cms-content center cms-tabset $BaseCSSClasses" data-layout-type="border">

<div class="cms-content-header north">
<div>
<% with EditForm %>
<h2>
<% with Controller %>
<% include CMSSectionIcon %>
<% include CMSBreadcrumbs %>
<% end_with %>
</h2>
<% if Fields.hasTabset %>
<% with Fields.fieldByName('Root') %>
<div class="cms-tabset cms-content-header-tabs ss-ui-tabs-nav">
<ul>
<% loop Tabs %>
<li<% if extraClass %> class="$extraClass"<% end_if %>><a href="#$id">$Title</a></li>
<% end_loop %>
</ul>
</div>
<% end_with %>
<% end_if %>
<% end_with %>
</div>
</div>

<div class="cms-content-fields center ui-widget-content" data-layout-type="border">

$EditForm

</div>

</div>
30 changes: 30 additions & 0 deletions templates/Includes/CMSSettingsController_EditForm.ss
Original file line number Original file line Diff line number Diff line change
@@ -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 %>
<% loop Fields %>
$FieldHolder
<% end_loop %>
<div class="clear"><!-- --></div>
</fieldset>

<% if Actions %>
<div class="Actions">
<% loop Actions %>
$Field
<% end_loop %>
<% if CurrentPage.LinkPreview %>
<a href="$CurrentPage.LinkPreview" class="cms-preview-toggle-link ss-ui-button" data-icon="preview">
<% _t('LeftAndMain.PreviewButton', 'Preview') %> &raquo;
</a>
<% end_if %>
</div>
<% end_if %>

</form>

0 comments on commit 7112032

Please sign in to comment.