diff --git a/common/behaviors/ShowImage.php b/common/behaviors/ShowImage.php index 3a59c2a..540268d 100644 --- a/common/behaviors/ShowImage.php +++ b/common/behaviors/ShowImage.php @@ -84,4 +84,12 @@ } + public function ShowAvatar($dir, $width, $height = NULL) { + if(empty($dir)) { + return '/images/avatar-bg.png'; + } else { + return $this->minImg($dir, $width, $height); + } + } + } \ No newline at end of file diff --git a/common/models/User.php b/common/models/User.php index 460b3df..bd7bd16 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -471,7 +471,7 @@ array_splice($result, 2); } - return implode(',', $result); + return implode('', $result); } /** diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index 6617a05..24b36be 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -82,6 +82,7 @@ [ [ 'email', + 'city', ], 'required', ], diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index 559d62d..13ddbf5 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -256,6 +256,7 @@ ], ], + 'remover' => true, 'multi' => false, 'gallery' => $user_info->image, 'name' => 'Выбрать файл', diff --git a/frontend/views/layouts/company.php b/frontend/views/layouts/company.php index f229b1a..71947d9 100755 --- a/frontend/views/layouts/company.php +++ b/frontend/views/layouts/company.php @@ -20,7 +20,7 @@ params[ 'company' ]->id != \Yii::$app->user->getId()) { // Форма "оставить заявку" - echo $this->render('//company/_feedback_company', ['company' => $this->params['company']]); + echo $this->render('//company/_feedback_company', [ 'company' => $this->params[ 'company' ] ]); // Конец формы "оставить заявку" if(!empty( \Yii::$app->user->identity )) { ?> @@ -50,79 +50,88 @@
[ - 'class' => 'menu-content', - ], - 'activeCssClass' => 'active-menu-content', - 'items' => [ - [ - 'label' => 'Общее', - 'url' => [ - 'company/common', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], + $items = [ + [ + 'label' => 'Общее', + 'url' => [ + 'company/common', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Выполненные работы', - 'url' => [ - 'company/portfolio', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], - 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + ], + [ + 'label' => 'Выполненные работы', + 'url' => [ + 'company/portfolio', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Заказанные работы', - 'url' => [ - 'company/projects', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], - 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false, + 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + ], + [ + 'label' => 'Заказанные работы', + 'url' => [ + 'company/projects', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Команда', - 'url' => [ - 'company/team', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], + 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false, + 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + ], + [ + 'label' => 'Вакансии', + 'url' => [ + 'company/vacancy-list', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Вакансии', - 'url' => [ - 'company/vacancy-list', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], + 'active' => preg_match('/^vacancy.*$/', $this->context->action->id) ? true : false, + ], + [ + 'label' => 'Мнения', + 'url' => [ + 'company/review', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Блог', - 'url' => [ - 'company/blog-list', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], + ]; + if(empty($this->params['type']) || $this->params[ 'type' ] == 'implementer') { + $items = array_merge($items, [ + [ + 'label' => 'Команда', + 'url' => [ + 'company/team', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], ], - ], - [ - 'label' => 'Мнения', - 'url' => [ - 'company/review', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + [ + 'label' => 'Блог', + 'url' => [ + 'company/blog-list', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], + 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, ], - ], - [ - 'label' => 'Галерея', - 'url' => [ - 'company/gallery', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + [ + 'label' => 'Галерея', + 'url' => [ + 'company/gallery', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], ], - ], + ]); + } + echo Menu::widget([ + 'options' => [ + 'class' => 'menu-content', ], + 'activeCssClass' => 'active-menu-content', + 'items' => $items, ]); ?>
@@ -140,7 +149,7 @@
  • params[ 'company' ]->userInfo->is_freelancer xor $this->params[ 'company' ]->userInfo->is_customer) { - if(!empty($this->params[ 'type' ]) && $this->params[ 'type' ] == 'customer') { + if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') { echo Html::tag('span', 'Заказчик', [ 'class' => 'activejob_span' ]); } else { echo Html::tag('span', 'Исполнитель', [ 'class' => 'activejob_span' ]); @@ -211,7 +220,7 @@ } ?>
  • -
    params[ 'company' ]->userInfo->image); ?>
    +
    params[ 'company' ]->userInfo->ShowAvatar($this->params[ 'company' ]->userInfo->image, 180)); ?>
    render('/patrial/social_list', [ 'params' => $this->params, diff --git a/frontend/views/layouts/gallery-company.php b/frontend/views/layouts/gallery-company.php index 85fba1f..07f7eb4 100755 --- a/frontend/views/layouts/gallery-company.php +++ b/frontend/views/layouts/gallery-company.php @@ -17,7 +17,7 @@ params[ 'company' ]->id != \Yii::$app->user->getId()) { // Форма "оставить заявку" - echo $this->render('//company/_feedback_company', ['company' => $this->params['company']]); + echo $this->render('//company/_feedback_company', [ 'company' => $this->params[ 'company' ] ]); // Конец формы "оставить заявку" if(!empty( \Yii::$app->user->identity )) { ?> @@ -47,38 +47,55 @@
    [ - 'class' => 'menu-content', + $items = [ + [ + 'label' => 'Общее', + 'url' => [ + 'company/common', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], ], - 'activeCssClass' => 'active-menu-content', - 'items' => [ - [ - 'label' => 'Общее', - 'url' => [ - 'company/common', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], + [ + 'label' => 'Выполненные работы', + 'url' => [ + 'company/portfolio', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Выполненные работы', - 'url' => [ - 'company/portfolio', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], - 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false, + 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + ], + [ + 'label' => 'Заказанные работы', + 'url' => [ + 'company/projects', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - [ - 'label' => 'Заказанные работы', - 'url' => [ - 'company/projects', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], - 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false, + 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + ], + [ + 'label' => 'Вакансии', + 'url' => [ + 'company/vacancy-list', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], + 'active' => preg_match('/^vacancy.*$/', $this->context->action->id) ? true : false, + ], + [ + 'label' => 'Мнения', + 'url' => [ + 'company/review', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], + ], + ]; + if(empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer') { + $items = array_merge($items, [ [ 'label' => 'Команда', 'url' => [ @@ -88,28 +105,13 @@ ], ], [ - 'label' => 'Вакансии', - 'url' => [ - 'company/vacancy-list', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], - ], - [ 'label' => 'Блог', 'url' => [ 'company/blog-list', 'company_id' => $this->params[ 'company' ]->id, 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], - ], - [ - 'label' => 'Мнения', - 'url' => [ - 'company/review', - 'company_id' => $this->params[ 'company' ]->id, - 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, - ], + 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Галерея', @@ -119,7 +121,14 @@ 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], + ]); + } + echo Menu::widget([ + 'options' => [ + 'class' => 'menu-content', ], + 'activeCssClass' => 'active-menu-content', + 'items' => $items, ]); ?>
    @@ -137,7 +146,7 @@
  • params[ 'company' ]->userInfo->is_freelancer xor $this->params[ 'company' ]->userInfo->is_customer) { - if(!empty($this->params[ 'type' ]) && $this->params[ 'type' ] == 'customer') { + if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') { echo Html::tag('span', 'Заказчик', [ 'class' => 'activejob_span' ]); } else { echo Html::tag('span', 'Исполнитель', [ 'class' => 'activejob_span' ]); @@ -209,7 +218,7 @@ ?>
  • - params[ 'company' ]->userInfo->image); ?> + params[ 'company' ]->userInfo->ShowAvatar($this->params[ 'company' ]->userInfo->image, 180)); ?>
    diff --git a/frontend/views/layouts/gallery.php b/frontend/views/layouts/gallery.php index a068c1b..042acf3 100755 --- a/frontend/views/layouts/gallery.php +++ b/frontend/views/layouts/gallery.php @@ -75,6 +75,7 @@ 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Заказанные работы', @@ -84,6 +85,7 @@ 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Блог', @@ -92,6 +94,7 @@ 'performer_id' => $this->params[ 'user' ]->id, 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], + 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Мнения', diff --git a/frontend/views/layouts/performer.php b/frontend/views/layouts/performer.php index da4dc99..051e872 100755 --- a/frontend/views/layouts/performer.php +++ b/frontend/views/layouts/performer.php @@ -80,6 +80,7 @@ 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], 'visible' => ( empty( $this->params[ 'type' ] ) || $this->params[ 'type' ] == 'implementer' ) ? true : false, + 'active' => preg_match('/^portfolio.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Заказанные работы', @@ -89,6 +90,7 @@ 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer' ) ? true : false, + 'active' => preg_match('/^projects.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Блог', @@ -97,6 +99,7 @@ 'performer_id' => $this->params[ 'user' ]->id, 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], + 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, ], [ 'label' => 'Мнения', diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index eeb247d..9ea4ad7 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -2337,6 +2337,7 @@ input[type=file]::-webkit-file-upload-button { float: left; margin-top: 18px; line-height: 16px; + overflow: hidden; } .performer-vacancy-sidebar-views ul li img { @@ -8841,6 +8842,10 @@ ul.menu-admin li.logout-li, ul.menu-admin li.logout-li a, ul.menu-admin li:last- text-align: center; } +.admin-avatar-pattern .remover_image { + left: 180px !important; +} + .admin-pattern .file-help-1 { display: none } -- libgit2 0.21.4