 
   success: (result) ->
 
-    @getOptions().success()
+    @getOptions().success @totalInvitation
     @destroy()

    { input: @input } = options

    @trailerContent = '''
      <p>Before starting to upload your file, please be sure that you have the right format.
      The file should contain Email, First Name (optional), Last Name (optional), and Role fields in the right order.
      Roles can be Admin or Member.
      </br></br>
      Here is an example:</p>

      <div class='example-csv'>
        Email, First Name, Last Name, Role </br>
        micheal@example.com, Micheal R., Crawley, Member </br>
        clora@example.com, Clora J., Ochoa, Member </br>
        randy@example.com, Randy S., Engel, Admin

    @selectAndUpload.hide()
    @sendAllInvites.show()
    @uploadingPage.updatePartial '''
      <p>
        Would you like to send an invitation to all people below
        except already invited members?
      </p>
      </br></br>
      In your files, we have found…
    '''
    { myself, admins, members, extras } = result

    memberLabel = if members.length > 1 then 'Members' else 'Member'
    adminLabel = if admins.length > 1 then 'Admins' else 'Admin'

    @totalInvitation = admins + members

    analyzeWrapperClassName = 'wrapper'
    for ex in Object.keys(extras)
      value = extras["#{ex}"]
      if value
        analyzeWrapperClassName = 'wrapper-with-extras'
        @totalInvitation = @totalInvitation + value



    @successPage.addSubView analyzeCSV = new kd.CustomHTMLView
      cssClass: 'analyzeCSV'
      partial: """
        <div class=#{analyzeWrapperClassName}>
          <div class='total'>
            #{@totalInvitation}</br>
            <label class='total-label'> Total
          </div>
          <div class='members'>
            #{members}</br>
            <label class='members-label'>#{memberLabel}
          </div>
          <div class='admins'>
            #{admins}</br>
            <label class='admins-label'>#{adminLabel}
          </div>
        </div>
      """

    analyzeCSV.addSubView extraInfo = new kd.CustomHTMLView
      cssClass: 'extras-wrapper'
    for ex in Object.keys(extras)
      value = extras["#{ex}"]
      if value
        if ex is 'alreadyMembers'
          label = if ex > 1 then 'Already Members' else 'Already Member'
        else if ex is 'notValidInvites'
          label = if ex > 1 then 'Invalid Invites' else 'Invalid Invite'
        else if ex is 'alreadyInvited'
          label = 'Already Invited'
        extraInfo.setPartial """<div class='alreadyInvited'><strong>+</strong> #{value} #{label}</div>"""


  errorAnalyzeCSV: (err) ->

    @setTitle 'Something Went Wrong'
    @loader.hide()
    @errorUploading.show()
    @errorUploading.addSubView showError = new kd.CustomHTMLView
      cssClass: 'show-error'
      partial: '''
        It seems that the file you have selected is not formatted right or has no valid data in it.
        </br></br>
      '''

    showError.addSubView fileFormat = new kd.CustomHTMLView
