import React, { PropTypes, Component } from 'react'; import NovaForm from "meteor/nova:forms"; import SmartContainers from "meteor/utilities:react-list-container"; const DocumentContainer = SmartContainers.DocumentContainer; import Core from "meteor/nova:core"; const Messages = Core.Messages; import Actions from "../actions.js"; class PostEditForm extends Component{ constructor() { super(); this.deletePost = this.deletePost.bind(this); } deletePost() { const post = this.props.post; if (window.confirm(`Delete post “${post.title}”?`)) { Actions.call('posts.deleteById', post._id, function(){ Messages.flash(`Post “${post.title}” deleted.`, "success"); Events.track("post deleted", {'_id': post._id}); }); } } render() { ({FlashMessages} = Telescope.components); return (

Edit Post

Delete Post
Telescope.utils.getFieldLabel(fieldName, Posts) }} />
) } } PostEditForm.propTypes = { post: React.PropTypes.object.isRequired } PostEditForm.contextTypes = { currentUser: React.PropTypes.object }; module.exports = PostEditForm; export default PostEditForm;