Commit 26656179d3a3ed3cabf89ab3bc90fc3e0b61dac4
1 parent
3ea37908
01.03.16
Showing
2 changed files
with
135 additions
and
108 deletions
Show diff stats
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +class m160301_105759_chat extends Migration | ||
| 6 | +{ | ||
| 7 | + public function up() | ||
| 8 | + { | ||
| 9 | + $this->createTable('{{%chat}}', [ | ||
| 10 | + 'chat_id' => $this->primaryKey(), | ||
| 11 | + 'status' => $this->string(), | ||
| 12 | + 'comment' => $this->string(), | ||
| 13 | + 'from_user' => $this->integer(), | ||
| 14 | + 'to_user' => $this->integer(), | ||
| 15 | + ]); | ||
| 16 | + | ||
| 17 | + $this->addForeignKey('chat_from_user', '{{%chat}}', 'from_user', '{{%user}}', 'id', 'SET NULL', 'NO ACTION'); | ||
| 18 | + $this->addForeignKey('chat_to_user', '{{%chat}}', 'to_user', '{{%user}}', 'id', 'SET NULL', 'NO ACTION'); | ||
| 19 | + } | ||
| 20 | + | ||
| 21 | + public function down() | ||
| 22 | + { | ||
| 23 | + $this->dropForeignKey('chat_from_user', '{{%chat}}'); | ||
| 24 | + $this->dropForeignKey('chat_to_user', '{{%chat}}'); | ||
| 25 | + $this->dropTable('{{%chat}}'); | ||
| 26 | + } | ||
| 27 | +} |
frontend/views/layouts/admin.php
| @@ -12,118 +12,118 @@ use yii\widgets\Menu; | @@ -12,118 +12,118 @@ use yii\widgets\Menu; | ||
| 12 | $this->beginContent('@app/views/layouts/main.php'); | 12 | $this->beginContent('@app/views/layouts/main.php'); |
| 13 | ?> | 13 | ?> |
| 14 | <div class="section-box admin-page"> | 14 | <div class="section-box admin-page"> |
| 15 | - <div class="box-wr"> | ||
| 16 | - <div class="box-all"> | ||
| 17 | - <div class="login-right-column"> | ||
| 18 | - <div class="admin-my-page">Моя страница</div> | ||
| 19 | - <?php | ||
| 20 | - echo Menu::widget([ | ||
| 21 | - 'options' => [ | ||
| 22 | - 'class' => 'menu-admin', | ||
| 23 | - ], | ||
| 24 | - 'activeCssClass' => 'active-menu-admin', | ||
| 25 | - 'items' => [ | ||
| 26 | - [ | ||
| 27 | - 'label' => 'Учетные данные', | ||
| 28 | - 'url' => ['accounts/general'], | ||
| 29 | - 'options' => ['class' => 'admin-menu-icons admin-menu-ico-1',], | ||
| 30 | - ], | ||
| 31 | - [ | ||
| 32 | - 'label' => 'Контакты', | ||
| 33 | - 'url' => ['accounts/contacts'], | ||
| 34 | - ], | ||
| 35 | - [ | ||
| 36 | - 'label' => 'Услуги', | ||
| 37 | - 'url' => ['accounts/service'], | ||
| 38 | - ], | ||
| 39 | - [ | ||
| 40 | - 'label' => 'Трудовой стаж', | ||
| 41 | - 'url' => ['accounts/employment'], | ||
| 42 | - ], | ||
| 43 | - [ | ||
| 44 | - 'label' => 'Дополнительные навыки', | ||
| 45 | - 'url' => ['accounts/add-skills'], | ||
| 46 | - ], | ||
| 47 | - [ | ||
| 48 | - 'label' => 'Описание', | ||
| 49 | - 'url' => ['accounts/description'], | ||
| 50 | - ], | 15 | + <div class="box-wr"> |
| 16 | + <div class="box-all"> | ||
| 17 | + <div class="login-right-column"> | ||
| 18 | + <div class="admin-my-page">Моя страница</div> | ||
| 19 | + <?php | ||
| 20 | + echo Menu::widget([ | ||
| 21 | + 'options' => [ | ||
| 22 | + 'class' => 'menu-admin', | ||
| 23 | + ], | ||
| 24 | + 'activeCssClass' => 'active-menu-admin', | ||
| 25 | + 'items' => [ | ||
| 26 | + [ | ||
| 27 | + 'label' => 'Учетные данные', | ||
| 28 | + 'url' => ['accounts/general'], | ||
| 29 | + 'options' => ['class' => 'admin-menu-icons admin-menu-ico-1',], | ||
| 30 | + ], | ||
| 31 | + [ | ||
| 32 | + 'label' => 'Контакты', | ||
| 33 | + 'url' => ['accounts/contacts'], | ||
| 34 | + ], | ||
| 35 | + [ | ||
| 36 | + 'label' => 'Услуги', | ||
| 37 | + 'url' => ['accounts/service'], | ||
| 38 | + ], | ||
| 39 | + [ | ||
| 40 | + 'label' => 'Трудовой стаж', | ||
| 41 | + 'url' => ['accounts/employment'], | ||
| 42 | + ], | ||
| 43 | + [ | ||
| 44 | + 'label' => 'Дополнительные навыки', | ||
| 45 | + 'url' => ['accounts/add-skills'], | ||
| 46 | + ], | ||
| 47 | + [ | ||
| 48 | + 'label' => 'Описание', | ||
| 49 | + 'url' => ['accounts/description'], | ||
| 50 | + ], | ||
| 51 | 51 | ||
| 52 | - [ | ||
| 53 | - 'label' => 'Команда', | ||
| 54 | - 'url' => ['accounts/team'], | ||
| 55 | - 'active' => preg_match('/^team.*$/', $this->context->action->id)?true:false, | ||
| 56 | - ], | 52 | + [ |
| 53 | + 'label' => 'Команда', | ||
| 54 | + 'url' => ['accounts/team'], | ||
| 55 | + 'active' => preg_match('/^team.*$/', $this->context->action->id)?true:false, | ||
| 56 | + ], | ||
| 57 | 57 | ||
| 58 | - [ | ||
| 59 | - 'label' => 'Вакансии', | ||
| 60 | - 'url' => ['accounts/vacancy'], | ||
| 61 | - 'active' => preg_match('/^vacancy.*$/', $this->context->action->id)?true:false, | ||
| 62 | - ], | ||
| 63 | - [ | ||
| 64 | - 'label' => 'Ваши проекты', | ||
| 65 | - 'url' => ['accounts/projects'], | ||
| 66 | - 'active' => preg_match('/^projects.*$/', $this->context->action->id)?true:false, | ||
| 67 | - ], | ||
| 68 | - [ | ||
| 69 | - 'label' => 'Портфолио', | ||
| 70 | - 'url' => ['accounts/portfolio'], | ||
| 71 | - 'active' => preg_match('/^portfolio.*$/', $this->context->action->id)?true:false, | ||
| 72 | - ], | 58 | + [ |
| 59 | + 'label' => 'Вакансии', | ||
| 60 | + 'url' => ['accounts/vacancy'], | ||
| 61 | + 'active' => preg_match('/^vacancy.*$/', $this->context->action->id)?true:false, | ||
| 62 | + ], | ||
| 63 | + [ | ||
| 64 | + 'label' => 'Ваши проекты', | ||
| 65 | + 'url' => ['accounts/projects'], | ||
| 66 | + 'active' => preg_match('/^projects.*$/', $this->context->action->id)?true:false, | ||
| 67 | + ], | ||
| 68 | + [ | ||
| 69 | + 'label' => 'Портфолио', | ||
| 70 | + 'url' => ['accounts/portfolio'], | ||
| 71 | + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id)?true:false, | ||
| 72 | + ], | ||
| 73 | 73 | ||
| 74 | - [ | ||
| 75 | - 'label' => 'Блог', | ||
| 76 | - 'url' => ['accounts/blog'], | ||
| 77 | - 'active' => preg_match('/^blog.*$/', $this->context->action->id)?true:false, | ||
| 78 | - ], | ||
| 79 | - [ | ||
| 80 | - 'label' => 'Галерея Изображения', | ||
| 81 | - 'url' => ['accounts/gallery'], | ||
| 82 | - 'active' => preg_match('/^gallery(?!-video).*$/', $this->context->action->id)?true:false, | ||
| 83 | - ], | ||
| 84 | - [ | ||
| 85 | - 'label' => 'Галерея Видео', | ||
| 86 | - 'url' => ['accounts/gallery-video'], | ||
| 87 | - ], | ||
| 88 | - [ | ||
| 89 | - 'label' => 'Сообщения', | ||
| 90 | - 'url' => ['chat/list'], | ||
| 91 | - 'options' => ['class' => 'admin-menu-icons admin-menu-ico-2',], | ||
| 92 | - ], | ||
| 93 | - [ | ||
| 94 | - 'label' => 'Уведомления о проектах', | ||
| 95 | - 'url' => ['/projects'], | ||
| 96 | - ], | ||
| 97 | - [ | ||
| 98 | - 'label' => 'Закладки', | ||
| 99 | - 'url' => ['accounts/bookmarks'], | ||
| 100 | - 'options' => ['class' => 'admin-menu-icons admin-menu-ico-3',], | ||
| 101 | - ], | ||
| 102 | - [ | ||
| 103 | - 'label' => 'Настройка аккаунта', | ||
| 104 | - 'url' => ['accounts/setting'], | ||
| 105 | - 'options' => ['class' => 'admin-menu-icons admin-menu-ico-4',], | ||
| 106 | - ], | ||
| 107 | - [ | ||
| 108 | - 'label' => 'На сайт', | ||
| 109 | - 'url' => \Yii::$app->user->identity->type == 1 ? ['performer/common', 'performer_id'=>\Yii::$app->user->id] : ['company/common', 'company_id'=>\Yii::$app->user->id], | ||
| 110 | - ], | ||
| 111 | - [ | ||
| 112 | - 'label' => 'Выход', | ||
| 113 | - 'options' => ['class'=>'logout-li'], | ||
| 114 | - 'url' => ['/site/logout'] | ||
| 115 | - ], | ||
| 116 | - ], | ||
| 117 | - ]); | ||
| 118 | - ?> | ||
| 119 | - </div> | 74 | + [ |
| 75 | + 'label' => 'Блог', | ||
| 76 | + 'url' => ['accounts/blog'], | ||
| 77 | + 'active' => preg_match('/^blog.*$/', $this->context->action->id)?true:false, | ||
| 78 | + ], | ||
| 79 | + [ | ||
| 80 | + 'label' => 'Галерея Изображения', | ||
| 81 | + 'url' => ['accounts/gallery'], | ||
| 82 | + 'active' => preg_match('/^gallery(?!-video).*$/', $this->context->action->id)?true:false, | ||
| 83 | + ], | ||
| 84 | + [ | ||
| 85 | + 'label' => 'Галерея Видео', | ||
| 86 | + 'url' => ['accounts/gallery-video'], | ||
| 87 | + ], | ||
| 88 | + [ | ||
| 89 | + 'label' => 'Сообщения', | ||
| 90 | + 'url' => ['chat/list'], | ||
| 91 | + 'options' => ['class' => 'admin-menu-icons admin-menu-ico-2',], | ||
| 92 | + ], | ||
| 93 | + [ | ||
| 94 | + 'label' => 'Уведомления о проектах', | ||
| 95 | + 'url' => ['/projects'], | ||
| 96 | + ], | ||
| 97 | + [ | ||
| 98 | + 'label' => 'Закладки', | ||
| 99 | + 'url' => ['accounts/bookmarks'], | ||
| 100 | + 'options' => ['class' => 'admin-menu-icons admin-menu-ico-3',], | ||
| 101 | + ], | ||
| 102 | + [ | ||
| 103 | + 'label' => 'Настройка аккаунта', | ||
| 104 | + 'url' => ['accounts/setting'], | ||
| 105 | + 'options' => ['class' => 'admin-menu-icons admin-menu-ico-4',], | ||
| 106 | + ], | ||
| 107 | + [ | ||
| 108 | + 'label' => 'На сайт', | ||
| 109 | + 'url' => \Yii::$app->user->identity->type == 1 ? ['performer/common', 'performer_id'=>\Yii::$app->user->id] : ['company/common', 'company_id'=>\Yii::$app->user->id], | ||
| 110 | + ], | ||
| 111 | + [ | ||
| 112 | + 'label' => 'Выход', | ||
| 113 | + 'options' => ['class'=>'logout-li'], | ||
| 114 | + 'url' => ['/site/logout'] | ||
| 115 | + ], | ||
| 116 | + ], | ||
| 117 | + ]); | ||
| 118 | + ?> | ||
| 119 | + </div> | ||
| 120 | 120 | ||
| 121 | - <div class="login-left-column"> | ||
| 122 | - <?= $content ?> | ||
| 123 | - </div> | 121 | + <div class="login-left-column"> |
| 122 | + <?= $content ?> | ||
| 123 | + </div> | ||
| 124 | 124 | ||
| 125 | - </div> | ||
| 126 | - </div> | ||
| 127 | - </div> | 125 | + </div> |
| 126 | + </div> | ||
| 127 | +</div> | ||
| 128 | 128 | ||
| 129 | <?php $this->endContent() ?> | 129 | <?php $this->endContent() ?> |
| 130 | \ No newline at end of file | 130 | \ No newline at end of file |