From 76f36646185486869423d310ae8670dd200bf291 Mon Sep 17 00:00:00 2001 From: Yarik Date: Thu, 24 Mar 2016 14:09:14 +0200 Subject: [PATCH] test --- common/models/User.php | 11 ++++++++++- common/models/UserInfo.php | 50 ++++++++++++++++++++++++++++++++++++++++---------- common/modules/comment/widgets/views/form-comment-review.php | 2 +- frontend/config/main.php | 2 +- frontend/controllers/AccountsController.php | 2 +- frontend/controllers/CompanyController.php | 29 +++++++++++++++++++++++++++++ frontend/models/SignupForm.php | 2 ++ frontend/views/company/_blog_list_view.php | 5 +++++ frontend/views/company/_company_common_blog.php | 4 ++++ frontend/views/company/_portfolio_list_view.php | 29 +++++++++++++++++++---------- frontend/views/company/blog-list.php | 29 +++++++++++++---------------- frontend/views/company/common.php | 6 ++++-- frontend/views/company/portfolio.php | 48 ++++++++++++++++++++++++++---------------------- frontend/views/company/project-list.php | 26 ++++++++++++++++++++++++++ frontend/views/layouts/company.php | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------- frontend/views/layouts/gallery-company.php | 240 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------- frontend/views/layouts/gallery.php | 176 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------- frontend/views/layouts/performer.php | 179 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------- frontend/views/patrial/show_site.php | 2 +- frontend/views/patrial/social_list.php | 23 +++++++++++++++-------- frontend/views/performer/_blog_list_view.php | 6 +++++- frontend/views/performer/_portfolio_list_view.php | 7 +++++-- frontend/views/performer/blog-list.php | 1 + frontend/views/performer/common.php | 156 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------- frontend/views/performer/portfolio.php | 47 +++++++++++++++++++++++++---------------------- 25 files changed, 911 insertions(+), 355 deletions(-) create mode 100644 frontend/views/company/project-list.php diff --git a/common/models/User.php b/common/models/User.php index 4c0a3f5..4b03d5c 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -641,7 +641,7 @@ ]) ->andWhere([ 'comment.model' => $this->className(), - ]); + ])->orderBy(['date_update' => SORT_DESC]); } /** @@ -828,4 +828,13 @@ ]) ->with('messages.user'); } + + public function getIsOnline() + { + if((time() - \Yii::$app->formatter->asTimestamp($this->userInfo->date_visit)) < 1800) { + return true; + } else { + return false; + } + } } diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index 15d8b3f..9b3f1f2 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -29,7 +29,7 @@ * @property integer $type * @property string $geography * @property integer $salary_currency - * @property string $email + * @property string $email * @property integer $hide_mail */ class UserInfo extends \yii\db\ActiveRecord @@ -61,7 +61,6 @@ return 'user_info'; } - /** * @inheritdoc */ @@ -69,7 +68,7 @@ { return [ [ - 'class' => 'common\behaviors\ShowImage', + 'class' => 'common\behaviors\ShowImage', ], ]; } @@ -203,7 +202,7 @@ 'geographies', ], 'default', - 'value' => [], + 'value' => [ ], ], [ [ @@ -218,10 +217,25 @@ 'max' => 1, ], [ - ['hide_mail'], + [ 'hide_mail' ], 'default', 'value' => 0, - ] + ], + [ + [ + 'social_vk', + 'social_t', + 'social_in', + 'social_fb', + ], + 'filter', + 'filter' => function($value) { + if(!preg_match('/^https?:\/{2}.*$/', $value)) { + $value = 'https://' . $value; + } + return $value; + }, + ], ]; } @@ -235,6 +249,21 @@ return \Yii::$app->formatter->asRelativeTime(new \DateTime($this->date_visit)); } + public function getLastVisitCabinet() + { + $time = strtotime($this->date_visit); + $date = date('d.m.Y', $time); + if($date == date('d.m.Y')) { + return 'Сегодня'; + } elseif($date == date('d.m.Y', time() - 24 * 3600)) { + return 'Вчера'; + } elseif($date == date('d.m.Y', time() - 48 * 3600)) { + return '2 дня назад'; + } else { + return date('d.m.Y', $time); + } + } + /** * @inheritdoc */ @@ -280,8 +309,8 @@ ]; } - - public function getUser(){ + public function getUser() + { return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); } @@ -291,7 +320,8 @@ return parent::beforeSave($insert); } - public function getName(){ + public function getName() + { return $this->user->name; } @@ -312,7 +342,7 @@ public function getCurrency() { - return $this->hasOne(Currency::className(), ['currency_id' => 'salary_currency']); + return $this->hasOne(Currency::className(), [ 'currency_id' => 'salary_currency' ]); } } diff --git a/common/modules/comment/widgets/views/form-comment-review.php b/common/modules/comment/widgets/views/form-comment-review.php index 95173e3..229286c 100644 --- a/common/modules/comment/widgets/views/form-comment-review.php +++ b/common/modules/comment/widgets/views/form-comment-review.php @@ -10,7 +10,7 @@ ?>
-

