Moved the delete and unpublish confirmation JavaScript back to the view.