<?
$item = $this->item;
$formAction = $this->formAction ? $this->formAction : $this->uri('/blog/comment/');
?>

<?if($item['commentStatus'] == 'open'):?>
<?if($item['commentType'] == 'local'):?>

<?
$form = new Blog\Form\CommentCreateForm();
$form
->setView($this)
->useSubFormGroup()
->setMethod('post')
->setAction($formAction);
?>

<form <?=$this->formAttr($form)?> class="form">
    <?=$form->restful();?>
    <?=$form->helper('id', array('class' => ''))?>
    <?=$form->helper('codeType', 'formHidden', array('value' => 'markdown'))?>        
    <?=$form->helper('parentId', 'formHidden', array('value' => ''))?>        
    <?=$form->helper('post_id', array('value' => $item['id']))?>
    <div class="control-group <?=$form->isError('content') ? 'error' : '';?>">
        <div class="controls">
            <?=$form->helper('content', 'formTextarea', array('class' => 'input-block-level', 'rows' => 3))?>        
            <button type="submit" class="btn btn-large"><?=$this->_('Leave Comment');?></button>
            <div class="help-block"><?=$form->helper('content', 'formElementErrors')?></div>
            <?=$this->callback()?>
        </div>
    </div>
</form>
<?elseif($item['commentType'] == 'duoshuo'):?>
<?=$this->duoshuoComment($item['id']);?>
<?elseif($item['commentType'] == 'disqus'):?>
<?=$this->disqusComment($item['id']);?>
<?elseif($item['commentType'] == 'youyan'):?>
<?=$this->youyanComment($item['id']);?>
<?elseif($item['commentType'] == 'livefyre'):?>
<?=$this->livefyreComment($item['id']);?>
<?elseif($item['commentType'] == 'denglu'):?>
<?=$this->dengluComment($item['id']);?>
<?endif?>
<?endif?>


