import React, { PropTypes, Component } from 'react'; import { FormattedMessage, intlShape } from 'react-intl'; import NovaForm from "meteor/nova:forms"; import { DocumentContainer } from "meteor/utilities:react-list-container"; import { Messages } from "meteor/nova:core"; import Actions from "../actions.js"; class PostsEditForm extends Component{ constructor() { super(); this.deletePost = this.deletePost.bind(this); } deletePost() { const post = this.props.post; const deletePostConfirm = this.context.intl.formatMessage({id: "posts.delete_confirm"}, {title: post.title}); const deletePostSuccess = this.context.intl.formatMessage({id: "posts.delete_success"}, {title: post.title}); if (window.confirm(deletePostConfirm)) { Actions.call('posts.deleteById', post._id, (error, result) => { Messages.flash(deletePostSuccess, "success"); Events.track("post deleted", {'_id': post._id}); }); } } renderAdminArea() { return (