Commit 631219042f512de7c8b9db1025c5af7f37ff2ae0
Merge remote-tracking branch 'origin/master'
# Conflicts: # frontend/controllers/AccountsController.php
Showing
11 changed files
with
163 additions
and
40 deletions
Show diff stats
common/behaviors/ShowImage.php
| ... | ... | @@ -27,5 +27,17 @@ class ShowImage extends Behavior |
| 27 | 27 | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | + function ShowGallery($array){ | |
| 31 | + | |
| 32 | + $gallery = explode(',', $array ); | |
| 33 | + if(is_array($gallery)){ | |
| 34 | + array_splice($gallery,-1); | |
| 35 | + return $gallery; | |
| 36 | + } else { | |
| 37 | + return []; | |
| 38 | + } | |
| 39 | + | |
| 40 | + } | |
| 41 | + | |
| 30 | 42 | |
| 31 | 43 | } |
| 32 | 44 | \ No newline at end of file | ... | ... |
frontend/controllers/AccountsController.php
| ... | ... | @@ -424,7 +424,7 @@ |
| 424 | 424 | { |
| 425 | 425 | $searchModel = new PortfolioSearch(); |
| 426 | 426 | $dataProvider = $searchModel->search(Yii::$app->request->queryParams); |
| 427 | - | |
| 427 | + $dataProvider->pagination->pageSize=5; | |
| 428 | 428 | return $this->render('portfolio', [ |
| 429 | 429 | 'searchModel' => $searchModel, |
| 430 | 430 | 'dataProvider' => $dataProvider, |
| ... | ... | @@ -434,14 +434,7 @@ |
| 434 | 434 | public function actionPortfolioCreate() |
| 435 | 435 | { |
| 436 | 436 | $portfolio = new Portfolio(); |
| 437 | - $specialization = Specialization::find() | |
| 438 | - ->select([ | |
| 439 | - 'specialization_name', | |
| 440 | - 'specialization_id', | |
| 441 | - ]) | |
| 442 | - ->indexBy('specialization_id') | |
| 443 | - ->asArray() | |
| 444 | - ->column(); | |
| 437 | + $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | |
| 445 | 438 | $post = \Yii::$app->request->post(); |
| 446 | 439 | if(!empty( $post )) { |
| 447 | 440 | $portfolio->load($post); |
| ... | ... | @@ -450,14 +443,17 @@ |
| 450 | 443 | $portfolio->save(); |
| 451 | 444 | $portfolio->unlinkAll('specializations', true); |
| 452 | 445 | foreach($portfolio->specializationInput as $one_specialization) { |
| 453 | - $portfolio->link('specializations', Specialization::findOne($one_specialization)); | |
| 446 | + if($one_specialization){ | |
| 447 | + | |
| 448 | + $portfolio->link('specializations', Specialization::findOne($one_specialization)); | |
| 449 | + } | |
| 454 | 450 | } |
| 455 | 451 | return $this->redirect('portfolio'); |
| 456 | 452 | } |
| 457 | 453 | } |
| 458 | 454 | return $this->render('_portfolio_form', [ |
| 459 | 455 | 'portfolio' => $portfolio, |
| 460 | - 'specialization' => $specialization, | |
| 456 | + 'specializations' => $specializations, | |
| 461 | 457 | ]); |
| 462 | 458 | } |
| 463 | 459 | |
| ... | ... | @@ -470,14 +466,7 @@ |
| 470 | 466 | if(!$portfolio instanceof ActiveRecord) { |
| 471 | 467 | throw new NotFoundHttpException('Запись не найдена'); |
| 472 | 468 | } |
| 473 | - $specialization = Specialization::find() | |
| 474 | - ->select([ | |
| 475 | - 'specialization_name', | |
| 476 | - 'specialization_id', | |
| 477 | - ]) | |
| 478 | - ->indexBy('specialization_id') | |
| 479 | - ->asArray() | |
| 480 | - ->column(); | |
| 469 | + $specializations = Specialization::find()->where(['specialization_pid' => 0])->orderBy('specialization_id')->all(); | |
| 481 | 470 | $post = \Yii::$app->request->post(); |
| 482 | 471 | if(!empty( $post )) { |
| 483 | 472 | $portfolio->load($post); |
| ... | ... | @@ -485,15 +474,18 @@ |
| 485 | 474 | if(!$portfolio->hasErrors()) { |
| 486 | 475 | $portfolio->save(); |
| 487 | 476 | $portfolio->unlinkAll('specializations', true); |
| 477 | + | |
| 488 | 478 | foreach($portfolio->specializationInput as $one_specialization) { |
| 489 | - $portfolio->link('specializations', Specialization::findOne($one_specialization)); | |
| 479 | + if($one_specialization){ | |
| 480 | + $portfolio->link('specializations', Specialization::findOne($one_specialization)); | |
| 481 | + } | |
| 490 | 482 | } |
| 491 | 483 | return $this->redirect('portfolio'); |
| 492 | 484 | } |
| 493 | 485 | } |
| 494 | 486 | return $this->render('_portfolio_form', [ |
| 495 | 487 | 'portfolio' => $portfolio, |
| 496 | - 'specialization' => $specialization, | |
| 488 | + 'specializations' => $specializations, | |
| 497 | 489 | ]); |
| 498 | 490 | } |
| 499 | 491 | ... | ... |
frontend/views/accounts/_portfolio_form.php
| ... | ... | @@ -4,7 +4,8 @@ |
| 4 | 4 | */ |
| 5 | 5 | use common\models\Option; |
| 6 | 6 | use common\models\Portfolio; |
| 7 | - use common\widgets\ImageUploader; | |
| 7 | +use common\models\Specialization; | |
| 8 | +use common\widgets\ImageUploader; | |
| 8 | 9 | use mihaildev\ckeditor\CKEditor; |
| 9 | 10 | use yii\helpers\Html; |
| 10 | 11 | use yii\widgets\ActiveForm; |
| ... | ... | @@ -42,8 +43,31 @@ use yii\web\JsExpression; |
| 42 | 43 | |
| 43 | 44 | |
| 44 | 45 | <div class="input-blocks-wrapper"> |
| 45 | - <?= $form->field($portfolio, 'specializationInput') | |
| 46 | - ->checkboxList($specialization) ?> | |
| 46 | + <ul class="content-menu-first"> | |
| 47 | + <?php foreach($specializations as $specialization):?> | |
| 48 | + <li data-img="<?= $specialization->image?>"> | |
| 49 | + <span data-menu-bg="<?= $specialization->background ?>" style="background: <?= $specialization->background ?>"></span><a href="#"><?= $specialization->specialization_name?></a> | |
| 50 | + <ul> | |
| 51 | + <?php foreach($specialization->children as $child_first):?> | |
| 52 | + | |
| 53 | + <?php if($child_first instanceof Specialization):?> | |
| 54 | + <li> | |
| 55 | + <a href="#"><?= $child_first->specialization_name?></a> | |
| 56 | + <ul> | |
| 57 | + <?php foreach($child_first->children as $child_second):?> | |
| 58 | + <?php if($child_first instanceof Specialization): ?> | |
| 59 | + <li><a href="#"><?= $form->field($portfolio, 'specializationInput[]')->checkbox(['value' => $child_second->specialization_id, 'label' =>$child_second->specialization_name])?></a></li> | |
| 60 | + <?php endif;?> | |
| 61 | + <?php endforeach; ?> | |
| 62 | + </ul> | |
| 63 | + </li> | |
| 64 | + <?php endif; ?> | |
| 65 | + <?php endforeach; ?> | |
| 66 | + | |
| 67 | + </ul> | |
| 68 | + </li> | |
| 69 | + <?php endforeach; ?> | |
| 70 | + </ul> | |
| 47 | 71 | </div> |
| 48 | 72 | |
| 49 | 73 | ... | ... |
frontend/views/accounts/blog.php
| ... | ... | @@ -12,11 +12,12 @@ |
| 12 | 12 | $this->title = 'Блог'; |
| 13 | 13 | $this->params[ 'breadcrumbs' ][] = $this->title; |
| 14 | 14 | ?> |
| 15 | -<h1><?= $this->title ?></h1> | |
| 16 | -<p> | |
| 15 | +<div class="login-left-column-title"><?= $this->title ?></div> | |
| 16 | +<div class="admin-all-pages-add"> | |
| 17 | 17 | <?= Html::a(Yii::t('app', 'Добавить'), [ 'blog-create' ], [ 'class' => 'btn btn-success' ]) ?> |
| 18 | -</p> | |
| 18 | +</div> | |
| 19 | 19 | <?= GridView::widget([ |
| 20 | + 'options' => ['class'=>'style admin-all-pages-wr'], | |
| 20 | 21 | 'dataProvider' => $dataProvider, |
| 21 | 22 | 'filterModel' => $searchModel, |
| 22 | 23 | 'columns' => [ |
| ... | ... | @@ -31,13 +32,15 @@ |
| 31 | 32 | 'class' => ActionColumn::className(), |
| 32 | 33 | 'buttons' => [ |
| 33 | 34 | 'update' => function($url, $model, $key) { |
| 34 | - return Html::a('Update', [ | |
| 35 | + return Html::a('<img src="/images/ico_pencil.png" alt="">', [ | |
| 35 | 36 | 'blog-update', |
| 36 | 37 | 'id' => $model->blog_id, |
| 38 | + ],[ | |
| 39 | + 'title' => 'Редактировать', | |
| 37 | 40 | ]); |
| 38 | 41 | }, |
| 39 | 42 | 'delete' => function($url, $model, $key) { |
| 40 | - return Html::a('Delete', [ | |
| 43 | + return Html::a('<img src="/images/delete-ico.png" alt="">', [ | |
| 41 | 44 | 'blog-delete', |
| 42 | 45 | 'id' => $model->blog_id, |
| 43 | 46 | ], [ | ... | ... |
frontend/views/accounts/gallery.php
frontend/views/accounts/portfolio.php
| ... | ... | @@ -12,11 +12,12 @@ |
| 12 | 12 | $this->title = 'Портфолио'; |
| 13 | 13 | $this->params[ 'breadcrumbs' ][] = $this->title; |
| 14 | 14 | ?> |
| 15 | -<h1><?= $this->title ?></h1> | |
| 16 | -<p> | |
| 15 | +<div class="login-left-column-title"><?= $this->title ?></div> | |
| 16 | +<div class="admin-all-pages-add"> | |
| 17 | 17 | <?= Html::a(Yii::t('app', 'Добавить'), [ 'portfolio-create' ], [ 'class' => 'btn btn-success' ]) ?> |
| 18 | -</p> | |
| 18 | +</div> | |
| 19 | 19 | <?= GridView::widget([ |
| 20 | + 'options' => ['class'=>'style admin-all-pages-wr'], | |
| 20 | 21 | 'dataProvider' => $dataProvider, |
| 21 | 22 | 'filterModel' => $searchModel, |
| 22 | 23 | 'columns' => [ | ... | ... |
frontend/views/layouts/gallery.php
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | +use yii\helpers\Html; | |
| 3 | 4 | use yii\widgets\Breadcrumbs; |
| 4 | 5 | use yii\widgets\Menu; |
| 5 | 6 | |
| 6 | -\frontend\assets\AdminAsset::register($this); | |
| 7 | +\frontend\assets\AppAsset::register($this); | |
| 7 | 8 | /* @var $content string */ |
| 8 | 9 | $this->beginContent('@app/views/layouts/main.php'); |
| 9 | 10 | ?> |
| 10 | 11 | <div class="section-box content"> |
| 11 | - <div class="section-box-16" style="background: url('/images/blog/box-16.jpg') no-repeat"> | |
| 12 | + <div class="section-box-16" style="background: url('<?= $this->params['user']->userInfo->poster;?>') 50% no-repeat"> | |
| 12 | 13 | <div class="box-wr"> |
| 13 | 14 | <div class="box-all"> |
| 14 | 15 | <div class="blog-buttons-wr style"> |
| ... | ... | @@ -90,7 +91,9 @@ $this->beginContent('@app/views/layouts/main.php'); |
| 90 | 91 | <div class="performance-vacancy-sidebar-comm style">30 отзывов</div> |
| 91 | 92 | <a href="#" class="performance-vacancy-sidebar-write style">написать отзыв</a> |
| 92 | 93 | </div> |
| 93 | - <div class="performer-vacancy-sidebar-img style"><img src="/images/ded-foto.jpg" alt=""/></div> | |
| 94 | + <div class="performer-vacancy-sidebar-img style"> | |
| 95 | + <?= Html::img($this->params['user']->userInfo->image);?> | |
| 96 | + </div> | |
| 94 | 97 | </div> |
| 95 | 98 | </div> |
| 96 | 99 | </div> | ... | ... |
frontend/views/performer/_gallery_list_view.php
| ... | ... | @@ -5,7 +5,7 @@ |
| 5 | 5 | <a href="#" class="gallery-box-min"><?= Html::img($model->cover)?></a> |
| 6 | 6 | <div class="gallery-box-hidden"> |
| 7 | 7 | <div class="gallery-box-preview"> |
| 8 | - <?php foreach(explode(',', $model->photo ) as $image):?> | |
| 8 | + <?php foreach($model->ShowGallery($model->photo ) as $image):?> | |
| 9 | 9 | <span data-link="<?= $image ?>"></span> |
| 10 | 10 | <?php endforeach; ?> |
| 11 | 11 | ... | ... |
frontend/views/performer/gallery.php
| ... | ... | @@ -4,12 +4,16 @@ use \yii\helpers\Html; |
| 4 | 4 | use yii\widgets\LinkPager; |
| 5 | 5 | use yii\widgets\ListView; |
| 6 | 6 | |
| 7 | + | |
| 8 | + | |
| 7 | 9 | /* @var $this yii\web\View */ |
| 10 | + | |
| 11 | + | |
| 8 | 12 | $this->params['user'] = $user; |
| 9 | 13 | $this->title = 'My Yii Application'; |
| 10 | 14 | ?> |
| 11 | 15 | <div class="video-performer-wrapper style"> |
| 12 | - <div class="gallery-title">Видео: 12</div> | |
| 16 | + <div class="gallery-title">Видео: <?= count($videos)?></div> | |
| 13 | 17 | <div class="slider-video-wr"> |
| 14 | 18 | <div id="demo5" class="scroll-img video-slider"> |
| 15 | 19 | <ul> |
| ... | ... | @@ -50,4 +54,19 @@ $this->title = 'My Yii Application'; |
| 50 | 54 | ?> |
| 51 | 55 | </div> |
| 52 | 56 | |
| 53 | -</div> | |
| 54 | 57 | \ No newline at end of file |
| 58 | +</div> | |
| 59 | +<script> | |
| 60 | + $(function () { | |
| 61 | + $('#demo5').scrollbox({ | |
| 62 | + direction: 'h', | |
| 63 | + distance: 220, | |
| 64 | + autoPlay: false | |
| 65 | + }); | |
| 66 | + $('#demo5-backward').click(function () { | |
| 67 | + $('#demo5').trigger('backward'); | |
| 68 | + }); | |
| 69 | + $('#demo5-forward').click(function () { | |
| 70 | + $('#demo5').trigger('forward'); | |
| 71 | + }); | |
| 72 | + }); | |
| 73 | +</script> | |
| 55 | 74 | \ No newline at end of file | ... | ... |
frontend/web/css/style.css
| ... | ... | @@ -5433,7 +5433,7 @@ ul.menu-admin li.logout-li, ul.menu-admin li.logout-li a, ul.menu-admin li:last- |
| 5433 | 5433 | margin-left: 193px; |
| 5434 | 5434 | margin-top: 7px; |
| 5435 | 5435 | } |
| 5436 | -.skills-admin-wrapper .btn:focus, .skills-admin-wrapper .btn:active, .add-field-employment .btn:focus, .add-field-employment .btn:active, .admin-contacts-wr .btn:focus, .admin-contacts-wr .btn:active { | |
| 5436 | +.skills-admin-wrapper .btn:focus, .skills-admin-wrapper .btn:active, .add-field-employment .btn:focus, .add-field-employment .btn:active, .admin-contacts-wr .btn:focus, .admin-contacts-wr .btn:active, .admin-all-pages-add .btn:active, .skills-admin-wrapper .btn:focus, .skills-admin-wrapper .btn:active, .add-field-employment .btn:focus, .add-field-employment .btn:active, .admin-contacts-wr .btn:focus, .admin-contacts-wr .btn:active, .admin-all-pages-add .btn:focus { | |
| 5437 | 5437 | background: none; |
| 5438 | 5438 | color: #003AA7; |
| 5439 | 5439 | box-shadow: none; |
| ... | ... | @@ -5590,4 +5590,72 @@ background: #f3f3f3; |
| 5590 | 5590 | padding: 2px 0 !important; |
| 5591 | 5591 | border: 1px solid #0072bc !important; |
| 5592 | 5592 | } |
| 5593 | -a {color: #0072bc} | |
| 5594 | 5593 | \ No newline at end of file |
| 5594 | +a {color: #0072bc} | |
| 5595 | +.admin-all-pages-add { | |
| 5596 | + margin-top: 20px; | |
| 5597 | + margin-bottom: 20px; | |
| 5598 | +} | |
| 5599 | +.admin-all-pages-add .btn{ | |
| 5600 | + width: 160px; | |
| 5601 | + height: 29px; | |
| 5602 | + color: #fff; | |
| 5603 | + background: #0072bc; | |
| 5604 | + border: 1px solid #0072bc; | |
| 5605 | + font-size: 13px; | |
| 5606 | + margin-top: 0 !important; | |
| 5607 | + float: none; | |
| 5608 | + outline: none; | |
| 5609 | + border-radius: 4px; | |
| 5610 | +} | |
| 5611 | +.admin-all-pages-add .btn:hover { | |
| 5612 | + background: #fff; | |
| 5613 | + color: #0072bc; | |
| 5614 | +} | |
| 5615 | +.admin-all-pages-add .btn:focus { | |
| 5616 | + border: 1px solid #00558C; | |
| 5617 | + color: #00558C; | |
| 5618 | +} | |
| 5619 | +.table-striped > tbody > tr:nth-of-type(odd) { | |
| 5620 | + background-color: #F1F1F1; | |
| 5621 | +} | |
| 5622 | +.table-striped tr:hover{ | |
| 5623 | + background-color: #eef8ff !important; | |
| 5624 | +} | |
| 5625 | +.admin-all-pages-wr {margin-bottom: 30px} | |
| 5626 | +.admin-all-pages-wr .form-control { | |
| 5627 | + height: 29px; | |
| 5628 | + border: 1px solid #dcdcdc; | |
| 5629 | + box-sizing: border-box; | |
| 5630 | + outline: none; | |
| 5631 | + color: #636363; | |
| 5632 | + font-size: 13px; | |
| 5633 | + line-height: 27px; | |
| 5634 | + padding-left: 8px; | |
| 5635 | + border-radius: 0; | |
| 5636 | + outline: none; | |
| 5637 | +} | |
| 5638 | +.admin-all-pages-wr table .form-control:focus {border: 1px solid #dcdcdc;box-shadow: 1px 2px 2px 0px rgba(215, 215, 215, 0.75) inset; transition: 0.1s; outline: none} | |
| 5639 | +.admin-all-pages-wr table tbody tr td {padding: 4px 8px; vertical-align: middle} | |
| 5640 | +.admin-all-pages-wr table {font-size: 13px} | |
| 5641 | +.admin-all-pages-wr .table > thead > tr > th {vertical-align: middle} | |
| 5642 | +.admin-all-pages-wr .pagination {float: right} | |
| 5643 | +.admin-all-pages-wr .pagination > li > a, .pagination > li > span { | |
| 5644 | + background: none; | |
| 5645 | + border: 0; | |
| 5646 | +} | |
| 5647 | +.admin-all-pages-wr .pagination > li.active:hover { | |
| 5648 | + cursor: default; | |
| 5649 | + | |
| 5650 | +} | |
| 5651 | +.admin-all-pages-wr .pagination > li.active > a, .admin-all-pages-wr .pagination > li.active > span { | |
| 5652 | + color: inherit; | |
| 5653 | +} | |
| 5654 | +.admin-all-pages-wr .pagination > li.active a:hover, .admin-all-pages-wr .pagination > li.active span:hover { | |
| 5655 | + color: inherit; | |
| 5656 | + background: none; | |
| 5657 | +} | |
| 5658 | + | |
| 5659 | + | |
| 5660 | + | |
| 5661 | + | |
| 5662 | + | ... | ... |
1.24 KB