title = Yii::t('app', 'Projects');
$this->params[ 'breadcrumbs' ][] = $this->title;
?>
= Html::a(Yii::t('app', 'add'), [ 'projects-create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([
'options' => ['class'=>'style admin-all-pages-wr'],
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'project_id',
'label' => 'ID',
],
'name',
[
'attribute' => 'date_add',
'filter' => "
".
DatePicker::widget([
'model' => $searchModel,
'attribute' => 'date_add_from',
'language' => 'ru',
'dateFormat' => 'yyyy-MM-dd',
'clientOptions' => [
'changeYear' => true,
'changeMonth' => true,
],
]).
"
".
DatePicker::widget([
'model' => $searchModel,
'attribute' => 'date_add_to',
'language' => 'ru',
'dateFormat' => 'yyyy-MM-dd',
'clientOptions' => [
'changeYear' => true,
'changeMonth' => true,
],
])
."
",
'format' => 'html',
],
[
'attribute' => 'budget',
'filter' => Html::activeInput('text', $searchModel, 'budget_approx', ['class'=>'form-control']),
'content' => function($model, $key, $index, $column) {
/**
* @var Project $model
*/
if($model->contractual) {
return 'Договорной';
} elseif(empty($model->budget)) {
return 'Не задано';
} else {
return $model->budget;
}
},
'label' => $searchModel->getAttributeLabel('budget').' +/- 10%',
],
[
'attribute' => 'contractual',
'filter' => Html::activeDropDownList($searchModel, 'contractual',[1 => 'Только договорные', 2 => 'Без договорных'], ['prompt' => 'Все', 'class'=>'form-control']),
'value' => function($model) {
return \Yii::$app->formatter->asBoolean($model->contractual);
}
],
'city',
[
'attribute' => 'specializationString',
],
'view_count',
[
'value' => function($model, $key, $index, $column) {
return count($model->comments);
},
'label' => 'Отклики',
],
[
'class' => ActionColumn::className(),
'buttons' => [
'update' => function($url, $model, $key) {
return Html::a('

', [
'projects-update',
'id' => $model->project_id,
],[
'title' => 'Редактировать',
]);
},
'delete' => function($url, $model, $key) {
return Html::a('

', [
'projects-delete',
'id' => $model->project_id,
], [
'title' => Yii::t('app', 'delete'),
'aria-label' => Yii::t('app', 'delete'),
'data-confirm' => Yii::t('app', 'delete_confirm'),
'data-method' => 'post',
'data-pjax' => '0',
]);
},
],
'template' => '{update} {delete}',
],
],
]); ?>