Better styling for object controls

This commit is contained in:
Mathias Biilmann Christensen
2016-10-28 10:21:13 +02:00
parent 6b73c39ba8
commit 86e3aed065
6 changed files with 57 additions and 59 deletions

View File

@ -87,7 +87,31 @@
}
});
var GeneralPreview = createClass({
render: function() {
var entry = this.props.entry;
var title = entry.getIn(['data', 'site_title']);
var posts = entry.getIn(['data', 'posts']);
var thumb = posts && posts.get('thumb');
return h('div', {},
h('h1', {}, title),
h('dl', {},
h('dt', {}, 'Posts on Frontpage'),
h('dd', {}, posts && posts.get('front_limit') || '0'),
h('dt', {}, 'Default Author'),
h('dd', {}, posts && posts.get('author') || 'None'),
h('dt', {}, 'Default Thumbnail'),
h('dd', {}, thumb && h('img', {src: this.props.getMedia(thumb).toString()}))
)
);
}
});
CMS.registerPreviewTemplate("posts", PostPreview);
CMS.registerPreviewTemplate("general", GeneralPreview);
CMS.registerPreviewStyle("/example.css");
CMS.registerEditorComponent({
id: "youtube",