Better styling for object controls
This commit is contained in:
@ -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",
|
||||
|
Reference in New Issue
Block a user