2019-11-18 13:06:54 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use yii\grid\GridView;
|
|
|
|
use yii\helpers\Html;
|
|
|
|
use yii\widgets\DetailView;
|
|
|
|
|
|
|
|
/* @var $this yii\web\View */
|
|
|
|
/* @var $skills \common\models\CardSkill */
|
|
|
|
/* @var $skill \common\models\Skill */
|
2021-09-13 13:37:59 +03:00
|
|
|
/* @var $achievements \common\models\Achievement */
|
2019-11-18 13:06:54 +03:00
|
|
|
/* @var $modelFildValue yii\data\ActiveDataProvider */
|
2020-09-09 16:37:35 +03:00
|
|
|
/* @var $model */
|
2019-11-18 13:06:54 +03:00
|
|
|
|
2019-11-18 16:14:06 +03:00
|
|
|
$this->title = 'Профиль';
|
2019-11-18 13:06:54 +03:00
|
|
|
?>
|
|
|
|
<div class="user-card-view">
|
|
|
|
<h3>Личная информация</h3>
|
|
|
|
<?php
|
2020-09-09 16:37:35 +03:00
|
|
|
echo Html::a('Изменить профиль', ['/card/user-card/update'], ['class' => 'btn btn-success'])
|
|
|
|
. ' ' . Html::a('Изменить пароль', ['/card/user-card/password'], ['class' => 'btn btn-success']) . '<br><br>';
|
|
|
|
|
2020-01-22 12:18:03 +03:00
|
|
|
echo DetailView::widget([
|
2019-11-18 13:06:54 +03:00
|
|
|
'model' => $model,
|
|
|
|
'attributes' => [
|
|
|
|
['label' => 'ФИО', 'attribute' => 'fio',],
|
|
|
|
['label' => 'Email', 'attribute' => 'email',],
|
|
|
|
['label' => 'Дата рождения', 'attribute' => 'dob',],
|
|
|
|
[
|
|
|
|
'attribute' => 'position_id',
|
|
|
|
'value' => (isset($model->position->name)) ? $model->position->name : 'Без должности',
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]);
|
|
|
|
?>
|
|
|
|
<h2>Навыки</h2>
|
|
|
|
|
|
|
|
<?php foreach ($skills as $skill) : ?>
|
|
|
|
<span class="btn btn-default btn-sm"><?= $skill['skill']->name; ?></span>
|
|
|
|
<?php endforeach; ?>
|
2019-11-18 16:14:06 +03:00
|
|
|
|
2021-09-13 13:37:59 +03:00
|
|
|
<h2>Достижения</h2>
|
|
|
|
<?php foreach ($achievements as $achievement) : ?>
|
|
|
|
<a target="_blank"
|
|
|
|
href="<? echo \yii\helpers\Url::to(['/achievements/achievements/view', 'id' => $achievement['achievement']->id]);?>"
|
|
|
|
class="btn btn-default btn-sm">
|
|
|
|
<?= Html::tag('img', null,
|
|
|
|
['src' => $achievement['achievement']->img, 'height' => '50px','width' => '50px', 'alt'=> $achievement['achievement']->title]
|
|
|
|
) ?>
|
|
|
|
<?= $achievement['achievement']->title; ?>
|
|
|
|
</a>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
2019-11-18 13:06:54 +03:00
|
|
|
<h2>Дополнительные сведения</h2>
|
|
|
|
|
|
|
|
<?= GridView::widget([
|
|
|
|
'dataProvider' => $modelFildValue,
|
|
|
|
'layout' => "{items}",
|
|
|
|
'columns' => [
|
|
|
|
'field.name:text:Поле',
|
|
|
|
[
|
|
|
|
'attribute' => 'value',
|
|
|
|
'format' => 'raw',
|
|
|
|
'value' => function ($model) {
|
|
|
|
if ($model->type_file == 'file') {
|
|
|
|
return $model->value . ' (' . Html::a('Скачать', $model->value, ['target' => '_blank', 'download' => 'download']) . ')';
|
|
|
|
}
|
|
|
|
return $model->value;
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
]); ?>
|
|
|
|
</div>
|