Commit 6f32e126341211a3cda231c8889e6c3d85e5bcd0
Merge remote-tracking branch 'origin/master'
Showing
5 changed files
with
61 additions
and
11 deletions
Show diff stats
console/migrations/m161229_140924_add_regexp_column_to_user_table.php
0 → 100644
| 1 | +<?php | ||
| 2 | + | ||
| 3 | +use yii\db\Migration; | ||
| 4 | + | ||
| 5 | +/** | ||
| 6 | + * Handles adding regexp to table `user`. | ||
| 7 | + */ | ||
| 8 | +class m161229_140924_add_regexp_column_to_user_table extends Migration | ||
| 9 | +{ | ||
| 10 | + /** | ||
| 11 | + * @inheritdoc | ||
| 12 | + */ | ||
| 13 | + public function up() | ||
| 14 | + { | ||
| 15 | + $this->addColumn('user', 'regexp', $this->string(255)); | ||
| 16 | + $this->addColumn('user', 'name', $this->string(255)); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + /** | ||
| 20 | + * @inheritdoc | ||
| 21 | + */ | ||
| 22 | + public function down() | ||
| 23 | + { | ||
| 24 | + $this->dropColumn('user', 'regexp'); | ||
| 25 | + $this->dropColumn('user', 'name'); | ||
| 26 | + } | ||
| 27 | +} |
frontend/controllers/CabinetController.php
| @@ -64,11 +64,11 @@ | @@ -64,11 +64,11 @@ | ||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | $table = IntellectualProperty::find() | 66 | $table = IntellectualProperty::find() |
| 67 | - ->where( | ||
| 68 | - [ | ||
| 69 | - 'user_id' => \Yii::$app->user->identity->id, | ||
| 70 | - ] | ||
| 71 | - ) | 67 | +// ->where( |
| 68 | +// [ | ||
| 69 | +// 'user_id' => \Yii::$app->user->identity->id, | ||
| 70 | +// ] | ||
| 71 | +// ) | ||
| 72 | ->all(); | 72 | ->all(); |
| 73 | 73 | ||
| 74 | return $this->render( | 74 | return $this->render( |
| @@ -128,11 +128,11 @@ | @@ -128,11 +128,11 @@ | ||
| 128 | public function actionList() | 128 | public function actionList() |
| 129 | { | 129 | { |
| 130 | $table = IntellectualProperty::find() | 130 | $table = IntellectualProperty::find() |
| 131 | - ->where( | ||
| 132 | - [ | ||
| 133 | - 'user_id' => \Yii::$app->user->identity->id, | ||
| 134 | - ] | ||
| 135 | - ) | 131 | +// ->where( |
| 132 | +// [ | ||
| 133 | +// 'user_id' => \Yii::$app->user->identity->id, | ||
| 134 | +// ] | ||
| 135 | +// ) | ||
| 136 | ->all(); | 136 | ->all(); |
| 137 | return $this->render( | 137 | return $this->render( |
| 138 | 'list', | 138 | 'list', |
frontend/views/layouts/cabinet.php
| @@ -71,7 +71,7 @@ EOT; | @@ -71,7 +71,7 @@ EOT; | ||
| 71 | <a href="#" class="btn_mails"><span>23</span></a> | 71 | <a href="#" class="btn_mails"><span>23</span></a> |
| 72 | 72 | ||
| 73 | <div class="name-wrapp-login"> | 73 | <div class="name-wrapp-login"> |
| 74 | - <span class="name_" style="background: url('/images/cabinet/ico/ico-5.png')0 50% no-repeat">Дмитро (фізична особа)</span> | 74 | + <span class="name_" style="background: url('/images/cabinet/ico/ico-5.png')0 50% no-repeat"><?php echo \Yii::$app->user->identity->name?></span> |
| 75 | <div id="hidden_list_head" class="_off"> | 75 | <div id="hidden_list_head" class="_off"> |
| 76 | <ul> | 76 | <ul> |
| 77 | <li><span class="s_">Киев</span></li> | 77 | <li><span class="s_">Киев</span></li> |
frontend/views/site/index.php
| @@ -13,6 +13,7 @@ | @@ -13,6 +13,7 @@ | ||
| 13 | 13 | ||
| 14 | $this->title = 'My Yii Application'; | 14 | $this->title = 'My Yii Application'; |
| 15 | ?> | 15 | ?> |
| 16 | + | ||
| 16 | <div class="section-box-header"> | 17 | <div class="section-box-header"> |
| 17 | <div class="container"> | 18 | <div class="container"> |
| 18 | <div class="row"> | 19 | <div class="row"> |
| @@ -27,6 +28,18 @@ | @@ -27,6 +28,18 @@ | ||
| 27 | </ul> | 28 | </ul> |
| 28 | <div class="login-wrapp"> | 29 | <div class="login-wrapp"> |
| 29 | <?php | 30 | <?php |
| 31 | + if(!\Yii::$app->user->isGuest) { | ||
| 32 | + echo Html::a('Вийти', | ||
| 33 | + [ | ||
| 34 | + 'site/logout' | ||
| 35 | + ], | ||
| 36 | + [ | ||
| 37 | + 'data-method' => 'post', | ||
| 38 | + 'class' => 'btn-logout', | ||
| 39 | + ]); | ||
| 40 | + } | ||
| 41 | + ?> | ||
| 42 | + <?php | ||
| 30 | if(\Yii::$app->user->isGuest) { | 43 | if(\Yii::$app->user->isGuest) { |
| 31 | echo Html::a('вхід', '#', [ | 44 | echo Html::a('вхід', '#', [ |
| 32 | 'class' => 'btn_login', | 45 | 'class' => 'btn_login', |
| @@ -39,6 +52,7 @@ | @@ -39,6 +52,7 @@ | ||
| 39 | ]); | 52 | ]); |
| 40 | } | 53 | } |
| 41 | ?> | 54 | ?> |
| 55 | + | ||
| 42 | </div> | 56 | </div> |
| 43 | </div> | 57 | </div> |
| 44 | </div> | 58 | </div> |
frontend/web/css/style.css
| @@ -46,6 +46,15 @@ ul.main_menu li a:hover {text-decoration: underline;} | @@ -46,6 +46,15 @@ ul.main_menu li a:hover {text-decoration: underline;} | ||
| 46 | .login-wrapp { | 46 | .login-wrapp { |
| 47 | float: right; | 47 | float: right; |
| 48 | } | 48 | } |
| 49 | +.btn-logout { | ||
| 50 | + float: left; | ||
| 51 | + display: block; | ||
| 52 | + margin-top: 30px; | ||
| 53 | + font-family: Ubuntu; | ||
| 54 | + color: #02a1ee; | ||
| 55 | + font-weight: 700; | ||
| 56 | + | ||
| 57 | +} | ||
| 49 | .btn_login { | 58 | .btn_login { |
| 50 | margin-top: 23px; | 59 | margin-top: 23px; |
| 51 | float: right; | 60 | float: right; |