Отзывы о пользователе: totalCount ?>

+

Мнения о пользователе: totalCount ?>

/' => 'company/blog-view', 'company/vacancy-view///' => 'company/vacancy-view', 'company/vacancy-view//' => 'company/vacancy-view', - 'company//' => 'company/', + 'company///' => 'company/', 'company//' => 'company/', 'chat/message/'=> 'chat/message', 'tender/view/' => 'tender/view', diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index f3a8fdb..e9e96b8 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -412,7 +412,7 @@ $company_info = $user->companyInfo; $user = \Yii::$app->user->identity; if(empty( $user_info )) { - $user_info = new UserInfo([ 'user_id' => $user->id ]); + //$user_info = new UserInfo([ 'user_id' => $user->id ]); } if(empty( $company_info )) { diff --git a/frontend/controllers/CompanyController.php b/frontend/controllers/CompanyController.php index f75c787..a1683e1 100755 --- a/frontend/controllers/CompanyController.php +++ b/frontend/controllers/CompanyController.php @@ -104,6 +104,27 @@ ]); } + public function actionProjects($company_id, $type = 'implementer') + { + $company = User::findOne($company_id); + + if(!$company instanceof User) { + throw new BadRequestHttpException('Пользователь не найден'); + } + + $dataProvider = new ActiveDataProvider([ + 'query' => $company->getProjects(), + 'pagination' => [ + 'pageSize' => 10, + ], + ]); + + return $this->render('project-list', [ + 'company' => $company, + 'dataProvider' => $dataProvider, + ]); + } + public function actionPortfolio($company_id, $type = 'implementer') { $company = User::findOne($company_id); @@ -398,4 +419,12 @@ 'videos' => $videos, ]); } + + public function beforeAction($action) + { + if(!empty(\Yii::$app->request->get('type'))) { + $action->controller->view->params['type'] = \Yii::$app->request->get('type'); + } + return parent::beforeAction($action); + } } diff --git a/frontend/models/SignupForm.php b/frontend/models/SignupForm.php index 074bd83..9b71ea7 100755 --- a/frontend/models/SignupForm.php +++ b/frontend/models/SignupForm.php @@ -2,6 +2,7 @@ namespace frontend\models; use common\models\User; +use common\models\UserInfo; use yii\base\Model; use Yii; @@ -94,6 +95,7 @@ class SignupForm extends Model $user->generateAuthKey(); if ($user->save()) { +// $user->link('userInfo', new UserInfo(['city' => $this->city])); return $user; } } diff --git a/frontend/views/company/_blog_list_view.php b/frontend/views/company/_blog_list_view.php index 376bc17..51fab8e 100644 --- a/frontend/views/company/_blog_list_view.php +++ b/frontend/views/company/_blog_list_view.php @@ -1,11 +1,13 @@
@@ -14,6 +16,7 @@ 'company/blog-view', 'company_id' => $this->params[ 'company' ]->id, 'link' => $model->link, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ]), [ 'class' => 'blog-new-link' ]); ?>
@@ -35,6 +38,7 @@ '/company/blog-view', 'company_id' => $this->params[ 'company' ]->id, 'link' => $model->link, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ])); ?> description, 1300) ?>
@@ -42,5 +46,6 @@ 'company/blog-view', 'company_id' => $this->params[ 'company' ]->id, 'link' => $model->link, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ]), [ 'class' => 'blog-post-see-all style' ]); ?>
\ No newline at end of file diff --git a/frontend/views/company/_company_common_blog.php b/frontend/views/company/_company_common_blog.php index a98bf61..8e82b21 100644 --- a/frontend/views/company/_company_common_blog.php +++ b/frontend/views/company/_company_common_blog.php @@ -1,9 +1,11 @@ $model->user_id, 'link' => $model->link, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ]); ?>
@@ -32,5 +35,6 @@ 'company/blog-view', 'company_id' => $model->user_id, 'link' => $model->link, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ]) ?>
\ No newline at end of file diff --git a/frontend/views/company/_portfolio_list_view.php b/frontend/views/company/_portfolio_list_view.php index f1960cf..fe1f184 100644 --- a/frontend/views/company/_portfolio_list_view.php +++ b/frontend/views/company/_portfolio_list_view.php @@ -1,8 +1,12 @@
@@ -10,16 +14,18 @@ use yii\helpers\Url;
cover), Url::toRoute([ 'company/portfolio-view', - 'company_id' => $model->user_id, + 'company_id' => $model->user_id, 'portfolio_id' => $model->portfolio_id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ])); ?>
name, Url::toRoute([ 'company/portfolio-view', - 'company_id' => $model->user_id, + 'company_id' => $model->user_id, 'portfolio_id' => $model->portfolio_id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ])) ?>
@@ -27,22 +33,25 @@ use yii\helpers\Url;
-
+
+
127
-
+
+
10.0
-
+
+
14
-
specializations,'specialization_name')),20)?>
+
specializations, 'specialization_name')), 20) ?>
\ No newline at end of file diff --git a/frontend/views/company/blog-list.php b/frontend/views/company/blog-list.php index a10d727..4085252 100755 --- a/frontend/views/company/blog-list.php +++ b/frontend/views/company/blog-list.php @@ -1,27 +1,24 @@ params['company'] = $company; -$this->title = 'My Yii Application'; + /* @var $this yii\web\View */ + $this->params[ 'company' ] = $company; + $this->title = 'My Yii Application'; ?>
- $blog, - 'itemView'=>'_blog_list_view', - 'summary'=>'', - ] ); - ?> + 'itemView' => '_blog_list_view', + 'summary' => '', + 'viewParams' => [ 'parent_view' => $this ], + ]); ?>
diff --git a/frontend/views/company/common.php b/frontend/views/company/common.php index 5277318..e32ef2e 100755 --- a/frontend/views/company/common.php +++ b/frontend/views/company/common.php @@ -1,7 +1,7 @@ 'min-post-block', ], 'layout' => '{items}', + 'viewParams' => [ 'parent_view' => $this ], ]); ?> @@ -386,6 +387,7 @@ $company->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, ]) ?> diff --git a/frontend/views/company/portfolio.php b/frontend/views/company/portfolio.php index dec3d24..d98e137 100755 --- a/frontend/views/company/portfolio.php +++ b/frontend/views/company/portfolio.php @@ -1,29 +1,34 @@ params['company'] = $company; -$this->title = 'My Yii Application'; + use yii\helpers\ArrayHelper; + use \yii\helpers\Html; + use yii\helpers\Url; + use yii\widgets\ListView; + + /* @var $this yii\web\View + * @var $portfolio yii\data\ArrayDataProvider + */ + $this->params[ 'company' ] = $company; + $this->title = 'My Yii Application'; ?>

