Ejemplo n.º 1
0
            <?php 
echo $form->field($model, 'user_id')->dropDownList(\common\modules\users\models\User::getUsersRoleUser(), ['prompt' => 'Выберите пользователя']);
?>
            <?php 
echo $form->field($model, 'date_create')->textInput(['class' => 'datepicker form-control']);
?>
            <?php 
echo $form->field($model, 'text')->textarea(['rows' => 5]);
?>
            <?php 
echo $form->field($model, 'show_main')->checkbox();
?>
            <?php 
echo $form->field($model, 'note')->textarea(['rows' => 3]);
?>
            <?php 
echo $form->field($model, 'status')->dropDownList(Comments::getStatusList(), array('prompt' => ''));
?>
        </div>
    </div>

    <div class="form-group">
        <?php 
echo Html::submitButton('Сохранить', ['class' => 'btn btn-primary']);
?>
    </div>
    <?php 
ActiveForm::end();
?>
</div>
Ejemplo n.º 2
0
Modal::end();
?>

    <p>
        <?php 
echo Html::a('Добавить отзыв', ['create'], ['data-original-title' => 'Новый отзыв', 'data-header' => 'Новый отзыв', 'class' => 'btn btn-success btn-xs btn-open-modal']);
?>
    </p>

    <?php 
Pjax::begin(['id' => 'comments-list', 'timeout' => 10000]);
?>
    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'user_id', 'format' => 'html', 'value' => function ($model) {
    $author = $model->author;
    return Html::a($author->firstname . ' ' . $author->lastname, ['/users/default/update', 'id' => $author->id]);
}], ['attribute' => 'object', 'format' => 'html', 'filter' => Html::activeDropDownList($searchModel, 'object', Comments::getObjects(1), ['class' => 'form-control', 'prompt' => 'Все']), 'value' => function ($model) {
    return Html::a(Comments::getObjectTitle($model->object) . ' #' . $model->object_id, ['/' . $model->object . '/default/update', 'id' => $author->id]);
}], 'date_create', 'text', 'note', ['attribute' => 'status', 'filter' => Html::activeDropDownList($searchModel, 'status', Comments::getStatusList(), ['class' => 'form-control', 'prompt' => 'Все']), 'value' => function ($model) {
    return $model->getStatusTitle();
}], 'show_main', ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['style' => 'width:70px'], 'template' => '{update} {delete}', 'buttons' => ['update' => function ($url, $model) {
    return Html::a('<i class="fa fa-edit"></i>', $url, ['data-original-title' => 'Редактировать', 'class' => 'btn btn-info btn-minier tooltip-info  btn-open-modal', 'data-header' => 'Редактирование', 'data-rel' => 'tooltip']);
}, 'delete' => function ($url, $model) {
    return Html::a('<i class="fa fa-trash"></i>', $url, ['data-original-title' => 'Удалить', 'class' => 'btn btn-danger btn-minier tooltip-error', 'data-rel' => 'tooltip', 'data-confirm' => "Вы уверены, что хотите удалить этого пользователя?", 'data-method' => 'post', 'data-pjax' => 0]);
}]]]]);
?>
    <?php 
Pjax::end();
?>
</div>