From f6ea894129243f61068d2ec7130b8b3f5d766d5d Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Fri, 12 Feb 2016 10:36:32 +0200 Subject: [PATCH] 09.02.16 --- common/models/Blog.php | 6 ++++++ common/models/Job.php | 16 ++++++++++++++++ common/models/User.php | 21 ++++++++++++++++++++- frontend/config/main.php | 2 ++ frontend/controllers/CompanyController.php | 85 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------- frontend/controllers/PerformerController.php | 3 +++ frontend/views/accounts/general.php | 2 +- frontend/views/company/blog-list.php | 2 +- frontend/views/company/blog-view.php | 1 + frontend/views/company/common.php | 2 +- frontend/views/company/gallery.php | 2 +- frontend/views/company/portfolio.php | 2 +- frontend/views/company/review.php | 2 +- frontend/views/company/team.php | 2 +- frontend/views/company/vacancy-list.php | 2 +- frontend/views/company/vacancy-view.php | 2 +- frontend/views/layouts/company.php | 54 +++++++++++++++++++++++++++++++++--------------------- frontend/views/layouts/gallery-company.php | 68 ++++++++++++++++++++++++++++++++++---------------------------------- frontend/views/performer/_blog_list_view.php | 2 +- frontend/views/performer/blog-list.php | 9 --------- frontend/views/performer/blog-view.php | 2 +- frontend/views/performer/common.php | 2 +- frontend/views/performer/workplace.php | 24 +++++++++--------------- frontend/web/css/style.css | 6 +++--- 24 files changed, 205 insertions(+), 114 deletions(-) diff --git a/common/models/Blog.php b/common/models/Blog.php index 907d542..3fa1339 100644 --- a/common/models/Blog.php +++ b/common/models/Blog.php @@ -83,6 +83,12 @@ ]; } + public function getDateCreate(){ + return date('Y-m-d',strtotime($this->date_add)); + } + + + /** * @inheritdoc */ diff --git a/common/models/Job.php b/common/models/Job.php index 8fbff20..9de2ac3 100755 --- a/common/models/Job.php +++ b/common/models/Job.php @@ -41,6 +41,22 @@ class Job extends \yii\db\ActiveRecord ]; } + + + public function getExpTime() + { + if($this->date_end){ + $date = new \DateTime(date('Y-m-d H:i:s', $this->date_start)); + return \Yii::$app->formatter->asRelativeTime($date->diff(new \DateTime(date('Y-m-d H:i:s', $this->date_end)))); + } else { + $now = new \DateTime('now'); + $date = new \DateTime(date('Y-m-d H:i:s', $this->date_start)); + return \Yii::$app->formatter->asRelativeTime($date->diff(new \DateTime(date('Y-m-d H:i:s', $now)))); + } + + } + + /** * @inheritdoc */ diff --git a/common/models/User.php b/common/models/User.php index 7eba55f..95e096b 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -343,9 +343,23 @@ return $this->hasOne(CompanyInfo::className(), [ 'user_id' => 'id' ]); } + + public function getPhones(){ + return Fields::getData($this->id, self::className(),'phone'); + } + + + public function getSite(){ + return Fields::getData($this->id, self::className(),'site'); + } + + public function getAddress(){ + return $this->userInfo->country.', '.$this->userInfo->city.', '.$this->companyInfo->street.', '.$this->companyInfo->house; + } + + public function getLiveTime() { - $now = new \DateTime('now'); $date1 = new \DateTime(date('Y-m-d H:i:s', $this->created_at)); return \Yii::$app->formatter->asRelativeTime($date1->diff($now)); @@ -385,6 +399,11 @@ return $this->hasMany(Blog::className(), [ 'user_id' => 'id' ]); } + public function getJobs() + { + return $this->hasMany(Job::className(), [ 'user_id' => 'id' ]); + } + public function getSpecializationInput() { return $this->getSpecializations() diff --git a/frontend/config/main.php b/frontend/config/main.php index ef5c9c8..c8d5f99 100755 --- a/frontend/config/main.php +++ b/frontend/config/main.php @@ -66,6 +66,8 @@ return [ 'landing/' => 'landing/view', 'performer/blog-view//' => 'performer/blog-view', 'performer//' => 'performer/', + 'company/blog-view//' => 'company/blog-view', + 'company//' => 'company/', ] ], diff --git a/frontend/controllers/CompanyController.php b/frontend/controllers/CompanyController.php index 1354954..e709673 100755 --- a/frontend/controllers/CompanyController.php +++ b/frontend/controllers/CompanyController.php @@ -1,6 +1,7 @@ redirect(['site/index']); + $this->redirect('site/index'); } - public function actionCommon(/*$company_id*/) + public function actionCommon($company_id) { - return $this->render('common'); + $company = User::findOne($company_id); + + $educations = Fields::getData($company->id,$company->className(),'education'); + $phones = Fields::getData($company->id,$company->className(),'phone'); + $sites = Fields::getData($company->id,$company->className(),'site'); + $soft = implode(', ',ArrayHelper::getColumn(Fields::getData($company->id,$company->className(),'soft'), 'soft')); + + return $this->render('common',[ + 'company' => $company, + 'educations' => $educations, + 'phones' => $phones, + 'sites' => $sites, + 'soft' => $soft + ]); } - public function actionPortfolio(/*$company_id*/) + public function actionPortfolio($company_id) { - return $this->render('portfolio'); + $company = User::findOne($company_id); + + return $this->render('portfolio',[ + 'company' => $company + ]); } - public function actionTeam(/*$company_id*/) + public function actionTeam($company_id) { - return $this->render('team'); + $company = User::findOne($company_id); + + return $this->render('team',[ + 'company' => $company + ]); } - public function actionBlogList(/*$company_id*/) + public function actionBlogList($company_id) { - return $this->render('blog-list'); + $company = User::findOne($company_id); + + return $this->render('blog-list',[ + 'company' => $company + ]); } - public function actionBlogView(/*$company_id, $article_id*/) + public function actionBlogView($company_id, $article_id) { - return $this->render('blog-view'); + $company = User::findOne($company_id); + + return $this->render('blog-view',[ + 'company' => $company + ]); } - public function actionReview(/*$company_id*/) + public function actionReview($company_id) { - return $this->render('review'); + $company = User::findOne($company_id); + + return $this->render('review',[ + 'company' => $company + ]); } - public function actionVacancyList(/*$company_id*/) + public function actionVacancyList($company_id) { - return $this->render('vacancy-list'); + $company = User::findOne($company_id); + + return $this->render('vacancy-list',[ + 'company' => $company + ]); } - public function actionVacancyView(/*$company_id, $vacancy_id*/) + public function actionVacancyView($company_id, $vacancy_id) { - return $this->render('vacancy-view'); + $company = User::findOne($company_id); + + return $this->render('vacancy-view',[ + 'company' => $company + ]); } - public function actionGallery(/*$company_id*/) + public function actionGallery($company_id) { + $company = User::findOne($company_id); + $this->layout = 'gallery-company'; - return $this->render('gallery'); + return $this->render('gallery',[ + 'company' => $company + ]); } } diff --git a/frontend/controllers/PerformerController.php b/frontend/controllers/PerformerController.php index 551a2ec..62ca255 100755 --- a/frontend/controllers/PerformerController.php +++ b/frontend/controllers/PerformerController.php @@ -109,6 +109,8 @@ class PerformerController extends Controller { $user = User::findOne($performer_id); $article = Blog::findOne(['link'=>$link,'user_id'=>$performer_id]); + $article->view_count ++; + $article->save(); return $this->render('blog-view',[ @@ -129,6 +131,7 @@ class PerformerController extends Controller public function actionWorkplace($performer_id) { $user = User::findOne($performer_id); + return $this->render('workplace',[ 'user' => $user ]); diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index 787cf9a..8c638af 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -221,7 +221,7 @@ 'model'=> $user_info, 'field'=>'poster', 'width'=>1920, - 'height'=>235, + 'height'=>380, 'multi'=>false, 'gallery' =>$user_info->poster, 'name' => 'Выбрать файл' diff --git a/frontend/views/company/blog-list.php b/frontend/views/company/blog-list.php index 0364ed3..f519129 100755 --- a/frontend/views/company/blog-list.php +++ b/frontend/views/company/blog-list.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/blog-view.php b/frontend/views/company/blog-view.php index c74f360..54aa8db 100755 --- a/frontend/views/company/blog-view.php +++ b/frontend/views/company/blog-view.php @@ -2,6 +2,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/common.php b/frontend/views/company/common.php index 22ba430..f9dd130 100755 --- a/frontend/views/company/common.php +++ b/frontend/views/company/common.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
О компании
diff --git a/frontend/views/company/gallery.php b/frontend/views/company/gallery.php index 3eb3a08..2cc3066 100755 --- a/frontend/views/company/gallery.php +++ b/frontend/views/company/gallery.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/portfolio.php b/frontend/views/company/portfolio.php index 50bd117..a0a7aca 100755 --- a/frontend/views/company/portfolio.php +++ b/frontend/views/company/portfolio.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/review.php b/frontend/views/company/review.php index 66ad30a..d15cf75 100755 --- a/frontend/views/company/review.php +++ b/frontend/views/company/review.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/team.php b/frontend/views/company/team.php index 9849f72..1e5df09 100755 --- a/frontend/views/company/team.php +++ b/frontend/views/company/team.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
diff --git a/frontend/views/company/vacancy-list.php b/frontend/views/company/vacancy-list.php index fda4cfc..a1f74a1 100755 --- a/frontend/views/company/vacancy-list.php +++ b/frontend/views/company/vacancy-list.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?>
Вакансии
diff --git a/frontend/views/company/vacancy-view.php b/frontend/views/company/vacancy-view.php index 1bbfa6f..8718e4b 100755 --- a/frontend/views/company/vacancy-view.php +++ b/frontend/views/company/vacancy-view.php @@ -3,7 +3,7 @@ use \yii\helpers\Html; /* @var $this yii\web\View */ - +$this->params['company'] = $company; $this->title = 'My Yii Application'; ?> diff --git a/frontend/views/layouts/company.php b/frontend/views/layouts/company.php index 44d0f62..8e7eaab 100755 --- a/frontend/views/layouts/company.php +++ b/frontend/views/layouts/company.php @@ -1,5 +1,6 @@ beginContent('@app/views/layouts/main.php'); ?>
-
+
@@ -39,31 +40,31 @@ $this->beginContent('@app/views/layouts/main.php'); 'items' => [ [ 'label' => 'Общее', - 'url' => ['company/common'], + 'url' => ['company/common', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Выполненные работы', - 'url' => ['company/portfolio'], + 'url' => ['company/portfolio', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Команда', - 'url' => ['company/team'], + 'url' => ['company/team', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Вакансии', - 'url' => ['company/vacancy-list'], + 'url' => ['company/vacancy-list', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Блог', - 'url' => ['company/blog-list'], + 'url' => ['company/blog-list', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Отзывы', - 'url' => ['company/review'], + 'url' => ['company/review', 'company_id'=>$this->params['company']->id], ], [ 'label' => 'Галерея', - 'url' => ['company/gallery'], + 'url' => ['company/gallery', 'company_id'=>$this->params['company']->id], ], ], ]); @@ -102,26 +103,37 @@ $this->beginContent('@app/views/layouts/main.php');
30 отзывов
написать отзыв
-
+
params['company']->userInfo->image);?>
    -
  • -
  • -
  • -
  • +
  • + params['company']->userInfo->social_fb],['target'=>'_blank'])?> +
  • +
  • + params['company']->userInfo->social_t],['target'=>'_blank'])?> +
  • +
  • + params['company']->userInfo->social_in],['target'=>'_blank'])?> +
  • +
  • + params['company']->userInfo->social_vk],['target'=>'_blank'])?> +
    -
  • 2562 просмотра
  • -
  • На сайте: 1г. 8 мес.
  • -
  • Последний визит:
    2 дня назад
  • -
  • Последнее обновление: 1 ноября 2015
  • -
  • Сотрудники:
    Более 400
  • -
  • +38 (050) 123-45-67
  • -
  • -
  • Адрес:
    Украина, г. Киев, бульвар Леси Украинки 30В
  • +
  • params['company']->userInfo->view_count;?> просмотра
  • +
  • На сайте: params['company']->liveTime?>
  • +
  • Последний визит:
    params['company']->userInfo->lastVisit?>
  • +
  • Сотрудники:
    params['company']->companyInfo->staff?>
  • + params['company']->phones as $phone ):?> +
  • + + params['company']->site as $site ):?> +
  • + +
  • Адрес:
    params['company']->address?>