Проектов: totalCount ?>

- $company->id], - ['class'=> !isset($filter_id) || empty($filter_id) ? "active-tag" : ""]);?> + $company->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], [ 'class' => !isset( $filter_id ) || empty( $filter_id ) ? "active-tag" : "" ]); ?> - specialization->specialization_name} ({$filter->count})", - Url::toRoute(['company/portfolio-filter', 'performer_id'=> $company->id, 'filter' => $filter->specialization->specialization_id]), - ['class'=> isset($filter_id) && $filter->specialization->specialization_id == $filter_id ? "active-tag" : ""]);?> + specialization->specialization_name} ({$filter->count})", Url::toRoute([ + 'company/portfolio-filter', + 'performer_id' => $company->id, + 'filter' => $filter->specialization->specialization_id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ]), [ 'class' => isset( $filter_id ) && $filter->specialization->specialization_id == $filter_id ? "active-tag" : "" ]); ?>
@@ -31,13 +36,12 @@ $this->title = 'My Yii Application';
- $portfolio, - 'itemView'=>'_portfolio_list_view', - 'layout' => "{items}\n" - ] ); - ?> + 'itemView' => '_portfolio_list_view', + 'layout' => "{items}\n", + 'viewParams' => [ 'parent_view' => $this ], + ]); ?>
diff --git a/frontend/views/company/project-list.php b/frontend/views/company/project-list.php new file mode 100644 index 0000000..7a022e3 --- /dev/null +++ b/frontend/views/company/project-list.php @@ -0,0 +1,26 @@ +params[ 'company' ] = $company; + + $this->title = 'My Yii Application'; +?> +
+
Сейчас totalCount ?> предложений
+
+ $dataProvider, + 'itemView' => '@frontend/views/search/_projects_list_view', + 'layout' => "{items}\n", + ]); ?> +
+
diff --git a/frontend/views/layouts/company.php b/frontend/views/layouts/company.php index d7107fe..4695869 100755 --- a/frontend/views/layouts/company.php +++ b/frontend/views/layouts/company.php @@ -6,6 +6,7 @@ use common\models\User; use yii\helpers\Html; + use yii\helpers\Url; use yii\web\View; use yii\widgets\Menu; @@ -15,44 +16,48 @@
-
-
Оставьте заявку
и мы вам перезвоним -
-
+ params[ 'company' ]->id != \Yii::$app->user->getId()) { + ?> +
+
Оставьте заявку
и мы вам перезвоним +
+ -
- - -
+
+ + +
-
- - -
+
+ + +
- - -
Гарантируем конфидециальность
-
- user->identity )) { - ?> -
- params[ 'company' ]->isBookmarked) { - echo Html::a('', [ '#' ], [ - 'class' => 'artbox_bookmark_remove_performer', - 'data-id' => $this->params[ 'company' ]->id, - ]); - } else { - echo Html::a('', [ '#' ], [ - 'class' => 'artbox_bookmark_add_performer', - 'data-id' => $this->params[ 'company' ]->id, - ]); - } - ?> + + +
Гарантируем конфидециальность
user->identity )) { + ?> +
+ params[ 'company' ]->isBookmarked) { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_remove_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } else { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_add_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } + ?> +
+
@@ -73,20 +78,33 @@ 'url' => [ 'company/common', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], [ - 'label' => 'Выполненные работы', - 'url' => [ + '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/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, ], [ 'label' => 'Команда', 'url' => [ 'company/team', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], [ @@ -94,6 +112,7 @@ 'url' => [ 'company/vacancy-list', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], [ @@ -101,13 +120,15 @@ 'url' => [ 'company/blog-list', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], [ - 'label' => 'Отзывы', + 'label' => 'Мнения', 'url' => [ 'company/review', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], [ @@ -115,6 +136,7 @@ 'url' => [ 'company/gallery', 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, ], ], ], @@ -133,12 +155,38 @@
  • - Испонитель + params[ 'type' ] ) && $this->params[ 'type' ] == 'implementer') { + echo Html::a('Исполнитель', Url::current([ 'type' => 'implementer' ])); + } elseif(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') { + echo Html::a('Заказчик', Url::current([ 'type' => NULL ])); + } else { + echo Html::a('Исполнитель', Url::current([ 'type' => NULL ])); + } + ?>
  • @@ -152,27 +200,53 @@
-
params[ 'company' ]->comments) ?> отзывов
- $this->params['company']->id], ['class' => 'performance-vacancy-sidebar-write style']) ?> +
params[ 'company' ]->comments) ?> мнений
+ params[ 'company' ]->id != \Yii::$app->user->getId()) { + echo Html::a('написать мнение', [ + 'company/review', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], [ 'class' => 'performance-vacancy-sidebar-write style' ]); + } + ?>
params[ 'company' ]->userInfo->image); ?>
- render('/patrial/social_list',[ - 'params' => $this->params - ])?> + render('/patrial/social_list', [ + 'params' => $this->params, + ]) ?>
    -
  • params['company']->userInfo->view_count;?> просмотра
  • -
  • На сайте: params['company']->liveTime?>
  • -
  • Последний визит:
    params['company']->userInfo->lastVisit?>
  • -
  • Сотрудники:
    params['company']->companyInfo->staff?>
  • - render('/patrial/show_phone_list',[ - 'phones' => $this->params['company']->phones - ])?> - render('/patrial/show_site_list',[ - 'sites' => $this->params['company']->site - ])?> -
  • Адрес:
    params['company']->address?>
  • +
  • +
    params[ 'company' ]->userInfo->view_count; ?> просмотра
    +
  • +
  • +
    + На сайте: params[ 'company' ]->liveTime ?> +
    +
  • +
  • +
    + Последний визит:
    params[ 'company' ]->userInfo->lastVisit ?> +
    +
  • +
  • +
    + Сотрудники:
    params[ 'company' ]->companyInfo->staff ?> +
    +
  • + render('/patrial/show_phone_list', [ + 'phones' => $this->params[ 'company' ]->phones, + ]) ?> + render('/patrial/show_site_list', [ + 'sites' => $this->params[ 'company' ]->site, + ]) ?> +
  • +
    + Адрес:
    params[ 'company' ]->address ?> +
    +
