       cssClass : 'compact solid green upload'
       title    : 'UPLOAD IMAGE'
       loader   : yes
+
+    section.addSubView @removeLogoButton = new KDButtonView
+      cssClass : 'compact solid black remove'
+      title    : 'REMOVE LOGO'
+      loader   : yes
+      callback : @bound 'removeLogo'
 
     section.addSubView @uploadInput = new KDInputView
       type       : 'file'


  createAvatarUploadForm: ->

    @addSubView section = @createSection
      name : 'avatar-upload'

    section.addSubView @avatar = new KDCustomHTMLView


      return showError err   if err

      group.modify { 'customize.logo': url }, => @showLogo url


  showLogo: (url) ->

    @avatar.getElement().style.backgroundImage = "url(#{url})"
    @uploadSection.setClass 'with-logo'


  showPattern: ->

    avatarEl = @avatar.getElement()
    pattern  = geoPattern.generate @getData().slug, generator: 'plusSigns'

    avatarEl.style.backgroundImage = pattern.toDataUrl()
    avatarEl.style.borderColor     = pattern.color
    @uploadSection.unsetClass 'with-logo'


  showAvatar: ->

    logo = @getData().customize?.logo

    if logo then @showLogo logo else @showPattern()


  removeLogo: ->

    @getData().modify { 'customize.logo': '' }, =>
      @showPattern()
      @removeLogoButton.hideLoader()


  createDeletionForm: ->
