Commit 5d627502d4e434171c6b61bb352a40b5a52b4be9
1 parent
76f36646
test
Showing
13 changed files
with
215 additions
and
169 deletions
Show diff stats
common/models/Job.php
@@ -69,8 +69,6 @@ | @@ -69,8 +69,6 @@ | ||
69 | [ | 69 | [ |
70 | [ | 70 | [ |
71 | 'user_id', | 71 | 'user_id', |
72 | - 'total_count', | ||
73 | - 'complete_count', | ||
74 | 'current', | 72 | 'current', |
75 | ], | 73 | ], |
76 | 'integer', | 74 | 'integer', |
@@ -91,6 +89,22 @@ | @@ -91,6 +89,22 @@ | ||
91 | 'match', | 89 | 'match', |
92 | 'pattern' => '/^(?:https?:\/\/)?(?:w{3}\.)?'.preg_quote($_SERVER['HTTP_HOST']).'\/company\/\w+\/\d+$/i', | 90 | 'pattern' => '/^(?:https?:\/\/)?(?:w{3}\.)?'.preg_quote($_SERVER['HTTP_HOST']).'\/company\/\w+\/\d+$/i', |
93 | ], | 91 | ], |
92 | + [ | ||
93 | + [ | ||
94 | + 'total_count', | ||
95 | + 'complete_count', | ||
96 | + ], | ||
97 | + 'integer', | ||
98 | + 'min' => 0, | ||
99 | + ], | ||
100 | + [ | ||
101 | + [ | ||
102 | + 'complete_count', | ||
103 | + ], | ||
104 | + 'compare', | ||
105 | + 'compareAttribute' => 'total_count', | ||
106 | + 'operator' => '<=', | ||
107 | + ] | ||
94 | ]; | 108 | ]; |
95 | } | 109 | } |
96 | 110 |
common/models/Portfolio.php
common/models/UserInfo.php
@@ -230,6 +230,9 @@ | @@ -230,6 +230,9 @@ | ||
230 | ], | 230 | ], |
231 | 'filter', | 231 | 'filter', |
232 | 'filter' => function($value) { | 232 | 'filter' => function($value) { |
233 | + if(empty($value)) { | ||
234 | + return $value; | ||
235 | + } | ||
233 | if(!preg_match('/^https?:\/{2}.*$/', $value)) { | 236 | if(!preg_match('/^https?:\/{2}.*$/', $value)) { |
234 | $value = 'https://' . $value; | 237 | $value = 'https://' . $value; |
235 | } | 238 | } |
frontend/controllers/AccountsController.php
@@ -234,8 +234,8 @@ | @@ -234,8 +234,8 @@ | ||
234 | $user_info->load($post); | 234 | $user_info->load($post); |
235 | $user_info->save(); | 235 | $user_info->save(); |
236 | $job = [ ]; | 236 | $job = [ ]; |
237 | - for($i = 0; $i < count($post[ 'Job' ]); $i++) { | ||
238 | - $job[ $i ] = new Job([ | 237 | + foreach($post['Job'] as $index => $value) { |
238 | + $job[$index] = new Job([ | ||
239 | 'user_id' => \Yii::$app->user->getId(), | 239 | 'user_id' => \Yii::$app->user->getId(), |
240 | 'current' => 0, | 240 | 'current' => 0, |
241 | ]); | 241 | ]); |
@@ -795,6 +795,9 @@ | @@ -795,6 +795,9 @@ | ||
795 | */ | 795 | */ |
796 | public function actionService() | 796 | public function actionService() |
797 | { | 797 | { |
798 | + /** | ||
799 | + * @var User $user | ||
800 | + */ | ||
798 | $user = \Yii::$app->user->identity; | 801 | $user = \Yii::$app->user->identity; |
799 | $user_info = $user->userInfo; | 802 | $user_info = $user->userInfo; |
800 | if(empty( $user_info )) { | 803 | if(empty( $user_info )) { |
frontend/controllers/PerformerController.php
@@ -74,7 +74,15 @@ | @@ -74,7 +74,15 @@ | ||
74 | $phones = Fields::getData($user->id, $user->className(), 'phone'); | 74 | $phones = Fields::getData($user->id, $user->className(), 'phone'); |
75 | $sites = Fields::getData($user->id, $user->className(), 'site'); | 75 | $sites = Fields::getData($user->id, $user->className(), 'site'); |
76 | $soft = implode(', ', ArrayHelper::getColumn(Fields::getData($user->id, $user->className(), 'soft'), 'soft')); | 76 | $soft = implode(', ', ArrayHelper::getColumn(Fields::getData($user->id, $user->className(), 'soft'), 'soft')); |
77 | - | 77 | + $geography = $user->getPortfolios() |
78 | + ->select([ | ||
79 | + 'count' => 'COUNT(*)', | ||
80 | + 'city' => 'city', | ||
81 | + ]) | ||
82 | + ->groupBy('city') | ||
83 | + ->asArray() | ||
84 | + ->indexBy('city') | ||
85 | + ->column(); | ||
78 | return $this->render('common', [ | 86 | return $this->render('common', [ |
79 | 'user' => $user, | 87 | 'user' => $user, |
80 | 'educations' => $educations, | 88 | 'educations' => $educations, |
@@ -83,6 +91,7 @@ | @@ -83,6 +91,7 @@ | ||
83 | 'phones' => $phones, | 91 | 'phones' => $phones, |
84 | 'sites' => $sites, | 92 | 'sites' => $sites, |
85 | 'soft' => $soft, | 93 | 'soft' => $soft, |
94 | + 'geography' => $geography, | ||
86 | ]); | 95 | ]); |
87 | 96 | ||
88 | } | 97 | } |
@@ -324,8 +333,8 @@ | @@ -324,8 +333,8 @@ | ||
324 | 333 | ||
325 | public function beforeAction($action) | 334 | public function beforeAction($action) |
326 | { | 335 | { |
327 | - if(!empty(\Yii::$app->request->get('type'))) { | ||
328 | - $action->controller->view->params['type'] = \Yii::$app->request->get('type'); | 336 | + if(!empty( \Yii::$app->request->get('type') )) { |
337 | + $action->controller->view->params[ 'type' ] = \Yii::$app->request->get('type'); | ||
329 | } | 338 | } |
330 | return parent::beforeAction($action); | 339 | return parent::beforeAction($action); |
331 | } | 340 | } |
frontend/views/accounts/_job_form.php
@@ -82,10 +82,10 @@ | @@ -82,10 +82,10 @@ | ||
82 | ]); ?> | 82 | ]); ?> |
83 | 83 | ||
84 | <div class="fix-quantity-project"> | 84 | <div class="fix-quantity-project"> |
85 | - <?= $form->field($model, '[' . $index . ']complete_count') | 85 | + <?= $form->field($model, '[' . $index . ']complete_count', [ 'enableClientValidation' => false ]) |
86 | ->label('из них реализовано') | 86 | ->label('из них реализовано') |
87 | ->textInput([ | 87 | ->textInput([ |
88 | - 'class' => 'custom-input-2 custom-input-2-date', | 88 | + 'class' => 'custom-input-2 custom-input-2-date no-client-validation', |
89 | 'type' => 'number', | 89 | 'type' => 'number', |
90 | ]); ?> | 90 | ]); ?> |
91 | </div> | 91 | </div> |
frontend/views/accounts/_portfolio_form.php
@@ -20,6 +20,7 @@ use mihaildev\ckeditor\CKEditor; | @@ -20,6 +20,7 @@ use mihaildev\ckeditor\CKEditor; | ||
20 | 20 | ||
21 | $this->title = 'Портфолио'; | 21 | $this->title = 'Портфолио'; |
22 | $this->params[ 'breadcrumbs' ][] = $this->title; | 22 | $this->params[ 'breadcrumbs' ][] = $this->title; |
23 | + var_dump($portfolio->getErrors()); | ||
23 | ?> | 24 | ?> |
24 | <div class="login-left-column-title"><?= $this->title ?></div> | 25 | <div class="login-left-column-title"><?= $this->title ?></div> |
25 | 26 |
frontend/views/accounts/employment.php
@@ -71,10 +71,10 @@ | @@ -71,10 +71,10 @@ | ||
71 | 'type' => 'number', | 71 | 'type' => 'number', |
72 | ]); ?> | 72 | ]); ?> |
73 | <div class="fix-quantity-project"> | 73 | <div class="fix-quantity-project"> |
74 | - <?= $form->field($current, '[0]complete_count') | 74 | + <?= $form->field($current, '[0]complete_count', [ 'enableClientValidation' => false ]) |
75 | ->label('из них реализовано') | 75 | ->label('из них реализовано') |
76 | ->textInput([ | 76 | ->textInput([ |
77 | - 'class' => 'custom-input-2 custom-input-2-date', | 77 | + 'class' => 'custom-input-2 custom-input-2-date no-client-validation', |
78 | 'type' => 'number', | 78 | 'type' => 'number', |
79 | ]); ?> | 79 | ]); ?> |
80 | </div> | 80 | </div> |
@@ -173,10 +173,10 @@ | @@ -173,10 +173,10 @@ | ||
173 | 'type' => 'number', | 173 | 'type' => 'number', |
174 | ]); ?> | 174 | ]); ?> |
175 | <div class="fix-quantity-project"> | 175 | <div class="fix-quantity-project"> |
176 | - <?= $form->field($job_model, '[' . ( $index + 1 ) . ']complete_count') | 176 | + <?= $form->field($job_model, '[' . ( $index + 1 ) . ']complete_count', [ 'enableClientValidation' => false ]) |
177 | ->label('из них реализовано') | 177 | ->label('из них реализовано') |
178 | ->textInput([ | 178 | ->textInput([ |
179 | - 'class' => 'custom-input-2 custom-input-2-date', | 179 | + 'class' => 'custom-input-2 custom-input-2-date no-client-validation', |
180 | 'type' => 'number', | 180 | 'type' => 'number', |
181 | ]); ?> | 181 | ]); ?> |
182 | </div> | 182 | </div> |
@@ -208,6 +208,9 @@ | @@ -208,6 +208,9 @@ | ||
208 | $( | 208 | $( |
209 | function() | 209 | function() |
210 | { | 210 | { |
211 | + $(document).on('change', '.no-client-validation', function() { | ||
212 | + $(this).parent().find('.help-block').hide(); | ||
213 | + }); | ||
211 | var regexp = /^[\w]+\[(\d+)\].*$/; | 214 | var regexp = /^[\w]+\[(\d+)\].*$/; |
212 | var prevEmploy = $('.prev_job_inputs').length | 215 | var prevEmploy = $('.prev_job_inputs').length |
213 | if(prevEmploy < 1) | 216 | if(prevEmploy < 1) |
frontend/views/accounts/general.php
@@ -97,7 +97,7 @@ | @@ -97,7 +97,7 @@ | ||
97 | <div class="hidden-input-admin-general"> | 97 | <div class="hidden-input-admin-general"> |
98 | <div class="input-blocks-wrapper"> | 98 | <div class="input-blocks-wrapper"> |
99 | <div class="input-blocks"> | 99 | <div class="input-blocks"> |
100 | - <?= $form->field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ] ]) | 100 | + <?= $form->field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ], 'enableClientValidation' => false ]) |
101 | ->textInput([ 'class' => 'custom-input-2' ]); ?> | 101 | ->textInput([ 'class' => 'custom-input-2' ]); ?> |
102 | </div> | 102 | </div> |
103 | </div> | 103 | </div> |
frontend/views/accounts/service.php
@@ -104,6 +104,9 @@ | @@ -104,6 +104,9 @@ | ||
104 | 104 | ||
105 | <div class="admin-specialization-selected style"><ul></ul></div> | 105 | <div class="admin-specialization-selected style"><ul></ul></div> |
106 | 106 | ||
107 | + <?php | ||
108 | + /* temporarily disabled | ||
109 | + ?> | ||
107 | <div class="input-blocks-wrapper admin-city-array"> | 110 | <div class="input-blocks-wrapper admin-city-array"> |
108 | <div class="input-blocks"> | 111 | <div class="input-blocks"> |
109 | <?= $form->field($user_info, 'geographies') | 112 | <?= $form->field($user_info, 'geographies') |
@@ -127,6 +130,9 @@ | @@ -127,6 +130,9 @@ | ||
127 | ]); ?> | 130 | ]); ?> |
128 | </div> | 131 | </div> |
129 | </div> | 132 | </div> |
133 | + <?php | ||
134 | + */ | ||
135 | + ?> | ||
130 | <div class="input-blocks-wrapper"> | 136 | <div class="input-blocks-wrapper"> |
131 | <div class="input-blocks"> | 137 | <div class="input-blocks"> |
132 | <?= $form->field($user_info, 'guarantee', [ | 138 | <?= $form->field($user_info, 'guarantee', [ |
frontend/views/layouts/main.php
@@ -56,7 +56,11 @@ AppAsset::register($this); | @@ -56,7 +56,11 @@ AppAsset::register($this); | ||
56 | 56 | ||
57 | <?php else : ?> | 57 | <?php else : ?> |
58 | <div class="header-cabinet-foto"> | 58 | <div class="header-cabinet-foto"> |
59 | - <?= Html::img(Yii::$app->user->identity->minImg(Yii::$app->user->identity->userInfo->image,48,48))?> | 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 | + ?> | ||
60 | </div> | 64 | </div> |
61 | <div class="header-cabinet-profile">Профиль</div> | 65 | <div class="header-cabinet-profile">Профиль</div> |
62 | <?= Html::a(Yii::$app->user->identity->email,['/accounts']) ?> | 66 | <?= Html::a(Yii::$app->user->identity->email,['/accounts']) ?> |
frontend/views/performer/common.php
@@ -9,12 +9,23 @@ | @@ -9,12 +9,23 @@ | ||
9 | * @var array $developments | 9 | * @var array $developments |
10 | * @var array $educations | 10 | * @var array $educations |
11 | * @var array $courses | 11 | * @var array $courses |
12 | + * @var int[] $geography | ||
12 | */ | 13 | */ |
13 | $this->params[ 'user' ] = $user; | 14 | $this->params[ 'user' ] = $user; |
14 | 15 | ||
15 | $this->title = 'My Yii Application'; | 16 | $this->title = 'My Yii Application'; |
16 | 17 | ||
17 | - $georgaphy = implode(',', array_filter(ArrayHelper::getColumn($user->portfolios, 'city'))); | 18 | + $geographyString = ''; |
19 | + | ||
20 | + $first = 1; | ||
21 | + foreach($geography as $city => $count) { | ||
22 | + if(!$first) { | ||
23 | + $geographyString .= ', '; | ||
24 | + } | ||
25 | + $geographyString .= $city . ' ('.$count.')'; | ||
26 | + $first = 0; | ||
27 | + } | ||
28 | + unset($first); | ||
18 | ?> | 29 | ?> |
19 | <div class="proektant-profile-content"> | 30 | <div class="proektant-profile-content"> |
20 | <?php | 31 | <?php |
@@ -129,10 +140,10 @@ | @@ -129,10 +140,10 @@ | ||
129 | <div class="profile-features style"> | 140 | <div class="profile-features style"> |
130 | <ul> | 141 | <ul> |
131 | <?php | 142 | <?php |
132 | - if(!empty( $georgaphy )) { | 143 | + if(!empty( $geographyString )) { |
133 | ?> | 144 | ?> |
134 | <li> | 145 | <li> |
135 | - <span>География работ: </span><?= $georgaphy ?> | 146 | + <span>География работ: </span><?= $geographyString ?> |
136 | </li> | 147 | </li> |
137 | <?php | 148 | <?php |
138 | } | 149 | } |
frontend/views/search/performer.php
1 | <?php | 1 | <?php |
2 | 2 | ||
3 | -use common\models\Vacancy; | ||
4 | -use kartik\select2\Select2; | ||
5 | -use yii\helpers\ArrayHelper; | ||
6 | -use \yii\helpers\Html; | ||
7 | -use yii\helpers\Url; | ||
8 | -use yii\jui\SliderInput; | ||
9 | -use yii\web\JsExpression; | ||
10 | -use yii\widgets\ActiveForm; | ||
11 | -use yii\widgets\LinkSorter; | ||
12 | -use yii\widgets\ListView; | ||
13 | - | ||
14 | -/* @var $this yii\web\View */ | ||
15 | - | ||
16 | -$sort_array = $dataProvider->sort->getAttributeOrders(); | ||
17 | -$active_key = array_keys($sort_array)[0]; | ||
18 | -$active_value = $sort_array[$active_key]; | ||
19 | -$sort_name = (($active_value == 4)?'-':'').$active_key; | ||
20 | - | ||
21 | - | ||
22 | - | ||
23 | -$this->title = 'My Yii Application'; | 3 | + use common\models\Vacancy; |
4 | + use kartik\select2\Select2; | ||
5 | + use yii\helpers\ArrayHelper; | ||
6 | + use \yii\helpers\Html; | ||
7 | + use yii\helpers\Url; | ||
8 | + use yii\jui\SliderInput; | ||
9 | + use yii\web\JsExpression; | ||
10 | + use yii\widgets\ActiveForm; | ||
11 | + use yii\widgets\LinkSorter; | ||
12 | + use yii\widgets\ListView; | ||
13 | + | ||
14 | + /* @var $this yii\web\View */ | ||
15 | + | ||
16 | + $sort_array = $dataProvider->sort->getAttributeOrders(); | ||
17 | + $active_key = array_keys($sort_array)[ 0 ]; | ||
18 | + $active_value = $sort_array[ $active_key ]; | ||
19 | + $sort_name = ( ( $active_value == 4 ) ? '-' : '' ) . $active_key; | ||
20 | + | ||
21 | + $this->title = 'My Yii Application'; | ||
24 | ?> | 22 | ?> |
25 | 23 | ||
26 | <div class="section-box content"> | 24 | <div class="section-box content"> |
@@ -29,167 +27,165 @@ $this->title = 'My Yii Application'; | @@ -29,167 +27,165 @@ $this->title = 'My Yii Application'; | ||
29 | <div class="box-all"> | 27 | <div class="box-all"> |
30 | <div class="left-search-work"> | 28 | <div class="left-search-work"> |
31 | <?php | 29 | <?php |
32 | - $form = ActiveForm::begin(['options'=>['class'=>'search-work-form'],'action'=>[''], 'method'=>'get']); | 30 | + $form = ActiveForm::begin([ |
31 | + 'options' => [ 'class' => 'search-work-form' ], | ||
32 | + 'action' => [ '' ], | ||
33 | + 'method' => 'get', | ||
34 | + ]); | ||
33 | ?> | 35 | ?> |
34 | 36 | ||
35 | 37 | ||
36 | - <?= $form->field($model, 'city') | ||
37 | - ->widget(Select2::classname(), [ | ||
38 | - 'options' => [ 'placeholder' => 'Выбор города ...' ], | ||
39 | - 'pluginOptions' => [ | ||
40 | - 'allowClear' => true, | ||
41 | - 'minimumInputLength' => 3, | ||
42 | - 'ajax' => [ | ||
43 | - 'url' => \yii\helpers\Url::to([ 'site/city' ]), | ||
44 | - 'dataType' => 'json', | ||
45 | - 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | ||
46 | - ], | ||
47 | - 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
48 | - 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
49 | - 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
50 | - ], | ||
51 | - ]); ?> | ||
52 | - | ||
53 | - | ||
54 | - <?= | ||
55 | - $form->field($model, 'specialization') | ||
56 | - ->dropDownList($specialization, ['prompt' => 'Любая']); | ||
57 | - ?> | ||
58 | - | ||
59 | - | ||
60 | - <?= | ||
61 | - $form->field($model, 'type') | ||
62 | - ->dropDownList(['1'=>'Частное лицо','2'=>'Компания'], ['prompt' => 'Любой']); | ||
63 | - ?> | ||
64 | - | ||
65 | - | ||
66 | - | ||
67 | - <?= | ||
68 | - | ||
69 | - $form->field ($model, 'working_conditions') | ||
70 | - ->checkboxList ( | ||
71 | - [ | ||
72 | - 'guarantee' => 'С гарантией', | ||
73 | - 'contract' => 'С договором', | ||
74 | - 'estimate' => 'Со сметой', | ||
75 | - 'prepayment' => 'Без предоплаты' | ||
76 | - ], | ||
77 | - [ | ||
78 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
79 | - $return = '<div class="blocks-check-list">'; | ||
80 | - $return .= '<input type="checkbox" '.($checked ? "checked" : "" ).' name="' . $name . '" class="check-search" value="' . $value . '" id="theme-'.$index.'">'; | ||
81 | - $return .= '<label for="theme-'.$index.'"><span></span>'.$label.'</label>'; | ||
82 | - $return .= '</div>'; | ||
83 | - return $return; | ||
84 | - } | ||
85 | - ] | ||
86 | - ); | ||
87 | - ?> | 38 | + <?= $form->field($model, 'city') |
39 | + ->widget(Select2::classname(), [ | ||
40 | + 'options' => [ 'placeholder' => 'Выбор города ...' ], | ||
41 | + 'pluginOptions' => [ | ||
42 | + 'allowClear' => true, | ||
43 | + 'minimumInputLength' => 3, | ||
44 | + 'ajax' => [ | ||
45 | + 'url' => \yii\helpers\Url::to([ 'site/city' ]), | ||
46 | + 'dataType' => 'json', | ||
47 | + 'data' => new JsExpression('function(params) { return {q:params.term}; }'), | ||
48 | + ], | ||
49 | + 'escapeMarkup' => new JsExpression('function (markup) { return markup; }'), | ||
50 | + 'templateResult' => new JsExpression('function(city) { return city.text; }'), | ||
51 | + 'templateSelection' => new JsExpression('function (city) { return city.text; }'), | ||
52 | + ], | ||
53 | + ]); ?> | ||
54 | + | ||
55 | + | ||
56 | + <?= $form->field($model, 'specialization') | ||
57 | + ->dropDownList($specialization, [ 'prompt' => 'Любая' ]); ?> | ||
58 | + | ||
59 | + | ||
60 | + <?= $form->field($model, 'type') | ||
61 | + ->dropDownList([ | ||
62 | + '1' => 'Частное лицо', | ||
63 | + '2' => 'Компания', | ||
64 | + ], [ 'prompt' => 'Любой' ]); ?> | ||
65 | + | ||
66 | + | ||
67 | + | ||
68 | + <?= | ||
69 | + | ||
70 | + $form->field($model, 'working_conditions') | ||
71 | + ->checkboxList([ | ||
72 | + 'guarantee' => 'С гарантией', | ||
73 | + //'contract' => 'С договором', | ||
74 | + //'estimate' => 'Со сметой', | ||
75 | + 'prepayment' => 'Без предоплаты', | ||
76 | + ], [ | ||
77 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
78 | + $return = '<div class="blocks-check-list">'; | ||
79 | + $return .= '<input type="checkbox" ' . ( $checked ? "checked" : "" ) . ' name="' . $name . '" class="check-search" value="' . $value . '" id="theme-' . $index . '">'; | ||
80 | + $return .= '<label for="theme-' . $index . '"><span></span>' . $label . '</label>'; | ||
81 | + $return .= '</div>'; | ||
82 | + return $return; | ||
83 | + }, | ||
84 | + ]); ?> | ||
88 | 85 | ||
89 | <div class="blocks-check-list-wrapp"> | 86 | <div class="blocks-check-list-wrapp"> |
90 | <div id="slider-value"></div> | 87 | <div id="slider-value"></div> |
91 | <?php | 88 | <?php |
92 | - echo $form->field($model, 'rating', [ | ||
93 | - 'template' => "{label}<br><div id='{$form->id}-rating'>{$model->rating}</div><br>{input}\n{hint}\n{error}", | ||
94 | - 'labelOptions' => [ | ||
95 | - 'class' => 'blocks-check-title', | ||
96 | - ], | ||
97 | - ]) | ||
98 | - ->widget(SliderInput::className(), [ | ||
99 | - 'clientOptions' => [ | ||
100 | - 'min' => 0, | ||
101 | - 'max' => 5, | ||
102 | - 'step' => 0.5, | 89 | + echo $form->field($model, 'rating', [ |
90 | + 'template' => "{label}<br><div id='{$form->id}-rating'>{$model->rating}</div><br>{input}\n{hint}\n{error}", | ||
91 | + 'labelOptions' => [ | ||
92 | + 'class' => 'blocks-check-title', | ||
103 | ], | 93 | ], |
104 | - 'clientEvents' => [ | ||
105 | - 'slide' => "function( event, ui ) { | 94 | + ]) |
95 | + ->widget(SliderInput::className(), [ | ||
96 | + 'clientOptions' => [ | ||
97 | + 'min' => 0, | ||
98 | + 'max' => 5, | ||
99 | + 'step' => 0.5, | ||
100 | + ], | ||
101 | + 'clientEvents' => [ | ||
102 | + 'slide' => "function( event, ui ) { | ||
106 | $( '#{$form->id}-rating' ).text(ui.value); | 103 | $( '#{$form->id}-rating' ).text(ui.value); |
107 | $('input[name=\"{$model->formName()}[rating]\"]').val(ui.value); | 104 | $('input[name=\"{$model->formName()}[rating]\"]').val(ui.value); |
108 | 105 | ||
109 | }", | 106 | }", |
110 | - ], | ||
111 | - ]); | 107 | + ], |
108 | + ]); | ||
112 | ?> | 109 | ?> |
113 | </div> | 110 | </div> |
114 | 111 | ||
115 | 112 | ||
116 | - | ||
117 | - <?= | ||
118 | - $form->field($model, 'online', [ | ||
119 | - 'options' => [ | ||
120 | - 'class' => 'blocks-check-list-wrapp', | ||
121 | - ], | ||
122 | - 'template' => "<div class='blocks-check-title'>{label}</div>\n{input}\n{hint}\n{error}", | ||
123 | - ]) | ||
124 | - ->radioList([ | ||
125 | - '' => 'Все', | ||
126 | - 1 => 'Онлайн', | ||
127 | - ], [ | ||
128 | - 'item' => function($index, $label, $name, $checked, $value) use ($model) { | ||
129 | - return "<div class='blocks-check-list'><input type='radio' id='{$model->formName()}-{$index}' name='{$name}' class='check-search' value='{$value}' " . ($checked?'checked':'') . "><label for='{$model->formName()}-{$index}'><span></span>{$label}</label></div>"; | ||
130 | - }, | ||
131 | - 'unselect' => NULL, | ||
132 | - ]); | ||
133 | - ?> | ||
134 | - | ||
135 | - | ||
136 | - | ||
137 | - <?= | ||
138 | - $form->field ($model, 'additional_parameters') | ||
139 | - ->checkboxList ( | ||
140 | - [ | ||
141 | - 'with_portfolio' => 'Только с портфолио', | ||
142 | - 'with_comments' => 'Только с отзывами', | ||
143 | - 'only_free' => 'Только свободные', | ||
144 | - ], | ||
145 | - [ | ||
146 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
147 | - $return = '<div class="blocks-check-list">'; | ||
148 | - $return .= '<input type="checkbox" '.($checked ? "checked" : "" ).' name="' . $name . '" class="check-search" value="' . $value . '" id="theme2-'.$index.'">'; | ||
149 | - $return .= '<label for="theme2-'.$index.'"><span></span>'.$label.'</label>'; | ||
150 | - $return .= '</div>'; | ||
151 | - return $return; | ||
152 | - } | ||
153 | - ] | ||
154 | - ); | ||
155 | - ?> | 113 | + <?= $form->field($model, 'online', [ |
114 | + 'options' => [ | ||
115 | + 'class' => 'blocks-check-list-wrapp', | ||
116 | + ], | ||
117 | + 'template' => "<div class='blocks-check-title'>{label}</div>\n{input}\n{hint}\n{error}", | ||
118 | + ]) | ||
119 | + ->radioList([ | ||
120 | + '' => 'Все', | ||
121 | + 1 => 'Онлайн', | ||
122 | + ], [ | ||
123 | + 'item' => function($index, $label, $name, $checked, $value) use ($model) { | ||
124 | + return "<div class='blocks-check-list'><input type='radio' id='{$model->formName()}-{$index}' name='{$name}' class='check-search' value='{$value}' " . ( $checked ? 'checked' : '' ) . "><label for='{$model->formName()}-{$index}'><span></span>{$label}</label></div>"; | ||
125 | + }, | ||
126 | + 'unselect' => NULL, | ||
127 | + ]); ?> | ||
128 | + | ||
129 | + | ||
130 | + | ||
131 | + <?= $form->field($model, 'additional_parameters') | ||
132 | + ->checkboxList([ | ||
133 | + 'with_portfolio' => 'Только с портфолио', | ||
134 | + 'with_comments' => 'Только с отзывами', | ||
135 | + 'only_free' => 'Только свободные', | ||
136 | + ], [ | ||
137 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
138 | + $return = '<div class="blocks-check-list">'; | ||
139 | + $return .= '<input type="checkbox" ' . ( $checked ? "checked" : "" ) . ' name="' . $name . '" class="check-search" value="' . $value . '" id="theme2-' . $index . '">'; | ||
140 | + $return .= '<label for="theme2-' . $index . '"><span></span>' . $label . '</label>'; | ||
141 | + $return .= '</div>'; | ||
142 | + return $return; | ||
143 | + }, | ||
144 | + ]); ?> | ||
156 | <div class="blocks-check-list-submit"> | 145 | <div class="blocks-check-list-submit"> |
157 | <?= Html::submitInput('Найти') ?> | 146 | <?= Html::submitInput('Найти') ?> |
158 | </div> | 147 | </div> |
159 | 148 | ||
160 | - <?php | ||
161 | - $form->end(); | ||
162 | - ?> | 149 | + <?php |
150 | + $form->end(); | ||
151 | + ?> | ||
163 | </div> | 152 | </div> |
164 | <div class="right-search-work"> | 153 | <div class="right-search-work"> |
165 | <div class="search-worker-title style">Найти исполнителя</div> | 154 | <div class="search-worker-title style">Найти исполнителя</div> |
166 | - <div class="search-worker-title-two style">Проектанты готовые приступить к работе <span><?= $dataProvider->totalCount ?></span></div> | 155 | + <div class="search-worker-title-two style">Проектанты готовые приступить к работе |
156 | + <span><?= $dataProvider->totalCount ?></span></div> | ||
167 | <div class="search-worker-search-wr style"> | 157 | <div class="search-worker-search-wr style"> |
168 | <?php | 158 | <?php |
169 | - $form2 = ActiveForm::begin(['method' => 'get', 'action' => [''], 'options' => ['class' => 'search-worker-form']]); | 159 | + $form2 = ActiveForm::begin([ |
160 | + 'method' => 'get', | ||
161 | + 'action' => [ '' ], | ||
162 | + 'options' => [ 'class' => 'search-worker-form' ], | ||
163 | + ]); | ||
170 | ?> | 164 | ?> |
171 | 165 | ||
172 | - <?= $form2->field($model, 'search', ['options' => ['tag' => 'span']])->label(false)->textInput(['placeholder' => $model->getAttributeLabel('search')]);?> | 166 | + <?= $form2->field($model, 'search', [ 'options' => [ 'tag' => 'span' ] ]) |
167 | + ->label(false) | ||
168 | + ->textInput([ 'placeholder' => $model->getAttributeLabel('search') ]); ?> | ||
173 | 169 | ||
174 | - <?= Html::submitInput('Найти');?> | 170 | + <?= Html::submitInput('Найти'); ?> |
175 | 171 | ||
176 | <?php | 172 | <?php |
177 | - $form2->end(); | 173 | + $form2->end(); |
178 | ?> | 174 | ?> |
179 | 175 | ||
180 | 176 | ||
181 | - <?= Html::a('Добавить себя в каталог',Url::toRoute('accounts/service'),['class'=>'add-to-catalog-search-worker'])?> | 177 | + <?= Html::a('Добавить себя в каталог', Url::toRoute('accounts/service'), [ 'class' => 'add-to-catalog-search-worker' ]) ?> |
182 | 178 | ||
183 | <div class="search-worker-sort-wr style"> | 179 | <div class="search-worker-sort-wr style"> |
184 | <div class="search-worker-sort">Сортировать: </div> | 180 | <div class="search-worker-sort">Сортировать: </div> |
185 | <ul> | 181 | <ul> |
186 | <li class="activejob"> | 182 | <li class="activejob"> |
187 | - <a href="#" data-sort-name="<?=$sort_name?>"></a> | 183 | + <a href="#" data-sort-name="<?= $sort_name ?>"></a> |
188 | <div class="sidebar-droped-wr style"> | 184 | <div class="sidebar-droped-wr style"> |
189 | <?php | 185 | <?php |
190 | - echo LinkSorter::widget([ | ||
191 | - 'sort' => $dataProvider->sort, | ||
192 | - ]); | 186 | + echo LinkSorter::widget([ |
187 | + 'sort' => $dataProvider->sort, | ||
188 | + ]); | ||
193 | ?> | 189 | ?> |
194 | </div> | 190 | </div> |
195 | </li> | 191 | </li> |
@@ -201,14 +197,11 @@ $this->title = 'My Yii Application'; | @@ -201,14 +197,11 @@ $this->title = 'My Yii Application'; | ||
201 | 197 | ||
202 | <?= | 198 | <?= |
203 | 199 | ||
204 | - ListView::widget( [ | ||
205 | - 'dataProvider' => $dataProvider, | ||
206 | - 'itemView'=>'_performer_list_view', | ||
207 | - 'layout' => "{items}\n<div class='navi-buttons-wr style'>{pager}</div>" | ||
208 | - ] ); | ||
209 | - ?> | ||
210 | - | ||
211 | - | 200 | + ListView::widget([ |
201 | + 'dataProvider' => $dataProvider, | ||
202 | + 'itemView' => '_performer_list_view', | ||
203 | + 'layout' => "{items}\n<div class='navi-buttons-wr style'>{pager}</div>", | ||
204 | + ]); ?> | ||
212 | 205 | ||
213 | 206 | ||
214 | </div> | 207 | </div> |