diff --git a/frontend/views/layouts/gallery-company.php b/frontend/views/layouts/gallery-company.php index ef56e6e..eed2511 100755 --- a/frontend/views/layouts/gallery-company.php +++ b/frontend/views/layouts/gallery-company.php @@ -30,42 +30,42 @@ $this->beginContent('@app/views/layouts/main.php');
[ - 'class' => 'menu-content', + echo Menu::widget([ + 'options' => [ + 'class' => 'menu-content', + ], + 'activeCssClass' => 'active-menu-content', + 'items' => [ + [ + 'label' => 'Общее', + 'url' => ['company/common', 'company_id'=>$this->params['company']->id], ], - 'activeCssClass' => 'active-menu-content', - 'items' => [ - [ - 'label' => 'Общее', - 'url' => ['company/common'], - ], - [ - 'label' => 'Выполненные работы', - 'url' => ['company/portfolio'], - ], - [ - 'label' => 'Команда', - 'url' => ['company/team'], - ], - [ - 'label' => 'Вакансии', - 'url' => ['company/vacancy-list'], - ], - [ - 'label' => 'Блог', - 'url' => ['company/blog-list'], - ], - [ - 'label' => 'Отзывы', - 'url' => ['company/review'], - ], - [ - 'label' => 'Галерея', - 'url' => ['company/gallery'], - ], + [ + '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], + ], + [ + 'label' => 'Галерея', + 'url' => ['company/gallery', 'company_id'=>$this->params['company']->id], + ], + ], + ]); ?>
diff --git a/frontend/views/performer/_blog_list_view.php b/frontend/views/performer/_blog_list_view.php index c4b046b..2f028d6 100644 --- a/frontend/views/performer/_blog_list_view.php +++ b/frontend/views/performer/_blog_list_view.php @@ -10,7 +10,7 @@ use yii\helpers\Url;

view_count?>

diff --git a/frontend/views/performer/blog-list.php b/frontend/views/performer/blog-list.php index 8f02720..dd72750 100755 --- a/frontend/views/performer/blog-list.php +++ b/frontend/views/performer/blog-list.php @@ -24,14 +24,5 @@ $this->title = 'My Yii Application'; 'pagination' => $pagination, ]); ?> - - - - - - - - -
diff --git a/frontend/views/performer/blog-view.php b/frontend/views/performer/blog-view.php index 9c69a35..4fe67cd 100755 --- a/frontend/views/performer/blog-view.php +++ b/frontend/views/performer/blog-view.php @@ -12,7 +12,7 @@
diff --git a/frontend/views/performer/common.php b/frontend/views/performer/common.php index 77d0d74..4fb3e2e 100755 --- a/frontend/views/performer/common.php +++ b/frontend/views/performer/common.php @@ -145,7 +145,7 @@ $this->title = 'My Yii Application'; diff --git a/frontend/views/performer/workplace.php b/frontend/views/performer/workplace.php index ff17053..bdfdf40 100755 --- a/frontend/views/performer/workplace.php +++ b/frontend/views/performer/workplace.php @@ -10,23 +10,17 @@ $this->title = 'My Yii Application';

Опыт работы

-
-
Проектное бюра Арсеньева
- -
Архитектор
-
-
-
Студия Keppy
- -
Архитектор, дизайнер
-
+ jobs as $job):?> +
+
name ?>
+ +
position ?>
+
+ + + -
-
Фриланс
- -
Дизайнер
-
\ No newline at end of file diff --git a/frontend/web/css/style.css b/frontend/web/css/style.css index 328b7a2..2323753 100755 --- a/frontend/web/css/style.css +++ b/frontend/web/css/style.css @@ -1834,10 +1834,10 @@ input[type=file]::-webkit-file-upload-button { /***blog****/ .section-box-16 { - height: 235px; + height: 380px; } .blog-buttons-wr { - margin-top: 160px; + margin-top: 305px; width: 526px; float: right; } @@ -5504,4 +5504,4 @@ a.blog-new-link:hover{text-decoration: underline !important;} display: block; border: none; outline: none; -} \ No newline at end of file +} -- libgit2 0.21.4