mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
FIX right sidebar was being forced to float left
This commit is contained in:
parent
1e602a0ac1
commit
37e5d106d2
@ -174,9 +174,7 @@ class BlogPost extends Page
|
|||||||
Requirements::css(BLOGGER_DIR . '/css/cms.css');
|
Requirements::css(BLOGGER_DIR . '/css/cms.css');
|
||||||
Requirements::javascript(BLOGGER_DIR . '/js/cms.js');
|
Requirements::javascript(BLOGGER_DIR . '/js/cms.js');
|
||||||
|
|
||||||
$self =& $this;
|
$this->beforeUpdateCMSFields(function ($fields) {
|
||||||
|
|
||||||
$this->beforeUpdateCMSFields(function ($fields) use ($self) {
|
|
||||||
$uploadField = UploadField::create('FeaturedImage', _t('BlogPost.FeaturedImage', 'Featured Image'));
|
$uploadField = UploadField::create('FeaturedImage', _t('BlogPost.FeaturedImage', 'Featured Image'));
|
||||||
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
|
$uploadField->getValidator()->setAllowedExtensions(array('jpg', 'jpeg', 'png', 'gif'));
|
||||||
|
|
||||||
@ -207,7 +205,7 @@ class BlogPost extends Page
|
|||||||
$fields->push(HiddenField::create('MenuTitle'));
|
$fields->push(HiddenField::create('MenuTitle'));
|
||||||
|
|
||||||
$urlSegment = $fields->dataFieldByName('URLSegment');
|
$urlSegment = $fields->dataFieldByName('URLSegment');
|
||||||
$urlSegment->setURLPrefix($self->Parent()->RelativeLink());
|
$urlSegment->setURLPrefix($this->Parent()->RelativeLink());
|
||||||
|
|
||||||
$fields->removeFieldsFromTab('Root.Main', array(
|
$fields->removeFieldsFromTab('Root.Main', array(
|
||||||
'MenuTitle',
|
'MenuTitle',
|
||||||
@ -217,7 +215,7 @@ class BlogPost extends Page
|
|||||||
$authorField = ListboxField::create(
|
$authorField = ListboxField::create(
|
||||||
'Authors',
|
'Authors',
|
||||||
_t('BlogPost.Authors', 'Authors'),
|
_t('BlogPost.Authors', 'Authors'),
|
||||||
$self->getCandidateAuthors()->map()->toArray()
|
$this->getCandidateAuthors()->map()->toArray()
|
||||||
);
|
);
|
||||||
|
|
||||||
$authorNames = TextField::create(
|
$authorNames = TextField::create(
|
||||||
@ -230,14 +228,14 @@ class BlogPost extends Page
|
|||||||
'If some authors of this post don\'t have CMS access, enter their name(s) here. You can separate multiple names with a comma.')
|
'If some authors of this post don\'t have CMS access, enter their name(s) here. You can separate multiple names with a comma.')
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!$self->canEditAuthors()) {
|
if (!$this->canEditAuthors()) {
|
||||||
$authorField = $authorField->performDisabledTransformation();
|
$authorField = $authorField->performDisabledTransformation();
|
||||||
$authorNames = $authorNames->performDisabledTransformation();
|
$authorNames = $authorNames->performDisabledTransformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
$publishDate = DatetimeField::create('PublishDate', _t('BlogPost.PublishDate', 'Publish Date'));
|
$publishDate = DatetimeField::create('PublishDate', _t('BlogPost.PublishDate', 'Publish Date'));
|
||||||
$publishDate->getDateField()->setConfig('showcalendar', true);
|
$publishDate->getDateField()->setConfig('showcalendar', true);
|
||||||
if (!$self->PublishDate) {
|
if (!$this->PublishDate) {
|
||||||
$publishDate->setDescription(_t(
|
$publishDate->setDescription(_t(
|
||||||
'BlogPost.PublishDate_Description',
|
'BlogPost.PublishDate_Description',
|
||||||
'Will be set to "now" if published without a value.')
|
'Will be set to "now" if published without a value.')
|
||||||
@ -245,7 +243,7 @@ class BlogPost extends Page
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Get categories and tags
|
// Get categories and tags
|
||||||
$parent = $self->Parent();
|
$parent = $this->Parent();
|
||||||
$categories = $parent instanceof Blog
|
$categories = $parent instanceof Blog
|
||||||
? $parent->Categories()
|
? $parent->Categories()
|
||||||
: BlogCategory::get();
|
: BlogCategory::get();
|
||||||
@ -260,17 +258,17 @@ class BlogPost extends Page
|
|||||||
'Categories',
|
'Categories',
|
||||||
_t('BlogPost.Categories', 'Categories'),
|
_t('BlogPost.Categories', 'Categories'),
|
||||||
$categories,
|
$categories,
|
||||||
$self->Categories()
|
$this->Categories()
|
||||||
)
|
)
|
||||||
->setCanCreate($self->canCreateCategories())
|
->setCanCreate($this->canCreateCategories())
|
||||||
->setShouldLazyLoad(true),
|
->setShouldLazyLoad(true),
|
||||||
TagField::create(
|
TagField::create(
|
||||||
'Tags',
|
'Tags',
|
||||||
_t('BlogPost.Tags', 'Tags'),
|
_t('BlogPost.Tags', 'Tags'),
|
||||||
$tags,
|
$tags,
|
||||||
$self->Tags()
|
$this->Tags()
|
||||||
)
|
)
|
||||||
->setCanCreate($self->canCreateTags())
|
->setCanCreate($this->canCreateTags())
|
||||||
->setShouldLazyLoad(true),
|
->setShouldLazyLoad(true),
|
||||||
$authorField,
|
$authorField,
|
||||||
$authorNames
|
$authorNames
|
||||||
|
40
css/cms.css
40
css/cms.css
@ -14,17 +14,21 @@
|
|||||||
clear: none;
|
clear: none;
|
||||||
float: left; }
|
float: left; }
|
||||||
|
|
||||||
.blog-admin-sidebar {
|
.has-panel .cms-content-tools.blog-admin-sidebar {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-left: 1px solid #C0C0C2;
|
border-left: 1px solid #C0C0C2;
|
||||||
position: absolute;
|
position: absolute !important;
|
||||||
|
/* overrides cms !imporant style */
|
||||||
right: 0px;
|
right: 0px;
|
||||||
bottom: 0px;
|
top: 0;
|
||||||
height: 100%; }
|
height: 100%; }
|
||||||
.blog-admin-sidebar .cms-panel-toggle a {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle a {
|
||||||
text-align: left; }
|
text-align: left;
|
||||||
.blog-admin-sidebar ~ .blog-admin-outer {
|
margin: 0; }
|
||||||
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-panel-toggle.south {
|
||||||
|
border-top: 1px solid #aaaaaa; }
|
||||||
|
.has-panel .cms-content-tools.blog-admin-sidebar ~ .blog-admin-outer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 280px;
|
padding-right: 280px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
@ -32,34 +36,36 @@
|
|||||||
overflow-y: hidden;
|
overflow-y: hidden;
|
||||||
overflow-x: hidden;
|
overflow-x: hidden;
|
||||||
box-sizing: border-box; }
|
box-sizing: border-box; }
|
||||||
.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset {
|
.has-panel .cms-content-tools.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset {
|
||||||
position: relative;
|
position: relative;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title label {
|
.has-panel .cms-content-tools.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title label {
|
||||||
float: none; }
|
float: none; }
|
||||||
.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title .middleColumn, .blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title input {
|
.has-panel .cms-content-tools.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title .middleColumn, .has-panel .cms-content-tools.blog-admin-sidebar ~ .blog-admin-outer > .ss-tabset #Title input {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
margin-left: 0; }
|
margin-left: 0; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field + .field {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field + .field {
|
||||||
margin-top: 10px; }
|
margin-top: 10px; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field.urlsegment .preview {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.urlsegment .preview {
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
line-height: 25px; }
|
line-height: 25px; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field.urlsegment .edit {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.urlsegment .edit {
|
||||||
float: right; }
|
float: right; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .date {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .date {
|
||||||
width: 60%; }
|
width: 60%; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .time {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn > .time {
|
||||||
width: 36%;
|
width: 36%;
|
||||||
float: right; }
|
float: right; }
|
||||||
.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn .middleColumn, .blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn input {
|
.has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn .middleColumn, .has-panel .cms-content-tools.blog-admin-sidebar .cms-content-view > .field.datetime > .middleColumn input {
|
||||||
width: 100%; }
|
width: 100%; }
|
||||||
.blog-admin-sidebar.collapsed ~ .blog-admin-outer {
|
.has-panel .cms-content-tools.blog-admin-sidebar.collapsed ~ .blog-admin-outer {
|
||||||
padding-right: 41px; }
|
padding-right: 41px; }
|
||||||
.blog-admin-sidebar.cms-content-tools .cms-panel-content {
|
.has-panel .cms-content-tools.blog-admin-sidebar.collapsed ~ .blog-admin-outer #Root_Main {
|
||||||
|
margin-right: 15px; }
|
||||||
|
.has-panel .cms-content-tools.blog-admin-sidebar.cms-content-tools .cms-panel-content {
|
||||||
width: auto; }
|
width: auto; }
|
||||||
|
|
||||||
.toggle-description {
|
.toggle-description {
|
||||||
|
11
js/cms.js
11
js/cms.js
@ -113,6 +113,10 @@
|
|||||||
if(!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) {
|
if(!this.hasClass('collapsed') && ($(".blog-admin-outer").width() < this.getMinInnerWidth())) {
|
||||||
this.collapsePanel();
|
this.collapsePanel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
window.onresize = function() {
|
||||||
|
this.updateLayout();
|
||||||
|
}.bind(this);
|
||||||
},
|
},
|
||||||
togglePanel: function(bool, silent) {
|
togglePanel: function(bool, silent) {
|
||||||
this._super(bool, silent);
|
this._super(bool, silent);
|
||||||
@ -124,9 +128,16 @@
|
|||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
updateLayout: function() {
|
updateLayout: function() {
|
||||||
|
$(this).css('height', '100%');
|
||||||
|
var currentHeight = $(this).outerHeight();
|
||||||
|
var bottomHeight = $('.cms-content-actions').eq(0).outerHeight();
|
||||||
|
$(this).css('height', (currentHeight - bottomHeight) + "px");
|
||||||
|
$(this).css('bottom', bottomHeight + "px");
|
||||||
|
|
||||||
$('.cms-container').updateLayoutOptions({
|
$('.cms-container').updateLayoutOptions({
|
||||||
minContentWidth: 820 + this.width()
|
minContentWidth: 820 + this.width()
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -21,19 +21,24 @@
|
|||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.blog-admin-sidebar {
|
.has-panel .cms-content-tools.blog-admin-sidebar {
|
||||||
width: 280px;
|
width: 280px;
|
||||||
border-right: none;
|
border-right: none;
|
||||||
border-left: 1px solid #C0C0C2;
|
border-left: 1px solid #C0C0C2;
|
||||||
position: absolute;
|
position: absolute !important; /* overrides cms !imporant style */
|
||||||
right: 0px;
|
right: 0px;
|
||||||
bottom: 0px;
|
top: 0;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
||||||
.cms-panel-toggle a {
|
.cms-panel-toggle a {
|
||||||
text-align: left;
|
text-align: left;
|
||||||
|
margin: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.cms-panel-toggle.south {
|
||||||
|
border-top: 1px solid #aaaaaa;
|
||||||
|
}
|
||||||
|
|
||||||
~ .blog-admin-outer {
|
~ .blog-admin-outer {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
padding-right: 280px;
|
padding-right: 280px;
|
||||||
@ -101,7 +106,12 @@
|
|||||||
&.collapsed {
|
&.collapsed {
|
||||||
~ .blog-admin-outer {
|
~ .blog-admin-outer {
|
||||||
padding-right: 41px;
|
padding-right: 41px;
|
||||||
|
|
||||||
|
#Root_Main {
|
||||||
|
margin-right: 15px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
&.cms-content-tools {
|
&.cms-content-tools {
|
||||||
|
Loading…
Reference in New Issue
Block a user