diff --git a/frontend/views/layouts/gallery-company.php b/frontend/views/layouts/gallery-company.php index 0ef7f38..1f11504 100755 --- a/frontend/views/layouts/gallery-company.php +++ b/frontend/views/layouts/gallery-company.php @@ -1,29 +1,62 @@ beginContent('@app/views/layouts/main.php'); + \frontend\assets\AdminAsset::register($this); + /* @var $content string */ + $this->beginContent('@app/views/layouts/main.php'); ?>
-
+
-
-
Оставьте заявку
и мы вам перезвоним
-
- - - - - -
-
Гарантируем конфидециальность
-
-
+ params[ 'company' ]->id != \Yii::$app->user->getId()) { + ?> +
+
Оставьте заявку
и мы вам перезвоним +
+
+ +
+ + +
+ +
+ + +
+ + +
+
Гарантируем конфидециальность
+
+ user->identity )) { + ?> +
+ params[ 'company' ]->isBookmarked) { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_remove_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } else { + echo Html::a('', [ '#' ], [ + 'class' => 'artbox_bookmark_add_performer', + 'data-id' => $this->params[ 'company' ]->id, + ]); + } + ?> +
+
@@ -31,42 +64,80 @@ $this->beginContent('@app/views/layouts/main.php');
[ - 'class' => 'menu-content', - ], - 'activeCssClass' => 'active-menu-content', - 'items' => [ - [ - 'label' => 'Общее', - 'url' => ['company/common', 'company_id'=>$this->params['company']->id], - ], - [ - 'label' => 'Выполненные работы', - 'url' => ['company/portfolio', 'company_id'=>$this->params['company']->id], - ], - [ - 'label' => 'Команда', - 'url' => ['company/team', 'company_id'=>$this->params['company']->id], - ], - [ - 'label' => 'Вакансии', - 'url' => ['company/vacancy-list', 'company_id'=>$this->params['company']->id], - ], - [ - 'label' => 'Блог', - 'url' => ['company/blog-list', 'company_id'=>$this->params['company']->id], - ], - [ - 'label' => 'Отзывы', - 'url' => ['company/review', 'company_id'=>$this->params['company']->id], + echo Menu::widget([ + 'options' => [ + 'class' => 'menu-content', ], - [ - 'label' => 'Галерея', - 'url' => ['company/gallery', 'company_id'=>$this->params['company']->id], + '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, + ], + '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, + ], + 'visible' => ( !empty( $this->params[ 'type' ] ) && $this->params['type'] == 'customer' ) ? true : false, + ], + [ + 'label' => 'Команда', + 'url' => [ + 'company/team', + '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, + ], + ], + [ + '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, + ], + ], + [ + 'label' => 'Галерея', + 'url' => [ + 'company/gallery', + 'company_id' => $this->params[ 'company' ]->id, + 'type' => ( !empty( $this->params[ 'type' ] ) ) ? $this->params[ 'type' ] : NULL, + ], + ], ], - ], - ]); + ]); ?>
@@ -77,15 +148,42 @@ $this->beginContent('@app/views/layouts/main.php');
endContent() ?> \ No newline at end of file diff --git a/frontend/views/layouts/gallery.php b/frontend/views/layouts/gallery.php index cafdcc1..9b29dbe 100755 --- a/frontend/views/layouts/gallery.php +++ b/frontend/views/layouts/gallery.php @@ -14,9 +14,36 @@ $this->beginContent('@app/views/layouts/main.php');
- Предложить
проект
- $this->params['user']->id]), ['class'=> 'blog-buttons-write'])?> - Добавить
в закладки
+ params[ 'user' ]->id != \Yii::$app->user->getId()) { + // Offer project button + if(!empty( $this->params[ 'type' ] ) && $this->params[ 'type' ] == 'customer') { + echo Html::a('Предложить проект', [ '#' ], [ + 'class' => 'blog-buttons-offer', + 'data-performer-id' => $this->params[ 'user' ]->id, + ]); + } + // Write message + echo Html::a('Написать сообщение', Url::toRoute([ + 'chat/message', + 'user_id' => $this->params[ 'user' ]->id, + ]), [ 'class' => 'blog-buttons-write' ]); + // Bookmarks + if(!empty( \Yii::$app->user->identity )) { + if($this->params[ 'user' ]->isBookmarked) { + echo Html::a('Убрать из закладок', [ '#' ], [ + 'class' => 'get-list artbox_bookmark_remove_performer', + 'data-id' => $this->params[ 'user' ]->id, + ]); + } else { + echo Html::a('Добавить в закладки', [ '#' ], [ + 'class' => 'get-list artbox_bookmark_add_performer', + 'data-id' => $this->params[ 'user' ]->id, + ]); + } + } + } + ?>
@@ -25,38 +52,70 @@ $this->beginContent('@app/views/layouts/main.php');
[ - 'class' => 'menu-content', - ], - 'activeCssClass' => 'active-menu-content', - 'items' => [ - [ - 'label' => 'Общее', - 'url' => ['performer/common', 'performer_id'=>$this->params['user']->id], + echo Menu::widget([ + 'options' => [ + 'class' => 'menu-content', ], - [ - 'label' => 'Портфолио', - 'url' => ['performer/portfolio', 'performer_id'=>$this->params['user']->id], + 'activeCssClass' => 'active-menu-content', + 'items' => [ + [ + 'label' => 'Общее', + 'url' => [ + 'performer/common', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Портфолио', + 'url' => [ + 'performer/portfolio', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Заказанные работы', + 'url' => [ + 'performer/projects', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Блог', + 'url' => [ + 'performer/blog-list', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Мнения', + 'url' => [ + 'performer/review', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Места работы', + 'url' => [ + 'performer/workplace', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], + [ + 'label' => 'Галерея', + 'url' => [ + 'performer/gallery', + 'performer_id' => $this->params[ 'user' ]->id, + 'type' => (!empty($this->params['type']))?$this->params['type']:null, + ], + ], ], - [ - 'label' => 'Блог', - 'url' => ['performer/blog-list', 'performer_id'=>$this->params['user']->id], - ], - [ - 'label' => 'Отзывы', - 'url' => ['performer/review', 'performer_id'=>$this->params['user']->id], - ], - [ - 'label' => 'Места работы', - 'url' => ['performer/workplace', 'performer_id'=>$this->params['user']->id], - ], - [ - 'label' => 'Галерея', - 'url' => ['performer/gallery', 'performer_id'=>$this->params['user']->id], - ], - ], - ]); + ]); ?>
@@ -67,15 +126,42 @@ $this->beginContent('@app/views/layouts/main.php');