Commit 7b71f0dec62588fe13168ba03d5f07e5ea7b7bb7
Merge remote-tracking branch 'origin/master'
Showing
37 changed files
with
1718 additions
and
1109 deletions
Show diff stats
common/models/Blog.php
| @@ -2,6 +2,7 @@ | @@ -2,6 +2,7 @@ | ||
| 2 | 2 | ||
| 3 | namespace common\models; | 3 | namespace common\models; |
| 4 | 4 | ||
| 5 | + use common\modules\comment\models\Comment; | ||
| 5 | use Yii; | 6 | use Yii; |
| 6 | use yii\behaviors\BlameableBehavior; | 7 | use yii\behaviors\BlameableBehavior; |
| 7 | use yii\behaviors\TimestampBehavior; | 8 | use yii\behaviors\TimestampBehavior; |
| @@ -30,7 +31,6 @@ | @@ -30,7 +31,6 @@ | ||
| 30 | return 'blog'; | 31 | return 'blog'; |
| 31 | } | 32 | } |
| 32 | 33 | ||
| 33 | - | ||
| 34 | /** | 34 | /** |
| 35 | * @inheritdoc | 35 | * @inheritdoc |
| 36 | */ | 36 | */ |
| @@ -49,11 +49,11 @@ | @@ -49,11 +49,11 @@ | ||
| 49 | 'value' => new Expression('NOW()'), | 49 | 'value' => new Expression('NOW()'), |
| 50 | ], | 50 | ], |
| 51 | 'slug' => [ | 51 | 'slug' => [ |
| 52 | - 'class' => 'common\behaviors\Slug', | ||
| 53 | - 'in_attribute' => 'name', | 52 | + 'class' => 'common\behaviors\Slug', |
| 53 | + 'in_attribute' => 'name', | ||
| 54 | 'out_attribute' => 'link', | 54 | 'out_attribute' => 'link', |
| 55 | - 'translit' => true | ||
| 56 | - ] | 55 | + 'translit' => true, |
| 56 | + ], | ||
| 57 | ]; | 57 | ]; |
| 58 | } | 58 | } |
| 59 | 59 | ||
| @@ -64,7 +64,10 @@ | @@ -64,7 +64,10 @@ | ||
| 64 | { | 64 | { |
| 65 | return [ | 65 | return [ |
| 66 | [ | 66 | [ |
| 67 | - [ 'name', 'description' ], | 67 | + [ |
| 68 | + 'name', | ||
| 69 | + 'description', | ||
| 70 | + ], | ||
| 68 | 'required', | 71 | 'required', |
| 69 | ], | 72 | ], |
| 70 | [ | 73 | [ |
| @@ -83,8 +86,9 @@ | @@ -83,8 +86,9 @@ | ||
| 83 | ]; | 86 | ]; |
| 84 | } | 87 | } |
| 85 | 88 | ||
| 86 | - public function getDateCreate(){ | ||
| 87 | - return date('Y-m-d',strtotime($this->date_add)); | 89 | + public function getDateCreate() |
| 90 | + { | ||
| 91 | + return date('Y-m-d', strtotime($this->date_add)); | ||
| 88 | } | 92 | } |
| 89 | 93 | ||
| 90 | /** | 94 | /** |
| @@ -104,4 +108,10 @@ | @@ -104,4 +108,10 @@ | ||
| 104 | 'cover' => Yii::t('app', 'Фото главное'), | 108 | 'cover' => Yii::t('app', 'Фото главное'), |
| 105 | ]; | 109 | ]; |
| 106 | } | 110 | } |
| 111 | + | ||
| 112 | + public function getComments() | ||
| 113 | + { | ||
| 114 | + return $this->hasMany(Comment::className(), [ 'model_id' => 'blog_id' ]) | ||
| 115 | + ->where([ 'model' => $this->className() ]); | ||
| 116 | + } | ||
| 107 | } | 117 | } |
common/models/Message.php
| @@ -89,8 +89,6 @@ class Message extends \yii\db\ActiveRecord | @@ -89,8 +89,6 @@ class Message extends \yii\db\ActiveRecord | ||
| 89 | 89 | ||
| 90 | } | 90 | } |
| 91 | 91 | ||
| 92 | - | ||
| 93 | - | ||
| 94 | public function isMy(){ | 92 | public function isMy(){ |
| 95 | if($this->user_id == \Yii::$app->user->id){ | 93 | if($this->user_id == \Yii::$app->user->id){ |
| 96 | return true; | 94 | return true; |
common/models/Project.php
| @@ -33,6 +33,7 @@ | @@ -33,6 +33,7 @@ | ||
| 33 | class Project extends \yii\db\ActiveRecord | 33 | class Project extends \yii\db\ActiveRecord |
| 34 | { | 34 | { |
| 35 | 35 | ||
| 36 | + public $files; | ||
| 36 | /** | 37 | /** |
| 37 | * @inheritdoc | 38 | * @inheritdoc |
| 38 | */ | 39 | */ |
| @@ -94,6 +95,7 @@ | @@ -94,6 +95,7 @@ | ||
| 94 | [ | 95 | [ |
| 95 | 'specializationInput', | 96 | 'specializationInput', |
| 96 | 'paymentInput', | 97 | 'paymentInput', |
| 98 | + 'files', | ||
| 97 | ], | 99 | ], |
| 98 | 'safe', | 100 | 'safe', |
| 99 | ], | 101 | ], |
| @@ -258,4 +260,17 @@ | @@ -258,4 +260,17 @@ | ||
| 258 | { | 260 | { |
| 259 | $this->specializationString = $value; | 261 | $this->specializationString = $value; |
| 260 | } | 262 | } |
| 263 | + | ||
| 264 | + /** | ||
| 265 | + * @return File[] | ||
| 266 | + */ | ||
| 267 | + public function getFilesList() | ||
| 268 | + { | ||
| 269 | + $files = json_decode($this->files); | ||
| 270 | + if(!empty( $files )) { | ||
| 271 | + return File::findAll($files); | ||
| 272 | + } else { | ||
| 273 | + return [ ]; | ||
| 274 | + } | ||
| 275 | + } | ||
| 261 | } | 276 | } |
common/models/TenderSearch.php
common/models/User.php
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | use yii\behaviors\TimestampBehavior; | 9 | use yii\behaviors\TimestampBehavior; |
| 10 | use yii\db\ActiveQuery; | 10 | use yii\db\ActiveQuery; |
| 11 | use yii\db\ActiveRecord; | 11 | use yii\db\ActiveRecord; |
| 12 | + use yii\helpers\Url; | ||
| 12 | use yii\rbac\ManagerInterface; | 13 | use yii\rbac\ManagerInterface; |
| 13 | use yii\rbac\Role; | 14 | use yii\rbac\Role; |
| 14 | use yii\web\IdentityInterface; | 15 | use yii\web\IdentityInterface; |
| @@ -28,6 +29,32 @@ | @@ -28,6 +29,32 @@ | ||
| 28 | * @property string $password write-only password | 29 | * @property string $password write-only password |
| 29 | * @property string $type | 30 | * @property string $type |
| 30 | * @property UserInfo $userInfo | 31 | * @property UserInfo $userInfo |
| 32 | + * @property string $userName | ||
| 33 | + * @property array[] $roles | ||
| 34 | + * @property CompanyInfo $companyInfo | ||
| 35 | + * @property array[] $phones | ||
| 36 | + * @property array[] $site | ||
| 37 | + * @property string $address | ||
| 38 | + * @property string $liveTime | ||
| 39 | + * @property Payment[] $payments | ||
| 40 | + * @property integer[] $paymentInput | ||
| 41 | + * @property Specialization[] $specializations | ||
| 42 | + * @property integer[] $specializationInput | ||
| 43 | + * @property Blog[] $blog | ||
| 44 | + * @property Job[] $jobs | ||
| 45 | + * @property Job $currentJob | ||
| 46 | + * @property Portfolio[] $portfolios | ||
| 47 | + * @property Project[] $projects | ||
| 48 | + * @property Team[] $teams | ||
| 49 | + * @property Vacancy[] $vacancies | ||
| 50 | + * @property Gallery[] $galleries | ||
| 51 | + * @property UserInfo|CompanyInfo $owner | ||
| 52 | + * @property string $name | ||
| 53 | + * @property Comment[] $comments | ||
| 54 | + * @property Rating[] $commentRating | ||
| 55 | + * @property int $ratingPG | ||
| 56 | + * @property string $lastVisit | ||
| 57 | + * @property string $link | ||
| 31 | */ | 58 | */ |
| 32 | class User extends ActiveRecord implements IdentityInterface, UserRbacInterface | 59 | class User extends ActiveRecord implements IdentityInterface, UserRbacInterface |
| 33 | { | 60 | { |
| @@ -51,8 +78,6 @@ | @@ -51,8 +78,6 @@ | ||
| 51 | return '{{%user}}'; | 78 | return '{{%user}}'; |
| 52 | } | 79 | } |
| 53 | 80 | ||
| 54 | - | ||
| 55 | - | ||
| 56 | /** | 81 | /** |
| 57 | * @inheritdoc | 82 | * @inheritdoc |
| 58 | */ | 83 | */ |
| @@ -60,7 +85,7 @@ | @@ -60,7 +85,7 @@ | ||
| 60 | { | 85 | { |
| 61 | return [ | 86 | return [ |
| 62 | [ | 87 | [ |
| 63 | - 'class' => 'common\behaviors\ShowImage', | 88 | + 'class' => 'common\behaviors\ShowImage', |
| 64 | ], | 89 | ], |
| 65 | TimestampBehavior::className(), | 90 | TimestampBehavior::className(), |
| 66 | ]; | 91 | ]; |
| @@ -560,11 +585,21 @@ | @@ -560,11 +585,21 @@ | ||
| 560 | ->inverseOf('user'); | 585 | ->inverseOf('user'); |
| 561 | } | 586 | } |
| 562 | 587 | ||
| 588 | + /** | ||
| 589 | + * Return all user's galleries | ||
| 590 | + * | ||
| 591 | + * @return ActiveQuery | ||
| 592 | + */ | ||
| 563 | public function getGalleries() | 593 | public function getGalleries() |
| 564 | { | 594 | { |
| 565 | return $this->hasMany(Gallery::className(), [ 'user_id' => 'id' ]); | 595 | return $this->hasMany(Gallery::className(), [ 'user_id' => 'id' ]); |
| 566 | } | 596 | } |
| 567 | 597 | ||
| 598 | + /** | ||
| 599 | + * Return company info or user info according to user type | ||
| 600 | + * | ||
| 601 | + * @return ActiveQuery | ||
| 602 | + */ | ||
| 568 | public function getOwner() | 603 | public function getOwner() |
| 569 | { | 604 | { |
| 570 | if($this->type == 2) { | 605 | if($this->type == 2) { |
| @@ -574,6 +609,11 @@ | @@ -574,6 +609,11 @@ | ||
| 574 | } | 609 | } |
| 575 | } | 610 | } |
| 576 | 611 | ||
| 612 | + /** | ||
| 613 | + * Return company name or user firstname and lastname according to user type | ||
| 614 | + * | ||
| 615 | + * @return string | ||
| 616 | + */ | ||
| 577 | public function getName() | 617 | public function getName() |
| 578 | { | 618 | { |
| 579 | if($this->type == 2) { | 619 | if($this->type == 2) { |
| @@ -584,6 +624,8 @@ | @@ -584,6 +624,8 @@ | ||
| 584 | } | 624 | } |
| 585 | 625 | ||
| 586 | /** | 626 | /** |
| 627 | + * Return all comments to user | ||
| 628 | + * | ||
| 587 | * @return ActiveQuery | 629 | * @return ActiveQuery |
| 588 | */ | 630 | */ |
| 589 | public function getComments() | 631 | public function getComments() |
| @@ -597,6 +639,8 @@ | @@ -597,6 +639,8 @@ | ||
| 597 | } | 639 | } |
| 598 | 640 | ||
| 599 | /** | 641 | /** |
| 642 | + * Return all ratings to user | ||
| 643 | + * | ||
| 600 | * @return ActiveQuery | 644 | * @return ActiveQuery |
| 601 | */ | 645 | */ |
| 602 | public function getCommentRating() | 646 | public function getCommentRating() |
| @@ -608,13 +652,20 @@ | @@ -608,13 +652,20 @@ | ||
| 608 | ]); | 652 | ]); |
| 609 | } | 653 | } |
| 610 | 654 | ||
| 655 | + /** | ||
| 656 | + * Return user's rating<br> | ||
| 657 | + * <b>Available only for PostgreSQL</b> | ||
| 658 | + * | ||
| 659 | + * @return int | ||
| 660 | + * @throws InvalidConfigException | ||
| 661 | + */ | ||
| 611 | public function getRatingPG() | 662 | public function getRatingPG() |
| 612 | { | 663 | { |
| 613 | if(\Yii::$app->db->driverName != 'pgsql') { | 664 | if(\Yii::$app->db->driverName != 'pgsql') { |
| 614 | throw new InvalidConfigException('This method is available only in PostgreSQL'); | 665 | throw new InvalidConfigException('This method is available only in PostgreSQL'); |
| 615 | } | 666 | } |
| 616 | return $this->getCommentRating() | 667 | return $this->getCommentRating() |
| 617 | - ->select('ROUND(SUM("rating"."value")/COUNT("rating"."rating_id")::float) as rating') | 668 | + ->select(['rating' => 'ROUND(SUM("rating"."value")/COUNT("rating"."rating_id")::numeric, 2)']) |
| 618 | ->andWhere([ | 669 | ->andWhere([ |
| 619 | 'not', | 670 | 'not', |
| 620 | [ 'rating.value' => NULL ], | 671 | [ 'rating.value' => NULL ], |
| @@ -622,6 +673,15 @@ | @@ -622,6 +673,15 @@ | ||
| 622 | ->scalar(); | 673 | ->scalar(); |
| 623 | } | 674 | } |
| 624 | 675 | ||
| 676 | + /** | ||
| 677 | + * Recalculate rating and write it to db. | ||
| 678 | + * | ||
| 679 | + * <b>Only for PostgreSQL</b> | ||
| 680 | + * | ||
| 681 | + * @see \common\models\User::getRatingPG() | ||
| 682 | + * | ||
| 683 | + * @throws InvalidConfigException | ||
| 684 | + */ | ||
| 625 | public function updateRating() | 685 | public function updateRating() |
| 626 | { | 686 | { |
| 627 | if($rating = $this->getRatingPG()) { | 687 | if($rating = $this->getRatingPG()) { |
| @@ -630,4 +690,23 @@ | @@ -630,4 +690,23 @@ | ||
| 630 | } | 690 | } |
| 631 | } | 691 | } |
| 632 | 692 | ||
| 693 | + public function getLastVisit() | ||
| 694 | + { | ||
| 695 | + return \Yii::$app->formatter->asRelativeTime($this->userInfo->date_visit); | ||
| 696 | + } | ||
| 697 | + | ||
| 698 | + /** | ||
| 699 | + * Return link to user personal page according to user type | ||
| 700 | + * | ||
| 701 | + * @return string | ||
| 702 | + */ | ||
| 703 | + public function getLink($page = 'common') | ||
| 704 | + { | ||
| 705 | + if($this->type == 2) { | ||
| 706 | + return Url::to(['company/'.$page, 'company_id' => $this->id]); | ||
| 707 | + } else { | ||
| 708 | + return Url::to(['performer/'.$page, 'performer_id' => $this->id]); | ||
| 709 | + } | ||
| 710 | + } | ||
| 711 | + | ||
| 633 | } | 712 | } |
common/models/Vacancy.php
| @@ -7,6 +7,7 @@ | @@ -7,6 +7,7 @@ | ||
| 7 | use yii\behaviors\TimestampBehavior; | 7 | use yii\behaviors\TimestampBehavior; |
| 8 | use yii\db\ActiveQuery; | 8 | use yii\db\ActiveQuery; |
| 9 | use yii\db\Expression; | 9 | use yii\db\Expression; |
| 10 | + use yii\helpers\ArrayHelper; | ||
| 10 | 11 | ||
| 11 | /** | 12 | /** |
| 12 | * This is the model class for table "vacancy". | 13 | * This is the model class for table "vacancy". |
| @@ -31,6 +32,7 @@ | @@ -31,6 +32,7 @@ | ||
| 31 | 32 | ||
| 32 | const STATUS_ACTIVE = 1; | 33 | const STATUS_ACTIVE = 1; |
| 33 | const STATUS_CLOSED = 3; | 34 | const STATUS_CLOSED = 3; |
| 35 | + | ||
| 34 | /** | 36 | /** |
| 35 | * @inheritdoc | 37 | * @inheritdoc |
| 36 | */ | 38 | */ |
| @@ -57,11 +59,11 @@ | @@ -57,11 +59,11 @@ | ||
| 57 | 'value' => new Expression('NOW()'), | 59 | 'value' => new Expression('NOW()'), |
| 58 | ], | 60 | ], |
| 59 | 'slug' => [ | 61 | 'slug' => [ |
| 60 | - 'class' => 'common\behaviors\Slug', | ||
| 61 | - 'in_attribute' => 'name', | 62 | + 'class' => 'common\behaviors\Slug', |
| 63 | + 'in_attribute' => 'name', | ||
| 62 | 'out_attribute' => 'link', | 64 | 'out_attribute' => 'link', |
| 63 | - 'translit' => true | ||
| 64 | - ] | 65 | + 'translit' => true, |
| 66 | + ], | ||
| 65 | ]; | 67 | ]; |
| 66 | } | 68 | } |
| 67 | 69 | ||
| @@ -72,7 +74,12 @@ | @@ -72,7 +74,12 @@ | ||
| 72 | { | 74 | { |
| 73 | return [ | 75 | return [ |
| 74 | [ | 76 | [ |
| 75 | - [ 'name', 'description', 'city', 'link' ], | 77 | + [ |
| 78 | + 'name', | ||
| 79 | + 'description', | ||
| 80 | + 'city', | ||
| 81 | + 'link', | ||
| 82 | + ], | ||
| 76 | 'required', | 83 | 'required', |
| 77 | ], | 84 | ], |
| 78 | [ | 85 | [ |
| @@ -80,22 +87,31 @@ | @@ -80,22 +87,31 @@ | ||
| 80 | 'string', | 87 | 'string', |
| 81 | ], | 88 | ], |
| 82 | [ | 89 | [ |
| 83 | - [ 'employmentInput', 'specializationInput', ], | 90 | + [ |
| 91 | + 'employmentInput', | ||
| 92 | + 'specializationInput', | ||
| 93 | + ], | ||
| 84 | 'safe', | 94 | 'safe', |
| 85 | ], | 95 | ], |
| 86 | [ | 96 | [ |
| 87 | - ['salary_currency', 'status',], | ||
| 88 | - 'integer' | 97 | + [ |
| 98 | + 'salary_currency', | ||
| 99 | + 'status', | ||
| 100 | + ], | ||
| 101 | + 'integer', | ||
| 89 | ], | 102 | ], |
| 90 | [ | 103 | [ |
| 91 | - ['salary'], | 104 | + [ 'salary' ], |
| 92 | 'integer', | 105 | 'integer', |
| 93 | 'min' => 0, | 106 | 'min' => 0, |
| 94 | ], | 107 | ], |
| 95 | [ | 108 | [ |
| 96 | - [ 'employmentInput', 'specializationInput' ], | 109 | + [ |
| 110 | + 'employmentInput', | ||
| 111 | + 'specializationInput', | ||
| 112 | + ], | ||
| 97 | 'default', | 113 | 'default', |
| 98 | - 'value' => [], | 114 | + 'value' => [ ], |
| 99 | ], | 115 | ], |
| 100 | [ | 116 | [ |
| 101 | [ 'view_count' ], | 117 | [ 'view_count' ], |
| @@ -118,7 +134,7 @@ | @@ -118,7 +134,7 @@ | ||
| 118 | 'max' => 255, | 134 | 'max' => 255, |
| 119 | ], | 135 | ], |
| 120 | [ | 136 | [ |
| 121 | - ['phone'], | 137 | + [ 'phone' ], |
| 122 | 'match', | 138 | 'match', |
| 123 | 'pattern' => '/^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$/', | 139 | 'pattern' => '/^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$/', |
| 124 | ], | 140 | ], |
| @@ -179,22 +195,25 @@ | @@ -179,22 +195,25 @@ | ||
| 179 | return Fields::getData($this->vacancy_id, Vacancy::className(), 'requirements'); | 195 | return Fields::getData($this->vacancy_id, Vacancy::className(), 'requirements'); |
| 180 | } | 196 | } |
| 181 | 197 | ||
| 198 | + public function getVacancySpecializations() | ||
| 199 | + { | ||
| 200 | + return $this->hasMany(VacancySpecialization::className(), [ 'specialization_id' => 'specialization_id' ]); | ||
| 201 | + } | ||
| 202 | + | ||
| 182 | /** | 203 | /** |
| 183 | * @return ActiveQuery | 204 | * @return ActiveQuery |
| 184 | */ | 205 | */ |
| 185 | public function getSpecializations() | 206 | public function getSpecializations() |
| 186 | { | 207 | { |
| 187 | return $this->hasMany(Specialization::className(), [ 'specialization_id' => 'specialization_id' ]) | 208 | return $this->hasMany(Specialization::className(), [ 'specialization_id' => 'specialization_id' ]) |
| 188 | - ->viaTable('vacancy_specialization', [ 'vacancy_id' => 'vacancy_id' ]); | 209 | + ->viaTable('vacancy_specialization', [ 'vacancy_id' => 'vacancy_id' ]); |
| 189 | } | 210 | } |
| 190 | 211 | ||
| 191 | - | ||
| 192 | public function getSalaryCurrency() | 212 | public function getSalaryCurrency() |
| 193 | { | 213 | { |
| 194 | return $this->hasOne(Currency::className(), [ 'currency_id' => 'salary_currency' ]); | 214 | return $this->hasOne(Currency::className(), [ 'currency_id' => 'salary_currency' ]); |
| 195 | } | 215 | } |
| 196 | 216 | ||
| 197 | - | ||
| 198 | /** | 217 | /** |
| 199 | * Return array of Vacancy's specialization IDs | 218 | * Return array of Vacancy's specialization IDs |
| 200 | * @return integer[] | 219 | * @return integer[] |
common/modules/comment/models/Comment.php
| 1 | <?php | 1 | <?php |
| 2 | namespace common\modules\comment\models; | 2 | namespace common\modules\comment\models; |
| 3 | 3 | ||
| 4 | + use common\models\User; | ||
| 4 | use yii\db\ActiveQuery; | 5 | use yii\db\ActiveQuery; |
| 5 | 6 | ||
| 6 | /** | 7 | /** |
| @@ -18,6 +19,8 @@ | @@ -18,6 +19,8 @@ | ||
| 18 | * @property string $date_delete | 19 | * @property string $date_delete |
| 19 | * @property string $model | 20 | * @property string $model |
| 20 | * @property int $model_id | 21 | * @property int $model_id |
| 22 | + * @property Rating $rating | ||
| 23 | + * @property User $user | ||
| 21 | * @package common\modules\comment\models | 24 | * @package common\modules\comment\models |
| 22 | */ | 25 | */ |
| 23 | class Comment extends \yii\db\ActiveRecord | 26 | class Comment extends \yii\db\ActiveRecord |
| @@ -117,6 +120,19 @@ | @@ -117,6 +120,19 @@ | ||
| 117 | ]; | 120 | ]; |
| 118 | } | 121 | } |
| 119 | 122 | ||
| 123 | + public function afterSave($insert, $changedAttributes) | ||
| 124 | + { | ||
| 125 | + if($this->model == User::className()) { | ||
| 126 | + if($user = User::findOne($this->model_id)) { | ||
| 127 | + /** | ||
| 128 | + * @var User $user | ||
| 129 | + */ | ||
| 130 | + $user->updateRating(); | ||
| 131 | + } | ||
| 132 | + } | ||
| 133 | + parent::afterSave($insert, $changedAttributes); | ||
| 134 | + } | ||
| 135 | + | ||
| 120 | public static function tableName() | 136 | public static function tableName() |
| 121 | { | 137 | { |
| 122 | return '{{%comment}}'; | 138 | return '{{%comment}}'; |
| @@ -157,7 +173,7 @@ | @@ -157,7 +173,7 @@ | ||
| 157 | 'comment.model' => $model, | 173 | 'comment.model' => $model, |
| 158 | 'comment.model_id' => $model_id, | 174 | 'comment.model_id' => $model_id, |
| 159 | 'comment.status' => 1, | 175 | 'comment.status' => 1, |
| 160 | - ]); | 176 | + ])->with('rating'); |
| 161 | } | 177 | } |
| 162 | 178 | ||
| 163 | public function postComment() | 179 | public function postComment() |
| @@ -294,7 +310,7 @@ | @@ -294,7 +310,7 @@ | ||
| 294 | 'model' => $this->className(), | 310 | 'model' => $this->className(), |
| 295 | ]) | 311 | ]) |
| 296 | ->one(); | 312 | ->one(); |
| 297 | - if(!$rating instanceof \common\modules\comment\models\Rating) { | 313 | + if(!$rating instanceof \common\modules\comment\models\Rating && !$this->isNewRecord) { |
| 298 | $rating = new \common\modules\comment\models\Rating([ | 314 | $rating = new \common\modules\comment\models\Rating([ |
| 299 | 'model' => $this->className(), | 315 | 'model' => $this->className(), |
| 300 | 'model_id' => $this->comment_id, | 316 | 'model_id' => $this->comment_id, |
| @@ -331,4 +347,9 @@ | @@ -331,4 +347,9 @@ | ||
| 331 | } | 347 | } |
| 332 | } | 348 | } |
| 333 | 349 | ||
| 350 | + public function getUser() | ||
| 351 | + { | ||
| 352 | + return $this->hasOne(User::className(), [ 'id' => 'user_id' ]); | ||
| 353 | + } | ||
| 354 | + | ||
| 334 | } | 355 | } |
common/modules/comment/models/CommentProject.php
| @@ -3,26 +3,29 @@ | @@ -3,26 +3,29 @@ | ||
| 3 | 3 | ||
| 4 | use common\models\Currency; | 4 | use common\models\Currency; |
| 5 | use common\models\File; | 5 | use common\models\File; |
| 6 | + use common\models\User; | ||
| 6 | use yii\db\ActiveQuery; | 7 | use yii\db\ActiveQuery; |
| 8 | + use yii\db\ActiveRecord; | ||
| 7 | use yii\web\UploadedFile; | 9 | use yii\web\UploadedFile; |
| 8 | 10 | ||
| 9 | /** | 11 | /** |
| 10 | * Class Comment | 12 | * Class Comment |
| 11 | - * @property bool $guestComment | ||
| 12 | - * @property integer $comment_id | ||
| 13 | - * @property string $text | ||
| 14 | - * @property int $user_id | ||
| 15 | - * @property int $status | ||
| 16 | - * @property string $date_add | ||
| 17 | - * @property string $date_update | ||
| 18 | - * @property string $date_delete | ||
| 19 | - * @property string $model | ||
| 20 | - * @property int $model_id | ||
| 21 | - * @property string $files | ||
| 22 | - * @property float $budget_from | ||
| 23 | - * @property float $budget_to | ||
| 24 | - * @property int $term_from | ||
| 25 | - * @property int $term_to | 13 | + * @property bool $guestComment |
| 14 | + * @property integer $comment_id | ||
| 15 | + * @property string $text | ||
| 16 | + * @property int $user_id | ||
| 17 | + * @property int $status | ||
| 18 | + * @property string $date_add | ||
| 19 | + * @property string $date_update | ||
| 20 | + * @property string $date_delete | ||
| 21 | + * @property string $model | ||
| 22 | + * @property int $model_id | ||
| 23 | + * @property string $files | ||
| 24 | + * @property float $budget_from | ||
| 25 | + * @property float $budget_to | ||
| 26 | + * @property int $term_from | ||
| 27 | + * @property int $term_to | ||
| 28 | + * @property Currency $currency | ||
| 26 | * @package common\modules\comment\models | 29 | * @package common\modules\comment\models |
| 27 | */ | 30 | */ |
| 28 | class CommentProject extends \yii\db\ActiveRecord | 31 | class CommentProject extends \yii\db\ActiveRecord |
| @@ -42,6 +45,7 @@ | @@ -42,6 +45,7 @@ | ||
| 42 | * @var bool | 45 | * @var bool |
| 43 | */ | 46 | */ |
| 44 | public $guestComment = false; | 47 | public $guestComment = false; |
| 48 | + | ||
| 45 | public $file; | 49 | public $file; |
| 46 | 50 | ||
| 47 | public function rules() | 51 | public function rules() |
| @@ -84,7 +88,7 @@ | @@ -84,7 +88,7 @@ | ||
| 84 | [ | 88 | [ |
| 85 | [ 'budget_currency' ], | 89 | [ 'budget_currency' ], |
| 86 | 'exist', | 90 | 'exist', |
| 87 | - 'targetClass' => Currency::className(), | 91 | + 'targetClass' => Currency::className(), |
| 88 | 'targetAttribute' => 'currency_id', | 92 | 'targetAttribute' => 'currency_id', |
| 89 | ], | 93 | ], |
| 90 | [ | 94 | [ |
| @@ -118,7 +122,7 @@ | @@ -118,7 +122,7 @@ | ||
| 118 | 'term_to', | 122 | 'term_to', |
| 119 | 'file', | 123 | 'file', |
| 120 | ], | 124 | ], |
| 121 | - self::SCENARIO_GUEST => [ | 125 | + self::SCENARIO_GUEST => [ |
| 122 | 126 | ||
| 123 | ], | 127 | ], |
| 124 | ]; | 128 | ]; |
| @@ -150,11 +154,11 @@ | @@ -150,11 +154,11 @@ | ||
| 150 | public function attributeLabels() | 154 | public function attributeLabels() |
| 151 | { | 155 | { |
| 152 | return [ | 156 | return [ |
| 153 | - 'text' => \Yii::t('app', 'Текст ответа'), | 157 | + 'text' => \Yii::t('app', 'Текст ответа'), |
| 154 | 'budget_from' => \Yii::t('app', 'от'), | 158 | 'budget_from' => \Yii::t('app', 'от'), |
| 155 | - 'budget_to' => \Yii::t('app', 'до'), | ||
| 156 | - 'term_from' => \Yii::t('app', 'от'), | ||
| 157 | - 'term_to' => \Yii::t('app', 'до'), | 159 | + 'budget_to' => \Yii::t('app', 'до'), |
| 160 | + 'term_from' => \Yii::t('app', 'от'), | ||
| 161 | + 'term_to' => \Yii::t('app', 'до'), | ||
| 158 | ]; | 162 | ]; |
| 159 | } | 163 | } |
| 160 | 164 | ||
| @@ -163,10 +167,10 @@ | @@ -163,10 +167,10 @@ | ||
| 163 | return $this->guestComment; | 167 | return $this->guestComment; |
| 164 | } | 168 | } |
| 165 | 169 | ||
| 166 | -// public function setGuestComment($value) | ||
| 167 | -// { | ||
| 168 | -// $this->guestComment = $value; | ||
| 169 | -// } | 170 | + // public function setGuestComment($value) |
| 171 | + // { | ||
| 172 | + // $this->guestComment = $value; | ||
| 173 | + // } | ||
| 170 | 174 | ||
| 171 | /** | 175 | /** |
| 172 | * @param string $model | 176 | * @param string $model |
| @@ -181,27 +185,28 @@ | @@ -181,27 +185,28 @@ | ||
| 181 | 'comment_project.model' => $model, | 185 | 'comment_project.model' => $model, |
| 182 | 'comment_project.model_id' => $model_id, | 186 | 'comment_project.model_id' => $model_id, |
| 183 | 'comment_project.status' => 1, | 187 | 'comment_project.status' => 1, |
| 184 | - ]); | 188 | + ]) |
| 189 | + ->with('currency', 'user', 'user.userInfo', 'user.companyInfo', 'user.comments'); | ||
| 185 | } | 190 | } |
| 186 | 191 | ||
| 187 | public function postComment() | 192 | public function postComment() |
| 188 | { | 193 | { |
| 189 | if($this->checkCreate()) { | 194 | if($this->checkCreate()) { |
| 190 | - if(!empty(\Yii::$app->request->post($this->formName())['anonymous'])) { | 195 | + if(!empty( \Yii::$app->request->post($this->formName())[ 'anonymous' ] )) { |
| 191 | $this->status = self::STATUS_ANONYMOUS; | 196 | $this->status = self::STATUS_ANONYMOUS; |
| 192 | } | 197 | } |
| 193 | $this->file = UploadedFile::getInstances($this, 'file'); | 198 | $this->file = UploadedFile::getInstances($this, 'file'); |
| 194 | - if(!empty($this->file)) { | ||
| 195 | - $file_id = []; | ||
| 196 | - if(is_array($this->file)){ | ||
| 197 | - foreach($this->file as $file){ | ||
| 198 | - if($file instanceof UploadedFile){ | 199 | + if(!empty( $this->file )) { |
| 200 | + $file_id = [ ]; | ||
| 201 | + if(is_array($this->file)) { | ||
| 202 | + foreach($this->file as $file) { | ||
| 203 | + if($file instanceof UploadedFile) { | ||
| 199 | $file_model = new File(); | 204 | $file_model = new File(); |
| 200 | $file_id[] = $file_model->saveFile($file); | 205 | $file_id[] = $file_model->saveFile($file); |
| 201 | } | 206 | } |
| 202 | } | 207 | } |
| 203 | } else { | 208 | } else { |
| 204 | - if($this->file instanceof UploadedFile){ | 209 | + if($this->file instanceof UploadedFile) { |
| 205 | $file_model = new File(); | 210 | $file_model = new File(); |
| 206 | $file_id[] = $file_model->saveFile($this->file); | 211 | $file_id[] = $file_model->saveFile($this->file); |
| 207 | } | 212 | } |
| @@ -325,4 +330,47 @@ | @@ -325,4 +330,47 @@ | ||
| 325 | // } | 330 | // } |
| 326 | } | 331 | } |
| 327 | 332 | ||
| 333 | + /** | ||
| 334 | + * @return ActiveQuery | ||
| 335 | + */ | ||
| 336 | + public function getCurrency() | ||
| 337 | + { | ||
| 338 | + return $this->hasOne(Currency::className(), [ 'currency_id' => 'budget_currency' ]); | ||
| 339 | + } | ||
| 340 | + | ||
| 341 | + /** | ||
| 342 | + * @return File[] | ||
| 343 | + */ | ||
| 344 | + public function getFilesList() | ||
| 345 | + { | ||
| 346 | + $files = json_decode($this->files); | ||
| 347 | + if(!empty( $files )) { | ||
| 348 | + return File::findAll($files); | ||
| 349 | + } else { | ||
| 350 | + return [ ]; | ||
| 351 | + } | ||
| 352 | + } | ||
| 353 | + | ||
| 354 | + /** | ||
| 355 | + * @return ActiveRecord | ||
| 356 | + * @throws \TypeError | ||
| 357 | + */ | ||
| 358 | + public function getOwner() | ||
| 359 | + { | ||
| 360 | + $model = new $this->model(); | ||
| 361 | + if($model instanceof ActiveRecord) { | ||
| 362 | + return $model->findOne($this->model_id); | ||
| 363 | + } else { | ||
| 364 | + throw new \TypeError('Model must extends Active Record Class'); | ||
| 365 | + } | ||
| 366 | + } | ||
| 367 | + | ||
| 368 | + /** | ||
| 369 | + * @return User | ||
| 370 | + */ | ||
| 371 | + public function getUser() | ||
| 372 | + { | ||
| 373 | + return $this->hasOne(User::className(), ['id' => 'user_id']); | ||
| 374 | + } | ||
| 375 | + | ||
| 328 | } | 376 | } |
common/modules/comment/widgets/CommentWidget.php
| @@ -197,12 +197,16 @@ | @@ -197,12 +197,16 @@ | ||
| 197 | if(empty( $view )) { | 197 | if(empty( $view )) { |
| 198 | throw new \yii\base\InvalidConfigException("form_options[view] must be set"); | 198 | throw new \yii\base\InvalidConfigException("form_options[view] must be set"); |
| 199 | } | 199 | } |
| 200 | - return $this->render($view, [ | ||
| 201 | - 'model' => $this->comment_class, | ||
| 202 | - 'rating' => $this->rating_class, | ||
| 203 | - 'user' => \Yii::$app->user->identity, | ||
| 204 | - 'dataProvider' => $this->dataProvider, | ||
| 205 | - ]); | 200 | + if($this->comment_class->guestComment || !empty(\Yii::$app->user->identity)) { |
| 201 | + return $this->render($view, [ | ||
| 202 | + 'model' => $this->comment_class, | ||
| 203 | + 'rating' => $this->rating_class, | ||
| 204 | + 'user' => \Yii::$app->user->identity, | ||
| 205 | + 'dataProvider' => $this->dataProvider, | ||
| 206 | + ]); | ||
| 207 | + } else { | ||
| 208 | + return ''; | ||
| 209 | + } | ||
| 206 | } | 210 | } |
| 207 | 211 | ||
| 208 | public function renderWidget() | 212 | public function renderWidget() |
common/modules/comment/widgets/views/_project_comment_view.php
| @@ -10,13 +10,7 @@ | @@ -10,13 +10,7 @@ | ||
| 10 | * @var \yii\widgets\ListView $widget current ListView instance | 10 | * @var \yii\widgets\ListView $widget current ListView instance |
| 11 | * @var User $user | 11 | * @var User $user |
| 12 | */ | 12 | */ |
| 13 | - $user = NULL; | ||
| 14 | - if(!empty( $model->user_id )) { | ||
| 15 | - $user = User::find() | ||
| 16 | - ->where([ 'id' => $model->user_id ]) | ||
| 17 | - ->with('userInfo') | ||
| 18 | - ->one(); | ||
| 19 | - } | 13 | + $user = $model->user; |
| 20 | ?> | 14 | ?> |
| 21 | <div class="performer-vacancy-sidebar-left-wr"> | 15 | <div class="performer-vacancy-sidebar-left-wr"> |
| 22 | <div class="performer-vacancy-sidebar-left"> | 16 | <div class="performer-vacancy-sidebar-left"> |
| @@ -28,22 +22,22 @@ | @@ -28,22 +22,22 @@ | ||
| 28 | <ul> | 22 | <ul> |
| 29 | <?php | 23 | <?php |
| 30 | if(!empty( $user->userInfo->social_fb )) { | 24 | if(!empty( $user->userInfo->social_fb )) { |
| 31 | - echo '<li>'.Html::a(Html::img('/images/ico-fb.png'), $user->userInfo->social_fb, ['target' => '_blank']).'</li>'; | 25 | + echo '<li>' . Html::a(Html::img('/images/ico-fb.png'), $user->userInfo->social_fb, [ 'target' => '_blank' ]) . '</li>'; |
| 32 | } | 26 | } |
| 33 | ?> | 27 | ?> |
| 34 | <?php | 28 | <?php |
| 35 | if(!empty( $user->userInfo->social_t )) { | 29 | if(!empty( $user->userInfo->social_t )) { |
| 36 | - echo '<li>'.Html::a(Html::img('/images/ico-tw.png'), $user->userInfo->social_t, ['target' => '_blank']).'</li>'; | 30 | + echo '<li>' . Html::a(Html::img('/images/ico-tw.png'), $user->userInfo->social_t, [ 'target' => '_blank' ]) . '</li>'; |
| 37 | } | 31 | } |
| 38 | ?> | 32 | ?> |
| 39 | <?php | 33 | <?php |
| 40 | if(!empty( $user->userInfo->social_in )) { | 34 | if(!empty( $user->userInfo->social_in )) { |
| 41 | - echo '<li>'.Html::a(Html::img('/images/ico-in.png'), $user->userInfo->social_in, ['target' => '_blank']).'</li>'; | 35 | + echo '<li>' . Html::a(Html::img('/images/ico-in.png'), $user->userInfo->social_in, [ 'target' => '_blank' ]) . '</li>'; |
| 42 | } | 36 | } |
| 43 | ?> | 37 | ?> |
| 44 | <?php | 38 | <?php |
| 45 | if(!empty( $user->userInfo->social_vk )) { | 39 | if(!empty( $user->userInfo->social_vk )) { |
| 46 | - echo '<li>'.Html::a(Html::img('/images/ico-vk.png'), $user->userInfo->social_vk, ['target' => '_blank']).'</li>'; | 40 | + echo '<li>' . Html::a(Html::img('/images/ico-vk.png'), $user->userInfo->social_vk, [ 'target' => '_blank' ]) . '</li>'; |
| 47 | } | 41 | } |
| 48 | ?> | 42 | ?> |
| 49 | </ul> | 43 | </ul> |
| @@ -54,60 +48,62 @@ | @@ -54,60 +48,62 @@ | ||
| 54 | <div class="sidebarvievstxt"><?= $user->userInfo->view_count ?></div> | 48 | <div class="sidebarvievstxt"><?= $user->userInfo->view_count ?></div> |
| 55 | </li> | 49 | </li> |
| 56 | <li><img src="/images/sidebar-ico/ico-9.png" alt=""> | 50 | <li><img src="/images/sidebar-ico/ico-9.png" alt=""> |
| 57 | - <div class="sidebarvievstxt"><span class="sidebar-views-txt">Статус: </span><?= (empty($user->userInfo->busy)?'Свободен':'Занят') ?> | 51 | + <div class="sidebarvievstxt"> |
| 52 | + <span class="sidebar-views-txt">Статус: </span><?= ( empty( $user->userInfo->busy ) ? 'Свободен' : 'Занят' ) ?> | ||
| 58 | </div> | 53 | </div> |
| 59 | </li> | 54 | </li> |
| 60 | <li><img src="/images/sidebar-ico/ico-2.png" alt=""> | 55 | <li><img src="/images/sidebar-ico/ico-2.png" alt=""> |
| 61 | <div class="sidebarvievstxt"> | 56 | <div class="sidebarvievstxt"> |
| 62 | - <span class="sidebar-views-txt">На сайте: </span>1г. 8 мес. | 57 | + <span class="sidebar-views-txt">На сайте: </span><?= $user->liveTime ?> |
| 63 | </div> | 58 | </div> |
| 64 | </li> | 59 | </li> |
| 65 | <li><img src="/images/sidebar-ico/ico-3.png" alt=""> | 60 | <li><img src="/images/sidebar-ico/ico-3.png" alt=""> |
| 66 | - <div class="sidebarvievstxt"><span class="sidebar-views-txt">Последний визит:<br></span>2 дня назад | 61 | + <div class="sidebarvievstxt"><span class="sidebar-views-txt">Последний визит:<br></span><?= $user->lastVisit ?> |
| 67 | </div> | 62 | </div> |
| 68 | </li> | 63 | </li> |
| 69 | </ul> | 64 | </ul> |
| 70 | - <a href="#" class="tender-see-profile style">Посмотреть профиль</a> | 65 | + <?= Html::a('Посмотреть профиль', $user->link, [ 'class' => 'tender-see-profile style' ]) ?> |
| 71 | </div> | 66 | </div> |
| 72 | </div> | 67 | </div> |
| 73 | </div> | 68 | </div> |
| 74 | </div> | 69 | </div> |
| 75 | <div class="tender-offer-proj-block-right-wr"> | 70 | <div class="tender-offer-proj-block-right-wr"> |
| 76 | <div class="tender-offer-proj-block-right"> | 71 | <div class="tender-offer-proj-block-right"> |
| 77 | - <div class="tender-offer-proj-min-blocks"><span>2000 грн</span></div> | ||
| 78 | - <div class="tender-offer-proj-min-blocks"><span>3 ДНЯ</span></div> | 72 | + <div class="tender-offer-proj-min-blocks"> |
| 73 | + <span><?= $model->budget_from . '-' . $model->budget_to . ' ' . $model->currency->label ?></span> | ||
| 74 | + </div> | ||
| 75 | + <div class="tender-offer-proj-min-blocks"> | ||
| 76 | + <span><?= $model->term_from . '-' . $model->term_to ?> ДНЯ</span></div> | ||
| 79 | </div> | 77 | </div> |
| 80 | <div class="tender-offer-proj-block-left"> | 78 | <div class="tender-offer-proj-block-left"> |
| 81 | <div class="search-worker-blocks-title-wr"> | 79 | <div class="search-worker-blocks-title-wr"> |
| 82 | - <div class="search-worker-blocks-title-title">Петер Цумтор</div> | 80 | + <div class="search-worker-blocks-title-title"><?= $user->name ?></div> |
| 83 | <div class="rating-new"> | 81 | <div class="rating-new"> |
| 84 | <!--оценка--> | 82 | <!--оценка--> |
| 85 | - <input type="hidden" class="val" value="4"/> | 83 | + <input type="hidden" class="val" value="<?= $user->userInfo->rating ?>"/> |
| 86 | </div> | 84 | </div> |
| 87 | - <a href="#" class="link-to-comm">30 отзывов</a> | 85 | + <?= Html::a(count($user->comments). ' отзывов', $user->getLink('review'), ['class' => 'link-to-comm']) ?> |
| 88 | </div> | 86 | </div> |
| 89 | <div class="tender-offer-proj-txt"> | 87 | <div class="tender-offer-proj-txt"> |
| 90 | - <p>1.1 Строительная площадка расположена по адресу: г. Киев.</p> | ||
| 91 | - <p>1.2 Существующий объект представляет собой помещение общей площадью ориентировочно – 140 м2.</p> | ||
| 92 | - <p>1.3. Цель проекта состоит в проведении внутренних общестроительных и отделочных работ.</p> | ||
| 93 | - <p>1.4. При разработке методов строительства и выборе материалов, используемых в настоящем проекте, необходимо учитывать климатические условия, характерные для г. Киева.</p> | ||
| 94 | - <p>1.5. Требования к проектированию и производству работ определяются следующими документами:</p> | ||
| 95 | - <p>- Техническим заданием.</p> | ||
| 96 | - <p>- Строительными нормами и правилами.</p> | ||
| 97 | - <p>Все проектные решения и все разделы рабочего проекта должны быть согласованы с Заказчиком в объеме, необходимом для последующей сдачи инженерных систем и коммуникаций.</p> | 88 | + <?= $model->text ?> |
| 98 | </div> | 89 | </div> |
| 99 | <ul class="download-list-files"> | 90 | <ul class="download-list-files"> |
| 100 | - <li> | ||
| 101 | - <span></span><a href="#" class="download-link-file">КП.doc</a><a href="#" class="download-link">Скачать</a> | ||
| 102 | - </li> | ||
| 103 | - <li> | ||
| 104 | - <span></span><a href="#" class="download-link-file">Резюме.txt</a><a href="#" class="download-link">Скачать</a> | ||
| 105 | - </li> | 91 | + <?php |
| 92 | + foreach($model->getFilesList() as $file) { | ||
| 93 | + ?> | ||
| 94 | + <li> | ||
| 95 | + <span></span> | ||
| 96 | + <?= Html::a($file->name, $file->dir, ['class' => 'download-link-file']) ?> | ||
| 97 | + <?= Html::a('Скачать', $file->dir, ['class' => 'download-link', 'download' => 'download']) ?> | ||
| 98 | + </li> | ||
| 99 | + <?php | ||
| 100 | + } | ||
| 101 | + ?> | ||
| 106 | </ul> | 102 | </ul> |
| 107 | </div> | 103 | </div> |
| 108 | <div class="tender-more-buttons-wr"> | 104 | <div class="tender-more-buttons-wr"> |
| 109 | - <a class="get-project-new" href="#">Портфолио</a> | ||
| 110 | - <a class="get-list-new" href="#">Конаткты</a> | 105 | + <?= Html::a('Портфолио', $user->getLink('portfolio'), ['class' => 'get-project-new']) ?> |
| 106 | + <?= Html::a('Контакты', $user->link, ['class' => 'get-list-new']) ?> | ||
| 111 | </div> | 107 | </div> |
| 112 | 108 | ||
| 113 | </div> | 109 | </div> |
common/modules/comment/widgets/views/_review_comment_view.php
0 → 100644
| 1 | +<?php | ||
| 2 | + use common\models\User; | ||
| 3 | + use yii\helpers\Html; | ||
| 4 | + | ||
| 5 | + /** | ||
| 6 | + * @var \common\modules\comment\models\Comment $model Current comment model | ||
| 7 | + * @var integer $key ID of current comment | ||
| 8 | + * @var integer $index index of current element according | ||
| 9 | + * to current page, starting from 0 | ||
| 10 | + * @var \yii\widgets\ListView $widget current ListView instance | ||
| 11 | + * @var User $user | ||
| 12 | + */ | ||
| 13 | + $user = $model->user; | ||
| 14 | +?> | ||
| 15 | + <div class="comments-name"><?= $user->name ?></div> | ||
| 16 | +<?php | ||
| 17 | + /* == STATUS PRO == | ||
| 18 | + ?> | ||
| 19 | + <div class="comments-status"><span>Pro</span></div> | ||
| 20 | + <?php | ||
| 21 | + */ | ||
| 22 | +?> | ||
| 23 | + <div class="comments-date"><?= \Yii::$app->formatter->asDate($model->date_add, 'php:d.m.Y') ?></div> | ||
| 24 | +<?php | ||
| 25 | + if(!empty( $model->rating )) { | ||
| 26 | + ?> | ||
| 27 | + <div class="rating"> | ||
| 28 | + <!--оценка--> | ||
| 29 | + <input type="hidden" class="val" value="<?= $model->rating->value ?>"/> | ||
| 30 | + </div> | ||
| 31 | + <?php | ||
| 32 | + } | ||
| 33 | +?> | ||
| 34 | + <div class="comments-content"> | ||
| 35 | + <?= $model->text ?> | ||
| 36 | + </div> | ||
| 37 | +<?php | ||
| 38 | + /* == PROJECT INFO == | ||
| 39 | + ?> | ||
| 40 | + <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div> | ||
| 41 | + <?php | ||
| 42 | + */ | ||
| 43 | +?> | ||
| 0 | \ No newline at end of file | 44 | \ No newline at end of file |
common/modules/comment/widgets/views/form-comment-review.php
0 → 100644
| 1 | +<?php | ||
| 2 | + /** | ||
| 3 | + * @var \common\modules\comment\models\Comment $model | ||
| 4 | + * @var \common\models\User $user | ||
| 5 | + * @var \yii\data\ActiveDataProvider $dataProvider | ||
| 6 | + * @var null|\common\modules\comment\models\Rating $rating | ||
| 7 | + */ | ||
| 8 | + use yii\widgets\ActiveForm; | ||
| 9 | + use yii\helpers\Html; | ||
| 10 | + | ||
| 11 | +?> | ||
| 12 | +<div class="workplace-title style"> | ||
| 13 | + <p></p>Отзывы о пользователе: <?= $dataProvider->totalCount ?></p></div> | ||
| 14 | +<div class="new-portf-add-comm style"> | ||
| 15 | + <?php | ||
| 16 | + $form = ActiveForm::begin(); | ||
| 17 | + echo $form->field($rating, 'value') | ||
| 18 | + ->label(false) | ||
| 19 | + ->radioList([ | ||
| 20 | + 1 => 1, | ||
| 21 | + 2 => 2, | ||
| 22 | + 3 => 3, | ||
| 23 | + 4 => 4, | ||
| 24 | + 5 => 5, | ||
| 25 | + ]); | ||
| 26 | + if($model->scenario == $model::SCENARIO_GUEST) { | ||
| 27 | + echo $form->field($model, 'user_name', [ | ||
| 28 | + 'options' => [ | ||
| 29 | + 'class' => 'input-blocks-comm', | ||
| 30 | + ], | ||
| 31 | + 'inputOptions' => [ | ||
| 32 | + 'class' => 'custom-input-4', | ||
| 33 | + ], | ||
| 34 | + ]) | ||
| 35 | + ->textInput(); | ||
| 36 | + echo $form->field($model, 'user_email', [ | ||
| 37 | + 'options' => [ | ||
| 38 | + 'class' => 'input-blocks-comm', | ||
| 39 | + ], | ||
| 40 | + 'inputOptions' => [ | ||
| 41 | + 'class' => 'custom-input-4', | ||
| 42 | + ], | ||
| 43 | + ]) | ||
| 44 | + ->textInput(); | ||
| 45 | + } | ||
| 46 | + | ||
| 47 | + ?> | ||
| 48 | + <div class="artbox_comment_reply_block"></div> | ||
| 49 | + <?php | ||
| 50 | + echo $form->field($model, 'text', [ | ||
| 51 | + 'options' => [ | ||
| 52 | + 'class' => 'input-blocks-comm area-comm', | ||
| 53 | + ], | ||
| 54 | + 'inputOptions' => [ | ||
| 55 | + 'class' => 'custom-area-4', | ||
| 56 | + ], | ||
| 57 | + ]) | ||
| 58 | + ->textarea(); | ||
| 59 | + ?> | ||
| 60 | + <div class="input-blocks-comm-button style"> | ||
| 61 | + <?= Html::submitButton('Добавить комментарий') ?> | ||
| 62 | + </div> | ||
| 63 | + <?php | ||
| 64 | + $form->end(); | ||
| 65 | + ?> | ||
| 66 | +</div> | ||
| 0 | \ No newline at end of file | 67 | \ No newline at end of file |
common/modules/comment/widgets/views/form-project-comment.php
| @@ -22,7 +22,7 @@ | @@ -22,7 +22,7 @@ | ||
| 22 | <div class="form-value-wr style"> | 22 | <div class="form-value-wr style"> |
| 23 | <div class="form-ico-ded-wr"> | 23 | <div class="form-ico-ded-wr"> |
| 24 | <div class="header-cabinet-foto"> | 24 | <div class="header-cabinet-foto"> |
| 25 | - <?= Html::img($user->userInfo->image) ?> | 25 | + <?= Html::img(($user->userInfo->image)?:'') ?> |
| 26 | </div> | 26 | </div> |
| 27 | <div class="form-value-ded-name"> | 27 | <div class="form-value-ded-name"> |
| 28 | <?= $user->name ?> | 28 | <?= $user->name ?> |
common/modules/comment/widgets/views/list-comment-review.php
0 → 100644
| 1 | +<?php | ||
| 2 | + /** | ||
| 3 | + * @var \yii\data\DataProviderInterface $dataProvider | ||
| 4 | + */ | ||
| 5 | +echo \yii\widgets\ListView::widget([ | ||
| 6 | + 'dataProvider' => $dataProvider, | ||
| 7 | + 'itemView' => '_review_comment_view', | ||
| 8 | + 'options' => [ | ||
| 9 | + 'tag' => 'ul', | ||
| 10 | + 'class' => 'proektant-comments style' | ||
| 11 | + ], | ||
| 12 | + 'itemOptions' => [ | ||
| 13 | + 'tag' => 'li', | ||
| 14 | + ], | ||
| 15 | + 'layout' => "{items}\n{pager}", | ||
| 16 | +]); | ||
| 0 | \ No newline at end of file | 17 | \ No newline at end of file |
common/modules/comment/widgets/views/list-project-comment.php
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | ?> | 5 | ?> |
| 6 | <div class="box-wr"> | 6 | <div class="box-wr"> |
| 7 | <div class="box-all"> | 7 | <div class="box-all"> |
| 8 | - <div class="tender-offer-proj-title-all style">Предложения проектантов</div> | 8 | + <div class="tender-offer-proj-title-all style">Предложения проектантов (<?=$dataProvider->getTotalCount()?>)</div> |
| 9 | <div class="tender-offer-proj-blocks-wr style"> | 9 | <div class="tender-offer-proj-blocks-wr style"> |
| 10 | <?php | 10 | <?php |
| 11 | echo \yii\widgets\ListView::widget([ | 11 | echo \yii\widgets\ListView::widget([ |
frontend/controllers/AccountsController.php
| @@ -9,6 +9,7 @@ | @@ -9,6 +9,7 @@ | ||
| 9 | use common\models\Department; | 9 | use common\models\Department; |
| 10 | use common\models\Employment; | 10 | use common\models\Employment; |
| 11 | use common\models\Fields; | 11 | use common\models\Fields; |
| 12 | + use common\models\File; | ||
| 12 | use common\models\Gallery; | 13 | use common\models\Gallery; |
| 13 | use common\models\GallerySearch; | 14 | use common\models\GallerySearch; |
| 14 | use common\models\Job; | 15 | use common\models\Job; |
| @@ -36,6 +37,7 @@ | @@ -36,6 +37,7 @@ | ||
| 36 | use yii\filters\VerbFilter; | 37 | use yii\filters\VerbFilter; |
| 37 | use yii\web\Controller; | 38 | use yii\web\Controller; |
| 38 | use yii\web\NotFoundHttpException; | 39 | use yii\web\NotFoundHttpException; |
| 40 | + use yii\web\UploadedFile; | ||
| 39 | 41 | ||
| 40 | /** | 42 | /** |
| 41 | * Site controller | 43 | * Site controller |
| @@ -626,6 +628,24 @@ | @@ -626,6 +628,24 @@ | ||
| 626 | $post = \Yii::$app->request->post(); | 628 | $post = \Yii::$app->request->post(); |
| 627 | if(!empty( $post )) { | 629 | if(!empty( $post )) { |
| 628 | $project->load($post); | 630 | $project->load($post); |
| 631 | + $project->files = UploadedFile::getInstances($project, 'files'); | ||
| 632 | + if(!empty( $project->files )) { | ||
| 633 | + $file_id = [ ]; | ||
| 634 | + if(is_array($project->files)) { | ||
| 635 | + foreach($project->files as $file) { | ||
| 636 | + if($file instanceof UploadedFile) { | ||
| 637 | + $file_model = new File(); | ||
| 638 | + $file_id[] = $file_model->saveFile($file); | ||
| 639 | + } | ||
| 640 | + } | ||
| 641 | + } else { | ||
| 642 | + if($project->files instanceof UploadedFile) { | ||
| 643 | + $file_model = new File(); | ||
| 644 | + $file_id[] = $file_model->saveFile($this->file); | ||
| 645 | + } | ||
| 646 | + } | ||
| 647 | + $project->file = json_encode($file_id); | ||
| 648 | + } | ||
| 629 | $project->validate(); | 649 | $project->validate(); |
| 630 | if(!$project->hasErrors()) { | 650 | if(!$project->hasErrors()) { |
| 631 | $date_end = new \DateTime(); | 651 | $date_end = new \DateTime(); |
| @@ -706,6 +726,24 @@ | @@ -706,6 +726,24 @@ | ||
| 706 | $post = \Yii::$app->request->post(); | 726 | $post = \Yii::$app->request->post(); |
| 707 | if(!empty( $post )) { | 727 | if(!empty( $post )) { |
| 708 | $project->load($post); | 728 | $project->load($post); |
| 729 | + $project->files = UploadedFile::getInstances($project, 'files'); | ||
| 730 | + if(!empty( $project->files )) { | ||
| 731 | + $file_id = [ ]; | ||
| 732 | + if(is_array($project->files)) { | ||
| 733 | + foreach($project->files as $file) { | ||
| 734 | + if($file instanceof UploadedFile) { | ||
| 735 | + $file_model = new File(); | ||
| 736 | + $file_id[] = $file_model->saveFile($file); | ||
| 737 | + } | ||
| 738 | + } | ||
| 739 | + } else { | ||
| 740 | + if($project->files instanceof UploadedFile) { | ||
| 741 | + $file_model = new File(); | ||
| 742 | + $file_id[] = $file_model->saveFile($this->file); | ||
| 743 | + } | ||
| 744 | + } | ||
| 745 | + $project->file = json_encode($file_id); | ||
| 746 | + } | ||
| 709 | $project->validate(); | 747 | $project->validate(); |
| 710 | if(!$project->hasErrors()) { | 748 | if(!$project->hasErrors()) { |
| 711 | $date_end = new \DateTime(); | 749 | $date_end = new \DateTime(); |
frontend/controllers/CompanyController.php
| 1 | <?php | 1 | <?php |
| 2 | -namespace frontend\controllers; | ||
| 3 | - | ||
| 4 | - | ||
| 5 | -use common\models\Blog; | ||
| 6 | -use common\models\Fields; | ||
| 7 | -use common\models\Gallery; | ||
| 8 | -use common\models\Portfolio; | ||
| 9 | -use common\models\PortfolioSpecialization; | ||
| 10 | -use common\models\Team; | ||
| 11 | -use common\models\Vacancy; | ||
| 12 | -use common\models\VacancySpecialization; | ||
| 13 | -use Yii; | ||
| 14 | -use yii\data\ActiveDataProvider; | ||
| 15 | -use yii\data\ArrayDataProvider; | ||
| 16 | -use yii\data\Pagination; | ||
| 17 | -use yii\helpers\ArrayHelper; | ||
| 18 | -use yii\web\BadRequestHttpException; | ||
| 19 | -use yii\web\Controller; | ||
| 20 | -use common\models\User; | ||
| 21 | -/** | ||
| 22 | - * Site controller | ||
| 23 | - */ | ||
| 24 | -class CompanyController extends Controller | ||
| 25 | -{ | ||
| 26 | - public $layout = 'company'; | ||
| 27 | - | ||
| 28 | - public $defaultAction = 'common'; | 2 | + namespace frontend\controllers; |
| 3 | + | ||
| 4 | + use common\models\Blog; | ||
| 5 | + use common\models\Fields; | ||
| 6 | + use common\models\Gallery; | ||
| 7 | + use common\models\Portfolio; | ||
| 8 | + use common\models\PortfolioSpecialization; | ||
| 9 | + use common\models\Team; | ||
| 10 | + use common\models\Vacancy; | ||
| 11 | + use common\models\VacancySpecialization; | ||
| 12 | + use Yii; | ||
| 13 | + use yii\data\ActiveDataProvider; | ||
| 14 | + use yii\data\ArrayDataProvider; | ||
| 15 | + use yii\data\Pagination; | ||
| 16 | + use yii\helpers\ArrayHelper; | ||
| 17 | + use yii\web\BadRequestHttpException; | ||
| 18 | + use yii\web\Controller; | ||
| 19 | + use common\models\User; | ||
| 29 | 20 | ||
| 30 | /** | 21 | /** |
| 31 | - * @inheritdoc | 22 | + * Site controller |
| 32 | */ | 23 | */ |
| 33 | - public function actions() | 24 | + class CompanyController extends Controller |
| 34 | { | 25 | { |
| 35 | - return [ | ||
| 36 | - 'error' => [ | ||
| 37 | - 'class' => 'yii\web\ErrorAction', | ||
| 38 | - ], | ||
| 39 | - 'captcha' => [ | ||
| 40 | - 'class' => 'yii\captcha\CaptchaAction', | ||
| 41 | - 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, | ||
| 42 | - ], | ||
| 43 | - ]; | ||
| 44 | - } | ||
| 45 | - | ||
| 46 | - public function actionIndex() | ||
| 47 | - { | ||
| 48 | - $this->redirect('site/index'); | ||
| 49 | - } | ||
| 50 | - | ||
| 51 | - public function actionCommon($company_id) | ||
| 52 | - { | ||
| 53 | - $company = User::findOne($company_id); | ||
| 54 | - | ||
| 55 | - $educations = Fields::getData($company->id,$company->className(),'education'); | ||
| 56 | - $phones = Fields::getData($company->id,$company->className(),'phone'); | ||
| 57 | - $sites = Fields::getData($company->id,$company->className(),'site'); | ||
| 58 | - $soft = implode(', ',ArrayHelper::getColumn(Fields::getData($company->id,$company->className(),'soft'), 'soft')); | ||
| 59 | - | ||
| 60 | - return $this->render('common',[ | ||
| 61 | - 'company' => $company, | ||
| 62 | - 'educations' => $educations, | ||
| 63 | - 'phones' => $phones, | ||
| 64 | - 'sites' => $sites, | ||
| 65 | - 'soft' => $soft | ||
| 66 | - ]); | ||
| 67 | - } | ||
| 68 | - | ||
| 69 | - public function actionPortfolio($company_id) | ||
| 70 | - { | ||
| 71 | - $company = User::findOne($company_id); | ||
| 72 | 26 | ||
| 73 | - if(!$company instanceof User){ | ||
| 74 | - throw new BadRequestHttpException('Пользователь не найден'); | 27 | + public $layout = 'company'; |
| 28 | + | ||
| 29 | + public $defaultAction = 'common'; | ||
| 30 | + | ||
| 31 | + /** | ||
| 32 | + * @inheritdoc | ||
| 33 | + */ | ||
| 34 | + public function actions() | ||
| 35 | + { | ||
| 36 | + return [ | ||
| 37 | + 'error' => [ | ||
| 38 | + 'class' => 'yii\web\ErrorAction', | ||
| 39 | + ], | ||
| 40 | + 'captcha' => [ | ||
| 41 | + 'class' => 'yii\captcha\CaptchaAction', | ||
| 42 | + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : NULL, | ||
| 43 | + ], | ||
| 44 | + ]; | ||
| 75 | } | 45 | } |
| 76 | - $projects = ArrayHelper::getColumn($company->portfolios,'portfolio_id'); | ||
| 77 | 46 | ||
| 78 | - | ||
| 79 | - $filters = PortfolioSpecialization::find()->select(["specialization_id","COUNT('specialization_id') AS count"]) | ||
| 80 | - ->where(["portfolio_id"=>$projects ])->groupBy("specialization_id")->all(); | ||
| 81 | - | ||
| 82 | - $portfolio = new ArrayDataProvider([ | ||
| 83 | - 'allModels' => $company->getPortfolios()->orderBy('portfolio_id')->all(), | ||
| 84 | - 'pagination' => [ | ||
| 85 | - 'pageSize' => 9, | ||
| 86 | - ], | ||
| 87 | - ]); | ||
| 88 | - | ||
| 89 | - return $this->render('portfolio',[ | ||
| 90 | - 'company' => $company, | ||
| 91 | - 'filters' => $filters, | ||
| 92 | - 'portfolio' => $portfolio, | ||
| 93 | - 'count' => count($company->portfolios) | ||
| 94 | - ]); | ||
| 95 | - } | ||
| 96 | - | ||
| 97 | - public function actionPortfolioFilter($performer_id, $filter){ | ||
| 98 | - $company = User::findOne($performer_id); | ||
| 99 | - | ||
| 100 | - if(!$company instanceof User){ | ||
| 101 | - throw new BadRequestHttpException('Пользователь не найден'); | 47 | + public function actionIndex() |
| 48 | + { | ||
| 49 | + $this->redirect('site/index'); | ||
| 102 | } | 50 | } |
| 103 | - $portfolios = ArrayHelper::getColumn($company->portfolios,'portfolio_id'); | ||
| 104 | - | ||
| 105 | - | ||
| 106 | - $filters = PortfolioSpecialization::find()->select(["specialization_id","COUNT('specialization_id') AS count"]) | ||
| 107 | - ->where(["portfolio_id"=>$portfolios ])->groupBy("specialization_id")->all(); | ||
| 108 | - | ||
| 109 | 51 | ||
| 110 | - $filter_result = PortfolioSpecialization::find() | ||
| 111 | - ->where(['specialization_id'=>$filter, | ||
| 112 | - 'portfolio_id'=>$portfolios | ||
| 113 | - ])->all(); | ||
| 114 | - | ||
| 115 | - | ||
| 116 | - $portfolio = new ArrayDataProvider([ | ||
| 117 | - 'allModels' => Portfolio::find()->where(['portfolio_id'=>ArrayHelper::getColumn($filter_result,'portfolio_id')])->all(), | ||
| 118 | - 'pagination' => [ | ||
| 119 | - 'pageSize' => 9, | ||
| 120 | - ], | ||
| 121 | - ]); | ||
| 122 | - | ||
| 123 | - return $this->render('portfolio',[ | ||
| 124 | - 'company' => $company, | ||
| 125 | - 'filters' => $filters, | ||
| 126 | - 'portfolio' => $portfolio, | ||
| 127 | - 'filter_id' => $filter, | ||
| 128 | - 'count' => count($company->portfolios) | ||
| 129 | - ]); | ||
| 130 | - } | ||
| 131 | - | ||
| 132 | - public function actionPortfolioView($company_id , $portfolio_id) | ||
| 133 | - { | ||
| 134 | - $user = User::findOne($company_id); | ||
| 135 | - $portfolio = $user->getPortfolios() | ||
| 136 | - ->where([ 'portfolio_id' => $portfolio_id ]) | ||
| 137 | - ->one(); | ||
| 138 | - $portfolio->updateCounters([ 'view_count' => 1 ]); | ||
| 139 | - return $this->render('portfolio-view', [ | ||
| 140 | - 'user' => $user, | ||
| 141 | - 'portfolio' => $portfolio, | ||
| 142 | - ]); | ||
| 143 | - } | ||
| 144 | - | ||
| 145 | - public function actionTeam($company_id) | ||
| 146 | - { | ||
| 147 | - $company = User::findOne($company_id); | ||
| 148 | - | ||
| 149 | - if(!$company instanceof User){ | ||
| 150 | - throw new BadRequestHttpException('Пользователь не найден'); | 52 | + public function actionCommon($company_id) |
| 53 | + { | ||
| 54 | + $company = User::findOne($company_id); | ||
| 55 | + | ||
| 56 | + $educations = Fields::getData($company->id, $company->className(), 'education'); | ||
| 57 | + $phones = Fields::getData($company->id, $company->className(), 'phone'); | ||
| 58 | + $sites = Fields::getData($company->id, $company->className(), 'site'); | ||
| 59 | + $soft = implode(', ', ArrayHelper::getColumn(Fields::getData($company->id, $company->className(), 'soft'), 'soft')); | ||
| 60 | + | ||
| 61 | + return $this->render('common', [ | ||
| 62 | + 'company' => $company, | ||
| 63 | + 'educations' => $educations, | ||
| 64 | + 'phones' => $phones, | ||
| 65 | + 'sites' => $sites, | ||
| 66 | + 'soft' => $soft, | ||
| 67 | + ]); | ||
| 151 | } | 68 | } |
| 152 | 69 | ||
| 153 | - | ||
| 154 | - $query = Team::find()->where(['user_id'=>$company_id]); | ||
| 155 | - | ||
| 156 | - $countQuery = clone $query; | ||
| 157 | - | ||
| 158 | - $pagination = new Pagination(['totalCount' => $countQuery->count(), | ||
| 159 | - 'pageSize' => 9, | ||
| 160 | - ]); | ||
| 161 | - | ||
| 162 | - $team = $query->offset($pagination->offset) | ||
| 163 | - ->limit($pagination->limit) | ||
| 164 | - ->all(); | ||
| 165 | - | ||
| 166 | - $team = new ArrayDataProvider([ | ||
| 167 | - 'allModels' => $team, | ||
| 168 | - ]); | ||
| 169 | - | ||
| 170 | - | ||
| 171 | - return $this->render('team',[ | ||
| 172 | - 'company' => $company, | ||
| 173 | - 'team' => $team, | ||
| 174 | - 'pagination' => $pagination | ||
| 175 | - ]); | ||
| 176 | - } | ||
| 177 | - | ||
| 178 | - public function actionBlogList($company_id) | ||
| 179 | - { | ||
| 180 | - $company = User::findOne($company_id); | ||
| 181 | - | ||
| 182 | - if(!$company instanceof User){ | ||
| 183 | - throw new BadRequestHttpException('Пользователь не найден'); | 70 | + public function actionPortfolio($company_id) |
| 71 | + { | ||
| 72 | + $company = User::findOne($company_id); | ||
| 73 | + | ||
| 74 | + if(!$company instanceof User) { | ||
| 75 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 76 | + } | ||
| 77 | + $projects = ArrayHelper::getColumn($company->portfolios, 'portfolio_id'); | ||
| 78 | + | ||
| 79 | + $filters = PortfolioSpecialization::find() | ||
| 80 | + ->select([ | ||
| 81 | + "specialization_id", | ||
| 82 | + "COUNT('specialization_id') AS count", | ||
| 83 | + ]) | ||
| 84 | + ->where([ "portfolio_id" => $projects ]) | ||
| 85 | + ->groupBy("specialization_id") | ||
| 86 | + ->all(); | ||
| 87 | + | ||
| 88 | + $portfolio = new ArrayDataProvider([ | ||
| 89 | + 'allModels' => $company->getPortfolios() | ||
| 90 | + ->orderBy('portfolio_id') | ||
| 91 | + ->all(), | ||
| 92 | + 'pagination' => [ | ||
| 93 | + 'pageSize' => 9, | ||
| 94 | + ], | ||
| 95 | + ]); | ||
| 96 | + | ||
| 97 | + return $this->render('portfolio', [ | ||
| 98 | + 'company' => $company, | ||
| 99 | + 'filters' => $filters, | ||
| 100 | + 'portfolio' => $portfolio, | ||
| 101 | + 'count' => count($company->portfolios), | ||
| 102 | + ]); | ||
| 184 | } | 103 | } |
| 185 | 104 | ||
| 105 | + public function actionPortfolioFilter($performer_id, $filter) | ||
| 106 | + { | ||
| 107 | + $company = User::findOne($performer_id); | ||
| 108 | + | ||
| 109 | + if(!$company instanceof User) { | ||
| 110 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 111 | + } | ||
| 112 | + $portfolios = ArrayHelper::getColumn($company->portfolios, 'portfolio_id'); | ||
| 113 | + | ||
| 114 | + $filters = PortfolioSpecialization::find() | ||
| 115 | + ->select([ | ||
| 116 | + "specialization_id", | ||
| 117 | + "COUNT('specialization_id') AS count", | ||
| 118 | + ]) | ||
| 119 | + ->where([ "portfolio_id" => $portfolios ]) | ||
| 120 | + ->groupBy("specialization_id") | ||
| 121 | + ->all(); | ||
| 122 | + | ||
| 123 | + $filter_result = PortfolioSpecialization::find() | ||
| 124 | + ->where([ | ||
| 125 | + 'specialization_id' => $filter, | ||
| 126 | + 'portfolio_id' => $portfolios, | ||
| 127 | + ]) | ||
| 128 | + ->all(); | ||
| 129 | + | ||
| 130 | + $portfolio = new ArrayDataProvider([ | ||
| 131 | + 'allModels' => Portfolio::find() | ||
| 132 | + ->where([ 'portfolio_id' => ArrayHelper::getColumn($filter_result, 'portfolio_id') ]) | ||
| 133 | + ->all(), | ||
| 134 | + 'pagination' => [ | ||
| 135 | + 'pageSize' => 9, | ||
| 136 | + ], | ||
| 137 | + ]); | ||
| 138 | + | ||
| 139 | + return $this->render('portfolio', [ | ||
| 140 | + 'company' => $company, | ||
| 141 | + 'filters' => $filters, | ||
| 142 | + 'portfolio' => $portfolio, | ||
| 143 | + 'filter_id' => $filter, | ||
| 144 | + 'count' => count($company->portfolios), | ||
| 145 | + ]); | ||
| 146 | + } | ||
| 186 | 147 | ||
| 187 | - $query = Blog::find()->where(['user_id'=>$company_id]); | 148 | + public function actionPortfolioView($company_id, $portfolio_id) |
| 149 | + { | ||
| 150 | + $user = User::findOne($company_id); | ||
| 151 | + $portfolio = $user->getPortfolios() | ||
| 152 | + ->where([ 'portfolio_id' => $portfolio_id ]) | ||
| 153 | + ->one(); | ||
| 154 | + $portfolio->updateCounters([ 'view_count' => 1 ]); | ||
| 155 | + return $this->render('portfolio-view', [ | ||
| 156 | + 'user' => $user, | ||
| 157 | + 'portfolio' => $portfolio, | ||
| 158 | + ]); | ||
| 159 | + } | ||
| 188 | 160 | ||
| 189 | - $countQuery = clone $query; | 161 | + public function actionTeam($company_id) |
| 162 | + { | ||
| 163 | + $company = User::findOne($company_id); | ||
| 164 | + if(!$company instanceof User) { | ||
| 165 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 166 | + } | ||
| 167 | + $comments = new ActiveDataProvider([ | ||
| 168 | + 'query' => $company->getComments(), | ||
| 169 | + 'pagination' => [ | ||
| 170 | + 'pageSize' => 4 | ||
| 171 | + ], | ||
| 172 | + ]); | ||
| 173 | + $query = Team::find() | ||
| 174 | + ->where([ 'user_id' => $company_id ]); | ||
| 175 | + $team = new ActiveDataProvider([ | ||
| 176 | + 'query' => $query, | ||
| 177 | + 'pagination' => [ | ||
| 178 | + 'pageSize' => 9, | ||
| 179 | + ], | ||
| 180 | + ]); | ||
| 181 | + return $this->render('team', [ | ||
| 182 | + 'company' => $company, | ||
| 183 | + 'team' => $team, | ||
| 184 | + 'comments' => $comments, | ||
| 185 | + ]); | ||
| 186 | + } | ||
| 190 | 187 | ||
| 191 | - $pagination = new Pagination(['totalCount' => $countQuery->count(), | ||
| 192 | - 'pageSize' => 5, | ||
| 193 | - ]); | 188 | + public function actionBlogList($company_id) |
| 189 | + { | ||
| 190 | + $company = User::findOne($company_id); | ||
| 194 | 191 | ||
| 195 | - $article = $query->offset($pagination->offset) | ||
| 196 | - ->limit($pagination->limit) | ||
| 197 | - ->all(); | 192 | + if(!$company instanceof User) { |
| 193 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 194 | + } | ||
| 198 | 195 | ||
| 199 | - $blog = new ArrayDataProvider([ | ||
| 200 | - 'allModels' => $article, | ||
| 201 | - ]); | 196 | + $query = Blog::find() |
| 197 | + ->where([ 'user_id' => $company_id ]); | ||
| 202 | 198 | ||
| 199 | + $countQuery = clone $query; | ||
| 203 | 200 | ||
| 204 | - return $this->render('blog-list',[ | ||
| 205 | - 'company' => $company, | ||
| 206 | - 'blog' => $blog, | ||
| 207 | - 'pagination' => $pagination | ||
| 208 | - ]); | ||
| 209 | - } | 201 | + $pagination = new Pagination([ |
| 202 | + 'totalCount' => $countQuery->count(), | ||
| 203 | + 'pageSize' => 5, | ||
| 204 | + ]); | ||
| 210 | 205 | ||
| 206 | + $article = $query->offset($pagination->offset) | ||
| 207 | + ->limit($pagination->limit) | ||
| 208 | + ->with('comments') | ||
| 209 | + ->all(); | ||
| 211 | 210 | ||
| 212 | - public function actionBlogView($company_id, $link) | ||
| 213 | - { | ||
| 214 | - $company = User::findOne($company_id); | 211 | + $blog = new ArrayDataProvider([ |
| 212 | + 'allModels' => $article, | ||
| 213 | + ]); | ||
| 215 | 214 | ||
| 216 | - if(!$company instanceof User){ | ||
| 217 | - throw new BadRequestHttpException('Пользователь не найден'); | 215 | + return $this->render('blog-list', [ |
| 216 | + 'company' => $company, | ||
| 217 | + 'blog' => $blog, | ||
| 218 | + 'pagination' => $pagination, | ||
| 219 | + ]); | ||
| 218 | } | 220 | } |
| 219 | 221 | ||
| 222 | + public function actionBlogView($company_id, $link) | ||
| 223 | + { | ||
| 224 | + $company = User::findOne($company_id); | ||
| 220 | 225 | ||
| 221 | - $article = Blog::findOne(['link'=>$link,'user_id'=>$company_id]); | ||
| 222 | - $article->view_count ++; | ||
| 223 | - $article->save(); | 226 | + if(!$company instanceof User) { |
| 227 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 228 | + } | ||
| 224 | 229 | ||
| 230 | + $article = Blog::find() | ||
| 231 | + ->where([ | ||
| 232 | + 'link' => $link, | ||
| 233 | + 'user_id' => $company_id, | ||
| 234 | + ]) | ||
| 235 | + ->with('comments') | ||
| 236 | + ->one(); | ||
| 237 | + $article->updateCounters([ 'view_count' => 1 ]); | ||
| 225 | 238 | ||
| 226 | - return $this->render('blog-view',[ | ||
| 227 | - 'company' => $company, | ||
| 228 | - 'article' =>$article, | ||
| 229 | - | ||
| 230 | - ]); | ||
| 231 | - } | ||
| 232 | - | ||
| 233 | - public function actionReview($company_id) | ||
| 234 | - { | ||
| 235 | - $company = User::findOne($company_id); | ||
| 236 | - | ||
| 237 | - return $this->render('review',[ | ||
| 238 | - 'company' => $company | ||
| 239 | - ]); | ||
| 240 | - } | ||
| 241 | - | ||
| 242 | - public function actionVacancyList($company_id) | ||
| 243 | - { | ||
| 244 | - | ||
| 245 | - $company = User::findOne($company_id); | 239 | + return $this->render('blog-view', [ |
| 240 | + 'company' => $company, | ||
| 241 | + 'article' => $article, | ||
| 246 | 242 | ||
| 247 | - if(!$company instanceof User){ | ||
| 248 | - throw new BadRequestHttpException('Пользователь не найден'); | 243 | + ]); |
| 249 | } | 244 | } |
| 250 | 245 | ||
| 246 | + public function actionReview($company_id) | ||
| 247 | + { | ||
| 248 | + $company = User::findOne($company_id); | ||
| 251 | 249 | ||
| 252 | - $query = $company->getVacancies(); | 250 | + return $this->render('review', [ |
| 251 | + 'company' => $company, | ||
| 252 | + ]); | ||
| 253 | + } | ||
| 253 | 254 | ||
| 254 | - $countQuery = clone $query; | 255 | + public function actionVacancyList($company_id) |
| 256 | + { | ||
| 255 | 257 | ||
| 256 | - $pagination = new Pagination(['totalCount' => $countQuery->count(), | ||
| 257 | - 'pageSize' => 5, | ||
| 258 | - ]); | 258 | + $company = User::findOne($company_id); |
| 259 | 259 | ||
| 260 | - $vacancy = $query->offset($pagination->offset) | ||
| 261 | - ->limit($pagination->limit); | 260 | + if(!$company instanceof User) { |
| 261 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 262 | + } | ||
| 262 | 263 | ||
| 264 | + $query = $company->getVacancies(); | ||
| 263 | 265 | ||
| 264 | - $provider = new ActiveDataProvider([ | ||
| 265 | - 'query' => $vacancy, | ||
| 266 | - 'pagination' => false, | ||
| 267 | - 'sort' => [ | ||
| 268 | - 'defaultOrder' => [ | ||
| 269 | - 'date_add' => SORT_DESC, | ||
| 270 | - 'name' => SORT_ASC, | ||
| 271 | - ] | ||
| 272 | - ], | ||
| 273 | - ]); | 266 | + $provider = new ActiveDataProvider([ |
| 267 | + 'query' => $query, | ||
| 268 | + 'pagination' => [ | ||
| 269 | + 'pageSize' => 5, | ||
| 270 | + ], | ||
| 271 | + 'sort' => [ | ||
| 272 | + 'defaultOrder' => [ | ||
| 273 | + 'date_add' => SORT_DESC, | ||
| 274 | + 'name' => SORT_ASC, | ||
| 275 | + ], | ||
| 276 | + ], | ||
| 277 | + ]); | ||
| 274 | 278 | ||
| 279 | + return $this->render('vacancy-list', [ | ||
| 280 | + 'company' => $company, | ||
| 281 | + 'provider' => $provider, | ||
| 282 | + ]); | ||
| 275 | 283 | ||
| 284 | + } | ||
| 276 | 285 | ||
| 277 | - return $this->render('vacancy-list',[ | ||
| 278 | - 'company' => $company, | ||
| 279 | - 'provider' => $provider, | ||
| 280 | - 'pagination' => $pagination | ||
| 281 | - ]); | 286 | + public function actionVacancyView($company_id, $link) |
| 287 | + { | ||
| 288 | + $company = User::findOne($company_id); | ||
| 289 | + $vacancy = $company->getVacancies() | ||
| 290 | + ->where([ 'link' => $link ]) | ||
| 291 | + ->with([ | ||
| 292 | + 'employments', | ||
| 293 | + 'specializations', | ||
| 294 | + ]) | ||
| 295 | + ->one(); | ||
| 296 | + | ||
| 297 | + $specialization_id = $vacancy->getSpecializations() | ||
| 298 | + ->select('specialization_id') | ||
| 299 | + ->column(); | ||
| 300 | + | ||
| 301 | + $vacancy_id = VacancySpecialization::find() | ||
| 302 | + ->where([ 'specialization_id' => $specialization_id ]) | ||
| 303 | + ->select('vacancy_id') | ||
| 304 | + ->column(); | ||
| 305 | + | ||
| 306 | + $similar_vacancies = Vacancy::find() | ||
| 307 | + ->where([ | ||
| 308 | + 'city' => $vacancy->city, | ||
| 309 | + 'vacancy_id' => $vacancy_id, | ||
| 310 | + ]) | ||
| 311 | + ->andFilterWhere([ | ||
| 312 | + '<>', | ||
| 313 | + 'vacancy_id', | ||
| 314 | + $vacancy->vacancy_id, | ||
| 315 | + ]) | ||
| 316 | + ->orderBy([ 'vacancy_id' => SORT_DESC ]) | ||
| 317 | + ->limit(3) | ||
| 318 | + ->all(); | ||
| 319 | + | ||
| 320 | + return $this->render('vacancy-view', [ | ||
| 321 | + 'company' => $company, | ||
| 322 | + 'vacancy' => $vacancy, | ||
| 323 | + 'similar_vacancies' => $similar_vacancies, | ||
| 324 | + ]); | ||
| 325 | + } | ||
| 282 | 326 | ||
| 283 | - } | 327 | + public function actionGallery($company_id) |
| 328 | + { | ||
| 329 | + $company = User::findOne($company_id); | ||
| 284 | 330 | ||
| 285 | - public function actionVacancyView($company_id, $link) | ||
| 286 | - { | ||
| 287 | - $company = User::findOne($company_id); | ||
| 288 | - $vacancy = $company->getVacancies()->where(['link' => $link])->with(['employments'])->one(); | 331 | + if(!$company instanceof User) { |
| 332 | + throw new BadRequestHttpException('Пользователь не найден'); | ||
| 333 | + } | ||
| 289 | 334 | ||
| 335 | + $query = Gallery::find() | ||
| 336 | + ->where([ 'user_id' => $company_id ]); | ||
| 290 | 337 | ||
| 291 | - $specialization_id = $vacancy->getSpecializations()->select('specialization_id')->column(); | 338 | + $countQuery = clone $query; |
| 292 | 339 | ||
| 293 | - $vacancy_id = VacancySpecialization::find()->where(['specialization_id'=>$specialization_id])->select('vacancy_id')->column(); | 340 | + $pagination = new Pagination([ |
| 341 | + 'totalCount' => $countQuery->count(), | ||
| 342 | + 'pageSize' => 5, | ||
| 343 | + ]); | ||
| 294 | 344 | ||
| 345 | + $gallery = $query->offset($pagination->offset) | ||
| 346 | + ->limit($pagination->limit) | ||
| 347 | + ->all(); | ||
| 295 | 348 | ||
| 296 | - $similar_vacancies = Vacancy::find() | ||
| 297 | - ->where([ | ||
| 298 | - 'city' => $vacancy->city, | ||
| 299 | - 'vacancy_id' => $vacancy_id | ||
| 300 | - ]) | ||
| 301 | - ->andFilterWhere([ | ||
| 302 | - '<>', | ||
| 303 | - 'vacancy_id', | ||
| 304 | - $vacancy->vacancy_id | ||
| 305 | - ])->limit(3) | ||
| 306 | - ->all(); | ||
| 307 | - | ||
| 308 | - return $this->render('vacancy-view',[ | ||
| 309 | - 'company' => $company, | ||
| 310 | - 'vacancy' => $vacancy, | ||
| 311 | - 'similar_vacancies' => $similar_vacancies | ||
| 312 | - ]); | ||
| 313 | - } | 349 | + $gallery = new ArrayDataProvider([ |
| 350 | + 'allModels' => $gallery, | ||
| 351 | + ]); | ||
| 314 | 352 | ||
| 353 | + $videos = Fields::getData($company->id, Gallery::className(), 'youtube'); | ||
| 315 | 354 | ||
| 316 | - public function actionGallery($company_id) | ||
| 317 | - { | ||
| 318 | - $company = User::findOne($company_id); | 355 | + $this->layout = 'gallery-company'; |
| 319 | 356 | ||
| 320 | - if(!$company instanceof User){ | ||
| 321 | - throw new BadRequestHttpException('Пользователь не найден'); | 357 | + return $this->render('gallery', [ |
| 358 | + 'company' => $company, | ||
| 359 | + 'gallery' => $gallery, | ||
| 360 | + 'pagination' => $pagination, | ||
| 361 | + 'videos' => $videos, | ||
| 362 | + ]); | ||
| 322 | } | 363 | } |
| 323 | - | ||
| 324 | - | ||
| 325 | - $query = Gallery::find()->where(['user_id'=>$company_id]); | ||
| 326 | - | ||
| 327 | - $countQuery = clone $query; | ||
| 328 | - | ||
| 329 | - $pagination = new Pagination(['totalCount' => $countQuery->count(), | ||
| 330 | - 'pageSize' => 5, | ||
| 331 | - ]); | ||
| 332 | - | ||
| 333 | - $gallery = $query->offset($pagination->offset) | ||
| 334 | - ->limit($pagination->limit) | ||
| 335 | - ->all(); | ||
| 336 | - | ||
| 337 | - $gallery = new ArrayDataProvider([ | ||
| 338 | - 'allModels' => $gallery, | ||
| 339 | - ]); | ||
| 340 | - | ||
| 341 | - $videos = Fields::getData($company->id,Gallery::className(),'youtube'); | ||
| 342 | - | ||
| 343 | - $this->layout = 'gallery-company'; | ||
| 344 | - | ||
| 345 | - return $this->render('gallery',[ | ||
| 346 | - 'company' => $company, | ||
| 347 | - 'gallery' =>$gallery, | ||
| 348 | - 'pagination' => $pagination, | ||
| 349 | - 'videos' => $videos | ||
| 350 | - ]); | ||
| 351 | } | 364 | } |
| 352 | -} |
frontend/controllers/PerformerController.php
| @@ -97,7 +97,9 @@ | @@ -97,7 +97,9 @@ | ||
| 97 | ->all(); | 97 | ->all(); |
| 98 | 98 | ||
| 99 | $portfolio = new ArrayDataProvider([ | 99 | $portfolio = new ArrayDataProvider([ |
| 100 | - 'allModels' => $user->getPortfolios()->orderBy('portfolio_id')->all(), | 100 | + 'allModels' => $user->getPortfolios() |
| 101 | + ->orderBy('portfolio_id') | ||
| 102 | + ->all(), | ||
| 101 | 'pagination' => [ | 103 | 'pagination' => [ |
| 102 | 'pageSize' => 9, | 104 | 'pageSize' => 9, |
| 103 | ], | 105 | ], |
| @@ -187,6 +189,7 @@ | @@ -187,6 +189,7 @@ | ||
| 187 | 189 | ||
| 188 | $article = $query->offset($pagination->offset) | 190 | $article = $query->offset($pagination->offset) |
| 189 | ->limit($pagination->limit) | 191 | ->limit($pagination->limit) |
| 192 | + ->with('comments') | ||
| 190 | ->all(); | 193 | ->all(); |
| 191 | 194 | ||
| 192 | $blog = new ArrayDataProvider([ | 195 | $blog = new ArrayDataProvider([ |
| @@ -208,16 +211,17 @@ | @@ -208,16 +211,17 @@ | ||
| 208 | throw new BadRequestHttpException('Пользователь не найден'); | 211 | throw new BadRequestHttpException('Пользователь не найден'); |
| 209 | } | 212 | } |
| 210 | 213 | ||
| 211 | - $article = Blog::findOne([ | ||
| 212 | - 'link' => $link, | ||
| 213 | - 'user_id' => $performer_id, | ||
| 214 | - ]); | 214 | + $article = Blog::find() |
| 215 | + ->where([ | ||
| 216 | + 'link' => $link, | ||
| 217 | + 'user_id' => $performer_id, | ||
| 218 | + ]) | ||
| 219 | + ->with('comments')->one(); | ||
| 215 | $article->updateCounters([ 'view_count' => 1 ]); | 220 | $article->updateCounters([ 'view_count' => 1 ]); |
| 216 | 221 | ||
| 217 | return $this->render('blog-view', [ | 222 | return $this->render('blog-view', [ |
| 218 | 'user' => $user, | 223 | 'user' => $user, |
| 219 | 'article' => $article, | 224 | 'article' => $article, |
| 220 | - | ||
| 221 | ]); | 225 | ]); |
| 222 | } | 226 | } |
| 223 | 227 | ||
| @@ -254,7 +258,8 @@ | @@ -254,7 +258,8 @@ | ||
| 254 | throw new BadRequestHttpException('Пользователь не найден'); | 258 | throw new BadRequestHttpException('Пользователь не найден'); |
| 255 | } | 259 | } |
| 256 | 260 | ||
| 257 | - $query = Gallery::find()->where([ 'user_id' => $performer_id ]); | 261 | + $query = Gallery::find() |
| 262 | + ->where([ 'user_id' => $performer_id ]); | ||
| 258 | 263 | ||
| 259 | $countQuery = clone $query; | 264 | $countQuery = clone $query; |
| 260 | 265 |
frontend/views/accounts/_projects_form.php
| @@ -23,21 +23,21 @@ | @@ -23,21 +23,21 @@ | ||
| 23 | <div class="login-left-column-title"><?= $this->title ?></div> | 23 | <div class="login-left-column-title"><?= $this->title ?></div> |
| 24 | 24 | ||
| 25 | <?php | 25 | <?php |
| 26 | - $form = ActiveForm::begin(); | 26 | + $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]); |
| 27 | ?> | 27 | ?> |
| 28 | 28 | ||
| 29 | 29 | ||
| 30 | <div class="input-blocks-wrapper"> | 30 | <div class="input-blocks-wrapper"> |
| 31 | <div class="input-blocks"> | 31 | <div class="input-blocks"> |
| 32 | <?= $form->field($project, 'name') | 32 | <?= $form->field($project, 'name') |
| 33 | - ->textInput (['class'=> 'custom-input-2']) ?> | 33 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 34 | </div> | 34 | </div> |
| 35 | </div> | 35 | </div> |
| 36 | 36 | ||
| 37 | <div class="input-blocks-wrapper"> | 37 | <div class="input-blocks-wrapper"> |
| 38 | <div class="input-blocks admin-project-list admin-currency-second"> | 38 | <div class="input-blocks admin-project-list admin-currency-second"> |
| 39 | <?= $form->field($project, 'project_pid') | 39 | <?= $form->field($project, 'project_pid') |
| 40 | - ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?> | 40 | + ->dropDownList($projects, [ 'prompt' => 'Родительский проект' ]) ?> |
| 41 | </div> | 41 | </div> |
| 42 | </div> | 42 | </div> |
| 43 | 43 | ||
| @@ -63,15 +63,15 @@ | @@ -63,15 +63,15 @@ | ||
| 63 | <li> | 63 | <li> |
| 64 | <a href="#" title="<?= $child_second->specialization_name ?>"> | 64 | <a href="#" title="<?= $child_second->specialization_name ?>"> |
| 65 | <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]", [ | 65 | <?= $form->field($project, "specializationInput[{$child_second->specialization_id}]", [ |
| 66 | - 'template' => '{input}{label}{hint}{error}', | 66 | + 'template' => '{input}{label}{hint}{error}', |
| 67 | ]) | 67 | ]) |
| 68 | - ->label('<span></span>' . $child_second->specialization_name) | ||
| 69 | - ->checkbox([ | ||
| 70 | - 'value' => $child_second->specialization_id, | ||
| 71 | - 'label' => NULL, | ||
| 72 | - 'uncheck' => NULL, | ||
| 73 | - 'class' => 'custom-check', | ||
| 74 | - ], false) ?> | 68 | + ->label('<span></span>' . $child_second->specialization_name) |
| 69 | + ->checkbox([ | ||
| 70 | + 'value' => $child_second->specialization_id, | ||
| 71 | + 'label' => NULL, | ||
| 72 | + 'uncheck' => NULL, | ||
| 73 | + 'class' => 'custom-check', | ||
| 74 | + ], false) ?> | ||
| 75 | </a> | 75 | </a> |
| 76 | </li> | 76 | </li> |
| 77 | <?php endif; ?> | 77 | <?php endif; ?> |
| @@ -91,7 +91,9 @@ | @@ -91,7 +91,9 @@ | ||
| 91 | </div> | 91 | </div> |
| 92 | </div> | 92 | </div> |
| 93 | 93 | ||
| 94 | -<div class="admin-specialization-selected style"><ul></ul></div> | 94 | +<div class="admin-specialization-selected style"> |
| 95 | + <ul></ul> | ||
| 96 | +</div> | ||
| 95 | 97 | ||
| 96 | 98 | ||
| 97 | <div class="conacts-admin style">Адрес проекта:</div> | 99 | <div class="conacts-admin style">Адрес проекта:</div> |
| @@ -99,38 +101,33 @@ | @@ -99,38 +101,33 @@ | ||
| 99 | <div class="input-blocks-wrapper"> | 101 | <div class="input-blocks-wrapper"> |
| 100 | <div class="input-blocks"> | 102 | <div class="input-blocks"> |
| 101 | <?= $form->field($project, 'city') | 103 | <?= $form->field($project, 'city') |
| 102 | - ->widget(Select2::classname(), [ | ||
| 103 | - 'options' => [ 'placeholder' => 'Выбор города ...' ], | ||
| 104 | - 'pluginOptions' => [ | ||
| 105 | - 'allowClear' => true, | ||
| 106 | - 'minimumInputLength' => 3, | ||
| 107 | - 'ajax' => [ | ||
| 108 | - 'url' => \yii\helpers\Url::to([ 'site/city' ]), | ||
| 109 | - 'dataType' => 'json', | ||
| 110 | - 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | ||
| 111 | - ], | ||
| 112 | - 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
| 113 | - 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
| 114 | - 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
| 115 | - ], | ||
| 116 | - ]); | ||
| 117 | - ?> | 104 | + ->widget(Select2::classname(), [ |
| 105 | + 'options' => [ 'placeholder' => 'Выбор города ...' ], | ||
| 106 | + 'pluginOptions' => [ | ||
| 107 | + 'allowClear' => true, | ||
| 108 | + 'minimumInputLength' => 3, | ||
| 109 | + 'ajax' => [ | ||
| 110 | + 'url' => \yii\helpers\Url::to([ 'site/city' ]), | ||
| 111 | + 'dataType' => 'json', | ||
| 112 | + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | ||
| 113 | + ], | ||
| 114 | + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
| 115 | + 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
| 116 | + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
| 117 | + ], | ||
| 118 | + ]); ?> | ||
| 118 | </div> | 119 | </div> |
| 119 | 120 | ||
| 120 | 121 | ||
| 121 | - | ||
| 122 | - | ||
| 123 | - | ||
| 124 | <div class="input-blocks street-input"> | 122 | <div class="input-blocks street-input"> |
| 125 | <?= $form->field($project, 'street', [ 'template' => "{label}{input}{hint}{error}" ]) | 123 | <?= $form->field($project, 'street', [ 'template' => "{label}{input}{hint}{error}" ]) |
| 126 | - ->textInput (['class'=> 'custom-input-2']) ?> | 124 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 127 | </div> | 125 | </div> |
| 128 | 126 | ||
| 129 | 127 | ||
| 130 | - | ||
| 131 | <div class="input-blocks home-input"> | 128 | <div class="input-blocks home-input"> |
| 132 | <?= $form->field($project, 'house', [ 'template' => "{label}{input}{hint}{error}" ]) | 129 | <?= $form->field($project, 'house', [ 'template' => "{label}{input}{hint}{error}" ]) |
| 133 | - ->textInput (['class'=> 'custom-input-2']) ?> | 130 | + ->textInput([ 'class' => 'custom-input-2' ]) ?> |
| 134 | </div> | 131 | </div> |
| 135 | </div> | 132 | </div> |
| 136 | </div> | 133 | </div> |
| @@ -138,20 +135,22 @@ | @@ -138,20 +135,22 @@ | ||
| 138 | <div class="input-blocks-wrapper"> | 135 | <div class="input-blocks-wrapper"> |
| 139 | <div class="input-blocks admin-project-list-two admin-currency-first"> | 136 | <div class="input-blocks admin-project-list-two admin-currency-first"> |
| 140 | <?= $form->field($project, 'budget', [ | 137 | <?= $form->field($project, 'budget', [ |
| 141 | - 'template' => "{label}<br />{input}\n{hint}\n{error}" | 138 | + 'template' => "{label}<br />{input}\n{hint}\n{error}", |
| 142 | ]) | 139 | ]) |
| 143 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']) ?> | 140 | + ->textInput([ |
| 141 | + 'class' => 'custom-input-2 custom-input-2-date', | ||
| 142 | + 'type' => 'number', | ||
| 143 | + ]) ?> | ||
| 144 | </div> | 144 | </div> |
| 145 | <div class="input-blocks admin-project-list-two admin-currency-second"> | 145 | <div class="input-blocks admin-project-list-two admin-currency-second"> |
| 146 | - <?= | ||
| 147 | - $form->field($project, 'budget_currency')->label(false)->dropDownList(Currency::getCurrencyDropdown(), ['class'=> 'custom-input-2']); | ||
| 148 | - ?> | 146 | + <?= $form->field($project, 'budget_currency') |
| 147 | + ->label(false) | ||
| 148 | + ->dropDownList(Currency::getCurrencyDropdown(), [ 'class' => 'custom-input-2' ]); ?> | ||
| 149 | </div> | 149 | </div> |
| 150 | <div class="input-blocks admin-who-check-payment admin-project-contractual"> | 150 | <div class="input-blocks admin-who-check-payment admin-project-contractual"> |
| 151 | - <?= $form->field($project, 'contractual', ['template' => "{input}{label}\n{hint}\n{error}"]) | ||
| 152 | - ->checkbox (['class'=> 'custom-check'], false) | ||
| 153 | - ->label ('<span></span>Договорной') | ||
| 154 | - ?> | 151 | + <?= $form->field($project, 'contractual', [ 'template' => "{input}{label}\n{hint}\n{error}" ]) |
| 152 | + ->checkbox([ 'class' => 'custom-check' ], false) | ||
| 153 | + ->label('<span></span>Договорной') ?> | ||
| 155 | </div> | 154 | </div> |
| 156 | 155 | ||
| 157 | </div> | 156 | </div> |
| @@ -159,37 +158,37 @@ | @@ -159,37 +158,37 @@ | ||
| 159 | <div class="input-blocks-wrapper"> | 158 | <div class="input-blocks-wrapper"> |
| 160 | <div class="input-blocks"> | 159 | <div class="input-blocks"> |
| 161 | <?= $form->field($project, 'payment_variant') | 160 | <?= $form->field($project, 'payment_variant') |
| 162 | - ->radioList([ | ||
| 163 | - 1 => 'Без предоплаты', | ||
| 164 | - 2 => 'Предоплата возможна', | ||
| 165 | - ],[ | ||
| 166 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
| 167 | - $return = '<div class="admin-who-check">'; | ||
| 168 | - $return .= '<input class="custom-radio" id="select_admin_mfp'.$value.'" type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
| 169 | - $return .= '<label for="select_admin_mfp'.$value.'" >'; | ||
| 170 | - $return .= '<span></span>' . ucwords($label); | ||
| 171 | - $return .= '</label>'; | ||
| 172 | - $return .= '</div>'; | ||
| 173 | - return $return; | ||
| 174 | - } | ||
| 175 | - ]) ?> | 161 | + ->radioList([ |
| 162 | + 1 => 'Без предоплаты', | ||
| 163 | + 2 => 'Предоплата возможна', | ||
| 164 | + ], [ | ||
| 165 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
| 166 | + $return = '<div class="admin-who-check">'; | ||
| 167 | + $return .= '<input class="custom-radio" id="select_admin_mfp' . $value . '" type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
| 168 | + $return .= '<label for="select_admin_mfp' . $value . '" >'; | ||
| 169 | + $return .= '<span></span>' . ucwords($label); | ||
| 170 | + $return .= '</label>'; | ||
| 171 | + $return .= '</div>'; | ||
| 172 | + return $return; | ||
| 173 | + }, | ||
| 174 | + ]) ?> | ||
| 176 | </div> | 175 | </div> |
| 177 | </div> | 176 | </div> |
| 178 | 177 | ||
| 179 | <div class="input-blocks-wrapper"> | 178 | <div class="input-blocks-wrapper"> |
| 180 | <div class="input-blocks"> | 179 | <div class="input-blocks"> |
| 181 | <?= $form->field($project, 'paymentInput') | 180 | <?= $form->field($project, 'paymentInput') |
| 182 | - ->checkboxList($payment,[ | ||
| 183 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
| 184 | - $return = '<div class="admin-who-check-payment">'; | ||
| 185 | - $return .= '<input class="custom-check" id="check_admin_mfp'.$value.'" type="checkbox" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
| 186 | - $return .= '<label for="check_admin_mfp'.$value.'" >'; | ||
| 187 | - $return .= '<span></span>' . ucwords($label); | ||
| 188 | - $return .= '</label>'; | ||
| 189 | - $return .= '</div>'; | ||
| 190 | - return $return; | ||
| 191 | - } | ||
| 192 | - ]) ?> | 181 | + ->checkboxList($payment, [ |
| 182 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
| 183 | + $return = '<div class="admin-who-check-payment">'; | ||
| 184 | + $return .= '<input class="custom-check" id="check_admin_mfp' . $value . '" type="checkbox" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
| 185 | + $return .= '<label for="check_admin_mfp' . $value . '" >'; | ||
| 186 | + $return .= '<span></span>' . ucwords($label); | ||
| 187 | + $return .= '</label>'; | ||
| 188 | + $return .= '</div>'; | ||
| 189 | + return $return; | ||
| 190 | + }, | ||
| 191 | + ]) ?> | ||
| 193 | </div> | 192 | </div> |
| 194 | </div> | 193 | </div> |
| 195 | 194 | ||
| @@ -197,7 +196,10 @@ | @@ -197,7 +196,10 @@ | ||
| 197 | <div class="input-blocks-wrapper"> | 196 | <div class="input-blocks-wrapper"> |
| 198 | <div class="input-blocks admin-project-days"> | 197 | <div class="input-blocks admin-project-days"> |
| 199 | <?= $form->field($project, 'deadline', [ 'template' => "{label}<br />{input}<span class='admn-input-txt' style='padding-left: 10px'>дней</span>\n{hint}\n{error}" ]) | 198 | <?= $form->field($project, 'deadline', [ 'template' => "{label}<br />{input}<span class='admn-input-txt' style='padding-left: 10px'>дней</span>\n{hint}\n{error}" ]) |
| 200 | - ->textInput (['class'=> 'custom-input-2 custom-input-2-date','type'=>'number']) ?> | 199 | + ->textInput([ |
| 200 | + 'class' => 'custom-input-2 custom-input-2-date', | ||
| 201 | + 'type' => 'number', | ||
| 202 | + ]) ?> | ||
| 201 | </div> | 203 | </div> |
| 202 | </div> | 204 | </div> |
| 203 | 205 | ||
| @@ -216,9 +218,8 @@ | @@ -216,9 +218,8 @@ | ||
| 216 | <div class="not-file-mb-adm">До 3 Мб файл</div> | 218 | <div class="not-file-mb-adm">До 3 Мб файл</div> |
| 217 | </div> | 219 | </div> |
| 218 | <div style="opacity: 0; height: 54px; width: 100%; float: left;position: absolute; top: 0;left: 0; z-index: 2;-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)'"> | 220 | <div style="opacity: 0; height: 54px; width: 100%; float: left;position: absolute; top: 0;left: 0; z-index: 2;-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=0)'"> |
| 219 | - <?= $form->field($project, 'file') | ||
| 220 | - | ||
| 221 | - ->fileInput([ 'multiple' => 'multiple' ]) ?> | 221 | + <?= $form->field($project, 'files[]') |
| 222 | + ->fileInput([ 'multiple' => 'multiple' ]) ?> | ||
| 222 | </div> | 223 | </div> |
| 223 | 224 | ||
| 224 | </div> | 225 | </div> |
| @@ -227,17 +228,17 @@ | @@ -227,17 +228,17 @@ | ||
| 227 | <div class="input-blocks-wrapper"> | 228 | <div class="input-blocks-wrapper"> |
| 228 | <div class="input-blocks admin-project-list admin-currency-second"> | 229 | <div class="input-blocks admin-project-list admin-currency-second"> |
| 229 | <?= $form->field($project, 'date_end') | 230 | <?= $form->field($project, 'date_end') |
| 230 | - ->dropDownList([ | ||
| 231 | - 1 => 'Неделя', | ||
| 232 | - 2 => '2 недели', | ||
| 233 | - 3 => 'Месяц', | ||
| 234 | - ]) ?> | 231 | + ->dropDownList([ |
| 232 | + 1 => 'Неделя', | ||
| 233 | + 2 => '2 недели', | ||
| 234 | + 3 => 'Месяц', | ||
| 235 | + ]) ?> | ||
| 235 | </div> | 236 | </div> |
| 236 | </div> | 237 | </div> |
| 237 | 238 | ||
| 238 | <div class="input-blocks-wrapper"> | 239 | <div class="input-blocks-wrapper"> |
| 239 | <div class="admin-save-btn skills-save-btn admin-add-remove-wr style"> | 240 | <div class="admin-save-btn skills-save-btn admin-add-remove-wr style"> |
| 240 | - <?= Html::submitButton($project->isNewRecord?'Добавить':'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?> | 241 | + <?= Html::submitButton($project->isNewRecord ? 'Добавить' : 'Обновить', [ 'class' => 'input-blocks-wrapper button' ]) ?> |
| 241 | <div class="admin-remove-note"> | 242 | <div class="admin-remove-note"> |
| 242 | <?php | 243 | <?php |
| 243 | if(!$project->isNewRecord) { | 244 | if(!$project->isNewRecord) { |
| @@ -255,7 +256,7 @@ | @@ -255,7 +256,7 @@ | ||
| 255 | ?> | 256 | ?> |
| 256 | </div> | 257 | </div> |
| 257 | <div class="admin-back-note"> | 258 | <div class="admin-back-note"> |
| 258 | - <?= Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer)?\Yii::$app->request->referrer:['accounts/projects' ]) ?> | 259 | + <?= Html::a('вернуться', Request::getIsLocal(\Yii::$app->request->referrer) ? \Yii::$app->request->referrer : [ 'accounts/projects' ]) ?> |
| 259 | </div> | 260 | </div> |
| 260 | </div> | 261 | </div> |
| 261 | </div> | 262 | </div> |
| @@ -264,29 +265,45 @@ | @@ -264,29 +265,45 @@ | ||
| 264 | $form->end(); | 265 | $form->end(); |
| 265 | ?> | 266 | ?> |
| 266 | <script> | 267 | <script> |
| 267 | - $(document).ready(function(){ | ||
| 268 | - $('.input-blocks.admin-currency-second select').change(function(){ | ||
| 269 | - $(this).blur() | ||
| 270 | - }) | ||
| 271 | - | ||
| 272 | - if($('.admin-project-contractual input[type="checkbox"]').prop("checked")) { | ||
| 273 | - $('.admin-project-list-two input, .admin-project-list-two select').attr('disabled', 'disabled') | ||
| 274 | - } | ||
| 275 | - $('.admin-project-contractual input[type="checkbox"]').change(function(){ | ||
| 276 | - if($(this).prop("checked")) { | ||
| 277 | - $('.admin-project-list-two input, .admin-project-list-two select').attr('disabled','disabled') | ||
| 278 | - } else { | ||
| 279 | - $('.admin-project-list-two input, .admin-project-list-two select').removeAttr('disabled') | ||
| 280 | - } | ||
| 281 | - }) | ||
| 282 | - | ||
| 283 | - | ||
| 284 | - $('.admin-project-file input[type="file"]').change(function(){ | ||
| 285 | - var strInput = this.value | ||
| 286 | - $('.admin-project-file .not-file-mb-adm').html(strInput.replace(/^.*\\/, "")) | 268 | + $(document).ready( |
| 269 | + function() | ||
| 270 | + { | ||
| 271 | + $('.input-blocks.admin-currency-second select').change( | ||
| 272 | + function() | ||
| 273 | + { | ||
| 274 | + $(this).blur() | ||
| 275 | + } | ||
| 276 | + ) | ||
| 277 | + | ||
| 278 | + if($('.admin-project-contractual input[type="checkbox"]').prop("checked")) | ||
| 279 | + { | ||
| 280 | + $('.admin-project-list-two input, .admin-project-list-two select') | ||
| 281 | + .attr('disabled', 'disabled') | ||
| 282 | + } | ||
| 283 | + $('.admin-project-contractual input[type="checkbox"]').change( | ||
| 284 | + function() | ||
| 285 | + { | ||
| 286 | + if($(this).prop("checked")) | ||
| 287 | + { | ||
| 288 | + $('.admin-project-list-two input, .admin-project-list-two select') | ||
| 289 | + .attr('disabled', 'disabled') | ||
| 290 | + } else | ||
| 291 | + { | ||
| 292 | + $('.admin-project-list-two input, .admin-project-list-two select') | ||
| 293 | + .removeAttr('disabled') | ||
| 294 | + } | ||
| 295 | + } | ||
| 296 | + ) | ||
| 287 | 297 | ||
| 288 | - }); | 298 | + $('.admin-project-file input[type="file"]').change( |
| 299 | + function() | ||
| 300 | + { | ||
| 301 | + var strInput = this.value | ||
| 302 | + $('.admin-project-file .not-file-mb-adm').html(strInput.replace(/^.*\\/, "")) | ||
| 289 | 303 | ||
| 304 | + } | ||
| 305 | + ); | ||
| 290 | 306 | ||
| 291 | - }) | 307 | + } |
| 308 | + ) | ||
| 292 | </script> | 309 | </script> |
frontend/views/company/_blog_list_view.php
| 1 | <?php | 1 | <?php |
| 2 | -use frontend\helpers\TextHelper; | ||
| 3 | -use yii\helpers\Html; | ||
| 4 | -use yii\helpers\StringHelper; | ||
| 5 | -use yii\helpers\Url; | 2 | + /** |
| 3 | + * @var Blog $model | ||
| 4 | + */ | ||
| 5 | + use common\models\Blog; | ||
| 6 | + use frontend\helpers\TextHelper; | ||
| 7 | + use yii\helpers\Html; | ||
| 8 | + use yii\helpers\Url; | ||
| 6 | 9 | ||
| 7 | ?> | 10 | ?> |
| 8 | <div class="blog-post-wr"> | 11 | <div class="blog-post-wr"> |
| 9 | <div class="blog-post-title style"> | 12 | <div class="blog-post-title style"> |
| 10 | - <?= Html::a($model->name, Url::toRoute(['company/blog-view','company_id'=>$this->params['company']->id,'link'=>$model->link]),['class'=>'blog-new-link']);?> | 13 | + <?= Html::a($model->name, Url::toRoute([ |
| 14 | + 'company/blog-view', | ||
| 15 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 16 | + 'link' => $model->link, | ||
| 17 | + ]), [ 'class' => 'blog-new-link' ]); ?> | ||
| 11 | </div> | 18 | </div> |
| 12 | <div class="blog-post-icons-wr style"> | 19 | <div class="blog-post-icons-wr style"> |
| 13 | <div class="blog-post-date"> | 20 | <div class="blog-post-date"> |
| 14 | - <span></span><p><?= $model->dateCreate?></p> | 21 | + <span></span> |
| 22 | + <p><?= \Yii::$app->formatter->asDate($model->dateCreate, 'php:d.m.Y') ?></p> | ||
| 15 | </div> | 23 | </div> |
| 16 | <div class="blog-post-views"> | 24 | <div class="blog-post-views"> |
| 17 | - <span></span><p><?= $model->view_count?></p> | 25 | + <span></span> |
| 26 | + <p><?= $model->view_count ?></p> | ||
| 18 | </div> | 27 | </div> |
| 19 | <div class="blog-post-comm-num"> | 28 | <div class="blog-post-comm-num"> |
| 20 | - <span></span><p><?= $model->view_count?></p> | 29 | + <span></span> |
| 30 | + <p><?= count($model->comments) ?></p> | ||
| 21 | </div> | 31 | </div> |
| 22 | </div> | 32 | </div> |
| 23 | <div class="blog-post-content style"> | 33 | <div class="blog-post-content style"> |
| 24 | - <?= Html::a(Html::img($model->cover), Url::toRoute(['/company/blog-view','company_id'=>$this->params['company']->id,'link'=>$model->link]));?> | ||
| 25 | - <?= TextHelper::truncateHtmlText($model->description, 1300)?> | 34 | + <?= Html::a(Html::img($model->cover), Url::toRoute([ |
| 35 | + '/company/blog-view', | ||
| 36 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 37 | + 'link' => $model->link, | ||
| 38 | + ])); ?> | ||
| 39 | + <?= TextHelper::truncateHtmlText($model->description, 1300) ?> | ||
| 26 | </div> | 40 | </div> |
| 27 | - <?= Html::a('<span>Подробнее</span>', Url::toRoute(['company/blog-view','company_id'=>$this->params['company']->id,'link'=>$model->link]),['class'=>'blog-post-see-all style']);?> | 41 | + <?= Html::a('<span>Подробнее</span>', Url::toRoute([ |
| 42 | + 'company/blog-view', | ||
| 43 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 44 | + 'link' => $model->link, | ||
| 45 | + ]), [ 'class' => 'blog-post-see-all style' ]); ?> | ||
| 28 | </div> | 46 | </div> |
| 29 | \ No newline at end of file | 47 | \ No newline at end of file |
frontend/views/company/_company_list_view.php
| @@ -6,7 +6,13 @@ | @@ -6,7 +6,13 @@ | ||
| 6 | <div class="command-block-wrapper"> | 6 | <div class="command-block-wrapper"> |
| 7 | <div class="command-block-wr-two"> | 7 | <div class="command-block-wr-two"> |
| 8 | <div class="command-block-foto"> | 8 | <div class="command-block-foto"> |
| 9 | - <?= Html::a(( $model->photo ? Html::img($model->photo) : '' ) . '<div class="hover-command-bg"></div>', Url::toRoute([ '#' ])) ?> | 9 | + <?php |
| 10 | + if(empty( $model->link )) { | ||
| 11 | + echo ( $model->photo ? Html::img($model->photo) : '' ) . '<div class="hover-command-bg"></div>'; | ||
| 12 | + } else { | ||
| 13 | + echo Html::a(( $model->photo ? Html::img($model->photo) : '' ) . '<div class="hover-command-bg"></div>', 'http://'.$model->link); | ||
| 14 | + } | ||
| 15 | + ?> | ||
| 10 | </div> | 16 | </div> |
| 11 | <div class="command-block-name"><?= $model->user ?></div> | 17 | <div class="command-block-name"><?= $model->user ?></div> |
| 12 | <?php | 18 | <?php |
| 1 | +<?php | ||
| 2 | + /** | ||
| 3 | + * @var Comment $model | ||
| 4 | + * @var int $key | ||
| 5 | + * @var int $index | ||
| 6 | + * @var ListView $widget | ||
| 7 | + */ | ||
| 8 | + use common\modules\comment\models\Comment; | ||
| 9 | + use yii\helpers\Html; | ||
| 10 | + use yii\widgets\ListView; | ||
| 11 | + | ||
| 12 | +?> | ||
| 13 | +<?php | ||
| 14 | + if(!empty( $model->rating )) { | ||
| 15 | + ?> | ||
| 16 | + <div class="rating"> | ||
| 17 | + <!--оценка--> | ||
| 18 | + <input type="hidden" class="val" value="<?= $model->rating->value ?>"/> | ||
| 19 | + <!--количество голосов--> | ||
| 20 | + <input type="hidden" class="votes" value="1"/> | ||
| 21 | + </div> | ||
| 22 | + <?php | ||
| 23 | + } | ||
| 24 | +?> | ||
| 25 | +<?php | ||
| 26 | + if(!empty( $model->user_id )) { | ||
| 27 | + ?> | ||
| 28 | + <div class="company-performer-comments-autor">Отзыв от: <?= $model->author->name ?></div> | ||
| 29 | + <?php | ||
| 30 | + } else { | ||
| 31 | + ?> | ||
| 32 | + <div class="company-performer-comments-autor">Отзыв от: <?= $model->user_name ?></div> | ||
| 33 | + <?php | ||
| 34 | + } | ||
| 35 | +?> | ||
| 36 | +<div class="company-performer-comments-txt"><?= $model->text ?></div> | ||
| 37 | +<a href="#" class="company-comm-see-all"><span>Развернуть</span></a> |
frontend/views/company/_vacancy_list_view.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var Vacancy $model | ||
| 4 | + */ | ||
| 5 | + use common\models\Vacancy; | ||
| 2 | use frontend\helpers\TextHelper; | 6 | use frontend\helpers\TextHelper; |
| 3 | use yii\bootstrap\Html; | 7 | use yii\bootstrap\Html; |
| 4 | use yii\helpers\Url; | 8 | use yii\helpers\Url; |
| 5 | - use yii\helpers\StringHelper; | ||
| 6 | 9 | ||
| 7 | ?> | 10 | ?> |
| 8 | 11 | ||
| @@ -14,7 +17,7 @@ | @@ -14,7 +17,7 @@ | ||
| 14 | ]), [ 'class' => 'performer-vacant-reclam-bl-title' ]) ?> | 17 | ]), [ 'class' => 'performer-vacant-reclam-bl-title' ]) ?> |
| 15 | <div class="performer-vacant-reclam-bl-title-two"> | 18 | <div class="performer-vacant-reclam-bl-title-two"> |
| 16 | <?= $model->city ?> | 19 | <?= $model->city ?> |
| 17 | - <?= \Yii::$app->formatter->asDatetime($model->date_add, 'Y-MM-dd') ?> | 20 | + <?= \Yii::$app->formatter->asDate($model->date_add, 'dd.MM.Y') ?> |
| 18 | <?php | 21 | <?php |
| 19 | if(!empty( $model->salary )) { | 22 | if(!empty( $model->salary )) { |
| 20 | ?> | 23 | ?> |
frontend/views/company/blog-view.php
| 1 | <?php | 1 | <?php |
| 2 | -use \yii\helpers\Html; | 2 | + /** |
| 3 | + * @var View $this | ||
| 4 | + * @var Blog $article | ||
| 5 | + * @var User $company | ||
| 6 | + */ | ||
| 7 | + use common\models\Blog; | ||
| 8 | + use common\models\User; | ||
| 9 | + use yii\web\View; | ||
| 3 | 10 | ||
| 4 | -/* @var $this yii\web\View */ | ||
| 5 | -$this->params['company'] = $company; | ||
| 6 | - | ||
| 7 | -$this->title = $article->name ; | 11 | + $this->params[ 'company' ] = $company; |
| 12 | + $this->title = $article->name; | ||
| 8 | ?> | 13 | ?> |
| 9 | <div class="performer-vacancy-vacant-title-reclam-wr style"> | 14 | <div class="performer-vacancy-vacant-title-reclam-wr style"> |
| 10 | <div class="blog-post-wr"> | 15 | <div class="blog-post-wr"> |
| @@ -12,15 +17,15 @@ $this->title = $article->name ; | @@ -12,15 +17,15 @@ $this->title = $article->name ; | ||
| 12 | <div class="blog-post-icons-wr style"> | 17 | <div class="blog-post-icons-wr style"> |
| 13 | <div class="blog-post-date"> | 18 | <div class="blog-post-date"> |
| 14 | <span></span> | 19 | <span></span> |
| 15 | - <p><?= $article->dateCreate?></p> | 20 | + <p><?= \Yii::$app->formatter->asDate($article->dateCreate, 'php:d.m.Y') ?></p> |
| 16 | </div> | 21 | </div> |
| 17 | <div class="blog-post-views"> | 22 | <div class="blog-post-views"> |
| 18 | <span></span> | 23 | <span></span> |
| 19 | - <p><?= $article->view_count?></p> | 24 | + <p><?= $article->view_count ?></p> |
| 20 | </div> | 25 | </div> |
| 21 | <div class="blog-post-comm-num"> | 26 | <div class="blog-post-comm-num"> |
| 22 | <span></span> | 27 | <span></span> |
| 23 | - <p><?= $article->view_count?></p> | 28 | + <p><?= count($article->comments) ?></p> |
| 24 | </div> | 29 | </div> |
| 25 | </div> | 30 | </div> |
| 26 | <div class="blog-post-content style"> | 31 | <div class="blog-post-content style"> |
| @@ -28,3 +33,29 @@ $this->title = $article->name ; | @@ -28,3 +33,29 @@ $this->title = $article->name ; | ||
| 28 | </div> | 33 | </div> |
| 29 | </div> | 34 | </div> |
| 30 | </div> | 35 | </div> |
| 36 | +<?php | ||
| 37 | + echo \common\modules\comment\widgets\CommentWidget::widget([ | ||
| 38 | + 'context' => $this, | ||
| 39 | + 'model' => $article::className(), | ||
| 40 | + 'model_id' => $article->blog_id, | ||
| 41 | + 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 42 | + 'rating_class' => \common\modules\comment\models\Rating::className(), | ||
| 43 | + 'class_options' => [ | ||
| 44 | + 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 45 | + 'user_id' => \Yii::$app->user->getId(), | ||
| 46 | + 'guestComment' => true, | ||
| 47 | + 'status' => \common\modules\comment\models\Comment::STATUS_ACTIVE, | ||
| 48 | + ], | ||
| 49 | + 'list_options' => [ | ||
| 50 | + 'view' => 'list-comment', | ||
| 51 | + ], | ||
| 52 | + 'form_options' => [ | ||
| 53 | + 'view' => 'form-comment', | ||
| 54 | + 'tag' => 'div', | ||
| 55 | + 'class' => 'artbox_comment_form', | ||
| 56 | + ], | ||
| 57 | + 'options' => [ | ||
| 58 | + 'class' => 'new-portf-comments-wr style', | ||
| 59 | + ], | ||
| 60 | + ]); | ||
| 61 | +?> |
frontend/views/company/portfolio-view.php
| 1 | <?php | 1 | <?php |
| 2 | 2 | ||
| 3 | -use common\models\Portfolio; | ||
| 4 | -use common\models\User; | ||
| 5 | -use yii\helpers\Html; | ||
| 6 | -use yii\web\ViewAction; | 3 | + use common\models\Portfolio; |
| 4 | + use common\models\User; | ||
| 5 | + use yii\helpers\Html; | ||
| 6 | + use yii\web\ViewAction; | ||
| 7 | 7 | ||
| 8 | -/** | ||
| 9 | - * @var ViewAction $this | ||
| 10 | - * @var User $user | ||
| 11 | - * @var Portfolio $portfolio | ||
| 12 | - */ | ||
| 13 | -$this->params[ 'company' ] = $user; | 8 | + /** |
| 9 | + * @var ViewAction $this | ||
| 10 | + * @var User $user | ||
| 11 | + * @var Portfolio $portfolio | ||
| 12 | + */ | ||
| 13 | + $this->params[ 'company' ] = $user; | ||
| 14 | 14 | ||
| 15 | -$this->title = 'My Yii Application'; | 15 | + $this->title = 'My Yii Application'; |
| 16 | ?> | 16 | ?> |
| 17 | <div class="portfolio-new-page-wrapper style"> | 17 | <div class="portfolio-new-page-wrapper style"> |
| 18 | <div class="new-portfolio-bg style "> | 18 | <div class="new-portfolio-bg style "> |
| 19 | - <?= Html::img($portfolio->minImg($portfolio->cover,'720', '280')) ?> | 19 | + <?= Html::img($portfolio->minImg($portfolio->cover, '720', '280')) ?> |
| 20 | </div> | 20 | </div> |
| 21 | <div class="new-portfolio-icons-rating-wr style"> | 21 | <div class="new-portfolio-icons-rating-wr style"> |
| 22 | <div class="new-portfolio-icons"> | 22 | <div class="new-portfolio-icons"> |
| @@ -57,29 +57,29 @@ $this->title = 'My Yii Application'; | @@ -57,29 +57,29 @@ $this->title = 'My Yii Application'; | ||
| 57 | <div class="new-portf-slider-wr style"> | 57 | <div class="new-portf-slider-wr style"> |
| 58 | <div class="new-portf-slider-title"><?= $portfolio->name ?></div> | 58 | <div class="new-portf-slider-title"><?= $portfolio->name ?></div> |
| 59 | <?php | 59 | <?php |
| 60 | - if(!empty( $portfolio->gallery ) || !empty( $portfolio->gallery->photo )) { | ||
| 61 | - ?> | ||
| 62 | - <div class="new-portf-slider style"> | ||
| 63 | - <div class="slider-video-wr"> | ||
| 64 | - <div id="demo5" class="scroll-img"> | ||
| 65 | - <ul> | ||
| 66 | - <?php | ||
| 67 | - foreach( explode(',', $portfolio->gallery->photo) as $one_photo ) { | ||
| 68 | - ?> | ||
| 69 | - <li><img src="<?= $one_photo ?>" alt=""/> | 60 | + if(!empty( $portfolio->gallery ) || !empty( $portfolio->gallery->photo )) { |
| 61 | + ?> | ||
| 62 | + <div class="new-portf-slider style"> | ||
| 63 | + <div class="slider-video-wr"> | ||
| 64 | + <div id="demo5" class="scroll-img"> | ||
| 65 | + <ul> | ||
| 70 | <?php | 66 | <?php |
| 71 | - } | 67 | + foreach( explode(',', $portfolio->gallery->photo) as $one_photo ) { |
| 72 | ?> | 68 | ?> |
| 73 | - </ul> | ||
| 74 | - </div> | ||
| 75 | - <div id="demo5-btn" class="text-center"> | ||
| 76 | - <button class="btn" id="demo5-backward"></button> | ||
| 77 | - <button class="btn" id="demo5-forward"></button> | 69 | + <li><img src="<?= $one_photo ?>" alt=""/> |
| 70 | + <?php | ||
| 71 | + } | ||
| 72 | + ?> | ||
| 73 | + </ul> | ||
| 74 | + </div> | ||
| 75 | + <div id="demo5-btn" class="text-center"> | ||
| 76 | + <button class="btn" id="demo5-backward"></button> | ||
| 77 | + <button class="btn" id="demo5-forward"></button> | ||
| 78 | + </div> | ||
| 78 | </div> | 79 | </div> |
| 79 | </div> | 80 | </div> |
| 80 | - </div> | ||
| 81 | - <?php | ||
| 82 | - } | 81 | + <?php |
| 82 | + } | ||
| 83 | ?> | 83 | ?> |
| 84 | </div> | 84 | </div> |
| 85 | 85 | ||
| @@ -89,229 +89,235 @@ $this->title = 'My Yii Application'; | @@ -89,229 +89,235 @@ $this->title = 'My Yii Application'; | ||
| 89 | <?= $portfolio->preview ?> | 89 | <?= $portfolio->preview ?> |
| 90 | </div> | 90 | </div> |
| 91 | <?php | 91 | <?php |
| 92 | - if(!empty( $portfolio->description )) { | ||
| 93 | - ?> | ||
| 94 | - <div class="new-portfolio-see-all style"><span>Развернуть</span></div> | ||
| 95 | - <?php | ||
| 96 | - } | 92 | + if(!empty( $portfolio->description )) { |
| 93 | + ?> | ||
| 94 | + <div class="new-portfolio-see-all style"><span>Развернуть</span></div> | ||
| 95 | + <?php | ||
| 96 | + } | ||
| 97 | ?> | 97 | ?> |
| 98 | </div> | 98 | </div> |
| 99 | <?php | 99 | <?php |
| 100 | - if(!empty( $portfolio->description )) { | ||
| 101 | - ?> | ||
| 102 | - <div class="new-portfolio-txt"> | ||
| 103 | - <div class="new-portfolio-editor"> | ||
| 104 | - <?= $portfolio->description ?> | 100 | + if(!empty( $portfolio->description )) { |
| 101 | + ?> | ||
| 102 | + <div class="new-portfolio-txt"> | ||
| 103 | + <div class="new-portfolio-editor"> | ||
| 104 | + <?= $portfolio->description ?> | ||
| 105 | + </div> | ||
| 106 | + <div class="new-portfolio-see-all style"><span>Свернуть</span></div> | ||
| 105 | </div> | 107 | </div> |
| 106 | - <div class="new-portfolio-see-all style"><span>Свернуть</span></div> | ||
| 107 | - </div> | ||
| 108 | - <?php | ||
| 109 | - } | 108 | + <?php |
| 109 | + } | ||
| 110 | ?> | 110 | ?> |
| 111 | </div> | 111 | </div> |
| 112 | 112 | ||
| 113 | <?php | 113 | <?php |
| 114 | - echo \common\modules\comment\widgets\CommentWidget::widget([ | ||
| 115 | - 'entity' => $portfolio::tableName().'-'.$portfolio->portfolio_id, | ||
| 116 | - 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 117 | - 'class_options' => [ | ||
| 118 | - 'scenario' => is_int(\Yii::$app->user->getId())?\common\modules\comment\models\Comment::SCENARIO_USER:\common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 119 | - 'user_id' => \Yii::$app->user->getId(), | ||
| 120 | - ], | ||
| 121 | - 'list_options' => [ | ||
| 122 | - 'view' => 'list-comment', | ||
| 123 | - ], | ||
| 124 | - 'form_options' => [ | ||
| 125 | - 'view' => 'form-comment', | ||
| 126 | - 'tag' => false, | ||
| 127 | - ], | ||
| 128 | - 'options' => [ | ||
| 129 | - 'class' => 'new-portf-comments-wr style', | ||
| 130 | - ], | ||
| 131 | - ]); | 114 | + echo \common\modules\comment\widgets\CommentWidget::widget([ |
| 115 | + 'context' => $this, | ||
| 116 | + 'model' => $portfolio->className(), | ||
| 117 | + 'model_id' => $portfolio->portfolio_id, | ||
| 118 | + 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 119 | + 'rating_class' => \common\modules\comment\models\Rating::className(), | ||
| 120 | + 'class_options' => [ | ||
| 121 | + 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 122 | + 'user_id' => \Yii::$app->user->getId(), | ||
| 123 | + 'guestComment' => true, | ||
| 124 | + 'status' => \common\modules\comment\models\Comment::STATUS_ACTIVE, | ||
| 125 | + ], | ||
| 126 | + 'list_options' => [ | ||
| 127 | + 'view' => 'list-comment', | ||
| 128 | + ], | ||
| 129 | + 'form_options' => [ | ||
| 130 | + 'view' => 'form-comment', | ||
| 131 | + 'tag' => 'div', | ||
| 132 | + 'class' => 'artbox_comment_form', | ||
| 133 | + ], | ||
| 134 | + 'options' => [ | ||
| 135 | + 'class' => 'new-portf-comments-wr style', | ||
| 136 | + ], | ||
| 137 | + ]); | ||
| 132 | ?> | 138 | ?> |
| 133 | 139 | ||
| 134 | <?php | 140 | <?php |
| 135 | - /* | ||
| 136 | - ?> | ||
| 137 | - <div class="new-portf-comments-wr style"> | ||
| 138 | - <div class="new-portf-comm-count">Комментарии: 3</div> | ||
| 139 | - <div class="new-portf-add-comm style"> | 141 | + /* |
| 142 | + ?> | ||
| 143 | + <div class="new-portf-comments-wr style"> | ||
| 144 | + <div class="new-portf-comm-count">Комментарии: 3</div> | ||
| 145 | + <div class="new-portf-add-comm style"> | ||
| 140 | 146 | ||
| 141 | - <form action=""> | ||
| 142 | - <div class="input-blocks-comm"> | ||
| 143 | - <label for="input-txt-5">Имя</label> | ||
| 144 | - <input class="custom-input-4" id="input-txt-5" type="text"> | ||
| 145 | - </div> | ||
| 146 | - <div class="input-blocks-comm"> | 147 | + <form action=""> |
| 148 | + <div class="input-blocks-comm"> | ||
| 149 | + <label for="input-txt-5">Имя</label> | ||
| 150 | + <input class="custom-input-4" id="input-txt-5" type="text"> | ||
| 151 | + </div> | ||
| 152 | + <div class="input-blocks-comm"> | ||
| 147 | 153 | ||
| 148 | - <label for="input-txt-6">e-mail</label> | ||
| 149 | - <input class="custom-input-4" id="input-txt-6" type="text"> | ||
| 150 | - </div> | ||
| 151 | - <div class="input-blocks-comm area-comm"> | ||
| 152 | - <label for="input-txt-7">Комментарий</label> | ||
| 153 | - <textarea class="custom-area-4" id="input-txt-7"></textarea> | ||
| 154 | - </div> | ||
| 155 | - <div class="input-blocks-comm-button style"> | ||
| 156 | - <button type="submit" class="">Добавить комментраий</button> | ||
| 157 | - </div> | ||
| 158 | - </form> | 154 | + <label for="input-txt-6">e-mail</label> |
| 155 | + <input class="custom-input-4" id="input-txt-6" type="text"> | ||
| 156 | + </div> | ||
| 157 | + <div class="input-blocks-comm area-comm"> | ||
| 158 | + <label for="input-txt-7">Комментарий</label> | ||
| 159 | + <textarea class="custom-area-4" id="input-txt-7"></textarea> | ||
| 160 | + </div> | ||
| 161 | + <div class="input-blocks-comm-button style"> | ||
| 162 | + <button type="submit" class="">Добавить комментраий</button> | ||
| 163 | + </div> | ||
| 164 | + </form> | ||
| 159 | 165 | ||
| 160 | - </div> | 166 | + </div> |
| 161 | 167 | ||
| 162 | - <div class="new-portf-comm-read-wr style"> | ||
| 163 | - <div class="new-portf-comm-read"> | ||
| 164 | - <div class="style"> | ||
| 165 | - <div class="header-cabinet-foto"> | ||
| 166 | - <img src="/images/ded-ico.png" alt=""> | ||
| 167 | - </div> | ||
| 168 | - <div class="new-prof-wrapper-read"> | ||
| 169 | - <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 170 | - <div class="new-portf-comm-read-rating"> | ||
| 171 | - <div class="rating"> | ||
| 172 | - <!--оценка--> | ||
| 173 | - <input type="hidden" class="val" value="3"/> | ||
| 174 | - <!--количество голосов--> | ||
| 175 | - <input type="hidden" class="votes" value="12"/> | 168 | + <div class="new-portf-comm-read-wr style"> |
| 169 | + <div class="new-portf-comm-read"> | ||
| 170 | + <div class="style"> | ||
| 171 | + <div class="header-cabinet-foto"> | ||
| 172 | + <img src="/images/ded-ico.png" alt=""> | ||
| 173 | + </div> | ||
| 174 | + <div class="new-prof-wrapper-read"> | ||
| 175 | + <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 176 | + <div class="new-portf-comm-read-rating"> | ||
| 177 | + <div class="rating"> | ||
| 178 | + <!--оценка--> | ||
| 179 | + <input type="hidden" class="val" value="3"/> | ||
| 180 | + <!--количество голосов--> | ||
| 181 | + <input type="hidden" class="votes" value="12"/> | ||
| 182 | + </div> | ||
| 183 | + </div> | ||
| 184 | + <div class="blog-post-date"> | ||
| 185 | + <span></span> | ||
| 186 | + <p>22.09.2015</p> | ||
| 176 | </div> | 187 | </div> |
| 177 | </div> | 188 | </div> |
| 178 | - <div class="blog-post-date"> | ||
| 179 | - <span></span> | ||
| 180 | - <p>22.09.2015</p> | 189 | + |
| 190 | + <div class="new-portf-answer"> | ||
| 191 | + <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 192 | + <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 181 | </div> | 193 | </div> |
| 182 | - </div> | ||
| 183 | 194 | ||
| 184 | - <div class="new-portf-answer"> | ||
| 185 | - <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 186 | - <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 187 | </div> | 195 | </div> |
| 188 | - | 196 | + <div class="style"></div> |
| 189 | </div> | 197 | </div> |
| 190 | - <div class="style"></div> | ||
| 191 | - </div> | ||
| 192 | 198 | ||
| 193 | - <div class="new-portf-comm-read"> | ||
| 194 | - <div class="style"> | ||
| 195 | - <div class="header-cabinet-foto"> | ||
| 196 | - <img src="/images/ded-ico.png" alt=""> | ||
| 197 | - </div> | ||
| 198 | - <div class="new-prof-wrapper-read"> | ||
| 199 | - <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 200 | - <div class="new-portf-comm-read-rating"> | ||
| 201 | - <div class="rating"> | ||
| 202 | - <!--оценка--> | ||
| 203 | - <input type="hidden" class="val" value="4"/> | ||
| 204 | - <!--количество голосов--> | ||
| 205 | - <input type="hidden" class="votes" value="12"/> | 199 | + <div class="new-portf-comm-read"> |
| 200 | + <div class="style"> | ||
| 201 | + <div class="header-cabinet-foto"> | ||
| 202 | + <img src="/images/ded-ico.png" alt=""> | ||
| 203 | + </div> | ||
| 204 | + <div class="new-prof-wrapper-read"> | ||
| 205 | + <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 206 | + <div class="new-portf-comm-read-rating"> | ||
| 207 | + <div class="rating"> | ||
| 208 | + <!--оценка--> | ||
| 209 | + <input type="hidden" class="val" value="4"/> | ||
| 210 | + <!--количество голосов--> | ||
| 211 | + <input type="hidden" class="votes" value="12"/> | ||
| 212 | + </div> | ||
| 213 | + </div> | ||
| 214 | + <div class="blog-post-date"> | ||
| 215 | + <span></span> | ||
| 216 | + <p>22.09.2015</p> | ||
| 206 | </div> | 217 | </div> |
| 207 | </div> | 218 | </div> |
| 208 | - <div class="blog-post-date"> | ||
| 209 | - <span></span> | ||
| 210 | - <p>22.09.2015</p> | 219 | + |
| 220 | + <div class="new-portf-answer"> | ||
| 221 | + <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 222 | + <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 211 | </div> | 223 | </div> |
| 212 | - </div> | ||
| 213 | 224 | ||
| 214 | - <div class="new-portf-answer"> | ||
| 215 | - <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 216 | - <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 217 | </div> | 225 | </div> |
| 218 | - | 226 | + <div class="style"></div> |
| 219 | </div> | 227 | </div> |
| 220 | - <div class="style"></div> | ||
| 221 | - </div> | ||
| 222 | 228 | ||
| 223 | - <div class="new-portf-comm-read"> | ||
| 224 | - <div class="style"> | ||
| 225 | - <div class="header-cabinet-foto"> | ||
| 226 | - <img src="/images/ded-ico.png" alt=""> | ||
| 227 | - </div> | ||
| 228 | - <div class="new-prof-wrapper-read"> | ||
| 229 | - <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 230 | - <div class="new-portf-comm-read-rating"> | ||
| 231 | - <div class="rating"> | ||
| 232 | - <!--оценка--> | ||
| 233 | - <input type="hidden" class="val" value="5"/> | ||
| 234 | - <!--количество голосов--> | ||
| 235 | - <input type="hidden" class="votes" value="12"/> | 229 | + <div class="new-portf-comm-read"> |
| 230 | + <div class="style"> | ||
| 231 | + <div class="header-cabinet-foto"> | ||
| 232 | + <img src="/images/ded-ico.png" alt=""> | ||
| 233 | + </div> | ||
| 234 | + <div class="new-prof-wrapper-read"> | ||
| 235 | + <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 236 | + <div class="new-portf-comm-read-rating"> | ||
| 237 | + <div class="rating"> | ||
| 238 | + <!--оценка--> | ||
| 239 | + <input type="hidden" class="val" value="5"/> | ||
| 240 | + <!--количество голосов--> | ||
| 241 | + <input type="hidden" class="votes" value="12"/> | ||
| 242 | + </div> | ||
| 243 | + </div> | ||
| 244 | + <div class="blog-post-date"> | ||
| 245 | + <span></span> | ||
| 246 | + <p>22.09.2015</p> | ||
| 236 | </div> | 247 | </div> |
| 237 | </div> | 248 | </div> |
| 238 | - <div class="blog-post-date"> | ||
| 239 | - <span></span> | ||
| 240 | - <p>22.09.2015</p> | 249 | + |
| 250 | + <div class="new-portf-answer"> | ||
| 251 | + <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 252 | + <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 241 | </div> | 253 | </div> |
| 242 | - </div> | ||
| 243 | 254 | ||
| 244 | - <div class="new-portf-answer"> | ||
| 245 | - <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 246 | - <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 247 | </div> | 255 | </div> |
| 248 | - | 256 | + <div class="style"></div> |
| 249 | </div> | 257 | </div> |
| 250 | - <div class="style"></div> | ||
| 251 | - </div> | ||
| 252 | 258 | ||
| 253 | - <div class="new-portf-comm-read"> | ||
| 254 | - <div class="style"> | ||
| 255 | - <div class="header-cabinet-foto"> | ||
| 256 | - <img src="/images/ded-ico.png" alt=""> | ||
| 257 | - </div> | ||
| 258 | - <div class="new-prof-wrapper-read"> | ||
| 259 | - <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 260 | - <div class="new-portf-comm-read-rating"> | ||
| 261 | - <div class="rating"> | ||
| 262 | - <!--оценка--> | ||
| 263 | - <input type="hidden" class="val" value="1"/> | ||
| 264 | - <!--количество голосов--> | ||
| 265 | - <input type="hidden" class="votes" value="12"/> | 259 | + <div class="new-portf-comm-read"> |
| 260 | + <div class="style"> | ||
| 261 | + <div class="header-cabinet-foto"> | ||
| 262 | + <img src="/images/ded-ico.png" alt=""> | ||
| 263 | + </div> | ||
| 264 | + <div class="new-prof-wrapper-read"> | ||
| 265 | + <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 266 | + <div class="new-portf-comm-read-rating"> | ||
| 267 | + <div class="rating"> | ||
| 268 | + <!--оценка--> | ||
| 269 | + <input type="hidden" class="val" value="1"/> | ||
| 270 | + <!--количество голосов--> | ||
| 271 | + <input type="hidden" class="votes" value="12"/> | ||
| 272 | + </div> | ||
| 273 | + </div> | ||
| 274 | + <div class="blog-post-date"> | ||
| 275 | + <span></span> | ||
| 276 | + <p>22.09.2015</p> | ||
| 266 | </div> | 277 | </div> |
| 267 | </div> | 278 | </div> |
| 268 | - <div class="blog-post-date"> | ||
| 269 | - <span></span> | ||
| 270 | - <p>22.09.2015</p> | 279 | + |
| 280 | + <div class="new-portf-answer"> | ||
| 281 | + <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 282 | + <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 271 | </div> | 283 | </div> |
| 272 | - </div> | ||
| 273 | 284 | ||
| 274 | - <div class="new-portf-answer"> | ||
| 275 | - <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 276 | - <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 277 | </div> | 285 | </div> |
| 278 | - | 286 | + <div class="style"></div> |
| 279 | </div> | 287 | </div> |
| 280 | - <div class="style"></div> | ||
| 281 | - </div> | ||
| 282 | - <div class="new-portf-comm-read"> | ||
| 283 | - <div class="style"> | ||
| 284 | - <div class="header-cabinet-foto"> | ||
| 285 | - <img src="/images/ded-ico.png" alt=""> | ||
| 286 | - </div> | ||
| 287 | - <div class="new-prof-wrapper-read"> | ||
| 288 | - <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 289 | - <div class="new-portf-comm-read-rating"> | ||
| 290 | - <div class="rating"> | ||
| 291 | - <!--оценка--> | ||
| 292 | - <input type="hidden" class="val" value="2"/> | ||
| 293 | - <!--количество голосов--> | ||
| 294 | - <input type="hidden" class="votes" value="12"/> | 288 | + <div class="new-portf-comm-read"> |
| 289 | + <div class="style"> | ||
| 290 | + <div class="header-cabinet-foto"> | ||
| 291 | + <img src="/images/ded-ico.png" alt=""> | ||
| 292 | + </div> | ||
| 293 | + <div class="new-prof-wrapper-read"> | ||
| 294 | + <div class="new-portf-comm-read-title"><a href="#">Петер Цумтор</a></div> | ||
| 295 | + <div class="new-portf-comm-read-rating"> | ||
| 296 | + <div class="rating"> | ||
| 297 | + <!--оценка--> | ||
| 298 | + <input type="hidden" class="val" value="2"/> | ||
| 299 | + <!--количество голосов--> | ||
| 300 | + <input type="hidden" class="votes" value="12"/> | ||
| 301 | + </div> | ||
| 302 | + </div> | ||
| 303 | + <div class="blog-post-date"> | ||
| 304 | + <span></span> | ||
| 305 | + <p>22.09.2015</p> | ||
| 295 | </div> | 306 | </div> |
| 296 | </div> | 307 | </div> |
| 297 | - <div class="blog-post-date"> | ||
| 298 | - <span></span> | ||
| 299 | - <p>22.09.2015</p> | 308 | + |
| 309 | + <div class="new-portf-answer"> | ||
| 310 | + <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 311 | + <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 300 | </div> | 312 | </div> |
| 301 | - </div> | ||
| 302 | 313 | ||
| 303 | - <div class="new-portf-answer"> | ||
| 304 | - <p>Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 305 | - <p>Евровагонка — удобная в монтаже фасонная доска, которая позволяет создать обшивку из плотно пригнанных элементов с качественно обработанной поверхностью. Толщина евровагонки составляет 125 мм, общая ширина (с гребнем) 960 мм, рабочая ширина 880 мм.Балкон, обшитый вагонкой, выглядит аккуратно, стильно и уютно. Монтаж обшивки вполне возможно выполнить своими силами — достаточно иметь в распоряжении необходимые инструменты и владеть базовыми навыками строительно-ремонтных работ.</p> | ||
| 306 | </div> | 314 | </div> |
| 307 | - | 315 | + <div class="style"></div> |
| 308 | </div> | 316 | </div> |
| 309 | - <div class="style"></div> | ||
| 310 | - </div> | ||
| 311 | 317 | ||
| 318 | + </div> | ||
| 312 | </div> | 319 | </div> |
| 313 | - </div> | ||
| 314 | - */ | 320 | + */ |
| 315 | ?> | 321 | ?> |
| 316 | </div> | 322 | </div> |
| 317 | <script> | 323 | <script> |
frontend/views/company/review.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var View $this | ||
| 4 | + * @var User $company | ||
| 5 | + */ | ||
| 2 | 6 | ||
| 3 | -use \yii\helpers\Html; | 7 | + use common\models\User; |
| 8 | + use yii\web\View; | ||
| 4 | 9 | ||
| 5 | -/* @var $this yii\web\View */ | ||
| 6 | -$this->params['company'] = $company; | ||
| 7 | -$this->title = 'My Yii Application'; | 10 | + $this->params[ 'company' ] = $company; |
| 11 | + $this->title = 'My Yii Application'; | ||
| 8 | ?> | 12 | ?> |
| 9 | <div class="performer-vacancy-vacant-title-reclam-wr style"> | 13 | <div class="performer-vacancy-vacant-title-reclam-wr style"> |
| 10 | - <div class="proektant-comments-wr style"> | ||
| 11 | - <div class="workplace-title style"><p>Отзывы о пользователе: 4</p></div> | ||
| 12 | - <ul class="proektant-comments style"> | ||
| 13 | - <li> | ||
| 14 | - <div class="comments-name">Иван Иванов</div> | ||
| 15 | - <div class="comments-status"><span>Pro</span></div> | ||
| 16 | - <div class="comments-date">10.07.2015</div> | ||
| 17 | - <div class="rating"> | ||
| 18 | - <!--оценка--> | ||
| 19 | - <input type="hidden" class="val" value="2"/> | ||
| 20 | - </div> | ||
| 21 | - <div class="comments-content"> | ||
| 22 | - <p>Уже дважды пользовались услугами мастеров и очень довольны качеством работы, профессиональной консультацией в подборе материалов и оформлением дизайна!</p> | ||
| 23 | - <p>Спасибо большое! Всем советуем!</p> | ||
| 24 | - </div> | ||
| 25 | - <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div> | ||
| 26 | - </li> | ||
| 27 | - | ||
| 28 | - <li> | ||
| 29 | - <div class="comments-name">Иван Иванов</div> | ||
| 30 | - <div class="comments-status"><span>Pro</span></div> | ||
| 31 | - <div class="comments-date">10.07.2015</div> | ||
| 32 | - <div class="rating"> | ||
| 33 | - <!--оценка--> | ||
| 34 | - <input type="hidden" class="val" value="5"/> | ||
| 35 | - </div> | ||
| 36 | - <div class="comments-content"> | ||
| 37 | - <p>Уже дважды пользовались услугами мастеров и очень довольны качеством работы, профессиональной консультацией в подборе материалов и оформлением дизайна!</p> | ||
| 38 | - <p>Спасибо большое! Всем советуем!</p> | ||
| 39 | - </div> | ||
| 40 | - <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div> | ||
| 41 | - </li> | ||
| 42 | - | ||
| 43 | - <li> | ||
| 44 | - <div class="comments-name">Иван Иванов</div> | ||
| 45 | - <div class="comments-status"><span>Pro</span></div> | ||
| 46 | - <div class="comments-date">10.07.2015</div> | ||
| 47 | - <div class="rating"> | ||
| 48 | - <!--оценка--> | ||
| 49 | - <input type="hidden" class="val" value="4"/> | ||
| 50 | - </div> | ||
| 51 | - <div class="comments-content"> | ||
| 52 | - <p>Уже дважды пользовались услугами мастеров и очень довольны качеством работы, профессиональной консультацией в подборе материалов и оформлением дизайна!</p> | ||
| 53 | - <p>Спасибо большое! Всем советуем!</p> | ||
| 54 | - </div> | ||
| 55 | - <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div> | ||
| 56 | - </li> | ||
| 57 | - | ||
| 58 | - <li> | ||
| 59 | - <div class="comments-name">Иван Иванов</div> | ||
| 60 | - <div class="comments-status"><span>Pro</span></div> | ||
| 61 | - <div class="comments-date">10.07.2015</div> | ||
| 62 | - <div class="rating"> | ||
| 63 | - <!--оценка--> | ||
| 64 | - <input type="hidden" class="val" value="1"/> | ||
| 65 | - </div> | ||
| 66 | - <div class="comments-content"> | ||
| 67 | - <p>Уже дважды пользовались услугами мастеров и очень довольны качеством работы, профессиональной консультацией в подборе материалов и оформлением дизайна!</p> | ||
| 68 | - <p>Спасибо большое! Всем советуем!</p> | ||
| 69 | - </div> | ||
| 70 | - <div class="comments-project-link">Проект: <a href="#">Ремонт спальни</a></div> | ||
| 71 | - </li> | ||
| 72 | - </ul> | ||
| 73 | - <div class="navi-buttons-wr style"> | ||
| 74 | - <ul class="pagination"> | ||
| 75 | - <li><a href="#">1</a></li> | ||
| 76 | - <li><a href="#">2</a></li> | ||
| 77 | - <li><a href="#">3</a></li> | ||
| 78 | - <li><a href="#">4</a></li> | ||
| 79 | - <li><a href="#">5</a></li> | ||
| 80 | - <li class="dots-next"><a href="#">...</a></li> | ||
| 81 | - <li><a href="#">156</a></li> | ||
| 82 | - </ul> | ||
| 83 | - </div> | ||
| 84 | - </div> | ||
| 85 | - | 14 | + <?php |
| 15 | + echo \common\modules\comment\widgets\CommentWidget::widget([ | ||
| 16 | + 'context' => $this, | ||
| 17 | + 'model' => $company->className(), | ||
| 18 | + 'model_id' => $company->id, | ||
| 19 | + 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 20 | + 'rating_class' => \common\modules\comment\models\Rating::className(), | ||
| 21 | + 'class_options' => [ | ||
| 22 | + 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 23 | + 'user_id' => \Yii::$app->user->getId(), | ||
| 24 | + 'guestComment' => false, | ||
| 25 | + 'status' => \common\modules\comment\models\Comment::STATUS_ACTIVE, | ||
| 26 | + ], | ||
| 27 | + 'list_options' => [ | ||
| 28 | + 'view' => 'list-comment-review', | ||
| 29 | + ], | ||
| 30 | + 'form_options' => [ | ||
| 31 | + 'view' => 'form-comment-review', | ||
| 32 | + 'tag' => 'span', | ||
| 33 | + ], | ||
| 34 | + 'options' => [ | ||
| 35 | + 'class' => 'proektant-comments-wr style', | ||
| 36 | + ], | ||
| 37 | + ]); | ||
| 38 | + ?> | ||
| 86 | </div> | 39 | </div> |
frontend/views/company/team.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var User $company | ||
| 4 | + * @var ActiveDataProvider $team | ||
| 5 | + * @var View $this | ||
| 6 | + * @var ActiveDataProvider $comments | ||
| 7 | + */ | ||
| 2 | 8 | ||
| 3 | -use \yii\helpers\Html; | ||
| 4 | -use yii\widgets\LinkPager; | ||
| 5 | -use yii\widgets\ListView; | 9 | + use common\models\User; |
| 10 | + use common\modules\comment\models\Comment; | ||
| 11 | + use yii\data\ActiveDataProvider; | ||
| 12 | + use yii\helpers\Html; | ||
| 13 | + use yii\web\View; | ||
| 14 | + use yii\widgets\LinkPager; | ||
| 15 | + use yii\widgets\ListView; | ||
| 6 | 16 | ||
| 7 | -/* @var $this yii\web\View */ | ||
| 8 | -$this->params['company'] = $company; | ||
| 9 | -$this->title = 'My Yii Application'; | 17 | + $this->params[ 'company' ] = $company; |
| 18 | + $this->title = 'My Yii Application'; | ||
| 10 | ?> | 19 | ?> |
| 11 | <div class="command-blocks-wr style"> | 20 | <div class="command-blocks-wr style"> |
| 12 | - <?= | ||
| 13 | - ListView::widget( [ | 21 | + <?= ListView::widget([ |
| 14 | 'dataProvider' => $team, | 22 | 'dataProvider' => $team, |
| 15 | - 'itemView'=>'_company_list_view', | ||
| 16 | - 'summary'=>'', | ||
| 17 | - ] ); | ||
| 18 | - ?> | 23 | + 'itemView' => '_company_list_view', |
| 24 | + 'layout' => '{items}', | ||
| 25 | + ]); ?> | ||
| 19 | 26 | ||
| 20 | 27 | ||
| 21 | </div> | 28 | </div> |
| 22 | <div class="navi-buttons-wr style command-command-style"> | 29 | <div class="navi-buttons-wr style command-command-style"> |
| 23 | - <?= | ||
| 24 | - LinkPager::widget([ | ||
| 25 | - 'pagination' => $pagination, | ||
| 26 | - ]); | ||
| 27 | - ?> | 30 | + <?= LinkPager::widget([ |
| 31 | + 'pagination' => $team->pagination, | ||
| 32 | + ]); ?> | ||
| 28 | </div> | 33 | </div> |
| 29 | <?php | 34 | <?php |
| 30 | /*====Blocks for layout====*/ | 35 | /*====Blocks for layout====*/ |
| 31 | - $this->beginBlock('review'); | ||
| 32 | -?> | ||
| 33 | - <div class="section-box-19"> | ||
| 34 | - <div class="box-wr"> | ||
| 35 | - <div class="box-all"> | ||
| 36 | - <div class="company-performer-comm-title style">Отзывов: 54</div> | ||
| 37 | - <div class="company-performer-comments-wr style"> | ||
| 38 | - <div class="company-performer-comments-bl"> | ||
| 39 | - <div class="rating"> | ||
| 40 | - <!--оценка--> | ||
| 41 | - <input type="hidden" class="val" value="3"/> | ||
| 42 | - <!--количество голосов--> | ||
| 43 | - <input type="hidden" class="votes" value="12"/> | ||
| 44 | - </div> | ||
| 45 | - | ||
| 46 | - <div class="company-performer-comments-autor">Отзыв от: Евгения</div> | ||
| 47 | - <div class="company-performer-comments-txt"></div> | ||
| 48 | - <a href="#" class="company-comm-see-all"><span>Развернуть</span></a> | ||
| 49 | - </div> | ||
| 50 | - | ||
| 51 | - <div class="company-performer-comments-bl"> | ||
| 52 | - <div class="rating"> | ||
| 53 | - <!--оценка--> | ||
| 54 | - <input type="hidden" class="val" value="2"/> | ||
| 55 | - <!--количество голосов--> | ||
| 56 | - <input type="hidden" class="votes" value="12"/> | ||
| 57 | - </div> | ||
| 58 | - | ||
| 59 | - <div class="company-performer-comments-autor">Отзыв от: Евгения</div> | ||
| 60 | - <div class="company-performer-comments-txt">2Петер, очень понравились Ваши работы. Замечательный вкус!!! Тонкое сочетание стиля, цвета и формы! Очень нравится. Успехов в работе и вдохновения.</div> | ||
| 61 | - <a href="#" class="company-comm-see-all"><span>Развернуть</span></a> | ||
| 62 | - </div> | ||
| 63 | - | ||
| 64 | - <div class="company-performer-comments-bl"> | ||
| 65 | - <div class="rating"> | ||
| 66 | - <!--оценка--> | ||
| 67 | - <input type="hidden" class="val" value="4"/> | ||
| 68 | - <!--количество голосов--> | ||
| 69 | - <input type="hidden" class="votes" value="12"/> | ||
| 70 | - </div> | ||
| 71 | - | ||
| 72 | - <div class="company-performer-comments-autor">Отзыв от: Евгения</div> | ||
| 73 | - <div class="company-performer-comments-txt">3Петер, очень понравились Ваши работы. Замечательный вкус!!! Тонкое сочетание стиля, цвета и формы! Очень нравится. Успехов в работе и вдохновения. Петер, очень понравились Ваши работы. Замечательный вкус!!! Тонкое сочетание стиля, цвета и формы! Очень нравится. Успехов в работе и вдохновения. | ||
| 74 | - </div> | ||
| 75 | - <a href="#" class="company-comm-see-all"><span>Развернуть</span></a> | ||
| 76 | - </div> | ||
| 77 | - | ||
| 78 | - <div class="company-performer-comments-bl"> | ||
| 79 | - <div class="rating"> | ||
| 80 | - <!--оценка--> | ||
| 81 | - <input type="hidden" class="val" value="5"/> | ||
| 82 | - <!--количество голосов--> | ||
| 83 | - <input type="hidden" class="votes" value="12"/> | ||
| 84 | - </div> | ||
| 85 | - | ||
| 86 | - <div class="company-performer-comments-autor">Отзыв от: Евгения</div> | ||
| 87 | - <div class="company-performer-comments-txt">4Петер, очень понравились Ваши работы. Замечательный вкус!!! Тонкое сочетание стиля, цвета и формы! Очень нравится. Успехов в работе и вдохновения. | ||
| 88 | - </div> | ||
| 89 | - <a href="#" class="company-comm-see-all"><span>Развернуть</span></a> | 36 | + if($comments->totalCount > 0) { |
| 37 | + $this->beginBlock('review'); | ||
| 38 | + ?> | ||
| 39 | + <div class="section-box-19"> | ||
| 40 | + <div class="box-wr"> | ||
| 41 | + <div class="box-all"> | ||
| 42 | + <div class="company-performer-comm-title style">Отзывов: <?= $comments->totalCount ?></div> | ||
| 43 | + <?= ListView::widget([ | ||
| 44 | + 'dataProvider' => $comments, | ||
| 45 | + 'itemView' => '_company_team_review', | ||
| 46 | + 'layout' => '{items}', | ||
| 47 | + 'options' => [ | ||
| 48 | + 'class' => 'company-performer-comments-wr style', | ||
| 49 | + ], | ||
| 50 | + 'itemOptions' => [ | ||
| 51 | + 'class' => 'company-performer-comments-bl', | ||
| 52 | + ], | ||
| 53 | + ]) ?> | ||
| 54 | + <div class="company-performer-comm-see-all-butt style"> | ||
| 55 | + <?= Html::a('Читать все отзывы', [ | ||
| 56 | + 'company/review', | ||
| 57 | + 'company_id' => $company->id, | ||
| 58 | + ]) ?> | ||
| 90 | </div> | 59 | </div> |
| 91 | </div> | 60 | </div> |
| 92 | - <div class="company-performer-comm-see-all-butt style"><a href="#">Читать все отзывы</a></div> | ||
| 93 | </div> | 61 | </div> |
| 94 | </div> | 62 | </div> |
| 95 | - </div> | ||
| 96 | -<?php | ||
| 97 | - $this->endBlock(); | 63 | + <?php |
| 64 | + $this->endBlock(); | ||
| 65 | + } | ||
| 98 | /*====End blocks for layout====*/ | 66 | /*====End blocks for layout====*/ |
| 99 | ?> | 67 | ?> |
| 100 | \ No newline at end of file | 68 | \ No newline at end of file |
frontend/views/company/vacancy-list.php
| @@ -23,13 +23,15 @@ $this->title = 'My Yii Application'; | @@ -23,13 +23,15 @@ $this->title = 'My Yii Application'; | ||
| 23 | 'options' => [ | 23 | 'options' => [ |
| 24 | 'class' => 'list-view performer-vacancy-vacant-title-reclam-wr style', | 24 | 'class' => 'list-view performer-vacancy-vacant-title-reclam-wr style', |
| 25 | ], | 25 | ], |
| 26 | + 'summary' => 'Всего {count} записей из {totalCount}', | ||
| 27 | + 'layout' => "{summary}\n{items}", | ||
| 26 | ]); | 28 | ]); |
| 27 | ?> | 29 | ?> |
| 28 | </div> | 30 | </div> |
| 29 | <div class="navi-buttons-wr style"> | 31 | <div class="navi-buttons-wr style"> |
| 30 | <?= | 32 | <?= |
| 31 | LinkPager::widget([ | 33 | LinkPager::widget([ |
| 32 | - 'pagination' => $pagination, | 34 | + 'pagination' => $provider->pagination, |
| 33 | ]); | 35 | ]); |
| 34 | ?> | 36 | ?> |
| 35 | </div> | 37 | </div> |
frontend/views/company/vacancy-view.php
| 1 | <?php | 1 | <?php |
| 2 | /** | 2 | /** |
| 3 | - * @var $this yii\web\View | ||
| 4 | - * @var User $company | ||
| 5 | - * @var Vacancy $vacancy | 3 | + * @var $this yii\web\View |
| 4 | + * @var User $company | ||
| 5 | + * @var Vacancy $vacancy | ||
| 6 | + * @var Vacancy[] $similar_vacancies | ||
| 6 | */ | 7 | */ |
| 7 | 8 | ||
| 8 | use common\models\User; | 9 | use common\models\User; |
| 9 | use common\models\Vacancy; | 10 | use common\models\Vacancy; |
| 10 | use yii\helpers\ArrayHelper; | 11 | use yii\helpers\ArrayHelper; |
| 11 | use yii\helpers\Html; | 12 | use yii\helpers\Html; |
| 12 | -use yii\helpers\Url; | 13 | + use yii\helpers\Url; |
| 13 | 14 | ||
| 14 | -$this->params[ 'company' ] = $company; | 15 | + $this->params[ 'company' ] = $company; |
| 15 | $this->title = 'My Yii Application'; | 16 | $this->title = 'My Yii Application'; |
| 16 | ?> | 17 | ?> |
| 17 | -<div class="performer-vacancy-list style"> | ||
| 18 | - <?php | ||
| 19 | - echo Html::a('к списку вакансий', [ | ||
| 20 | - 'vacancy-list', | ||
| 21 | - 'company_id' => $company->id, | ||
| 22 | - ]); | ||
| 23 | - ?> | ||
| 24 | -</div> | ||
| 25 | -<div class="performer-vacancy-blocks-desk-wr style"> | ||
| 26 | - <div class="performer-vacancy-date style"> Вакансия от <?= $vacancy->date_add ?> </div> | ||
| 27 | - <div class="performance-vacancy-page-title style"><?= $vacancy->name ?></div> | ||
| 28 | - <div class="performance-vacancy-page-options style"> | ||
| 29 | - <ul> | ||
| 30 | - <?php | ||
| 31 | - if(!empty( $vacancy->user_name )) { | ||
| 32 | - echo "<li><span>Контактное лицо:</span><p>{$vacancy->user_name}</p></li>"; | ||
| 33 | - } | ||
| 34 | - if(!empty( $vacancy->phone )) { | ||
| 35 | - echo "<li><span>Телефон:</span><p>{$vacancy->phone}</p></li>"; | ||
| 36 | - } | ||
| 37 | - ?> | ||
| 38 | - <?php | ||
| 39 | - if(!empty( $vacancy->city )) { | ||
| 40 | - echo "<li><span>Город:</span><p>{$vacancy->city}</p></li>"; | ||
| 41 | - } | ||
| 42 | - ?> | ||
| 43 | - <?php | ||
| 44 | - if(!empty( $vacancy->employments )) { | ||
| 45 | - echo "<li><span>Вид занятости:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->employments, 'name')) . "</p></li>"; | ||
| 46 | - } | ||
| 47 | - ?> | ||
| 48 | - <?php | ||
| 49 | - if(!empty( $vacancy->requirements )) { | ||
| 50 | - echo "<li><span>Требования:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->requirements, 'requirements')) . "</p></li>"; | ||
| 51 | - } | ||
| 52 | - ?> | ||
| 53 | - </ul> | ||
| 54 | - </div> | ||
| 55 | - <div class="performance-vacancy-description style">Описание вакансии</div> | ||
| 56 | - <div class="performance-vacancy-desc-txt style"> | 18 | + <div class="performer-vacancy-list style"> |
| 57 | <?php | 19 | <?php |
| 58 | - echo $vacancy->description; | 20 | + echo Html::a('назад', [ |
| 21 | + 'vacancy-list', | ||
| 22 | + 'company_id' => $company->id, | ||
| 23 | + ]); | ||
| 59 | ?> | 24 | ?> |
| 60 | </div> | 25 | </div> |
| 61 | - <div class="performance-vacancy-desc-form style"> | ||
| 62 | - <a href="#">Отправить резюме</a> | ||
| 63 | - </div> | ||
| 64 | -</div> | ||
| 65 | -<div class="performance-vacancy-similar style"> | ||
| 66 | - <div class="performance-vacancy-similar-title style">Похожие вакансии</div> | ||
| 67 | - <div class="style"> | ||
| 68 | - | ||
| 69 | - <?php foreach($similar_vacancies as $similar_vacancy):?> | ||
| 70 | - <div class="performance-vacancy-similar-blocks-wr style"> | ||
| 71 | - | ||
| 72 | - <?= Html::a($similar_vacancy->name, Url::toRoute([ | ||
| 73 | - 'company/vacancy-view', | ||
| 74 | - 'company_id' => $similar_vacancy->user_id, | ||
| 75 | - 'link' => $similar_vacancy->link, | ||
| 76 | - ]), [ 'class' => 'performer-vacant-reclam-bl-title' ]) ?> | ||
| 77 | - | ||
| 78 | - <div class="performer-vacant-reclam-bl-title-two"><?= $similar_vacancy->city ?>. <?= \Yii::$app->formatter->asDatetime($similar_vacancy->date_add, 'Y-MM-dd') ?>. | 26 | + <div class="performer-vacancy-blocks-desk-wr style"> |
| 27 | + <div class="performer-vacancy-date style"> Вакансия от <?= $vacancy->date_add ?> </div> | ||
| 28 | + <div class="performance-vacancy-page-title style"><?= $vacancy->name ?></div> | ||
| 29 | + <div class="performance-vacancy-page-options style"> | ||
| 30 | + <ul> | ||
| 79 | <?php | 31 | <?php |
| 80 | - if(!empty( $similar_vacancy->salary )) { | ||
| 81 | - ?> | ||
| 82 | - <?= $similar_vacancy->salary ?> | ||
| 83 | - <?= $similar_vacancy->salaryCurrency->label ?> | ||
| 84 | - <?php | ||
| 85 | - } | ||
| 86 | - ?></div> | 32 | + if(!empty( $vacancy->user_name )) { |
| 33 | + echo "<li><span>Контактное лицо:</span><p>{$vacancy->user_name}</p></li>"; | ||
| 34 | + } | ||
| 35 | + if(!empty( $vacancy->phone )) { | ||
| 36 | + echo "<li><span>Телефон:</span><p>{$vacancy->phone}</p></li>"; | ||
| 37 | + } | ||
| 38 | + ?> | ||
| 39 | + <?php | ||
| 40 | + if(!empty( $vacancy->city )) { | ||
| 41 | + echo "<li><span>Город:</span><p>{$vacancy->city}</p></li>"; | ||
| 42 | + } | ||
| 43 | + ?> | ||
| 44 | + <?php | ||
| 45 | + if(!empty( $vacancy->employments )) { | ||
| 46 | + echo "<li><span>Вид занятости:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->employments, 'name')) . "</p></li>"; | ||
| 47 | + } | ||
| 48 | + ?> | ||
| 49 | + <?php | ||
| 50 | + if(!empty( $vacancy->requirements )) { | ||
| 51 | + echo "<li><span>Требования:</span><p>" . implode(', ', ArrayHelper::getColumn($vacancy->requirements, 'requirements')) . "</p></li>"; | ||
| 52 | + } | ||
| 53 | + ?> | ||
| 54 | + </ul> | ||
| 55 | + </div> | ||
| 56 | + <div class="performance-vacancy-description style">Описание вакансии</div> | ||
| 57 | + <div class="performance-vacancy-desc-txt style"> | ||
| 58 | + <?php | ||
| 59 | + echo $vacancy->description; | ||
| 60 | + ?> | ||
| 61 | + </div> | ||
| 62 | + <div class="performance-vacancy-desc-form style"> | ||
| 63 | + <a href="#">Отправить резюме</a> | ||
| 87 | </div> | 64 | </div> |
| 88 | - <?php endforeach;?> | 65 | + </div> |
| 66 | +<?php | ||
| 67 | + if(!empty( $similar_vacancies )) { | ||
| 68 | + ?> | ||
| 69 | + <div class="performance-vacancy-similar style"> | ||
| 70 | + <div class="performance-vacancy-similar-title style">Похожие вакансии</div> | ||
| 71 | + <div class="style"> | ||
| 72 | + <?php foreach($similar_vacancies as $similar_vacancy): ?> | ||
| 73 | + <div class="performance-vacancy-similar-blocks-wr style"> | ||
| 89 | 74 | ||
| 75 | + <?= Html::a($similar_vacancy->name, Url::toRoute([ | ||
| 76 | + 'company/vacancy-view', | ||
| 77 | + 'company_id' => $similar_vacancy->user_id, | ||
| 78 | + 'link' => $similar_vacancy->link, | ||
| 79 | + ]), [ 'class' => 'performer-vacant-reclam-bl-title' ]) ?> | ||
| 90 | 80 | ||
| 91 | - </div> | ||
| 92 | -</div> | ||
| 93 | \ No newline at end of file | 81 | \ No newline at end of file |
| 82 | + <div class="performer-vacant-reclam-bl-title-two"><?= $similar_vacancy->city ?>. <?= \Yii::$app->formatter->asDatetime($similar_vacancy->date_add, 'dd.MM.Y') ?>. | ||
| 83 | + <?php | ||
| 84 | + if(!empty( $similar_vacancy->salary )) { | ||
| 85 | + ?> | ||
| 86 | + <?= $similar_vacancy->salary ?> | ||
| 87 | + <?= $similar_vacancy->salaryCurrency->label ?> | ||
| 88 | + <?php | ||
| 89 | + } | ||
| 90 | + ?></div> | ||
| 91 | + </div> | ||
| 92 | + <?php endforeach; ?> | ||
| 93 | + </div> | ||
| 94 | + </div> | ||
| 95 | + <?php | ||
| 96 | + } | ||
| 97 | +?> | ||
| 94 | \ No newline at end of file | 98 | \ No newline at end of file |
frontend/views/layouts/company.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var string $content | ||
| 4 | + * @var View $this | ||
| 5 | + */ | ||
| 2 | 6 | ||
| 3 | -use yii\helpers\Html; | ||
| 4 | -use yii\widgets\Breadcrumbs; | ||
| 5 | -use yii\widgets\Menu; | 7 | + use common\models\User; |
| 8 | + use yii\helpers\Html; | ||
| 9 | + use yii\web\View; | ||
| 10 | + use yii\widgets\Menu; | ||
| 6 | 11 | ||
| 7 | - | ||
| 8 | -/* @var $content string */ | ||
| 9 | -$this->beginContent('@app/views/layouts/main.php'); | 12 | + $this->beginContent('@app/views/layouts/main.php'); |
| 10 | ?> | 13 | ?> |
| 11 | 14 | ||
| 12 | <div class="section-box content"> | 15 | <div class="section-box content"> |
| 13 | - <div class="section-box-14" style="background: url(<?= $this->params['company']->userInfo->poster;?>) 50% no-repeat ;"> | 16 | + <div class="section-box-14" style="background: url(<?= $this->params[ 'company' ]->userInfo->poster; ?>) 50% no-repeat ;"> |
| 14 | <div class="box-wr"> | 17 | <div class="box-wr"> |
| 15 | <div class="box-all"> | 18 | <div class="box-all"> |
| 16 | <div class="performance-vacancy-call-back"> | 19 | <div class="performance-vacancy-call-back"> |
| 17 | - <div class="performance-vacancy-call-back-title">Оставьте заявку<br />и мы вам перезвоним</div> | 20 | + <div class="performance-vacancy-call-back-title">Оставьте заявку<br/>и мы вам перезвоним |
| 21 | + </div> | ||
| 18 | <form class="callback" action=""> | 22 | <form class="callback" action=""> |
| 19 | 23 | ||
| 20 | <div class="input-blocks-wrapper"> | 24 | <div class="input-blocks-wrapper"> |
| @@ -24,7 +28,7 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -24,7 +28,7 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 24 | 28 | ||
| 25 | <div class="input-blocks-wrapper"> | 29 | <div class="input-blocks-wrapper"> |
| 26 | <label for="callbac_phone">Телефон</label> | 30 | <label for="callbac_phone">Телефон</label> |
| 27 | - <input id="callbac_phone" type="text"/> | 31 | + <input id="callbac_phone" type="text"/> |
| 28 | </div> | 32 | </div> |
| 29 | 33 | ||
| 30 | <input id="callbac_submit" type="submit" value="Перезвонить мне"/> | 34 | <input id="callbac_submit" type="submit" value="Перезвонить мне"/> |
| @@ -40,38 +44,59 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -40,38 +44,59 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 40 | <div class="box-all"> | 44 | <div class="box-all"> |
| 41 | <?php | 45 | <?php |
| 42 | echo Menu::widget([ | 46 | echo Menu::widget([ |
| 43 | - 'options' => [ | 47 | + 'options' => [ |
| 44 | 'class' => 'menu-content', | 48 | 'class' => 'menu-content', |
| 45 | ], | 49 | ], |
| 46 | 'activeCssClass' => 'active-menu-content', | 50 | 'activeCssClass' => 'active-menu-content', |
| 47 | - 'items' => [ | 51 | + 'items' => [ |
| 48 | [ | 52 | [ |
| 49 | 'label' => 'Общее', | 53 | 'label' => 'Общее', |
| 50 | - 'url' => ['company/common', 'company_id'=>$this->params['company']->id], | 54 | + 'url' => [ |
| 55 | + 'company/common', | ||
| 56 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 57 | + ], | ||
| 51 | ], | 58 | ], |
| 52 | [ | 59 | [ |
| 53 | 'label' => 'Выполненные работы', | 60 | 'label' => 'Выполненные работы', |
| 54 | - 'url' => ['company/portfolio', 'company_id'=>$this->params['company']->id], | 61 | + 'url' => [ |
| 62 | + 'company/portfolio', | ||
| 63 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 64 | + ], | ||
| 55 | ], | 65 | ], |
| 56 | [ | 66 | [ |
| 57 | 'label' => 'Команда', | 67 | 'label' => 'Команда', |
| 58 | - 'url' => ['company/team', 'company_id'=>$this->params['company']->id], | 68 | + 'url' => [ |
| 69 | + 'company/team', | ||
| 70 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 71 | + ], | ||
| 59 | ], | 72 | ], |
| 60 | [ | 73 | [ |
| 61 | 'label' => 'Вакансии', | 74 | 'label' => 'Вакансии', |
| 62 | - 'url' => ['company/vacancy-list', 'company_id'=>$this->params['company']->id], | 75 | + 'url' => [ |
| 76 | + 'company/vacancy-list', | ||
| 77 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 78 | + ], | ||
| 63 | ], | 79 | ], |
| 64 | [ | 80 | [ |
| 65 | 'label' => 'Блог', | 81 | 'label' => 'Блог', |
| 66 | - 'url' => ['company/blog-list', 'company_id'=>$this->params['company']->id], | 82 | + 'url' => [ |
| 83 | + 'company/blog-list', | ||
| 84 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 85 | + ], | ||
| 67 | ], | 86 | ], |
| 68 | [ | 87 | [ |
| 69 | 'label' => 'Отзывы', | 88 | 'label' => 'Отзывы', |
| 70 | - 'url' => ['company/review', 'company_id'=>$this->params['company']->id], | 89 | + 'url' => [ |
| 90 | + 'company/review', | ||
| 91 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 92 | + ], | ||
| 71 | ], | 93 | ], |
| 72 | [ | 94 | [ |
| 73 | 'label' => 'Галерея', | 95 | 'label' => 'Галерея', |
| 74 | - 'url' => ['company/gallery', 'company_id'=>$this->params['company']->id], | 96 | + 'url' => [ |
| 97 | + 'company/gallery', | ||
| 98 | + 'company_id' => $this->params[ 'company' ]->id, | ||
| 99 | + ], | ||
| 75 | ], | 100 | ], |
| 76 | ], | 101 | ], |
| 77 | ]); | 102 | ]); |
| @@ -93,7 +118,8 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -93,7 +118,8 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 93 | <div class="sidebar-droped-wr style"> | 118 | <div class="sidebar-droped-wr style"> |
| 94 | <ul> | 119 | <ul> |
| 95 | <li><a href="#">Заказчик</a></li> | 120 | <li><a href="#">Заказчик</a></li> |
| 96 | - <li style="display: none"><a href="#">Испонитель</a></li> | 121 | + <li style="display: none"> |
| 122 | + <a href="#">Испонитель</a></li> | ||
| 97 | </ul> | 123 | </ul> |
| 98 | </div> | 124 | </div> |
| 99 | </li> | 125 | </li> |
| @@ -102,45 +128,71 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -102,45 +128,71 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 102 | <div class="performance-vacancy-sidebar-stars style"> | 128 | <div class="performance-vacancy-sidebar-stars style"> |
| 103 | <div class="rating"> | 129 | <div class="rating"> |
| 104 | <!--оценка--> | 130 | <!--оценка--> |
| 105 | - <input type="hidden" class="val" value="5"/> | 131 | + <input type="hidden" class="val" value="<?= $this->params[ 'company' ]->userInfo->rating ?>"/> |
| 106 | <!--количество голосов--> | 132 | <!--количество голосов--> |
| 107 | - <input type="hidden" class="votes" value="12"/> | 133 | + <input type="hidden" class="votes" value="1"/> |
| 108 | </div> | 134 | </div> |
| 109 | </div> | 135 | </div> |
| 110 | - <div class="performance-vacancy-sidebar-comm style">30 отзывов</div> | 136 | + <div class="performance-vacancy-sidebar-comm style"><?= count($this->params[ 'company' ]->comments) ?> отзывов</div> |
| 111 | <a href="#" class="performance-vacancy-sidebar-write style">написать отзыв</a> | 137 | <a href="#" class="performance-vacancy-sidebar-write style">написать отзыв</a> |
| 112 | </div> | 138 | </div> |
| 113 | - <div class="performer-vacancy-sidebar-img style"><?= Html::img($this->params['company']->userInfo->image);?></div> | 139 | + <div class="performer-vacancy-sidebar-img style"><?= Html::img($this->params[ 'company' ]->userInfo->image); ?></div> |
| 114 | <div class="performer-vacancy-sidebar-all style"> | 140 | <div class="performer-vacancy-sidebar-all style"> |
| 115 | <div class="performer-vacancy-sidebar-soc style"> | 141 | <div class="performer-vacancy-sidebar-soc style"> |
| 116 | <ul> | 142 | <ul> |
| 117 | <li> | 143 | <li> |
| 118 | - <?= Html::a(Html::img('/images/ico-fb.png'),[$this->params['company']->userInfo->social_fb],['target'=>'_blank'])?> | 144 | + <?= Html::a(Html::img('/images/ico-fb.png'), [ $this->params[ 'company' ]->userInfo->social_fb ], [ 'target' => '_blank' ]) ?> |
| 119 | </li> | 145 | </li> |
| 120 | <li> | 146 | <li> |
| 121 | - <?= Html::a(Html::img('/images/ico-tw.png'),[$this->params['company']->userInfo->social_t],['target'=>'_blank'])?> | 147 | + <?= Html::a(Html::img('/images/ico-tw.png'), [ $this->params[ 'company' ]->userInfo->social_t ], [ 'target' => '_blank' ]) ?> |
| 122 | </li> | 148 | </li> |
| 123 | <li> | 149 | <li> |
| 124 | - <?= Html::a(Html::img('/images/ico-in.png'),[$this->params['company']->userInfo->social_in],['target'=>'_blank'])?> | 150 | + <?= Html::a(Html::img('/images/ico-in.png'), [ $this->params[ 'company' ]->userInfo->social_in ], [ 'target' => '_blank' ]) ?> |
| 125 | </li> | 151 | </li> |
| 126 | <li> | 152 | <li> |
| 127 | - <?= Html::a(Html::img('/images/ico-vk.png'),[$this->params['company']->userInfo->social_vk],['target'=>'_blank'])?> | 153 | + <?= Html::a(Html::img('/images/ico-vk.png'), [ $this->params[ 'company' ]->userInfo->social_vk ], [ 'target' => '_blank' ]) ?> |
| 128 | </li> | 154 | </li> |
| 129 | </ul> | 155 | </ul> |
| 130 | </div> | 156 | </div> |
| 131 | <div class="performer-vacancy-sidebar-views style"> | 157 | <div class="performer-vacancy-sidebar-views style"> |
| 132 | <ul class="style"> | 158 | <ul class="style"> |
| 133 | - <li><img src="/images/sidebar-ico/ico-1.png" alt=""/><div class="sidebarvievstxt"><?= $this->params['company']->userInfo->view_count;?> просмотра</div></li> | ||
| 134 | - <li><img src="/images/sidebar-ico/ico-2.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">На сайте: </span><?= $this->params['company']->liveTime?></div></li> | ||
| 135 | - <li><img src="/images/sidebar-ico/ico-3.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Последний визит: <br /></span><?= $this->params['company']->userInfo->lastVisit?></div></li> | ||
| 136 | - <li><img src="/images/sidebar-ico/ico-5.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Сотрудники:<br /></span><?= $this->params['company']->companyInfo->staff?></div></li> | ||
| 137 | - <?php foreach($this->params['company']->phones as $phone ):?> | ||
| 138 | - <li><img src="/images/sidebar-ico/ico-6.png" alt=""/><div class="sidebarvievstxt"><span class="sidebarvievs-phone"><?= $phone['phone'] ?></span></div></li> | ||
| 139 | - <?php endforeach;?> | ||
| 140 | - <?php foreach($this->params['company']->site as $site ):?> | ||
| 141 | - <li><img src="/images/sidebar-ico/ico-7.png" alt=""/><div class="sidebarvievstxt"><a target="_blank" href="<?= $site['site']?>">Сайт</a></div></li> | ||
| 142 | - <?php endforeach;?> | ||
| 143 | - <li><img src="/images/sidebar-ico/ico-8.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Адрес:<br /></span><?= $this->params['company']->address?></div></li> | 159 | + <li><img src="/images/sidebar-ico/ico-1.png" alt=""/> |
| 160 | + <div class="sidebarvievstxt"><?= $this->params[ 'company' ]->userInfo->view_count; ?> просмотра</div> | ||
| 161 | + </li> | ||
| 162 | + <li><img src="/images/sidebar-ico/ico-2.png" alt=""/> | ||
| 163 | + <div class="sidebarvievstxt"> | ||
| 164 | + <span class="sidebar-views-txt">На сайте: </span><?= $this->params[ 'company' ]->liveTime ?> | ||
| 165 | + </div> | ||
| 166 | + </li> | ||
| 167 | + <li><img src="/images/sidebar-ico/ico-3.png" alt=""/> | ||
| 168 | + <div class="sidebarvievstxt"> | ||
| 169 | + <span class="sidebar-views-txt">Последний визит: <br/></span><?= $this->params[ 'company' ]->userInfo->lastVisit ?> | ||
| 170 | + </div> | ||
| 171 | + </li> | ||
| 172 | + <li><img src="/images/sidebar-ico/ico-5.png" alt=""/> | ||
| 173 | + <div class="sidebarvievstxt"> | ||
| 174 | + <span class="sidebar-views-txt">Сотрудники:<br/></span><?= $this->params[ 'company' ]->companyInfo->staff ?> | ||
| 175 | + </div> | ||
| 176 | + </li> | ||
| 177 | + <?php foreach($this->params[ 'company' ]->phones as $phone): ?> | ||
| 178 | + <li><img src="/images/sidebar-ico/ico-6.png" alt=""/> | ||
| 179 | + <div class="sidebarvievstxt"> | ||
| 180 | + <span class="sidebarvievs-phone"><?= $phone[ 'phone' ] ?></span> | ||
| 181 | + </div> | ||
| 182 | + </li> | ||
| 183 | + <?php endforeach; ?> | ||
| 184 | + <?php foreach($this->params[ 'company' ]->site as $site): ?> | ||
| 185 | + <li><img src="/images/sidebar-ico/ico-7.png" alt=""/> | ||
| 186 | + <div class="sidebarvievstxt"> | ||
| 187 | + <a target="_blank" href="<?= $site[ 'site' ] ?>">Сайт</a> | ||
| 188 | + </div> | ||
| 189 | + </li> | ||
| 190 | + <?php endforeach; ?> | ||
| 191 | + <li><img src="/images/sidebar-ico/ico-8.png" alt=""/> | ||
| 192 | + <div class="sidebarvievstxt"> | ||
| 193 | + <span class="sidebar-views-txt">Адрес:<br/></span><?= $this->params[ 'company' ]->address ?> | ||
| 194 | + </div> | ||
| 195 | + </li> | ||
| 144 | </ul> | 196 | </ul> |
| 145 | </div> | 197 | </div> |
| 146 | </div> | 198 | </div> |
| @@ -154,26 +206,26 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -154,26 +206,26 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 154 | </div> | 206 | </div> |
| 155 | <?php | 207 | <?php |
| 156 | /*====Blocks created in view====*/ | 208 | /*====Blocks created in view====*/ |
| 157 | - if(isset($this->blocks['our_objects'])) { | ||
| 158 | - echo $this->blocks['our_objects']; | 209 | + if(isset( $this->blocks[ 'our_objects' ] )) { |
| 210 | + echo $this->blocks[ 'our_objects' ]; | ||
| 159 | } | 211 | } |
| 160 | - if(isset($this->blocks['blog'])) { | ||
| 161 | - echo $this->blocks['blog']; | 212 | + if(isset( $this->blocks[ 'blog' ] )) { |
| 213 | + echo $this->blocks[ 'blog' ]; | ||
| 162 | } | 214 | } |
| 163 | - if(isset($this->blocks['team'])) { | ||
| 164 | - echo $this->blocks['team']; | 215 | + if(isset( $this->blocks[ 'team' ] )) { |
| 216 | + echo $this->blocks[ 'team' ]; | ||
| 165 | } | 217 | } |
| 166 | - if(isset($this->blocks['review'])) { | ||
| 167 | - echo $this->blocks['review']; | 218 | + if(isset( $this->blocks[ 'review' ] )) { |
| 219 | + echo $this->blocks[ 'review' ]; | ||
| 168 | } | 220 | } |
| 169 | /*====End of blocks created in view====*/ | 221 | /*====End of blocks created in view====*/ |
| 170 | ?> | 222 | ?> |
| 171 | </div> | 223 | </div> |
| 172 | <script> | 224 | <script> |
| 173 | - $('div.rating').rating({ | ||
| 174 | - fx: 'full', | ||
| 175 | - readOnly: 'true', | ||
| 176 | - url: 'rating.php' | ||
| 177 | - }); | 225 | + $('div.rating').rating( |
| 226 | + { | ||
| 227 | + fx : 'full', readOnly : 'true', url : 'rating.php' | ||
| 228 | + } | ||
| 229 | + ); | ||
| 178 | </script> | 230 | </script> |
| 179 | <?php $this->endContent() ?> | 231 | <?php $this->endContent() ?> |
| 180 | \ No newline at end of file | 232 | \ No newline at end of file |
frontend/views/layouts/performer.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var string $content | ||
| 4 | + * @var View $this | ||
| 5 | + */ | ||
| 2 | 6 | ||
| 3 | -use common\models\User; | ||
| 4 | -use yii\helpers\ArrayHelper; | ||
| 5 | -use yii\helpers\Html; | ||
| 6 | -use yii\helpers\Url; | ||
| 7 | -use yii\widgets\Menu; | ||
| 8 | - | ||
| 9 | -\frontend\assets\AppAsset::register($this); | ||
| 10 | -/* @var $content string */ | ||
| 11 | -$this->beginContent('@app/views/layouts/main.php'); | 7 | + use common\models\User; |
| 8 | + use yii\helpers\ArrayHelper; | ||
| 9 | + use yii\helpers\Html; | ||
| 10 | + use yii\helpers\Url; | ||
| 11 | + use yii\web\View; | ||
| 12 | + use yii\widgets\Menu; | ||
| 12 | 13 | ||
| 14 | + \frontend\assets\AppAsset::register($this); | ||
| 15 | + $this->beginContent('@app/views/layouts/main.php'); | ||
| 13 | 16 | ||
| 14 | ?> | 17 | ?> |
| 15 | <div class="section-box content"> | 18 | <div class="section-box content"> |
| 16 | - <div class="section-box-16" style="background: url('<?= $this->params['user']->userInfo->poster;?>') 50% no-repeat"> | 19 | + <div class="section-box-16" style="background: url('<?= $this->params[ 'user' ]->userInfo->poster; ?>') 50% no-repeat"> |
| 17 | <div class="box-wr"> | 20 | <div class="box-wr"> |
| 18 | <div class="box-all"> | 21 | <div class="box-all"> |
| 19 | <div class="blog-buttons-wr style"> | 22 | <div class="blog-buttons-wr style"> |
| 20 | <a class="blog-buttons-offer" href="#">Предложить<br>проект</a> | 23 | <a class="blog-buttons-offer" href="#">Предложить<br>проект</a> |
| 21 | - <?= Html::a('Предложить проект', Url::toRoute(['chat/message', 'user_id' => $this->params['user']->id]), ['class'=> 'blog-buttons-write'])?> | 24 | + <?= Html::a('Предложить проект', Url::toRoute([ |
| 25 | + 'chat/message', | ||
| 26 | + 'user_id' => $this->params[ 'user' ]->id, | ||
| 27 | + ]), [ 'class' => 'blog-buttons-write' ]) ?> | ||
| 22 | <a class="blog-buttons-add-favorite" href="#">Добавить<br>в закладки</a> | 28 | <a class="blog-buttons-add-favorite" href="#">Добавить<br>в закладки</a> |
| 23 | </div> | 29 | </div> |
| 24 | </div> | 30 | </div> |
| @@ -36,27 +42,45 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -36,27 +42,45 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 36 | 'items' => [ | 42 | 'items' => [ |
| 37 | [ | 43 | [ |
| 38 | 'label' => 'Общее', | 44 | 'label' => 'Общее', |
| 39 | - 'url' => ['performer/common', 'performer_id'=>$this->params['user']->id], | 45 | + 'url' => [ |
| 46 | + 'performer/common', | ||
| 47 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 48 | + ], | ||
| 40 | ], | 49 | ], |
| 41 | [ | 50 | [ |
| 42 | 'label' => 'Портфолио', | 51 | 'label' => 'Портфолио', |
| 43 | - 'url' => ['performer/portfolio', 'performer_id'=>$this->params['user']->id], | 52 | + 'url' => [ |
| 53 | + 'performer/portfolio', | ||
| 54 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 55 | + ], | ||
| 44 | ], | 56 | ], |
| 45 | [ | 57 | [ |
| 46 | 'label' => 'Блог', | 58 | 'label' => 'Блог', |
| 47 | - 'url' => ['performer/blog-list', 'performer_id'=>$this->params['user']->id], | 59 | + 'url' => [ |
| 60 | + 'performer/blog-list', | ||
| 61 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 62 | + ], | ||
| 48 | ], | 63 | ], |
| 49 | [ | 64 | [ |
| 50 | 'label' => 'Отзывы', | 65 | 'label' => 'Отзывы', |
| 51 | - 'url' => ['performer/review', 'performer_id'=>$this->params['user']->id], | 66 | + 'url' => [ |
| 67 | + 'performer/review', | ||
| 68 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 69 | + ], | ||
| 52 | ], | 70 | ], |
| 53 | [ | 71 | [ |
| 54 | 'label' => 'Места работы', | 72 | 'label' => 'Места работы', |
| 55 | - 'url' => ['performer/workplace', 'performer_id'=>$this->params['user']->id], | 73 | + 'url' => [ |
| 74 | + 'performer/workplace', | ||
| 75 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 76 | + ], | ||
| 56 | ], | 77 | ], |
| 57 | [ | 78 | [ |
| 58 | 'label' => 'Галерея', | 79 | 'label' => 'Галерея', |
| 59 | - 'url' => ['performer/gallery', 'performer_id'=>$this->params['user']->id], | 80 | + 'url' => [ |
| 81 | + 'performer/gallery', | ||
| 82 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 83 | + ], | ||
| 60 | ], | 84 | ], |
| 61 | ], | 85 | ], |
| 62 | ]); | 86 | ]); |
| @@ -78,7 +102,8 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -78,7 +102,8 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 78 | <div class="sidebar-droped-wr style"> | 102 | <div class="sidebar-droped-wr style"> |
| 79 | <ul> | 103 | <ul> |
| 80 | <li><a href="#">Заказчик</a></li> | 104 | <li><a href="#">Заказчик</a></li> |
| 81 | - <li style="display: none"><a href="#">Испонитель</a></li> | 105 | + <li style="display: none"> |
| 106 | + <a href="#">Испонитель</a></li> | ||
| 82 | </ul> | 107 | </ul> |
| 83 | </div> | 108 | </div> |
| 84 | </li> | 109 | </li> |
| @@ -87,45 +112,77 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -87,45 +112,77 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 87 | <div class="performance-vacancy-sidebar-stars style"> | 112 | <div class="performance-vacancy-sidebar-stars style"> |
| 88 | <div class="rating"> | 113 | <div class="rating"> |
| 89 | <!--оценка--> | 114 | <!--оценка--> |
| 90 | - <input type="hidden" class="val" value="5"/> | 115 | + <input type="hidden" class="val" value="<?= $this->params['user']->userInfo->rating ?>"/> |
| 91 | <!--количество голосов--> | 116 | <!--количество голосов--> |
| 92 | - <input type="hidden" class="votes" value="12"/> | 117 | + <input type="hidden" class="votes" value="1"/> |
| 93 | </div> | 118 | </div> |
| 94 | </div> | 119 | </div> |
| 95 | - <div class="performance-vacancy-sidebar-comm style">30 отзывов</div> | 120 | + <div class="performance-vacancy-sidebar-comm style"><?= count($this->params['user']->comments) ?> отзывов</div> |
| 96 | <a href="#" class="performance-vacancy-sidebar-write style">написать отзыв</a> | 121 | <a href="#" class="performance-vacancy-sidebar-write style">написать отзыв</a> |
| 97 | </div> | 122 | </div> |
| 98 | <div class="performer-vacancy-sidebar-img style"> | 123 | <div class="performer-vacancy-sidebar-img style"> |
| 99 | - <?= Html::img($this->params['user']->userInfo->image);?> | 124 | + <?= Html::img($this->params[ 'user' ]->userInfo->image); ?> |
| 100 | </div> | 125 | </div> |
| 101 | <div class="performer-vacancy-sidebar-all style"> | 126 | <div class="performer-vacancy-sidebar-all style"> |
| 102 | <div class="performer-vacancy-sidebar-soc style"> | 127 | <div class="performer-vacancy-sidebar-soc style"> |
| 103 | <ul> | 128 | <ul> |
| 104 | <li> | 129 | <li> |
| 105 | - <?= Html::a(Html::img('/images/ico-fb.png'),"{$this->params['user']->userInfo->social_fb}",['target'=>'_blank'])?> | 130 | + <?= Html::a(Html::img('/images/ico-fb.png'), "{$this->params['user']->userInfo->social_fb}", [ 'target' => '_blank' ]) ?> |
| 106 | </li> | 131 | </li> |
| 107 | <li> | 132 | <li> |
| 108 | - <?= Html::a(Html::img('/images/ico-tw.png'),"{$this->params['user']->userInfo->social_t}", ['target'=>'_blank'])?> | 133 | + <?= Html::a(Html::img('/images/ico-tw.png'), "{$this->params['user']->userInfo->social_t}", [ 'target' => '_blank' ]) ?> |
| 109 | </li> | 134 | </li> |
| 110 | <li> | 135 | <li> |
| 111 | - <?= Html::a(Html::img('/images/ico-in.png'),"{$this->params['user']->userInfo->social_in}",['target'=>'_blank'])?> | 136 | + <?= Html::a(Html::img('/images/ico-in.png'), "{$this->params['user']->userInfo->social_in}", [ 'target' => '_blank' ]) ?> |
| 112 | </li> | 137 | </li> |
| 113 | <li> | 138 | <li> |
| 114 | - <?= Html::a(Html::img('/images/ico-vk.png'),"{$this->params['user']->userInfo->social_vk}",['target'=>'_blank'])?> | 139 | + <?= Html::a(Html::img('/images/ico-vk.png'), "{$this->params['user']->userInfo->social_vk}", [ 'target' => '_blank' ]) ?> |
| 115 | </li> | 140 | </li> |
| 116 | </ul> | 141 | </ul> |
| 117 | </div> | 142 | </div> |
| 118 | <div class="performer-vacancy-sidebar-views style"> | 143 | <div class="performer-vacancy-sidebar-views style"> |
| 119 | <ul class="style"> | 144 | <ul class="style"> |
| 120 | - <li><img src="/images/sidebar-ico/ico-1.png" alt=""/><div class="sidebarvievstxt"><?= $this->params['user']->userInfo->view_count?> просмотра</div></li> | ||
| 121 | - <li><img src="/images/sidebar-ico/ico-9.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Статус: </span><?= $this->params['user']->userInfo->busyText?></div></li> | ||
| 122 | - <li><img src="/images/sidebar-ico/ico-2.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">На сайте: </span><?= $this->params['user']->liveTime?></div></li> | ||
| 123 | - <li><img src="/images/sidebar-ico/ico-3.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Последний визит:<br /></span><?= $this->params['user']->userInfo->lastVisit?></div></li> | ||
| 124 | - <li><img src="/images/sidebar-ico/ico-10.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Трудовой стаж:<br /></span><?= $this->params['user']->userInfo->experience?></div></li> | ||
| 125 | - <li><img src="/images/sidebar-ico/ico-11.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Звание в МФП:<br /></span><?= $this->params['user']->userInfo->rank?></div></li> | ||
| 126 | - <li><img src="/images/sidebar-ico/ico-12.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Стоимость работ:<br /></span><?= $this->params['user']->userInfo->salary?></div></li> | ||
| 127 | - <li><img src="/images/sidebar-ico/ico-13.png" alt=""/><div class="sidebarvievstxt"><?= implode(', ',ArrayHelper::getColumn($this->params['user']->payments,'name'))?></div></li> | ||
| 128 | - <li><img src="/images/sidebar-ico/ico-14.png" alt=""/><div class="sidebarvievstxt"><span class="sidebar-views-txt">Текущее место работы:<br /></span><?= isset($this->params['user']->currentJob) ?$this->params['user']->currentJob->name : ""?></div></li> | 145 | + <li><img src="/images/sidebar-ico/ico-1.png" alt=""/> |
| 146 | + <div class="sidebarvievstxt"><?= $this->params[ 'user' ]->userInfo->view_count ?> просмотра</div> | ||
| 147 | + </li> | ||
| 148 | + <li><img src="/images/sidebar-ico/ico-9.png" alt=""/> | ||
| 149 | + <div class="sidebarvievstxt"> | ||
| 150 | + <span class="sidebar-views-txt">Статус: </span><?= $this->params[ 'user' ]->userInfo->busyText ?> | ||
| 151 | + </div> | ||
| 152 | + </li> | ||
| 153 | + <li><img src="/images/sidebar-ico/ico-2.png" alt=""/> | ||
| 154 | + <div class="sidebarvievstxt"> | ||
| 155 | + <span class="sidebar-views-txt">На сайте: </span><?= $this->params[ 'user' ]->liveTime ?> | ||
| 156 | + </div> | ||
| 157 | + </li> | ||
| 158 | + <li><img src="/images/sidebar-ico/ico-3.png" alt=""/> | ||
| 159 | + <div class="sidebarvievstxt"> | ||
| 160 | + <span class="sidebar-views-txt">Последний визит:<br/></span><?= $this->params[ 'user' ]->userInfo->lastVisit ?> | ||
| 161 | + </div> | ||
| 162 | + </li> | ||
| 163 | + <li><img src="/images/sidebar-ico/ico-10.png" alt=""/> | ||
| 164 | + <div class="sidebarvievstxt"> | ||
| 165 | + <span class="sidebar-views-txt">Трудовой стаж:<br/></span><?= $this->params[ 'user' ]->userInfo->experience ?> | ||
| 166 | + </div> | ||
| 167 | + </li> | ||
| 168 | + <li><img src="/images/sidebar-ico/ico-11.png" alt=""/> | ||
| 169 | + <div class="sidebarvievstxt"> | ||
| 170 | + <span class="sidebar-views-txt">Звание в МФП:<br/></span><?= $this->params[ 'user' ]->userInfo->rank ?> | ||
| 171 | + </div> | ||
| 172 | + </li> | ||
| 173 | + <li><img src="/images/sidebar-ico/ico-12.png" alt=""/> | ||
| 174 | + <div class="sidebarvievstxt"> | ||
| 175 | + <span class="sidebar-views-txt">Стоимость работ:<br/></span><?= $this->params[ 'user' ]->userInfo->salary ?> | ||
| 176 | + </div> | ||
| 177 | + </li> | ||
| 178 | + <li><img src="/images/sidebar-ico/ico-13.png" alt=""/> | ||
| 179 | + <div class="sidebarvievstxt"><?= implode(', ', ArrayHelper::getColumn($this->params[ 'user' ]->payments, 'name')) ?></div> | ||
| 180 | + </li> | ||
| 181 | + <li><img src="/images/sidebar-ico/ico-14.png" alt=""/> | ||
| 182 | + <div class="sidebarvievstxt"> | ||
| 183 | + <span class="sidebar-views-txt">Текущее место работы:<br/></span><?= isset( $this->params[ 'user' ]->currentJob ) ? $this->params[ 'user' ]->currentJob->name : "" ?> | ||
| 184 | + </div> | ||
| 185 | + </li> | ||
| 129 | 186 | ||
| 130 | </ul> | 187 | </ul> |
| 131 | </div> | 188 | </div> |
| @@ -142,11 +199,11 @@ $this->beginContent('@app/views/layouts/main.php'); | @@ -142,11 +199,11 @@ $this->beginContent('@app/views/layouts/main.php'); | ||
| 142 | 199 | ||
| 143 | </div> | 200 | </div> |
| 144 | <script> | 201 | <script> |
| 145 | - $('div.rating').rating({ | ||
| 146 | - fx: 'full', | ||
| 147 | - readOnly: 'true', | ||
| 148 | - url: 'rating.php' | ||
| 149 | - }); | 202 | + $('div.rating').rating( |
| 203 | + { | ||
| 204 | + fx : 'full', readOnly : 'true', url : 'rating.php' | ||
| 205 | + } | ||
| 206 | + ); | ||
| 150 | </script> | 207 | </script> |
| 151 | 208 | ||
| 152 | <?php $this->endContent() ?> | 209 | <?php $this->endContent() ?> |
| 153 | \ No newline at end of file | 210 | \ No newline at end of file |
frontend/views/performer/_blog_list_view.php
| 1 | <?php | 1 | <?php |
| 2 | -use frontend\helpers\TextHelper; | ||
| 3 | -use yii\helpers\Html; | ||
| 4 | -use yii\helpers\StringHelper; | ||
| 5 | -use yii\helpers\Url; | 2 | + /** |
| 3 | + * @var Blog $model | ||
| 4 | + */ | ||
| 5 | + use common\models\Blog; | ||
| 6 | + use common\modules\comment\models\Comment; | ||
| 7 | + use frontend\helpers\TextHelper; | ||
| 8 | + use yii\helpers\Html; | ||
| 9 | + use yii\helpers\Url; | ||
| 6 | 10 | ||
| 7 | ?> | 11 | ?> |
| 8 | <div class="blog-post-wr"> | 12 | <div class="blog-post-wr"> |
| 9 | <div class="blog-post-title style"> | 13 | <div class="blog-post-title style"> |
| 10 | - <?= Html::a($model->name, Url::toRoute(['performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]),['class'=>'blog-new-link']);?> | 14 | + <?= Html::a($model->name, Url::toRoute([ |
| 15 | + 'performer/blog-view', | ||
| 16 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 17 | + 'link' => $model->link, | ||
| 18 | + ]), [ 'class' => 'blog-new-link' ]); ?> | ||
| 11 | </div> | 19 | </div> |
| 12 | <div class="blog-post-icons-wr style"> | 20 | <div class="blog-post-icons-wr style"> |
| 13 | <div class="blog-post-date"> | 21 | <div class="blog-post-date"> |
| 14 | - <span></span><p><?= $model->dateCreate?></p> | 22 | + <span></span> |
| 23 | + <p><?= \Yii::$app->formatter->asDate($model->dateCreate, 'php:d.m.Y') ?></p> | ||
| 15 | </div> | 24 | </div> |
| 16 | <div class="blog-post-views"> | 25 | <div class="blog-post-views"> |
| 17 | - <span></span><p><?= $model->view_count?></p> | 26 | + <span></span> |
| 27 | + <p><?= $model->view_count ?></p> | ||
| 18 | </div> | 28 | </div> |
| 19 | <div class="blog-post-comm-num"> | 29 | <div class="blog-post-comm-num"> |
| 20 | - <span></span><p><?= $model->view_count?></p> | 30 | + <span></span> |
| 31 | + <p><?= count($model->comments) ?></p> | ||
| 21 | </div> | 32 | </div> |
| 22 | </div> | 33 | </div> |
| 23 | <div class="blog-post-content style"> | 34 | <div class="blog-post-content style"> |
| 24 | - <?= Html::a(Html::img($model->cover), Url::toRoute(['/performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]));?> | ||
| 25 | - <?= TextHelper::truncateHtmlText($model->description, 1300)?> | 35 | + <?= Html::a(Html::img($model->cover), Url::toRoute([ |
| 36 | + '/performer/blog-view', | ||
| 37 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 38 | + 'link' => $model->link, | ||
| 39 | + ])); ?> | ||
| 40 | + <?= TextHelper::truncateHtmlText($model->description, 1300) ?> | ||
| 26 | </div> | 41 | </div> |
| 27 | - <?= Html::a('<span>Подробнее</span>', Url::toRoute(['performer/blog-view','performer_id'=>$this->params['user']->id,'link'=>$model->link]),['class'=>'blog-post-see-all style']);?> | 42 | + <?= Html::a('<span>Подробнее</span>', Url::toRoute([ |
| 43 | + 'performer/blog-view', | ||
| 44 | + 'performer_id' => $this->params[ 'user' ]->id, | ||
| 45 | + 'link' => $model->link, | ||
| 46 | + ]), [ 'class' => 'blog-post-see-all style' ]); ?> | ||
| 28 | </div> | 47 | </div> |
| 29 | \ No newline at end of file | 48 | \ No newline at end of file |
frontend/views/performer/blog-list.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var ArrayDataProvider $blog | ||
| 4 | + * @var Pagination $pagination | ||
| 5 | + * @var yii\web\View $this | ||
| 6 | + */ | ||
| 7 | + use yii\data\ArrayDataProvider; | ||
| 8 | + use yii\data\Pagination; | ||
| 9 | + use yii\widgets\LinkPager; | ||
| 10 | + use yii\widgets\ListView; | ||
| 2 | 11 | ||
| 3 | -use \yii\helpers\Html; | ||
| 4 | -use yii\widgets\LinkPager; | ||
| 5 | -use yii\widgets\ListView; | ||
| 6 | - | ||
| 7 | -/* @var $this yii\web\View */ | ||
| 8 | -$this->params['user'] = $user; | ||
| 9 | -$this->title = 'My Yii Application'; | 12 | + $this->params[ 'user' ] = $user; |
| 13 | + $this->title = 'My Yii Application'; | ||
| 10 | ?> | 14 | ?> |
| 11 | <div class="performer-vacancy-vacant-title-reclam-wr style"> | 15 | <div class="performer-vacancy-vacant-title-reclam-wr style"> |
| 12 | 16 | ||
| 13 | - <?= | ||
| 14 | - ListView::widget( [ | 17 | + <?= ListView::widget([ |
| 15 | 'dataProvider' => $blog, | 18 | 'dataProvider' => $blog, |
| 16 | - 'itemView'=>'_blog_list_view', | ||
| 17 | - 'summary'=>'', | ||
| 18 | - ] ); | ||
| 19 | - ?> | 19 | + 'itemView' => '_blog_list_view', |
| 20 | + 'summary' => '', | ||
| 21 | + ]); ?> | ||
| 20 | </div> | 22 | </div> |
| 21 | <div class="navi-buttons-wr style"> | 23 | <div class="navi-buttons-wr style"> |
| 22 | - <?= | ||
| 23 | - LinkPager::widget([ | 24 | + <?= LinkPager::widget([ |
| 24 | 'pagination' => $pagination, | 25 | 'pagination' => $pagination, |
| 25 | - ]); | ||
| 26 | - ?> | 26 | + ]); ?> |
| 27 | </div> | 27 | </div> |
| 28 | 28 |
frontend/views/performer/blog-view.php
| 1 | <?php | 1 | <?php |
| 2 | - use \yii\helpers\Html; | 2 | + /** |
| 3 | + * @var yii\web\View $this | ||
| 4 | + * @var Blog $article | ||
| 5 | + */ | ||
| 6 | + use common\models\Blog; | ||
| 3 | 7 | ||
| 4 | - /* @var $this yii\web\View */ | ||
| 5 | - $this->params['user'] = $user; | 8 | + $this->params[ 'user' ] = $user; |
| 6 | 9 | ||
| 7 | - $this->title = $article->name ; | 10 | + $this->title = $article->name; |
| 8 | ?> | 11 | ?> |
| 9 | <div class="performer-vacancy-vacant-title-reclam-wr style"> | 12 | <div class="performer-vacancy-vacant-title-reclam-wr style"> |
| 10 | <div class="blog-post-wr"> | 13 | <div class="blog-post-wr"> |
| @@ -12,15 +15,15 @@ | @@ -12,15 +15,15 @@ | ||
| 12 | <div class="blog-post-icons-wr style"> | 15 | <div class="blog-post-icons-wr style"> |
| 13 | <div class="blog-post-date"> | 16 | <div class="blog-post-date"> |
| 14 | <span></span> | 17 | <span></span> |
| 15 | - <p><?= $article->dateCreate?></p> | 18 | + <p><?= \Yii::$app->formatter->asDate($article->date_add, 'php:d.m.Y') ?></p> |
| 16 | </div> | 19 | </div> |
| 17 | <div class="blog-post-views"> | 20 | <div class="blog-post-views"> |
| 18 | <span></span> | 21 | <span></span> |
| 19 | - <p><?= $article->view_count?></p> | 22 | + <p><?= $article->view_count ?></p> |
| 20 | </div> | 23 | </div> |
| 21 | <div class="blog-post-comm-num"> | 24 | <div class="blog-post-comm-num"> |
| 22 | <span></span> | 25 | <span></span> |
| 23 | - <p><?= $article->view_count?></p> | 26 | + <p><?= count($article->comments) ?></p> |
| 24 | </div> | 27 | </div> |
| 25 | </div> | 28 | </div> |
| 26 | <div class="blog-post-content style"> | 29 | <div class="blog-post-content style"> |
| @@ -28,3 +31,29 @@ | @@ -28,3 +31,29 @@ | ||
| 28 | </div> | 31 | </div> |
| 29 | </div> | 32 | </div> |
| 30 | </div> | 33 | </div> |
| 34 | +<?php | ||
| 35 | + echo \common\modules\comment\widgets\CommentWidget::widget([ | ||
| 36 | + 'context' => $this, | ||
| 37 | + 'model' => $article::className(), | ||
| 38 | + 'model_id' => $article->blog_id, | ||
| 39 | + 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 40 | + 'rating_class' => \common\modules\comment\models\Rating::className(), | ||
| 41 | + 'class_options' => [ | ||
| 42 | + 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 43 | + 'user_id' => \Yii::$app->user->getId(), | ||
| 44 | + 'guestComment' => true, | ||
| 45 | + 'status' => \common\modules\comment\models\Comment::STATUS_ACTIVE, | ||
| 46 | + ], | ||
| 47 | + 'list_options' => [ | ||
| 48 | + 'view' => 'list-comment', | ||
| 49 | + ], | ||
| 50 | + 'form_options' => [ | ||
| 51 | + 'view' => 'form-comment', | ||
| 52 | + 'tag' => 'div', | ||
| 53 | + 'class' => 'artbox_comment_form', | ||
| 54 | + ], | ||
| 55 | + 'options' => [ | ||
| 56 | + 'class' => 'new-portf-comments-wr style', | ||
| 57 | + ], | ||
| 58 | + ]); | ||
| 59 | +?> |
frontend/views/performer/review.php
| 1 | <?php | 1 | <?php |
| 2 | + /** | ||
| 3 | + * @var View $this | ||
| 4 | + * @var User $user | ||
| 5 | + */ | ||
| 2 | 6 | ||
| 3 | -use \yii\helpers\Html; | 7 | + use common\models\User; |
| 8 | + use yii\web\View; | ||
| 4 | 9 | ||
| 5 | -/* @var $this yii\web\View */ | ||
| 6 | -$this->params['user'] = $user; | ||
| 7 | -$this->title = 'My Yii Application'; | 10 | + $this->params[ 'user' ] = $user; |
| 11 | + $this->title = 'My Yii Application'; | ||
| 8 | ?> | 12 | ?> |
| 9 | <div class="performer-vacancy-vacant-title-reclam-wr style"> | 13 | <div class="performer-vacancy-vacant-title-reclam-wr style"> |
| 14 | + <?php | ||
| 15 | + echo \common\modules\comment\widgets\CommentWidget::widget([ | ||
| 16 | + 'context' => $this, | ||
| 17 | + 'model' => $user->className(), | ||
| 18 | + 'model_id' => $user->id, | ||
| 19 | + 'comment_class' => \common\modules\comment\models\Comment::className(), | ||
| 20 | + 'rating_class' => \common\modules\comment\models\Rating::className(), | ||
| 21 | + 'class_options' => [ | ||
| 22 | + 'scenario' => is_int(\Yii::$app->user->getId()) ? \common\modules\comment\models\Comment::SCENARIO_USER : \common\modules\comment\models\Comment::SCENARIO_GUEST, | ||
| 23 | + 'user_id' => \Yii::$app->user->getId(), | ||
| 24 | + 'guestComment' => false, | ||
| 25 | + 'status' => \common\modules\comment\models\Comment::STATUS_ACTIVE, | ||
| 26 | + ], | ||
| 27 | + 'list_options' => [ | ||
| 28 | + 'view' => 'list-comment-review', | ||
| 29 | + ], | ||
| 30 | + 'form_options' => [ | ||
| 31 | + 'view' => 'form-comment-review', | ||
| 32 | + 'tag' => 'span', | ||
| 33 | + ], | ||
| 34 | + 'options' => [ | ||
| 35 | + 'class' => 'proektant-comments-wr style', | ||
| 36 | + ], | ||
| 37 | + ]); | ||
| 38 | + ?> | ||
| 39 | + <?php /* == Layout == ?> | ||
| 10 | <div class="proektant-comments-wr style"> | 40 | <div class="proektant-comments-wr style"> |
| 11 | <div class="workplace-title style"><p>Отзывы о пользователе: 4</p></div> | 41 | <div class="workplace-title style"><p>Отзывы о пользователе: 4</p></div> |
| 12 | <ul class="proektant-comments style"> | 42 | <ul class="proektant-comments style"> |
| @@ -82,5 +112,5 @@ $this->title = 'My Yii Application'; | @@ -82,5 +112,5 @@ $this->title = 'My Yii Application'; | ||
| 82 | </ul> | 112 | </ul> |
| 83 | </div> | 113 | </div> |
| 84 | </div> | 114 | </div> |
| 85 | - | 115 | + <?php */ ?> |
| 86 | </div> | 116 | </div> |
frontend/views/search/project.php
| @@ -75,7 +75,7 @@ | @@ -75,7 +75,7 @@ | ||
| 75 | 'options' => [ 'class' => 'blocks-check-list' ], | 75 | 'options' => [ 'class' => 'blocks-check-list' ], |
| 76 | ]) | 76 | ]) |
| 77 | ->label("<span></span>{$model->getAttributeLabel('contractual')}", ['class' => '']) | 77 | ->label("<span></span>{$model->getAttributeLabel('contractual')}", ['class' => '']) |
| 78 | - ->checkbox([ 'uncheck' => NULL ], false) ?> | 78 | + ->checkbox([ ], false) ?> |
| 79 | <?= $form->field($model, 'payment', [ 'template' => "{input}\n{error}" ]) | 79 | <?= $form->field($model, 'payment', [ 'template' => "{input}\n{error}" ]) |
| 80 | ->checkboxList($payments, [ | 80 | ->checkboxList($payments, [ |
| 81 | 'item' => function($index, $label, $name, $checked, $value) { | 81 | 'item' => function($index, $label, $name, $checked, $value) { |
frontend/views/tender/view.php
| @@ -47,7 +47,7 @@ $this->title = 'My Yii Application'; | @@ -47,7 +47,7 @@ $this->title = 'My Yii Application'; | ||
| 47 | <div class="section-box"> | 47 | <div class="section-box"> |
| 48 | <div class="cabinet-message-read-autor-wr style"> | 48 | <div class="cabinet-message-read-autor-wr style"> |
| 49 | <div class="cabinet-message-read-foto-wr"> | 49 | <div class="cabinet-message-read-foto-wr"> |
| 50 | - <div class="cabinet-message-read-foto"><img src="<?= $model->user->userInfo->image ?>" alt=""/></div> | 50 | + <div class="cabinet-message-read-foto"><img src="<?= ($model->user->userInfo->image)?:'' ?>" alt=""/></div> |
| 51 | </div> | 51 | </div> |
| 52 | <div class="cab-mes-read-cont"> | 52 | <div class="cab-mes-read-cont"> |
| 53 | <div class="cab-mes-read-cont-title"><?= $model->user->owner->name ?></div> | 53 | <div class="cab-mes-read-cont-title"><?= $model->user->owner->name ?></div> |