vc_text admin

This commit is contained in:
andrey 2021-06-25 13:24:32 +03:00
parent 998e4c4336
commit 1a4f0b6d5e
7 changed files with 237 additions and 5 deletions

View File

@ -1,5 +1,6 @@
<?php
use asmoday74\ckeditor5\EditorClassic;
use common\classes\Debug;
use kartik\select2\Select2;
use mihaildev\elfinder\InputFile;
@ -145,6 +146,12 @@ use yii\widgets\ActiveForm;
</div>
</div>
<?= $form->field($model, 'vc_text')->widget(EditorClassic::className(),[
'clientOptions' => [
'language' => 'ru',
]
]); ?>
<div class="row">
<div class="col-xs-12">
<?= $form->field($model, 'fields')->widget(MultipleInput::class, [

View File

@ -69,6 +69,10 @@ $this->params['breadcrumbs'][] = $this->title;
],
'created_at',
'updated_at',
[
'attribute' => 'vc_text',
'format' => 'raw'
]
],
]) ?>
@ -77,6 +81,7 @@ $this->params['breadcrumbs'][] = $this->title;
<?php foreach ($skills as $skill) : ?>
<span class="btn btn-default btn-sm"><?= $skill['skill']->name; ?></span>
<?php endforeach; ?>
<h2>Дополнительные сведения</h2>
<?= GridView::widget([

View File

@ -26,6 +26,7 @@ use yii\helpers\ArrayHelper;
* @property string $deleted_at
* @property string $resume
* @property string $salary
* @property string $vc_text
* @property int $position_id
* @property int $city
*
@ -67,7 +68,7 @@ class UserCard extends \yii\db\ActiveRecord
return [
[['fio', 'status', 'gender', 'email'], 'required'],
[['gender', 'status', 'position_id', 'id_user'], 'integer'],
[['dob', 'created_at', 'updated_at', 'deleted_at'], 'safe'],
[['dob', 'created_at', 'updated_at', 'deleted_at', 'vc_text'], 'safe'],
[['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']],
@ -99,6 +100,7 @@ class UserCard extends \yii\db\ActiveRecord
'city' => 'Город',
'link_vk' => 'VK',
'link_telegram' => 'Telegram',
'vc_text' => 'Резюме текст'
];
}

View File

@ -30,7 +30,8 @@
"2amigos/yii2-file-upload-widget": "~1.0",
"kartik-v/yii2-grid": "dev-master",
"kartik-v/yii2-widget-datetimepicker": "dev-master",
"edofre/yii2-fullcalendar-scheduler": "V1.1.12"
"edofre/yii2-fullcalendar-scheduler": "V1.1.12",
"asmoday74/yii2-ckeditor5": "*"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",

156
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "fa1395e986b21ee60c85db006a32bcc9",
"content-hash": "720b3677e423d8946aeb7857883c7328",
"packages": [
{
"name": "2amigos/yii2-file-upload-widget",
@ -168,6 +168,46 @@
],
"time": "2019-08-29T08:20:20+00:00"
},
{
"name": "asmoday74/yii2-ckeditor5",
"version": "1.0.2",
"source": {
"type": "git",
"url": "https://github.com/asmoday74/yii2-ckeditor5.git",
"reference": "d5cb38abfc6afd9f0a8729662897ecefc83b18a6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/asmoday74/yii2-ckeditor5/zipball/d5cb38abfc6afd9f0a8729662897ecefc83b18a6",
"reference": "d5cb38abfc6afd9f0a8729662897ecefc83b18a6",
"shasum": ""
},
"require": {
"yiisoft/yii2": "~2.0.0"
},
"type": "yii2-extension",
"autoload": {
"psr-4": {
"asmoday74\\ckeditor5\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Maksim Klimov"
}
],
"description": "CKEditor 5 WYSIWYG widget for Yii2",
"keywords": [
"ckeditor 5",
"extension",
"yii2"
],
"time": "2019-09-24T20:23:27+00:00"
},
{
"name": "bower-asset/blueimp-canvas-to-blob",
"version": "v3.16.0",
@ -227,7 +267,7 @@
"version": "v2.24.0",
"source": {
"type": "git",
"url": "git@github.com:blueimp/JavaScript-Load-Image.git",
"url": "https://github.com/blueimp/JavaScript-Load-Image.git",
"reference": "1196b4ce3c56f01cacf90fc5527b324ecccdf3b0"
},
"dist": {
@ -242,7 +282,7 @@
"version": "v3.13.0",
"source": {
"type": "git",
"url": "git@github.com:blueimp/JavaScript-Templates.git",
"url": "https://github.com/blueimp/JavaScript-Templates.git",
"reference": "07b3dd455b971cf5d087fc86889fcadae48ab2fc"
},
"dist": {
@ -634,6 +674,59 @@
],
"time": "2019-07-30T19:33:28+00:00"
},
{
"name": "edofre/yii2-fullcalendar-scheduler",
"version": "V1.1.12",
"source": {
"type": "git",
"url": "https://github.com/Edofre/yii2-fullcalendar-scheduler.git",
"reference": "36a2fe9e1bbb51d290423cbca87f3f12d00e9198"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Edofre/yii2-fullcalendar-scheduler/zipball/36a2fe9e1bbb51d290423cbca87f3f12d00e9198",
"reference": "36a2fe9e1bbb51d290423cbca87f3f12d00e9198",
"shasum": ""
},
"require": {
"npm-asset/fullcalendar": "v3.8.0",
"npm-asset/fullcalendar-scheduler": "1.9.1",
"php": ">=5.5.0",
"yiisoft/yii2": ">=2.0.9",
"yiisoft/yii2-jui": ">=2.0.6"
},
"type": "yii2-extension",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"autoload": {
"psr-4": {
"edofre\\fullcalendarscheduler\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Edo Freriks",
"email": "edofre@gmail.com"
}
],
"description": "Yii2 widget for fullcalendar scheduler module",
"homepage": "https://github.com/edofre/yii2-fullcalendar-scheduler",
"keywords": [
"calendar",
"event",
"fullcalendar-scheduler",
"javascript",
"scheduler"
],
"time": "2018-03-28T09:19:09+00:00"
},
{
"name": "egulias/email-validator",
"version": "2.1.11",
@ -1396,6 +1489,63 @@
],
"time": "2017-03-28T08:57:15+00:00"
},
{
"name": "npm-asset/fullcalendar",
"version": "3.8.0",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/fullcalendar/-/fullcalendar-3.8.0.tgz"
},
"require": {
"npm-asset/jquery": ">=2,<4.0",
"npm-asset/moment": ">=2.9.0,<3.0.0"
},
"type": "npm-asset",
"license": [
"MIT"
]
},
{
"name": "npm-asset/fullcalendar-scheduler",
"version": "1.9.1",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/fullcalendar-scheduler/-/fullcalendar-scheduler-1.9.1.tgz"
},
"require": {
"npm-asset/fullcalendar": "~3.8.0",
"npm-asset/jquery": ">=2,<4.0",
"npm-asset/moment": ">=2.9.0,<3.0.0"
},
"type": "npm-asset",
"license": [
"SEE LICENSE IN LICENSE.md"
]
},
{
"name": "npm-asset/jquery",
"version": "3.6.0",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/jquery/-/jquery-3.6.0.tgz"
},
"type": "npm-asset",
"license": [
"MIT"
]
},
{
"name": "npm-asset/moment",
"version": "2.29.1",
"dist": {
"type": "tar",
"url": "https://registry.npmjs.org/moment/-/moment-2.29.1.tgz"
},
"type": "npm-asset",
"license": [
"MIT"
]
},
{
"name": "rmrevin/yii2-fontawesome",
"version": "2.17.1",

View File

@ -0,0 +1,25 @@
<?php
use yii\db\Migration;
/**
* Handles adding columns to table `{{%user_card}}`.
*/
class m210625_094710_add_vc_text_column_to_user_card_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->addColumn('{{%user_card}}', 'vc_text', $this->text());
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->dropColumn('{{%user_card}}', 'vc_text');
}
}

View File

@ -0,0 +1,42 @@
<?php
use yii\db\Migration;
/**
* Class m210625_101825_alter_columns_in_change_history_table
*/
class m210625_101825_alter_columns_in_change_history_table extends Migration
{
/**
* {@inheritdoc}
*/
public function safeUp()
{
$this->alterColumn('change_history', 'old_value', $this->text());
$this->alterColumn('change_history', 'new_value', $this->text());
}
/**
* {@inheritdoc}
*/
public function safeDown()
{
$this->alterColumn('change_history', 'old_value', $this->string(255));
$this->alterColumn('change_history', 'new_value', $this->string(255));
}
/*
// Use up()/down() to run migration code without a transaction.
public function up()
{
}
public function down()
{
echo "m210625_101825_alter_columns_in_change_history_table cannot be reverted.\n";
return false;
}
*/
}