       TaskPlanActions.delete(id)
       @context.router.transitionTo('dashboard')
 
+  onCancel: ->
+    {id} = @props
+    if confirm('Are you sure you want to cancel?')
+      TaskPlanActions.reset(id)
+      @context.router.transitionTo('dashboard')
+
   onViewStats: ->
     {id, courseId} = @props
     @context.router.transitionTo('viewStats', {courseId, id, type: 'homework'})

    if deleteable
      deleteLink = <BS.Button bsStyle='link' className='-delete' onClick={@onDelete}>Delete</BS.Button>

    if TaskPlanStore.isHomework(id) and not TaskPlanStore.isPublished(id)
      selectProblems = <BS.Button 
        bsStyle='primary' 
        className='-select-problems'

      {selectProblems}
      {publishButton}
      {deleteLink}
      <BS.Button aria-role='close' onClick={@onCancel}>Cancel</BS.Button>
    </span>

module.exports = PlanFooter
