예제 #1
0
                        </div>
                        <?php 
    }
    ?>
                    <div class="actions">
                        <?php 
    if (!$Comment->isDeleted()) {
        if ($Comment->canCreate()) {
            echo Html::a(FA::icon('reply') . ' ' . Yii::t('app', 'Reply'), '#', ['class' => 'btn btn-info btn-xs', 'data-role' => 'reply']);
        }
        if ($Comment->canUpdate()) {
            echo Html::a(FA::icon('pencil') . ' ' . Yii::t('app', 'Edit'), '#', ['data-role' => 'edit', 'class' => 'btn btn-primary btn-xs']);
        }
        if ($Comment->canDelete()) {
            echo Html::a(FA::icon('times') . ' ' . Yii::t('app', 'Delete'), ['', 'delete-comment' => $Comment->id], ['class' => 'btn btn-danger btn-xs']);
        }
    }
    ?>
                    </div>
                </div>
            </div>
            <?php 
    return ob_get_clean();
}]);
/** @var Comments\models\Comment $CommentModel */
$CommentModel = \Yii::createObject(Comments\Module::instance()->model('comment'));
if ($CommentListWidget->showCreateForm && $CommentModel::canCreate()) {
    echo Html::tag('h3', Yii::t('app', 'Add comment'), ['class' => 'comment-title']);
    echo Comments\widgets\CommentFormWidget::widget(['theme' => $CommentListWidget->theme, 'entity' => $CommentListWidget->entity, 'Comment' => $CommentModel, 'anchor' => $CommentListWidget->anchorAfterUpdate]);
}
$CommentListWidget->getView()->registerJs('jQuery("#' . $CommentListWidget->options['id'] . '").yiiCommentsList(' . Json::encode($comments) . ');');
예제 #2
0
                        <div class="edit">
                            <?php 
        echo Comments\widgets\CommentFormWidget::widget(['entity' => $CommentListWidget->entity, 'Comment' => $Comment]);
        ?>
                        </div>
                    <?php 
    }
    ?>
                    <div class="actions">
                        <?php 
    if (!$Comment->isDeleted()) {
        echo Html::a(FA::icon('reply') . ' ' . Yii::t('app', 'Reply'), '#', ['class' => 'btn btn-info btn-xs', 'data-role' => 'reply']);
        if ($Comment->canUpdate()) {
            echo Html::a(FA::icon('pencil') . ' ' . Yii::t('app', 'Edit'), '#', ['data-role' => 'edit', 'class' => 'btn btn-primary btn-xs']);
        }
        if ($Comment->canDelete()) {
            echo Html::a(FA::icon('times') . ' ' . Yii::t('app', 'Delete'), ['', 'delete-comment' => $Comment->id], ['class' => 'btn btn-danger btn-xs']);
        }
    }
    ?>
                    </div>
                </div>
            </div>
            <?php 
    return ob_get_clean();
}]);
if ($CommentListWidget->showCreateForm && Comments\models\Comment::canCreate()) {
    echo Html::tag('h3', Yii::t('app', 'Add comment'), ['class' => 'comment-title']);
    echo Comments\widgets\CommentFormWidget::widget(['entity' => $CommentListWidget->entity, 'Comment' => new Comments\models\Comment()]);
}
$CommentListWidget->view->registerJs('jQuery("#' . $CommentListWidget->options['id'] . '").yiiCommentsList(' . Json::encode($comments) . ');');