title = 'Команда';
$this->params[ 'breadcrumbs' ][] = $this->title;
?>
= $this->title ?>
= Html::a(Yii::t('app', 'Добавить'), [ 'team-create' ], [ 'class' => 'btn btn-success' ]) ?>
= GridView::widget([
'options' => [ 'class' => 'style admin-all-pages-wr' ],
'dataProvider' => $dataProvider,
'filterModel' => $searchModel,
'columns' => [
[
'attribute' => 'team_id',
'label' => 'ID',
],
[
'attribute' => 'user',
'label' => 'ФИО',
],
[
'attribute' => 'link',
'format' => 'boolean',
'label' => 'Участник МФП',
'filter' => [
1 => 'Да',
0 => 'Нет',
],
],
[
'attribute' => 'department',
'value' => 'department.name',
'label' => 'Отдел компании',
'filter' => $departments,
],
'position',
[
'attribute' => 'experience_from',
'value' => function($model, $key, $index, $column) {
if(!empty($model->experience_from)) {
return \Yii::$app->formatter->asDate(time(), 'yyyy') - $model->experience_from;
} else {
return 'Год начала не задан';
}
},
'label' => 'Опыт, лет',
'filter' => "
",
],
'country_id',
[
'class' => 'yii\grid\ActionColumn',
'buttons' => [
'update' => function($url, $model, $key) {
return Html::a('
', [
'team-update',
'id' => $model->team_id,
], [
'title' => 'Редактировать',
]);
},
'delete' => function($url, $model, $key) {
return Html::a('
', [
'team-delete',
'id' => $model->team_id,
], [
'title' => 'Удалить',
'aria-label' => 'Удалить',
'data-confirm' => 'Вы уверены, что хотите удалить этот элемент?',
'data-method' => 'post',
'data-pjax' => '0',
]);
},
],
'template' => '{update} {delete}',
],
],
]); ?>