Commit 239b32497b54befa478b6560f0e3da48fa7a0ad1
1 parent
42648c98
test
Showing
12 changed files
with
309 additions
and
308 deletions
Show diff stats
common/models/User.php
common/widgets/views/phone_field.php
1 | 1 | <?php |
2 | 2 | use yii\helpers\Html; |
3 | + use yii\validators\RegularExpressionValidator; | |
3 | 4 | use yii\widgets\MaskedInput; |
4 | 5 | |
5 | 6 | ?> |
... | ... | @@ -8,24 +9,25 @@ |
8 | 9 | <div class="field_list"> |
9 | 10 | |
10 | 11 | |
11 | - <?php $t = 0; | |
12 | + <?php $t = 0; | |
12 | 13 | |
13 | - $label = 0; // add this var | |
14 | + $label = 0; // add this var | |
14 | 15 | |
15 | - for($i=1; $i <= count($model); $i++): | |
16 | - $row = $i; | |
17 | - | |
18 | - ?> | |
19 | - | |
20 | - <?= Html::beginTag('div',['class'=>'form-group','id'=>isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ])?> | |
21 | - <div class="input-blocks"> | |
22 | - <label for="cont-phone-<?= ++$label ?>">Телефон</label> | |
23 | - <input id="cont-phone-<?= $label ?>" type="tel" pattern="^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$" placeholder="+xx(xxx)xxx-xx-xx" class="form-control custom-input-2" value="<?= isset($model[$t]['value']) ? $model[$t]['value'] : '' ?>" name="Fields[phone][<?=$row?>][0][phone]" /> | |
24 | - </div> | |
25 | - <span data-id="<?= isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ?>" title="<?= Yii::t('app','add') ?>" class="glyphicon glyphicon-trash delete-field-item"></span> | |
26 | - <?= Html::endTag('div')?> | |
27 | - <?php $i = ++ $t; ?> | |
28 | - <?php endfor; ?> | |
16 | + for($i = 1; $i <= count($model); $i++): | |
17 | + $row = $i; | |
18 | + ?> | |
19 | + <?= Html::beginTag('div', [ | |
20 | + 'class' => 'form-group', | |
21 | + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, | |
22 | + ]) ?> | |
23 | + <div class="input-blocks"> | |
24 | + <label for="cont-phone-<?= ++$label ?>">Телефон</label> | |
25 | + <input id="cont-phone-<?= $label ?>" type="tel" pattern="^\+?(?:\d{0,3})?[\(\s]?\d{0,5}[\)\s]?\d{3}[-\s]?\d{2}[-\s]?\d{2}$" placeholder="+xx(xxx)xxx-xx-xx" class="form-control custom-input-2" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[phone][<?= $row ?>][0][phone]"/> | |
26 | + </div> | |
27 | + <span data-id="<?= isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0 ?>" title="<?= Yii::t('app', 'add') ?>" class="glyphicon glyphicon-trash delete-field-item"></span> | |
28 | + <?= Html::endTag('div') ?> | |
29 | + <?php $i = ++$t; ?> | |
30 | + <?php endfor; ?> | |
29 | 31 | |
30 | 32 | </div> |
31 | 33 | <p class="btn btn-success add_field_<?= $this->context->id ?>">Добавить еще</p> |
... | ... | @@ -34,23 +36,22 @@ |
34 | 36 | <script> |
35 | 37 | var start_i_<?=$this->context->id?> = <?=$i?>; |
36 | 38 | var start_label_<?=$this->context->id?> = <?=$label?>; // add this var |
37 | - $( document ).ready(function(){ | |
38 | - $('.add_field_<?=$this->context->id?>').click(function(){ | |
39 | - var block = $ (this) | |
40 | - .siblings('.field_list'); | |
41 | - var block_id = $(this).parent('fieldset'); | |
42 | - var sub_block = '<div class="form-group" >'+ | |
43 | - '<div class="input-blocks">'+ | |
44 | - '<label for="cont-phone-' + ++start_label_<?=$this->context->id?> +'">Телефон</label>'+ | |
45 | - '<input id="cont-phone-' + start_label_<?=$this->context->id?> +'" type="tel" pattern="^\\+?(?:\\d{0,3})?[\\(\\s]?\\d{0,5}[\\)\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" placeholder="+xx(xxx)xxx-xx-xx" class="form-control custom-input-2" value="" name="Fields[phone]['+ start_i_<?=$this->context->id?>++ +'][0][phone]" />'+ | |
46 | - '</div>'+ | |
47 | - '<span class="glyphicon glyphicon-trash delete-field-item custom-remove-ico"></span>'+ | |
48 | - '<div>'; | |
49 | -// console.log(block); | |
50 | - block.append(sub_block); | |
51 | - | |
52 | - }); | |
53 | - }); | |
39 | + $(document).ready( | |
40 | + function() | |
41 | + { | |
42 | + $('.add_field_<?=$this->context->id?>').click( | |
43 | + function() | |
44 | + { | |
45 | + var block = $(this) | |
46 | + .siblings('.field_list'); | |
47 | + var block_id = $(this).parent('fieldset'); | |
48 | + var sub_block = '<div class="form-group" >' + '<div class="input-blocks">' + '<label for="cont-phone-' + ++start_label_<?=$this->context->id?> + '">Телефон</label>' + '<input id="cont-phone-' + start_label_<?=$this->context->id?> + '" type="tel" pattern="^\\+?(?:\\d{0,3})?[\\(\\s]?\\d{0,5}[\\)\\s]?\\d{3}[-\\s]?\\d{2}[-\\s]?\\d{2}$" placeholder="+xx(xxx)xxx-xx-xx" class="form-control custom-input-2" value="" name="Fields[phone][' + start_i_<?=$this->context->id?>++ + '][0][phone]" />' + '</div>' + '<span class="glyphicon glyphicon-trash delete-field-item custom-remove-ico"></span>' + '<div>'; | |
49 | + block.append(sub_block); | |
50 | + | |
51 | + } | |
52 | + ); | |
53 | + } | |
54 | + ); | |
54 | 55 | </script> |
55 | 56 | |
56 | 57 | ... | ... |
frontend/controllers/AccountsController.php
... | ... | @@ -1041,7 +1041,7 @@ |
1041 | 1041 | $user->new_password = $post[ 'new_password' ]; |
1042 | 1042 | } |
1043 | 1043 | if(empty( $post[ 'old_password' ] )) { |
1044 | - $user->addError('old_password', 'Введите новый пароль'); | |
1044 | + $user->addError('old_password', 'Введите старый пароль'); | |
1045 | 1045 | } else { |
1046 | 1046 | $user->old_password = $post[ 'old_password' ]; |
1047 | 1047 | } | ... | ... |
frontend/controllers/CompanyController.php
... | ... | @@ -16,6 +16,7 @@ |
16 | 16 | use yii\data\ArrayDataProvider; |
17 | 17 | use yii\data\Pagination; |
18 | 18 | use yii\data\Sort; |
19 | + use yii\db\ActiveQuery; | |
19 | 20 | use yii\helpers\ArrayHelper; |
20 | 21 | use yii\web\BadRequestHttpException; |
21 | 22 | use yii\web\Controller; |
... | ... | @@ -178,7 +179,7 @@ |
178 | 179 | 'pagination' => [ |
179 | 180 | 'pageSize' => 9, |
180 | 181 | ], |
181 | - 'sort' => new Sort([ | |
182 | + 'sort' => new Sort([ | |
182 | 183 | 'defaultOrder' => [ |
183 | 184 | 'portfolio_id' => SORT_DESC, |
184 | 185 | ], |
... | ... | @@ -248,15 +249,33 @@ |
248 | 249 | $user = User::findOne($company_id); |
249 | 250 | $portfolio = $user->getPortfolios() |
250 | 251 | ->where([ 'portfolio_id' => $portfolio_id ]) |
251 | - ->with('portfolioUsers') | |
252 | + ->with([ | |
253 | + 'portfolioUsers' => function($query) { | |
254 | + /** | |
255 | + * @var ActiveQuery $query | |
256 | + */ | |
257 | + $query->andWhere([ 'status' => 1 ]); | |
258 | + }, | |
259 | + ]) | |
252 | 260 | ->with('portfolioUsers.gallery') |
253 | 261 | ->one(); |
254 | 262 | if(!empty( $portfolio_user )) { |
255 | 263 | $portfolio_user = PortfolioUser::find() |
256 | - ->where([ 'portfolio_user_id' => $portfolio_user ]) | |
264 | + ->where([ | |
265 | + 'portfolio_user_id' => $portfolio_user, | |
266 | + 'status' => 1, | |
267 | + ]) | |
257 | 268 | ->with('gallery') |
258 | 269 | ->with('user') |
259 | 270 | ->one(); |
271 | + if(empty( $portfolio_user )) { | |
272 | + $this->redirect([ | |
273 | + 'portfolio-view', | |
274 | + 'performer_id' => $company_id, | |
275 | + 'portfolio_id' => $portfolio_id, | |
276 | + 'type' => $type, | |
277 | + ]); | |
278 | + } | |
260 | 279 | } else { |
261 | 280 | $portfolio->updateCounters([ 'view_count' => 1 ]); |
262 | 281 | } | ... | ... |
frontend/controllers/PerformerController.php
... | ... | @@ -12,6 +12,7 @@ |
12 | 12 | use yii\data\ArrayDataProvider; |
13 | 13 | use yii\data\Pagination; |
14 | 14 | use yii\data\Sort; |
15 | + use yii\db\ActiveQuery; | |
15 | 16 | use yii\helpers\ArrayHelper; |
16 | 17 | use yii\web\BadRequestHttpException; |
17 | 18 | use yii\web\Controller; |
... | ... | @@ -182,15 +183,33 @@ |
182 | 183 | $user = User::findOne($performer_id); |
183 | 184 | $portfolio = $user->getPortfolios() |
184 | 185 | ->where([ 'portfolio_id' => $portfolio_id ]) |
185 | - ->with('portfolioUsers') | |
186 | + ->with([ | |
187 | + 'portfolioUsers' => function($query) { | |
188 | + /** | |
189 | + * @var ActiveQuery $query | |
190 | + */ | |
191 | + $query->andWhere([ 'status' => 1 ]); | |
192 | + }, | |
193 | + ]) | |
186 | 194 | ->with('portfolioUsers.gallery') |
187 | 195 | ->one(); |
188 | 196 | if(!empty( $portfolio_user )) { |
189 | 197 | $portfolio_user = PortfolioUser::find() |
190 | - ->where([ 'portfolio_user_id' => $portfolio_user ]) | |
198 | + ->where([ | |
199 | + 'portfolio_user_id' => $portfolio_user, | |
200 | + 'status' => 1, | |
201 | + ]) | |
191 | 202 | ->with('gallery') |
192 | 203 | ->with('user') |
193 | 204 | ->one(); |
205 | + if(empty( $portfolio_user )) { | |
206 | + $this->redirect([ | |
207 | + 'portfolio-view', | |
208 | + 'performer_id' => $performer_id, | |
209 | + 'portfolio_id' => $portfolio_id, | |
210 | + 'type' => $type, | |
211 | + ]); | |
212 | + } | |
194 | 213 | } else { |
195 | 214 | $portfolio->updateCounters([ 'view_count' => 1 ]); |
196 | 215 | } | ... | ... |
frontend/messages/ru/app.php
frontend/views/accounts/_portfolio_form.php
... | ... | @@ -288,9 +288,9 @@ $form->end(); |
288 | 288 | $.post( |
289 | 289 | "/accounts/gallery-cover", {gallery_id : gallery_id}, function(data) |
290 | 290 | { |
291 | - if(!($('#cover_old_img').val().length)) | |
291 | + if(!($('#cover_old_img').val().length) && !($('#portfolio-cover').val().length)) | |
292 | 292 | { |
293 | - $('#cover_picture_link').val(data); | |
293 | + $('#portfolio-cover').val(data); | |
294 | 294 | var newimg = document.createElement("img"); |
295 | 295 | newimg.setAttribute("src", data); |
296 | 296 | ... | ... |
frontend/views/accounts/projects.php
... | ... | @@ -66,7 +66,7 @@ |
66 | 66 | [ |
67 | 67 | 'attribute' => 'budget', |
68 | 68 | 'filter' => Html::activeInput('text', $searchModel, 'budget_approx', ['class'=>'form-control']), |
69 | - 'value' => function($model, $key, $index, $column) { | |
69 | + 'content' => function($model, $key, $index, $column) { | |
70 | 70 | /** |
71 | 71 | * @var Project $model |
72 | 72 | */ | ... | ... |
frontend/views/layouts/admin.php
... | ... | @@ -59,7 +59,7 @@ |
59 | 59 | 'active' => preg_match('/^blog.*$/', $this->context->action->id) ? true : false, |
60 | 60 | ], |
61 | 61 | [ |
62 | - 'label' => 'Галерея Изображения', | |
62 | + 'label' => 'Галерея Изображений', | |
63 | 63 | 'url' => [ 'accounts/gallery' ], |
64 | 64 | 'active' => preg_match('/^gallery(?!-video).*$/', $this->context->action->id) ? true : false, |
65 | 65 | ], | ... | ... |
frontend/views/layouts/main.php
1 | 1 | <?php |
2 | 2 | |
3 | -/* @var $this \yii\web\View */ | |
4 | -/* @var $content string */ | |
3 | + /* @var $this \yii\web\View */ | |
4 | + /* @var $content string */ | |
5 | 5 | |
6 | -use yii\helpers\Html; | |
7 | -use yii\widgets\Menu; | |
8 | -use frontend\assets\AppAsset; | |
9 | -AppAsset::register($this); | |
6 | + use yii\helpers\Html; | |
7 | + use yii\widgets\Menu; | |
8 | + use frontend\assets\AppAsset; | |
9 | + | |
10 | + AppAsset::register($this); | |
10 | 11 | ?> |
11 | 12 | |
12 | 13 | <?php $this->beginPage() ?> |
... | ... | @@ -18,8 +19,6 @@ AppAsset::register($this); |
18 | 19 | <head> |
19 | 20 | |
20 | 21 | |
21 | - | |
22 | - | |
23 | 22 | <meta charset="<?= Yii::$app->charset ?>"> |
24 | 23 | |
25 | 24 | <?= Html::csrfMetaTags() ?> |
... | ... | @@ -39,32 +38,36 @@ AppAsset::register($this); |
39 | 38 | <a href="/"><img class="logo" src="/images/logo.png" width="100" height="68" alt=""/></a> |
40 | 39 | <div class="header-proektant-slogan">Международная Федерация Проектантов</div> |
41 | 40 | <ul class="header-contacts-menu"> |
42 | - <li><span><img src="/images/icon_question_01.png" alt=""/></span><?= Html::a('Задать вопрос','', ['class' =>'contactsLinkModalFirst'])?></li> | |
43 | - <li><span><img src="/images/icon_help_01.png" alt=""/></span><?= Html::a('Помощь',['/site/help'], ['class' =>'contactsLinkModal'])?></li> | |
41 | + <li> | |
42 | + <span><img src="/images/icon_question_01.png" alt=""/></span><?= Html::a('Задать вопрос', '', [ 'class' => 'contactsLinkModalFirst' ]) ?> | |
43 | + </li> | |
44 | + <li> | |
45 | + <span><img src="/images/icon_help_01.png" alt=""/></span><?= Html::a('Помощь', [ '/site/help' ], [ 'class' => 'contactsLinkModal' ]) ?> | |
46 | + </li> | |
44 | 47 | </ul> |
45 | 48 | <div class="header-cabinet-wr"> |
46 | 49 | <?php |
47 | - if (Yii::$app->user->isGuest): ?> | |
48 | - <div class="header-cabinet-foto"> | |
50 | + if(Yii::$app->user->isGuest): ?> | |
51 | + <div class="header-cabinet-foto"> | |
49 | 52 | |
50 | - </div> | |
51 | - <div class="header-cabinet-profile not-login">Профиль</div> | |
52 | - <div> | |
53 | - <?= Html::a('Вход',['/site/login'], ['class'=>'loginLinkModal']) ?> | |
54 | - <?= Html::a('Регистрация',['/site/registration']) ?> | |
55 | - </div> | |
53 | + </div> | |
54 | + <div class="header-cabinet-profile not-login">Профиль</div> | |
55 | + <div> | |
56 | + <?= Html::a('Вход', [ '/site/login' ], [ 'class' => 'loginLinkModal' ]) ?> | |
57 | + <?= Html::a('Регистрация', [ '/site/registration' ]) ?> | |
58 | + </div> | |
56 | 59 | |
57 | - <?php else : ?> | |
58 | - <div class="header-cabinet-foto"> | |
59 | - <?php | |
60 | - if(!empty(\Yii::$app->user->identity->userInfo->image)) { | |
61 | - echo Html::img(Yii::$app->user->identity->minImg(Yii::$app->user->identity->userInfo->image,48,48)); | |
62 | - } | |
63 | - ?> | |
64 | - </div> | |
65 | - <div class="header-cabinet-profile">Профиль</div> | |
66 | - <?= Html::a(Yii::$app->user->identity->email,['/accounts']) ?> | |
67 | - <?php endif; ?> | |
60 | + <?php else : ?> | |
61 | + <div class="header-cabinet-foto"> | |
62 | + <?php | |
63 | + if(!empty( \Yii::$app->user->identity->userInfo->image )) { | |
64 | + echo Html::img(Yii::$app->user->identity->minImg(Yii::$app->user->identity->userInfo->image, 48, 48)); | |
65 | + } | |
66 | + ?> | |
67 | + </div> | |
68 | + <div class="header-cabinet-profile">Профиль</div> | |
69 | + <?= Html::a(Yii::$app->user->identity->email, [ '/accounts' ]) ?> | |
70 | + <?php endif; ?> | |
68 | 71 | |
69 | 72 | </div> |
70 | 73 | </div> |
... | ... | @@ -82,18 +85,18 @@ AppAsset::register($this); |
82 | 85 | |
83 | 86 | <li> |
84 | 87 | <?php |
85 | - if(\Yii::$app->user->isGuest) { | |
86 | - echo Html::a('Войти в профиль', ['site/login']); | |
87 | - } else { | |
88 | - echo Html::a('Редактировать профиль', ['accounts/']); | |
89 | - } | |
88 | + if(\Yii::$app->user->isGuest) { | |
89 | + echo Html::a('Войти в профиль', [ 'site/login' ]); | |
90 | + } else { | |
91 | + echo Html::a('Редактировать профиль', [ 'accounts/' ]); | |
92 | + } | |
90 | 93 | ?> |
91 | 94 | </li> |
92 | 95 | </ul> |
93 | 96 | <ul> |
94 | - <li><?= Html::a(Yii::t('app', 'Project list'), ['search/project'])?></li> | |
95 | - <li><?= Html::a('Список вакансий', ['search/vacancy'])?></li> | |
96 | - <li><?= Html::a('Список заказчиков', ['search/customer'])?></li> | |
97 | + <li><?= Html::a(Yii::t('app', 'Project list'), [ 'search/project' ]) ?></li> | |
98 | + <li><?= Html::a('Список вакансий', [ 'search/vacancy' ]) ?></li> | |
99 | + <li><?= Html::a('Список заказчиков', [ 'search/customer' ]) ?></li> | |
97 | 100 | </ul> |
98 | 101 | </div> |
99 | 102 | </li> |
... | ... | @@ -102,13 +105,19 @@ AppAsset::register($this); |
102 | 105 | <div class="main-menu-hover"> |
103 | 106 | <ul> |
104 | 107 | |
105 | - <li><?= Html::a(Yii::t('app', 'Add project'), ['accounts/projects-create'])?></li> | |
106 | - <li><?= Html::a('Разместить вакансию', ['accounts/vacancy'])?></li> | |
108 | + <li><?= Html::a(Yii::t('app', 'Add project'), [ 'accounts/projects-create' ]) ?></li> | |
109 | + <li><?= Html::a('Разместить вакансию', [ 'accounts/vacancy' ]) ?></li> | |
107 | 110 | </ul> |
108 | 111 | <ul> |
109 | 112 | |
110 | - <li><?= Html::a('Список проектантов', ['search/performer','SearchPerformerForm[type]'=>'1'])?></li> | |
111 | - <li><?= Html::a('Список проектных компаний', ['search/performer','SearchPerformerForm[type]'=>'2'])?></li> | |
113 | + <li><?= Html::a('Список проектантов', [ | |
114 | + 'search/performer', | |
115 | + 'SearchPerformerForm[type]' => '1', | |
116 | + ]) ?></li> | |
117 | + <li><?= Html::a('Список проектных компаний', [ | |
118 | + 'search/performer', | |
119 | + 'SearchPerformerForm[type]' => '2', | |
120 | + ]) ?></li> | |
112 | 121 | </ul> |
113 | 122 | </div> |
114 | 123 | </li> |
... | ... | @@ -117,14 +126,14 @@ AppAsset::register($this); |
117 | 126 | <div class="main-menu-hover"> |
118 | 127 | <ul> |
119 | 128 | |
120 | - <li><?= Html::a(Yii::t('app', 'Add project'), ['accounts/projects-create'])?></li> | |
121 | - <li><?= Html::a('Разместить вакансию', ['accounts/vacancy-create'])?></li> | |
122 | - <li><?= Html::a('Редактировать портфолио', ['accounts/portfolio'])?></li> | |
129 | + <li><?= Html::a(Yii::t('app', 'Add project'), [ 'accounts/projects-create' ]) ?></li> | |
130 | + <li><?= Html::a('Разместить вакансию', [ 'accounts/vacancy-create' ]) ?></li> | |
131 | + <li><?= Html::a('Редактировать портфолио', [ 'accounts/portfolio' ]) ?></li> | |
123 | 132 | </ul> |
124 | 133 | <ul> |
125 | - <li><?= Html::a('Список проектантов', ['search/performer'])?></li> | |
126 | - <li><?= Html::a(Yii::t('app', 'Project list'), ['search/project'])?></li> | |
127 | - <li><?= Html::a('Список заказчиков', ['search/customer'])?></li> | |
134 | + <li><?= Html::a('Список проектантов', [ 'search/performer' ]) ?></li> | |
135 | + <li><?= Html::a(Yii::t('app', 'Project list'), [ 'search/project' ]) ?></li> | |
136 | + <li><?= Html::a('Список заказчиков', [ 'search/customer' ]) ?></li> | |
128 | 137 | </ul> |
129 | 138 | </div> |
130 | 139 | </li> |
... | ... | @@ -133,12 +142,12 @@ AppAsset::register($this); |
133 | 142 | <div class="search-main-menu"> |
134 | 143 | <form action=""> |
135 | 144 | <input value="" name="" type="search"/> |
136 | - <input type="hidden" value="1" name="" /> | |
145 | + <input type="hidden" value="1" name=""/> | |
137 | 146 | <button type="submit" value=""></button> |
138 | 147 | <div class="search-list"> |
139 | - <span><?=Yii::t('app', 'Projects')?></span> | |
148 | + <span><?= Yii::t('app', 'Projects') ?></span> | |
140 | 149 | <ul class="search-ul"> |
141 | - <li><?=Yii::t('app', 'Projects')?></li> | |
150 | + <li><?= Yii::t('app', 'Projects') ?></li> | |
142 | 151 | <li>Исполнители</li> |
143 | 152 | <li>Заказчики</li> |
144 | 153 | </ul> |
... | ... | @@ -148,25 +157,25 @@ AppAsset::register($this); |
148 | 157 | <?php |
149 | 158 | if(!\Yii::$app->user->isGuest) { |
150 | 159 | echo Menu::widget([ |
151 | - 'options' => [ | |
152 | - 'tag' => 'div', | |
160 | + 'options' => [ | |
161 | + 'tag' => 'div', | |
153 | 162 | 'class' => 'main-menu-icons-wr', |
154 | 163 | ], |
155 | 164 | 'itemOptions' => [ |
156 | 165 | 'tag' => false, |
157 | 166 | ], |
158 | - 'items' => [ | |
167 | + 'items' => [ | |
159 | 168 | [ |
160 | - 'url' => ['/projects'], | |
161 | - 'template' => '<a href="{url}" class="main-menu-icons-home"><span>'.count(\Yii::$app->user->identity->commentProjects).'</span></a>', | |
169 | + 'url' => [ '/projects' ], | |
170 | + 'template' => '<a href="{url}" class="main-menu-icons-home"><span>' . count(\Yii::$app->user->identity->commentProjects) . '</span></a>', | |
162 | 171 | ], |
163 | 172 | [ |
164 | - 'url' => ['chat/list'], | |
165 | - 'template' => '<a href="{url}" class="main-menu-icons-edit"><span>'.\Yii::$app->user->identity->chatCount.'</span></a>', | |
173 | + 'url' => [ 'chat/list' ], | |
174 | + 'template' => '<a href="{url}" class="main-menu-icons-edit"><span>' . \Yii::$app->user->identity->chatCount . '</span></a>', | |
166 | 175 | ], |
167 | 176 | [ |
168 | - 'url' => ['/bookmarks'], | |
169 | - 'template' => "<a href='{url}' class='main-menu-icons-copy'><span>".count(\Yii::$app->user->identity->bookmarks)."</span></a>", | |
177 | + 'url' => [ '/bookmarks' ], | |
178 | + 'template' => "<a href='{url}' class='main-menu-icons-copy'><span>" . count(\Yii::$app->user->identity->bookmarks) . "</span></a>", | |
170 | 179 | ], |
171 | 180 | ], |
172 | 181 | ]); |
... | ... | @@ -189,70 +198,78 @@ AppAsset::register($this); |
189 | 198 | <div class="footer-all-wr"> |
190 | 199 | <div class="footer-menu-wrapper first-footer-menu"> |
191 | 200 | <?php |
201 | + $items = [ | |
202 | + [ | |
203 | + 'label' => Yii::t('app', 'Projects'), | |
204 | + 'url' => [ 'search/project' ], | |
205 | + ], | |
206 | + [ | |
207 | + 'label' => 'Вакансии', | |
208 | + 'url' => [ 'search/vacancy' ], | |
209 | + ], | |
210 | + [ | |
211 | + 'label' => 'Рейтинг проектантов', | |
212 | + 'url' => [ 'search/performer' ], | |
213 | + ], | |
214 | + ]; | |
215 | + if(empty( \Yii::$app->user->id )) { | |
216 | + array_unshift($items, [ | |
217 | + 'label' => 'Регистрация проектанта', | |
218 | + 'url' => [ '/site/registration' ], | |
219 | + ]); | |
220 | + } | |
192 | 221 | echo Menu::widget([ |
193 | 222 | 'options' => [ |
194 | 223 | 'class' => 'footer-menu', |
195 | 224 | ], |
196 | - 'items' => [ | |
197 | - [ | |
198 | - 'label' => 'Регистрация проектанта', | |
199 | - 'url' => ['site/signup'], | |
200 | - ], | |
201 | - [ | |
202 | - 'label' => Yii::t('app', 'Projects'), | |
203 | - 'url' => ['search/project'], | |
204 | - ], | |
205 | - [ | |
206 | - 'label' => 'Вакансии', | |
207 | - 'url' => ['search/vacancy'], | |
208 | - ], | |
209 | - [ | |
210 | - 'label' => 'Рейтинг проектантов', | |
211 | - 'url' => ['search/performer'], | |
212 | - ], | |
213 | - ] | |
225 | + 'items' => $items | |
214 | 226 | ]); |
227 | + unset($items); | |
215 | 228 | ?> |
216 | 229 | </div> |
217 | 230 | |
218 | 231 | <div class="footer-menu-wrapper second-footer-menu"> |
219 | 232 | <?php |
233 | + $items = [ | |
234 | + [ | |
235 | + 'label' => 'Рейтинг компаний', | |
236 | + 'url' => [ 'search/performer', 'SearchPerformerForm[type]' => 2 ], | |
237 | + ] | |
238 | + ]; | |
239 | + if(empty( \Yii::$app->user->id )) { | |
240 | + array_unshift($items, [ | |
241 | + 'label' => 'Регистрация заказчика', | |
242 | + 'url' => [ '/site/registration' ], | |
243 | + ]); | |
244 | + } | |
220 | 245 | echo Menu::widget([ |
221 | 246 | 'options' => [ |
222 | 247 | 'class' => 'footer-menu', |
223 | 248 | ], |
224 | - 'items' => [ | |
225 | - [ | |
226 | - 'label' => 'Регистрация заказчика', | |
227 | - 'url' => ['site/signup'], | |
228 | - ], | |
229 | - [ | |
230 | - 'label' => 'Рейтинг компаний', | |
231 | - 'url' => ['search/index'], | |
232 | - ], | |
233 | - ] | |
249 | + 'items' => $items, | |
234 | 250 | ]); |
251 | + unset($items); | |
235 | 252 | ?> |
236 | 253 | <div class="footer-menu-project"> |
237 | 254 | <?php |
238 | 255 | echo Menu::widget([ |
239 | - 'options' => [ | |
240 | - 'tag' => 'div', | |
256 | + 'options' => [ | |
257 | + 'tag' => 'div', | |
241 | 258 | 'class' => 'footer-menu-project-ico', |
242 | 259 | ], |
243 | 260 | 'encodeLabels' => false, |
244 | - 'itemOptions' => [ | |
261 | + 'itemOptions' => [ | |
245 | 262 | 'tag' => false, |
246 | 263 | ], |
247 | 264 | 'linkTemplate' => '<a target="_blank" href="{url}">{label}</a>', |
248 | - 'items' => [ | |
265 | + 'items' => [ | |
249 | 266 | [ |
250 | 267 | 'label' => "<img src='/images/soc-ico-1.png' alt=''/>", |
251 | - 'url' => 'http://rss.com', | |
268 | + 'url' => 'http://rss.com', | |
252 | 269 | ], |
253 | 270 | [ |
254 | 271 | 'label' => "<img src='/images/soc-ico-2.png' alt=''/>", |
255 | - 'url' => 'http://twitter.com', | |
272 | + 'url' => 'http://twitter.com', | |
256 | 273 | ], |
257 | 274 | ], |
258 | 275 | ]); |
... | ... | @@ -263,49 +280,53 @@ AppAsset::register($this); |
263 | 280 | |
264 | 281 | <div class="footer-menu-wrapper third-footer-menu"> |
265 | 282 | <?php |
266 | - echo Menu::widget([ | |
267 | - 'options' => [ | |
268 | - 'class' => 'footer-menu', | |
269 | - ], | |
270 | - 'items' => [ | |
271 | - [ | |
272 | - 'label' => 'Регистрация компаний', | |
273 | - 'url' => ['site/signup'], | |
274 | - ], | |
283 | + $items = [ | |
275 | 284 | [ |
276 | 285 | 'label' => 'Рейтинг компаний', |
277 | - 'url' => ['search/company'], | |
286 | + 'url' => [ 'search/performer', 'SearchPerformerForm[type]' => 2 ], | |
278 | 287 | ], |
279 | - ] | |
280 | - ]); | |
281 | - ?> | |
282 | - <div class="footer-menu-project-two"> | |
283 | - <?php | |
288 | + ]; | |
289 | + if(empty( \Yii::$app->user->id )) { | |
290 | + array_unshift($items, [ | |
291 | + 'label' => 'Регистрация компаний', | |
292 | + 'url' => [ '/site/registration' ], | |
293 | + ]); | |
294 | + } | |
284 | 295 | echo Menu::widget([ |
285 | 296 | 'options' => [ |
286 | - 'tag' => 'div', | |
287 | - 'class' => 'footer-menu-project-ico', | |
288 | - ], | |
289 | - 'encodeLabels' => false, | |
290 | - 'itemOptions' => [ | |
291 | - 'tag' => false, | |
297 | + 'class' => 'footer-menu', | |
292 | 298 | ], |
293 | - 'linkTemplate' => '<a target="_blank" href="{url}">{label}</a>', | |
294 | - 'items' => [ | |
295 | - [ | |
296 | - 'label' => "<img src='/images/soc-ico-3.png' alt=''/>", | |
297 | - 'url' => 'http://fb.com', | |
299 | + 'items' => $items | |
300 | + ]); | |
301 | + unset($items); | |
302 | + ?> | |
303 | + <div class="footer-menu-project-two"> | |
304 | + <?php | |
305 | + echo Menu::widget([ | |
306 | + 'options' => [ | |
307 | + 'tag' => 'div', | |
308 | + 'class' => 'footer-menu-project-ico', | |
298 | 309 | ], |
299 | - [ | |
300 | - 'label' => "<img src='/images/soc-ico-4.png' alt=''/>", | |
301 | - 'url' => 'http://vk.com', | |
310 | + 'encodeLabels' => false, | |
311 | + 'itemOptions' => [ | |
312 | + 'tag' => false, | |
302 | 313 | ], |
303 | - [ | |
304 | - 'label' => "<img src='/images/soc-ico-5.png' alt=''/>", | |
305 | - 'url' => 'http://plus.google.com', | |
314 | + 'linkTemplate' => '<a target="_blank" href="{url}">{label}</a>', | |
315 | + 'items' => [ | |
316 | + [ | |
317 | + 'label' => "<img src='/images/soc-ico-3.png' alt=''/>", | |
318 | + 'url' => 'http://fb.com', | |
319 | + ], | |
320 | + [ | |
321 | + 'label' => "<img src='/images/soc-ico-4.png' alt=''/>", | |
322 | + 'url' => 'http://vk.com', | |
323 | + ], | |
324 | + [ | |
325 | + 'label' => "<img src='/images/soc-ico-5.png' alt=''/>", | |
326 | + 'url' => 'http://plus.google.com', | |
327 | + ], | |
306 | 328 | ], |
307 | - ], | |
308 | - ]); | |
329 | + ]); | |
309 | 330 | ?> |
310 | 331 | <div class="footer-menu-project-ico-txt">новости сервера</div> |
311 | 332 | </div> |
... | ... | @@ -313,41 +334,41 @@ AppAsset::register($this); |
313 | 334 | |
314 | 335 | <div class="footer-menu-wrapper last-footer-menu"> |
315 | 336 | <?php |
316 | - echo Menu::widget([ | |
317 | - 'options' => [ | |
318 | - 'class' => 'footer-menu', | |
319 | - ], | |
320 | - 'items' => [ | |
321 | - [ | |
322 | - 'label' => 'Русский', | |
323 | - 'url' => [' '] | |
324 | - ], | |
325 | - [ | |
326 | - 'label' => 'Конфиденциальность', | |
327 | - 'url' => [' '] | |
328 | - ], | |
329 | - [ | |
330 | - 'label' => 'Условия использования', | |
331 | - 'url' => [' '] | |
332 | - ], | |
333 | - [ | |
334 | - 'label' => 'Файлы cookie', | |
335 | - 'url' => [' '] | |
336 | - ], | |
337 | - [ | |
338 | - 'label' => 'Реклама', | |
339 | - 'url' => [' '] | |
340 | - ], | |
341 | - [ | |
342 | - 'label' => 'Ad Choices', | |
343 | - 'url' => [' '] | |
337 | + echo Menu::widget([ | |
338 | + 'options' => [ | |
339 | + 'class' => 'footer-menu', | |
344 | 340 | ], |
345 | - [ | |
346 | - 'label' => 'Еще', | |
347 | - 'url' => [' '] | |
341 | + 'items' => [ | |
342 | + [ | |
343 | + 'label' => 'Русский', | |
344 | + 'url' => [ ' ' ], | |
345 | + ], | |
346 | + [ | |
347 | + 'label' => 'Конфиденциальность', | |
348 | + 'url' => [ ' ' ], | |
349 | + ], | |
350 | + [ | |
351 | + 'label' => 'Условия использования', | |
352 | + 'url' => [ ' ' ], | |
353 | + ], | |
354 | + [ | |
355 | + 'label' => 'Файлы cookie', | |
356 | + 'url' => [ ' ' ], | |
357 | + ], | |
358 | + [ | |
359 | + 'label' => 'Реклама', | |
360 | + 'url' => [ ' ' ], | |
361 | + ], | |
362 | + [ | |
363 | + 'label' => 'Ad Choices', | |
364 | + 'url' => [ ' ' ], | |
365 | + ], | |
366 | + [ | |
367 | + 'label' => 'Еще', | |
368 | + 'url' => [ ' ' ], | |
369 | + ], | |
348 | 370 | ], |
349 | - ] | |
350 | - ]); | |
371 | + ]); | |
351 | 372 | ?> |
352 | 373 | </div> |
353 | 374 | |
... | ... | @@ -365,7 +386,7 @@ AppAsset::register($this); |
365 | 386 | <div class="artweb-wr"> |
366 | 387 | <a target="_blank" href="http://artweb.ua/">Создание сайтов</a> |
367 | 388 | <div class="artweb-img"> |
368 | - <a target="_blank" href="http://artweb.ua/"><img src="/images/artweb.png" /></a> | |
389 | + <a target="_blank" href="http://artweb.ua/"><img src="/images/artweb.png"/></a> | |
369 | 390 | </div> |
370 | 391 | </div> |
371 | 392 | </div> | ... | ... |
frontend/views/performer/portfolio-view.php
... | ... | @@ -171,8 +171,10 @@ |
171 | 171 | <div class="new-portf-slider-wr style"> |
172 | 172 | <p>Участники проекта:</p> |
173 | 173 | <?php |
174 | - foreach($portfolio->portfolioUsers as $portfolioUser) { | |
175 | - $gallery = $portfolio->ShowGallery($portfolioUser->gallery->photo); | |
174 | + foreach($portfolio->getPortfolioUsers()->where(['status' => 1])->with('gallery')->all() as $portfolioUser) { | |
175 | + if(!empty($portfolioUser->gallery)) { | |
176 | + $gallery = $portfolio->ShowGallery($portfolioUser->gallery->photo); | |
177 | + } | |
176 | 178 | ?> |
177 | 179 | <a href="<?= Url::to([ |
178 | 180 | 'performer/portfolio-view', | ... | ... |
frontend/views/search/project.php
... | ... | @@ -74,7 +74,7 @@ |
74 | 74 | 'template' => "{input}\n{label}\n{hint}\n{error}", |
75 | 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 | 78 | ->checkbox([ ], false) ?> |
79 | 79 | <?= $form->field($model, 'payment', [ 'template' => "{input}\n{error}" ]) |
80 | 80 | ->checkboxList($payments, [ |
... | ... | @@ -94,93 +94,7 @@ |
94 | 94 | </div> |
95 | 95 | <?php |
96 | 96 | $form->end(); |
97 | - /* | |
98 | 97 | ?> |
99 | - <form action="" class="search-work-form"> | |
100 | - | |
101 | - <div class="blocks-check-list-wrapp"> | |
102 | - <div class="blocks-check-title">Профиль</div> | |
103 | - <div class="blocks-check-list-wrapp"> | |
104 | - <select> | |
105 | - <option selected disabled>Дизайн</option> | |
106 | - <option value="">Ландшафтный дизайн</option> | |
107 | - <option value="">Интерьерный дизайн</option> | |
108 | - </select> | |
109 | - </div> | |
110 | - | |
111 | - <div class="blocks-check-list-wrapp"> | |
112 | - <select> | |
113 | - <option selected disabled>Архитектура</option> | |
114 | - <option value="">Ландшафтный дизайн</option> | |
115 | - <option value="">Интерьерный дизайн</option> | |
116 | - </select> | |
117 | - </div> | |
118 | - | |
119 | - <div class="blocks-check-list-wrapp"> | |
120 | - <select> | |
121 | - <option selected disabled>Строительство</option> | |
122 | - <option value="">Ландшафтный дизайн</option> | |
123 | - <option value="">Интерьерный дизайн</option> | |
124 | - </select> | |
125 | - </div> | |
126 | - </div> | |
127 | - | |
128 | - <div class="blocks-check-list-wrapp"> | |
129 | - <div class="blocks-check-title">Регион</div> | |
130 | - <select> | |
131 | - <option selected value="">Все страны</option> | |
132 | - <option style="color: #000; font-weight: bold !important;" value="">Украина</option> | |
133 | - <option value="">Россия</option> | |
134 | - <option value="">Белорусь</option> | |
135 | - </select> | |
136 | - </div> | |
137 | - <div class="blocks-check-list-wrapp"> | |
138 | - <select id="theme-1"> | |
139 | - <option selected disabled>Город</option> | |
140 | - <option value="">Все</option> | |
141 | - <option value="">Киев</option> | |
142 | - <option value="">Житомир</option> | |
143 | - <option value="">Львов</option> | |
144 | - <option value="">Киев</option> | |
145 | - <option value="">Житомир</option> | |
146 | - <option value="">Львов</option> | |
147 | - </select> | |
148 | - </div> | |
149 | - | |
150 | - <div class="blocks-check-list-wrapp"> | |
151 | - <div class="blocks-check-title">Бюджет</div> | |
152 | - <div class="form-price-wr"> | |
153 | - <input type="text" placeholder="от"/> | |
154 | - <input type="text" placeholder="до"/> | |
155 | - <div class="blocks-check-list-wrapp check-valuta"> | |
156 | - <select> | |
157 | - <option selected>грн</option> | |
158 | - <option value="">$</option> | |
159 | - <option value="">eur</option> | |
160 | - </select> | |
161 | - </div> | |
162 | - </div> | |
163 | - <div class="blocks-check-list"> | |
164 | - <input type="checkbox" name="group2" class="check-search" id="theme-4"><label for="theme-4"><span></span>Договорной</label> | |
165 | - </div> | |
166 | - <div class="blocks-check-list"> | |
167 | - <input type="checkbox" name="group2" class="check-search" id="theme-5"><label for="theme-5"><span></span>Компании</label> | |
168 | - </div> | |
169 | - <div class="blocks-check-list"> | |
170 | - <input type="checkbox" name="group2" class="check-search" id="theme-6"><label for="theme-6"><span></span>Проектанты</label> | |
171 | - </div> | |
172 | - <div class="blocks-check-list"> | |
173 | - <input checked type="checkbox" name="group2" class="check-search" id="theme-7"><label for="theme-7"><span></span>Все</label> | |
174 | - </div> | |
175 | - </div> | |
176 | - | |
177 | - | |
178 | - <a href="#" class="reset-filter">Сбросить фильтр</a> | |
179 | - <div class="blocks-check-list-submit"> | |
180 | - <input type="submit" value="Найти"/> | |
181 | - </div> | |
182 | - </form> | |
183 | - */ ?> | |
184 | 98 | </div> |
185 | 99 | <div class="right-search-work"> |
186 | 100 | <div class="search-worker-title style">Сейчас <?= $dataProvider->totalCount ?> предложений</div> |
... | ... | @@ -226,7 +140,7 @@ |
226 | 140 | </ul> |
227 | 141 | <ul class="min_markers_two"> |
228 | 142 | <li><span><img src="/images/markers/marker-min-10.png"/></span> |
229 | - <p><?=Yii::t('app', 'projects')?></p></li> | |
143 | + <p><?= Yii::t('app', 'projects') ?></p></li> | |
230 | 144 | <li><span><img src="/images/markers/marker-min-11.png"/></span> |
231 | 145 | <p>подряды</p></li> |
232 | 146 | </ul> |
... | ... | @@ -240,12 +154,16 @@ |
240 | 154 | var start_position = new google.maps.LatLng('56', '30'); |
241 | 155 | var settings = { |
242 | 156 | zoom : 7, // scrollwheel: false, |
243 | - center : start_position, mapTypeControl : false, | |
157 | + center : start_position, | |
158 | + mapTypeControl : false, | |
244 | 159 | mapTypeControlOptions : {style : google.maps.MapTypeControlStyle.DROPDOWN_MENU}, |
245 | 160 | navigationControl : false, |
246 | 161 | navigationControlOptions : {style : google.maps.NavigationControlStyle.SMALL}, |
247 | - scaleControl : false, streetViewControl : false, rotateControl : false, | |
248 | - zoomControl : false, mapTypeId : google.maps.MapTypeId.ROADMAP | |
162 | + scaleControl : false, | |
163 | + streetViewControl : false, | |
164 | + rotateControl : false, | |
165 | + zoomControl : false, | |
166 | + mapTypeId : google.maps.MapTypeId.ROADMAP | |
249 | 167 | }; |
250 | 168 | var map = new google.maps.Map(document.getElementById("map_canvas"), settings); |
251 | 169 | |
... | ... | @@ -308,45 +226,57 @@ |
308 | 226 | |
309 | 227 | var marker = new google.maps.Marker( |
310 | 228 | { |
311 | - position : new google.maps.LatLng('56', '35.3'), map : map, | |
312 | - title : 'Marker Title2', icon : image1 | |
229 | + position : new google.maps.LatLng('56', '35.3'), | |
230 | + map : map, | |
231 | + title : 'Marker Title2', | |
232 | + icon : image1 | |
313 | 233 | } |
314 | 234 | ); |
315 | 235 | markers.push(marker); |
316 | 236 | |
317 | 237 | var marker = new google.maps.Marker( |
318 | 238 | { |
319 | - position : new google.maps.LatLng('56', '36'), map : map, | |
320 | - title : 'Marker Title2', icon : image2 | |
239 | + position : new google.maps.LatLng('56', '36'), | |
240 | + map : map, | |
241 | + title : 'Marker Title2', | |
242 | + icon : image2 | |
321 | 243 | } |
322 | 244 | ); |
323 | 245 | markers.push(marker); |
324 | 246 | |
325 | 247 | var marker = new google.maps.Marker( |
326 | 248 | { |
327 | - position : new google.maps.LatLng('56', '34.5'), map : map, | |
328 | - title : 'Marker Title3', icon : image18 | |
249 | + position : new google.maps.LatLng('56', '34.5'), | |
250 | + map : map, | |
251 | + title : 'Marker Title3', | |
252 | + icon : image18 | |
329 | 253 | } |
330 | 254 | ); |
331 | 255 | markers.push(marker); |
332 | 256 | |
333 | 257 | var marker = new google.maps.Marker( |
334 | 258 | { |
335 | - position : new google.maps.LatLng('56', '35'), map : map, | |
336 | - title : 'Marker Title4', icon : image13 | |
259 | + position : new google.maps.LatLng('56', '35'), | |
260 | + map : map, | |
261 | + title : 'Marker Title4', | |
262 | + icon : image13 | |
337 | 263 | } |
338 | 264 | ); |
339 | 265 | markers.push(marker); |
340 | 266 | |
341 | 267 | var clusterStyles = [ |
342 | 268 | { |
343 | - url : '/images/markers/clasters.png', height : 36, width : 36 | |
269 | + url : '/images/markers/clasters.png', | |
270 | + height : 36, | |
271 | + width : 36 | |
344 | 272 | } |
345 | 273 | |
346 | 274 | ]; |
347 | 275 | markerClusterer = new MarkerClusterer( |
348 | 276 | map, markers, { |
349 | - maxZoom : 10, gridSize : 100, styles : clusterStyles | |
277 | + maxZoom : 10, | |
278 | + gridSize : 100, | |
279 | + styles : clusterStyles | |
350 | 280 | } |
351 | 281 | ); |
352 | 282 | //балун |
... | ... | @@ -365,6 +295,9 @@ |
365 | 295 | </script> |
366 | 296 | </div> |
367 | 297 | <div id="map_canvas" style="width: 100%; height:100%;"></div> |
298 | + <?php | |
299 | + /* Решено убрать нижний слайдер | |
300 | + ?> | |
368 | 301 | <div class="slider_map-wr"> |
369 | 302 | <div class="slider_map_overlay"></div> |
370 | 303 | <div class="slider_map"> |
... | ... | @@ -456,6 +389,9 @@ |
456 | 389 | </div> |
457 | 390 | </div> |
458 | 391 | </div> |
392 | + <?php | |
393 | + */ | |
394 | + ?> | |
459 | 395 | </div> |
460 | 396 | |
461 | 397 | </div> | ... | ... |