add portfolio projects

This commit is contained in:
iIronside
2022-12-27 11:45:28 +03:00
parent 24e3dce192
commit 74214f090e
10 changed files with 407 additions and 11 deletions

View File

@ -223,6 +223,60 @@ use yii\widgets\ActiveForm;
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'portfolioProjects')->widget(MultipleInput::class, [
'cloneButton' => true,
'columns' => [
[
'name' => 'title',
'type' => 'textInput',
'title' => 'Название',
'defaultValue' => null,
'options' => ['prompt' => 'Заполните']
],
[
'name' => 'description',
'type' => 'textarea',
'title' => 'Описание',
'defaultValue' => null,
'options' => [
'prompt' => 'Заполните',
'rows' => '3'
]
],
[
'name' => 'main_stack',
'type' => 'dropDownList',
'title' => 'Основная технология',
'defaultValue' => null,
'items' => \yii\helpers\ArrayHelper::map(
\backend\modules\settings\models\Skill::find()->all(),
'id',
'name'
),
'options' => ['prompt' => 'Выберите']
],
[
'name' => 'additional_stack',
'type' => 'textInput',
'title' => 'Используемые технологии',
'defaultValue' => null,
'options' => ['prompt' => 'Заполните']
],
[
'name' => 'link',
'type' => 'textInput',
'title' => 'Ссылка',
'defaultValue' => null,
'options' => ['prompt' => 'Заполните']
],
],
])->label('Проекты в портфолио');
?>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [

View File

@ -1,7 +1,6 @@
<?php
use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
use yii\widgets\DetailView;
@ -14,6 +13,7 @@ use yii\widgets\DetailView;
/* @var $achievement \common\models\Achievement */
/* @var $modelFieldValue yii\data\ActiveDataProvider */
/* @var $changeDataProvider yii\data\ActiveDataProvider */
/* @var $portfolioProjects yii\data\ActiveDataProvider */
$this->title = $model->fio;
$this->params['breadcrumbs'][] = ['label' => 'Профили', 'url' => ['index']];
@ -127,6 +127,22 @@ $this->params['breadcrumbs'][] = $this->title;
</a>
<?php endforeach; ?>
<h2>Проекты в портфолио</h2>
<?= GridView::widget([
'dataProvider' => $portfolioProjects,
'layout' => "{items}",
'columns' => [
'title',
'description',
[
'attribute' => 'main_stack',
'value' => 'skill.name'
],
'additional_stack',
'link:url',
],
]); ?>
<h2>Дополнительные сведения</h2>
<?= GridView::widget([