social links on user card

This commit is contained in:
vladrigos 2020-08-05 15:34:23 +03:00
parent 38069c57d4
commit 50d539488f
4 changed files with 40 additions and 1 deletions

View File

@ -70,6 +70,12 @@ use yii\widgets\ActiveForm;
<div class="col-xs-6">
<?= $form->field($model, 'city')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-3">
<?= $form->field($model, 'link_vk')->textInput(['maxlength' => true]) ?>
</div>
<div class="col-xs-3">
<?= $form->field($model, 'link_telegram')->textInput(['maxlength' => true]) ?>
</div>
</div>
<div class="row">

View File

@ -52,6 +52,10 @@ $this->params['breadcrumbs'][] = $this->title;
'email:email',
'link_vk:url',
'link_telegram:url',
'dob',
[
'attribute' => 'status',

View File

@ -68,7 +68,7 @@ class UserCard extends \yii\db\ActiveRecord
[['fio', 'status', 'gender', 'email'], 'required'],
[['gender', 'status', 'position_id', 'id_user'], 'integer'],
[['dob', 'created_at', 'updated_at', 'deleted_at'], 'safe'],
[['fio', 'passport', 'photo', 'email', 'resume', 'city'], 'string', 'max' => 255],
[['fio', 'passport', 'photo', 'email', 'resume', 'city', 'link_vk', 'link_telegram'], 'string', 'max' => 255],
[['salary'], 'string', 'max' => 100],
[['position_id'], 'exist', 'skipOnError' => true, 'targetClass' => Position::class, 'targetAttribute' => ['position_id' => 'id']],
[['status'], 'exist', 'skipOnError' => true, 'targetClass' => Status::class, 'targetAttribute' => ['status' => 'id']],
@ -97,6 +97,8 @@ class UserCard extends \yii\db\ActiveRecord
'salary' => 'Зарплата',
'position_id' => 'Должность',
'city' => 'Город',
'link_vk' => 'VK',
'link_telegram' => 'Telegram',
];
}

View File

@ -0,0 +1,27 @@
<?php
use yii\db\Migration;
/**
* Class m200805_113316_add_columns_links_to_user_card_table
*/
class m200805_113316_add_columns_links_to_user_card_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('user_card', 'link_vk', $this->string(255));
$this->addColumn('user_card', 'link_telegram', $this->string(255));
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('user_card', 'link_vk');
$this->dropColumn('user_card', 'link_telegram');
}
}