Переместил резюме

This commit is contained in:
anatolidew 2021-12-10 15:29:07 +03:00
parent afe743a6f3
commit 5c80f72ee5
3 changed files with 44 additions and 11 deletions

View File

@ -112,6 +112,21 @@ class UserCardController extends Controller
]);
}
public function actionResume()
{
$id_user = Yii::$app->user->id;
$result = UserCard::find()->where(['id_user' => $id_user])->asArray()->all();
if ($result) {
$id = $result[0]['id'];
$model = $this->findModel($id);
return $this->render('resume', [
'model' => $model
]);
} else {
return $this->render('index', ['info' => '<h3>Ваши личные данные не заненсены в базу.</h3>']);
}
}
/**
* Finds the Product model based on its primary key value.
* If the model is not found, a 404 HTTP exception will be thrown.

View File

@ -0,0 +1,27 @@
<?php
use asmoday74\ckeditor5\EditorClassic;
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\Url;
/* @var $this yii\web\View */
/* @var $model */
$this->title = 'Резюме';
?>
<div class="user-card-view">
<h1>Резюме</h1>
<?php $form = ActiveForm::begin(['action' => Url::base(true)]); ?>
<?= $form->field($model, 'vc_text')->widget(EditorClassic::className(), [
'clientOptions' => [
'language' => 'ru',
]
]); ?>
<div class="form-group">
<?= Html::submitButton('<i class="fas fa-save"></i> Save', ['class' => 'btn btn-success']) ?>
<?= Html::a('<i class="fas fa-long-arrow-alt-left"></i> Back', Url::base(true), ['class' => 'btn btn-primary', 'style' => 'float: right']) ?>
</div>
<?php $form = ActiveForm::end(); ?>
</div>

View File

@ -19,7 +19,8 @@ $this->title = 'Профиль';
<h3>Личная информация</h3>
<?php
echo Html::a('Изменить профиль', ['/card/user-card/update'], ['class' => 'btn btn-success'])
. '&nbsp' . Html::a('Изменить пароль', ['/card/user-card/password'], ['class' => 'btn btn-success']) . '<br><br>';
. '&nbsp' . Html::a('Изменить пароль', ['/card/user-card/password'], ['class' => 'btn btn-success'])
. '&nbsp' . Html::a('Изменить резюме', ['/card/user-card/resume'], ['class' => 'btn btn-success']). '<br><br>';
echo DetailView::widget([
'model' => $model,
@ -70,14 +71,4 @@ $this->title = 'Профиль';
],
]); ?>
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'vc_text')->widget(EditorClassic::className(), [
'clientOptions' => [
'language' => 'ru',
]
]); ?>
<div class="form-group">
<?= Html::submitButton('Save', ['class' => 'btn btn-success']) ?>
</div>
<?php $form = ActiveForm::end(); ?>
</div>