         messages    :
           required  : "Please type a #{itemTypeString}..."
       callback      : @bound "commentInputReceivedEnter"
+
+    @commentFormWrapper = new KDView
+      cssClass    : "item-add-comment-form"
+
+    @commentFormWrapper.addSubView @commentInput
+
+  viewAppended:->
+    {editable} = @getOptions()
+    unless editable
+      @addSubView commenterAvatar = new AvatarStaticView
+        size    :
+          width : 35
+          height: 35
+      , KD.whoami()
+
+    @addSubView @commentFormWrapper
 
     @attachListeners()
 

    options.type           or= "new-comment"
    options.cssClass       or= "item-add-comment-box"
    options.itemTypeString or= 'comment'

    super options, data

  viewAppended:->

    @addSubView commenterAvatar = new AvatarStaticView
      size    :
        width : 35
        height: 35
    , KD.whoami()

    @addSubView commentFormWrapper = new KDView
      cssClass    : "item-add-comment-form"

    {itemTypeString} = @getOptions()

    commentFormWrapper.addSubView @commentInput = new KDHitEnterInputView
      type          : "textarea"
      delegate      : this
      placeholder   : "Type your #{itemTypeString} and hit enter..."

  commentInputReceivedEnter:(instance,event)->
    KD.requireMembership
      callback  : =>
        {editable} = @getOptions()
        reply = @commentInput.getValue()
        @commentInput.setValue ''
        @commentInput.resize()
        @commentInput.blur()
        @commentInput.$().blur()
        unless editable then @getDelegate().emit 'CommentSubmitted', reply
        else @getDelegate().emit 'CommentUpdated', reply


        KD.mixpanel "Comment activity, click", reply.length
      onFailMsg : "Login required to post a comment!"
      tryAgain  : yes
      groupName : @getDelegate().getData().group

class EditCommentForm extends NewCommentForm

  constructor:(options = {}, data)->
    options.editable = yes
    super options, data

    @commentFormWrapper.addSubView new KDCustomHTMLView
      pistachio: "Press Esc to cancel"

    @commentInput.setValue data.body
    @commentInput.on "EscapePerformed", @bound "cancel"
    @commentInput.setFocus()

  cancel: ->
    @getDelegate().emit "CommentUpdateCancelled"