add skill and position

This commit is contained in:
king199025
2018-10-12 14:52:08 +03:00
parent c9db4cd49b
commit 369cf94f23
52 changed files with 1129 additions and 62 deletions

View File

@ -1,5 +1,6 @@
<?php
use kartik\select2\Select2;
use mihaildev\elfinder\InputFile;
use unclead\multipleinput\MultipleInput;
use unclead\multipleinput\examples\models\ExampleModel;
@ -103,12 +104,32 @@ use yii\widgets\ActiveForm;
<div class="row">
<div class="col-xs-6">
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'salary')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-6">
<?= $form->field($model, 'position_id')->dropDownList(
\yii\helpers\ArrayHelper::map(\backend\modules\settings\models\Position::find()->all(), 'id', 'name'),
['prompt' => '...']
) ?>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'skill')->widget(Select2::class,
[
'data' => \yii\helpers\ArrayHelper::map(\common\models\Skill::find()->all(),'id', 'name'),
'options' => ['placeholder' => '...','class' => 'form-control', 'multiple' => true],
'pluginOptions' => [
'allowClear' => true
],
]
)->label('Навыки'); ?>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [
@ -119,7 +140,7 @@ use yii\widgets\ActiveForm;
'type' => 'dropDownList',
'title' => 'Поле',
'defaultValue' => null,
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\fields\models\AdditionalFields::find()
'items' => \yii\helpers\ArrayHelper::map(\backend\modules\settings\models\AdditionalFields::find()
->joinWith('useFields')
->where(['`use_field`.`use`' => \common\models\UseStatus::USE_PROFILE])
->all(),

View File

@ -6,6 +6,8 @@ use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model backend\modules\card\models\UserCard */
/* @var $skills \common\models\CardSkill */
/* @var $skill \common\models\Skill */
$this->title = $model->fio;
$this->params['breadcrumbs'][] = ['label' => 'User Cards', 'url' => ['index']];
@ -23,21 +25,21 @@ $this->params['breadcrumbs'][] = $this->title;
'fio',
'passport',
[
'label' => 'Photo',
'attribute' => 'Photo',
'format' => 'raw',
'value' => function($model){
return Html::tag('img', null, ['src' => $model->photo, 'width' => '100px']);
}
],
[
'label' => 'Resume',
'attribute' => 'Resume',
'format' => 'raw',
'value' => function($model){
return Html::a('Скачать', $model->resume, ['target' => '_blank']);
}
],
[
'label' => 'gender',
'attribute' => 'gender',
'value' => $model->gendersText,
],
@ -45,15 +47,24 @@ $this->params['breadcrumbs'][] = $this->title;
'dob',
[
'label' => 'status',
'attribute' => 'status',
'value' => $model->status0->name,
],
'salary',
[
'attribute' => 'position_id',
'value' => $model->position->name,
],
'created_at',
'updated_at',
],
]) ?>
<h2>Навыки</h2>
<?php foreach ($skills as $skill): ?>
<span class="btn btn-default btn-sm"><?= $skill['skill']->name; ?></span>
<?php endforeach; ?>
<h2>Дополнительные сведения</h2>
<?= GridView::widget([