Commit 766bd93b3b8f9b5b069ecdf7aa93d7faee11c678
1 parent
8ac2f37e
test
Showing
9 changed files
with
343 additions
and
156 deletions
Show diff stats
common/models/Fields.php
@@ -68,7 +68,7 @@ class Fields extends \yii\db\ActiveRecord | @@ -68,7 +68,7 @@ class Fields extends \yii\db\ActiveRecord | ||
68 | 68 | ||
69 | public static function saveFieldData($post,$table_id,$table_name, $language){ | 69 | public static function saveFieldData($post,$table_id,$table_name, $language){ |
70 | 70 | ||
71 | - self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language]); | 71 | + self::deleteAll(['table_id'=>$table_id, 'table_name'=>$table_name, 'language' => $language, 'field_type' => array_keys($post)]); |
72 | 72 | ||
73 | if($post){ | 73 | if($post){ |
74 | 74 |
common/widgets/FieldEditor.php
@@ -33,13 +33,13 @@ class FieldEditor extends Widget | @@ -33,13 +33,13 @@ class FieldEditor extends Widget | ||
33 | protected function findModel() | 33 | protected function findModel() |
34 | { | 34 | { |
35 | 35 | ||
36 | - | ||
37 | if (($model = Fields::find()->where([ | 36 | if (($model = Fields::find()->where([ |
38 | 'table_id'=>$this->item_id, | 37 | 'table_id'=>$this->item_id, |
39 | 'table_name'=>$this->model, | 38 | 'table_name'=>$this->model, |
40 | 'field_type'=>$this->template, | 39 | 'field_type'=>$this->template, |
41 | 'language'=>$this->language, | 40 | 'language'=>$this->language, |
42 | ])->all())) { | 41 | ])->all())) { |
42 | + | ||
43 | return $model; | 43 | return $model; |
44 | 44 | ||
45 | } else { | 45 | } else { |
1 | +<?php | ||
2 | + use yii\helpers\Html; | ||
3 | + | ||
4 | +?> | ||
5 | +<fieldset> | ||
6 | + | ||
7 | + <legend>Пройденные курсы, тренинги</legend> | ||
8 | + | ||
9 | + <p class="btn btn-success add_field_<?= $this->context->id ?>">Добавить поле</p> | ||
10 | + | ||
11 | + | ||
12 | + <?php $t = 0; | ||
13 | + for($i = 1; $i <= count($model); $i++): | ||
14 | + $row = $i; | ||
15 | + | ||
16 | + ?> | ||
17 | + | ||
18 | + <?= Html::beginTag('div', [ | ||
19 | + 'class' => 'form-group', | ||
20 | + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, | ||
21 | + ]) ?> | ||
22 | + <input type="text" placeholder="Курсы, тренинги" class="form-control" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[courses][<?= $row ?>][0][name]"/> | ||
23 | + <input type="number" class="form-control" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[courses][<?= $row ?>][1][year]"/> | ||
24 | + <span data-id="<?= isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0 ?>" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span> | ||
25 | + <?= Html::endTag('div') ?> | ||
26 | + <?php $i = ++$t; ?> | ||
27 | + <?php endfor; ?> | ||
28 | + | ||
29 | + | ||
30 | +</fieldset> | ||
31 | +<script> | ||
32 | + var start_i_<?=$this->context->id?> = <?=$i?>; | ||
33 | + $ (document) | ||
34 | + .ready ( | ||
35 | + function () | ||
36 | + { | ||
37 | + $ ('.add_field_<?=$this->context->id?>') | ||
38 | + .click ( | ||
39 | + function () | ||
40 | + { | ||
41 | + var block = $ (this) | ||
42 | + .parent ('fieldset'); | ||
43 | + var block_id = $ (this) | ||
44 | + .parent ('fieldset'); | ||
45 | + var sub_block = '<div class="form-group" >' + | ||
46 | + '<input type="text" placeholder="Курсы, тренинги" class="form-control" value="" name="Fields[courses][' + start_i_<?=$this->context->id?>++ + '][0][name]" />' + | ||
47 | + '<input type="number" class="form-control" value="" name="Fields[courses][' + start_i_<?=$this->context->id?>++ + '][1][year]" />' + | ||
48 | + '<span title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>' + | ||
49 | + '<div>'; | ||
50 | + console.log (block); | ||
51 | + block.append (sub_block); | ||
52 | + } | ||
53 | + ); | ||
54 | + } | ||
55 | + ); | ||
56 | +</script> | ||
57 | + | ||
58 | + |
1 | +<?php | ||
2 | + use yii\helpers\Html; | ||
3 | + | ||
4 | +?> | ||
5 | +<fieldset> | ||
6 | + | ||
7 | + <legend>Собственные разработки, патенты</legend> | ||
8 | + | ||
9 | + <p class="btn btn-success add_field_<?= $this->context->id ?>">Добавить поле</p> | ||
10 | + | ||
11 | + | ||
12 | + <?php $t = 0; | ||
13 | + for($i = 1; $i <= count($model); $i++): | ||
14 | + $row = $i; | ||
15 | + | ||
16 | + ?> | ||
17 | + | ||
18 | + <?= Html::beginTag('div', [ | ||
19 | + 'class' => 'form-group', | ||
20 | + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, | ||
21 | + ]) ?> | ||
22 | + <input type="text" placeholder="Название" class="form-control" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[development][<?= $row ?>][0][name]"/> | ||
23 | + <input type="number" class="form-control" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[development][<?= $row ?>][1][year]"/> | ||
24 | + <span data-id="<?= isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0 ?>" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span> | ||
25 | + <?= Html::endTag('div') ?> | ||
26 | + <?php $i = ++$t; ?> | ||
27 | + <?php endfor; ?> | ||
28 | + | ||
29 | + | ||
30 | +</fieldset> | ||
31 | +<script> | ||
32 | + var start_i_<?=$this->context->id?> = <?=$i?>; | ||
33 | + $ (document) | ||
34 | + .ready ( | ||
35 | + function () | ||
36 | + { | ||
37 | + $ ('.add_field_<?=$this->context->id?>') | ||
38 | + .click ( | ||
39 | + function () | ||
40 | + { | ||
41 | + var block = $ (this) | ||
42 | + .parent ('fieldset'); | ||
43 | + var block_id = $ (this) | ||
44 | + .parent ('fieldset'); | ||
45 | + var sub_block = '<div class="form-group" >' + | ||
46 | + '<input type="text" placeholder="Телефон" class="form-control" value="" name="Fields[development][' + start_i_<?=$this->context->id?>++ + '][0][name]" />' + | ||
47 | + '<input type="number" class="form-control" value="" name="Fields[development][' + start_i_<?=$this->context->id?>++ + '][1][year]" />' + | ||
48 | + '<span title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>' + | ||
49 | + '<div>'; | ||
50 | + console.log (block); | ||
51 | + block.append (sub_block); | ||
52 | + } | ||
53 | + ); | ||
54 | + } | ||
55 | + ); | ||
56 | +</script> | ||
57 | + | ||
58 | + |
common/widgets/views/education_field.php
1 | <?php | 1 | <?php |
2 | -use yii\helpers\Html; | 2 | + use yii\helpers\Html; |
3 | 3 | ||
4 | ?> | 4 | ?> |
5 | <fieldset> | 5 | <fieldset> |
6 | 6 | ||
7 | <legend>Образование</legend> | 7 | <legend>Образование</legend> |
8 | 8 | ||
9 | - <p class="btn btn-success add_field">Добавить поле</p> | 9 | + <p class="btn btn-success add_field_<?= $this->context->id ?>">Добавить поле</p> |
10 | 10 | ||
11 | 11 | ||
12 | - <?php | ||
13 | - $t = 0; | ||
14 | - for($i=1; $i <= count($model); $i++): | ||
15 | - $row = $i; | 12 | + <?php $t = 0; |
13 | + for($i = 1; $i <= count($model); $i++): | ||
14 | + $row = $i; | ||
16 | 15 | ||
17 | - ?> | ||
18 | - | ||
19 | - <?= Html::beginTag('div',['class'=>'form-group','id'=>isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ])?> | ||
20 | - <input type="text" placeholder="С" class="form-control" value="<?= isset($model[$t]['value']) ? $model[$t]['value'] : '' ?>" name="Fields[education][<?=$row?>][0][year_from]" /> | ||
21 | - <input type="text" placeholder="По" class="form-control" value="<?= isset($model[++$t]['value']) ? $model[$t]['value'] : '' ?>" name="Fields[education][<?=$row?>][1][year_to]" /> | ||
22 | - <textarea placeholder="Место" name="Fields[education][<?=$row?>][2][place]" /><?= isset($model[++$t]['value']) ? $model[$t]['value'] : '' ?></textarea> | ||
23 | - <span data-id="<?= isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ?>" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span> | ||
24 | - <?= Html::endTag('div')?> | ||
25 | - <?php $i = ++ $t; ?> | ||
26 | - <?php endfor; ?> | 16 | + ?> |
27 | 17 | ||
18 | + <?= Html::beginTag('div', [ | ||
19 | + 'class' => 'form-group', | ||
20 | + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, | ||
21 | + ]) ?> | ||
22 | + <input type="text" placeholder="Название" class="form-control" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][0][name]"/> | ||
23 | + <input type="number" class="form-control" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][1][year_from]"/> | ||
24 | + <input type="number" class="form-control" value="<?= isset( $model[ ++$t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[education][<?= $row ?>][2][year_to]"/> | ||
25 | + <span data-id="<?= isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0 ?>" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span> | ||
26 | + <?= Html::endTag('div') ?> | ||
27 | + <?php $i = ++$t; ?> | ||
28 | + <?php endfor; ?> | ||
28 | 29 | ||
29 | 30 | ||
30 | </fieldset> | 31 | </fieldset> |
31 | <script> | 32 | <script> |
32 | - $( document ).ready(function(){ | ||
33 | - var start_i = <?=$i?>; | ||
34 | - $('.add_field').click(function(){ | ||
35 | - var block = $(this).parent('fieldset'); | ||
36 | - var block_id = $(this).parent('fieldset'); | ||
37 | - var sub_block = '<div class="form-group" >'+ | ||
38 | - '<input type="text" placeholder="С" class="form-control" value="" name="Fields[education]['+ ++start_i +'][0][year_from]" />'+ | ||
39 | - '<input type="text" placeholder="По" class="form-control" value="" name="Fields[education]['+ start_i +'][1][year_to]" />'+ | ||
40 | - '<textarea placeholder="Место" name="Fields[education]['+ start_i +'][2][place]" /></textarea>'+ | ||
41 | - '<span title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>'+ | ||
42 | - '<div>'; | ||
43 | - block.append(sub_block); | ||
44 | - | ||
45 | - }); | ||
46 | - }); | 33 | + var start_i_<?=$this->context->id?> = <?=$i?>; |
34 | + $ (document) | ||
35 | + .ready ( | ||
36 | + function () | ||
37 | + { | ||
38 | + $ ('.add_field_<?=$this->context->id?>') | ||
39 | + .click ( | ||
40 | + function () | ||
41 | + { | ||
42 | + var block = $ (this) | ||
43 | + .parent ('fieldset'); | ||
44 | + var block_id = $ (this) | ||
45 | + .parent ('fieldset'); | ||
46 | + var sub_block = '<div class="form-group" >' + | ||
47 | + '<input type="text" placeholder="Название" class="form-control" value="" name="Fields[education][' + start_i_<?=$this->context->id?>++ + '][0][name]" />' + | ||
48 | + '<input type="number" class="form-control" value="" name="Fields[education][' + start_i_<?=$this->context->id?>++ + '][1][year_from]" />' + | ||
49 | + '<input type="number" class="form-control" value="" name="Fields[education][' + start_i_<?=$this->context->id?>++ + '][2][year_to]" />' + | ||
50 | + '<span title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>' + | ||
51 | + '<div>'; | ||
52 | + console.log (block); | ||
53 | + block.append (sub_block); | ||
54 | + } | ||
55 | + ); | ||
56 | + } | ||
57 | + ); | ||
47 | </script> | 58 | </script> |
48 | 59 | ||
49 | 60 |
1 | +<?php | ||
2 | + use yii\helpers\Html; | ||
3 | + | ||
4 | +?> | ||
5 | +<fieldset> | ||
6 | + | ||
7 | + <legend>Работа с программами</legend> | ||
8 | + | ||
9 | + <p class="btn btn-success add_field_<?= $this->context->id ?>">Добавить поле</p> | ||
10 | + | ||
11 | + | ||
12 | + <?php $t = 0; | ||
13 | + for($i = 1; $i <= count($model); $i++): | ||
14 | + $row = $i; | ||
15 | + | ||
16 | + ?> | ||
17 | + | ||
18 | + <?= Html::beginTag('div', [ | ||
19 | + 'class' => 'form-group', | ||
20 | + 'id' => isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0, | ||
21 | + ]) ?> | ||
22 | + <input type="text" placeholder="Программа" class="form-control" value="<?= isset( $model[ $t ][ 'value' ] ) ? $model[ $t ][ 'value' ] : '' ?>" name="Fields[soft][<?= $row ?>][0][soft]"/> | ||
23 | + <span data-id="<?= isset( $model[ $i ][ 'parent_key' ] ) ? $model[ $i ][ 'parent_key' ] : 0 ?>" title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span> | ||
24 | + <?= Html::endTag('div') ?> | ||
25 | + <?php $i = ++$t; ?> | ||
26 | + <?php endfor; ?> | ||
27 | + | ||
28 | + | ||
29 | +</fieldset> | ||
30 | +<script> | ||
31 | + var start_i_<?=$this->context->id?> = <?=$i?>; | ||
32 | + $ (document) | ||
33 | + .ready ( | ||
34 | + function () | ||
35 | + { | ||
36 | + $ ('.add_field_<?=$this->context->id?>') | ||
37 | + .click ( | ||
38 | + function () | ||
39 | + { | ||
40 | + var block = $ (this) | ||
41 | + .parent ('fieldset'); | ||
42 | + var block_id = $ (this) | ||
43 | + .parent ('fieldset'); | ||
44 | + var sub_block = '<div class="form-group" >' + | ||
45 | + '<input type="text" placeholder="Программа" class="form-control" value="" name="Fields[soft][' + start_i_<?=$this->context->id?>++ + '][0][soft]" />' + | ||
46 | + '<span title="удалить" class="glyphicon glyphicon-trash delete-field-item"></span>' + | ||
47 | + '<div>'; | ||
48 | + console.log (block); | ||
49 | + block.append (sub_block); | ||
50 | + } | ||
51 | + ); | ||
52 | + } | ||
53 | + ); | ||
54 | +</script> | ||
55 | + | ||
56 | + |
frontend/controllers/AccountsController.php
@@ -233,7 +233,11 @@ | @@ -233,7 +233,11 @@ | ||
233 | 233 | ||
234 | public function actionAddSkills() | 234 | public function actionAddSkills() |
235 | { | 235 | { |
236 | - return $this->render('add-skills'); | 236 | + $user = \Yii::$app->user->identity; |
237 | + if(!empty(\Yii::$app->request->post())) { | ||
238 | + Fields::saveFieldData(Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(), 'ru'); | ||
239 | + } | ||
240 | + return $this->render('add-skills', ['user' => $user]); | ||
237 | } | 241 | } |
238 | 242 | ||
239 | public function actionDescription() | 243 | public function actionDescription() |
frontend/views/accounts/add-skills.php
1 | <?php | 1 | <?php |
2 | + /** | ||
3 | + * @var User $user | ||
4 | + */ | ||
2 | use common\models\Option; | 5 | use common\models\Option; |
3 | -use yii\helpers\Html; | 6 | + use common\models\User; |
7 | + use common\widgets\FieldEditor; | ||
8 | + use yii\helpers\Html; | ||
4 | use yii\widgets\ActiveForm; | 9 | use yii\widgets\ActiveForm; |
5 | use \common\widgets\MultiLangForm; | 10 | use \common\widgets\MultiLangForm; |
6 | 11 | ||
@@ -11,7 +16,27 @@ use \common\widgets\MultiLangForm; | @@ -11,7 +16,27 @@ use \common\widgets\MultiLangForm; | ||
11 | <?php | 16 | <?php |
12 | $form = ActiveForm::begin(); | 17 | $form = ActiveForm::begin(); |
13 | ?> | 18 | ?> |
14 | - | 19 | +<?= FieldEditor::widget ( |
20 | + [ | ||
21 | + 'template' => 'soft', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', | ||
22 | + ] | ||
23 | +); ?> | ||
24 | +<?= FieldEditor::widget ( | ||
25 | + [ | ||
26 | + 'template' => 'education', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', | ||
27 | + ] | ||
28 | +); ?> | ||
29 | +<?= FieldEditor::widget ( | ||
30 | + [ | ||
31 | + 'template' => 'development', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', | ||
32 | + ] | ||
33 | +); ?> | ||
34 | +<?= FieldEditor::widget ( | ||
35 | + [ | ||
36 | + 'template' => 'courses', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', | ||
37 | + ] | ||
38 | +); ?> | ||
39 | + <?= Html::submitButton('Обновить') ?> | ||
15 | <?php | 40 | <?php |
16 | $form->end(); | 41 | $form->end(); |
17 | ?> | 42 | ?> |
18 | \ No newline at end of file | 43 | \ No newline at end of file |
frontend/views/accounts/general.php
@@ -14,41 +14,22 @@ | @@ -14,41 +14,22 @@ | ||
14 | use \common\widgets\MultiLangForm; | 14 | use \common\widgets\MultiLangForm; |
15 | 15 | ||
16 | $this->title = 'Учетные данные'; | 16 | $this->title = 'Учетные данные'; |
17 | - $this->params['breadcrumbs'][] = $this->title; | 17 | + $this->params[ 'breadcrumbs' ][] = $this->title; |
18 | ?> | 18 | ?> |
19 | <div class="login-left-column-title"><?= $this->title ?></div> | 19 | <div class="login-left-column-title"><?= $this->title ?></div> |
20 | 20 | ||
21 | <div class="" id="form_definition"> | 21 | <div class="" id="form_definition"> |
22 | - <?php $form = ActiveForm::begin (); ?> | ||
23 | - | ||
24 | - | ||
25 | - | ||
26 | - | ||
27 | -<!--// $form->field ($user, 'isPerformer', ['template' => "{label}:\n{input}\n{hint}\n{error}"])--> | ||
28 | -<!--// ->label ('<span></span>Я - исполнитель')--> | ||
29 | -<!--// ->hint ('Отображается если указать специализации услуг в личном кабинете.')--> | ||
30 | -<!--// ->checkbox (['class'=> 'test', 'disabled'=>'disabled'], false);--> | ||
31 | -<!--// $form->field ($user, 'isCustomer', ['template' => "{label}:\n{input}\n{hint}\n{error}"])--> | ||
32 | -<!--// ->label ('Я - заказчик')--> | ||
33 | -<!--// ->hint ('Отображается если созданы заказы.')--> | ||
34 | -<!--// ->checkbox ([], false);--> | ||
35 | -<!--// $form->field ($user, 'type')--> | ||
36 | -<!--// ->label ('Кто вы')--> | ||
37 | -<!--// ->radioList ([1 => 'Частное лицо', 2 => 'Компания'],['class'=>'test']);--> | ||
38 | - | ||
39 | - | ||
40 | - | ||
41 | - | ||
42 | - | ||
43 | - | 22 | + <?php $form = ActiveForm::begin(); ?> |
44 | <div class="general-check-wr style"> | 23 | <div class="general-check-wr style"> |
45 | <div class="general-check"> | 24 | <div class="general-check"> |
46 | 25 | ||
47 | <div class="general-check-left"> | 26 | <div class="general-check-left"> |
48 | - <?= $form->field ($user, 'isPerformer', ['template' => "{input}\n{label}\n{error}"]) | ||
49 | - ->label ('<span></span>Я - исполнитель') | ||
50 | - ->checkbox (['class'=> 'custom-check disabled admin-check', 'disabled'=>'disabled'], false); | ||
51 | - ?> | 27 | + <?= $form->field($user, 'isPerformer', [ 'template' => "{input}\n{label}\n{error}" ]) |
28 | + ->label('<span></span>Я - исполнитель') | ||
29 | + ->checkbox([ | ||
30 | + 'class' => 'custom-check disabled admin-check', | ||
31 | + 'disabled' => 'disabled', | ||
32 | + ], false); ?> | ||
52 | </div> | 33 | </div> |
53 | <div class="general-check-right"> | 34 | <div class="general-check-right"> |
54 | <div class="general-check-right-txt">Обязательно должны быть указаны специализации услуг, что бы вы попали в рейтинг исполнителей</div> | 35 | <div class="general-check-right-txt">Обязательно должны быть указаны специализации услуг, что бы вы попали в рейтинг исполнителей</div> |
@@ -57,10 +38,12 @@ | @@ -57,10 +38,12 @@ | ||
57 | 38 | ||
58 | <div class="general-check"> | 39 | <div class="general-check"> |
59 | <div class="general-check-left"> | 40 | <div class="general-check-left"> |
60 | - <?= $form->field ($user, 'isCustomer', ['template' => "{input}\n{label}\n{error}"]) | ||
61 | - ->label ('<span></span>Я - заказчик') | ||
62 | - ->checkbox (['class'=> 'custom-check disabled admin-check', 'disabled'=>'disabled'], false); | ||
63 | - ?> | 41 | + <?= $form->field($user, 'isCustomer', [ 'template' => "{input}\n{label}\n{error}" ]) |
42 | + ->label('<span></span>Я - заказчик') | ||
43 | + ->checkbox([ | ||
44 | + 'class' => 'custom-check disabled admin-check', | ||
45 | + 'disabled' => 'disabled', | ||
46 | + ], false); ?> | ||
64 | </div> | 47 | </div> |
65 | <div class="general-check-right"> | 48 | <div class="general-check-right"> |
66 | <div class="general-check-right-txt">Обязательно должны быть созданы проекты вами, что бы вы попали в рейтинг исполнителей</div> | 49 | <div class="general-check-right-txt">Обязательно должны быть созданы проекты вами, что бы вы попали в рейтинг исполнителей</div> |
@@ -71,105 +54,97 @@ | @@ -71,105 +54,97 @@ | ||
71 | <div class="general-who style border-general"> | 54 | <div class="general-who style border-general"> |
72 | <div class="general-who-title gen-admin-title">Кто вы:</div> | 55 | <div class="general-who-title gen-admin-title">Кто вы:</div> |
73 | 56 | ||
74 | - <?= $form->field ($user, 'type') | ||
75 | - ->label (false) | ||
76 | - ->radioList ( | ||
77 | - [1 => 'Частное лицо', 2 => 'Компания'], | ||
78 | - [ | ||
79 | - 'item' => function($index, $label, $name, $checked, $value) { | ||
80 | - $return = '<label>'; | ||
81 | - $return .= '<input type="radio" name="' . $name . '" value="' . $value . '" '.($checked ? "checked" :"").' >'; | ||
82 | - $return .= '<span></span>' . ucwords($label); | ||
83 | - $return .= '</label>'; | 57 | + <?= $form->field($user, 'type') |
58 | + ->label(false) | ||
59 | + ->radioList([ | ||
60 | + 1 => 'Частное лицо', | ||
61 | + 2 => 'Компания', | ||
62 | + ], [ | ||
63 | + 'item' => function($index, $label, $name, $checked, $value) { | ||
64 | + $return = '<label>'; | ||
65 | + $return .= '<input type="radio" name="' . $name . '" value="' . $value . '" ' . ( $checked ? "checked" : "" ) . ' >'; | ||
66 | + $return .= '<span></span>' . ucwords($label); | ||
67 | + $return .= '</label>'; | ||
84 | 68 | ||
85 | - return $return; | ||
86 | - } | ||
87 | - ] | ||
88 | - ); | ||
89 | - ?> | 69 | + return $return; |
70 | + }, | ||
71 | + ]); ?> | ||
90 | 72 | ||
91 | 73 | ||
92 | </div> | 74 | </div> |
93 | 75 | ||
94 | - <?= $form->field ($company_info, 'name', ['options' => ['class' => 'form-group company_info']]) | ||
95 | - ->label ('Название компании') | ||
96 | - ->textInput (); | ||
97 | - ?> | ||
98 | - <?= $form->field ($company_info, 'staff', ['options' => ['class' => 'form-group company_info']]) | ||
99 | - ->label ('Количество сотрудников') | ||
100 | - ->input ('number'); | ||
101 | - ?> | ||
102 | - <?= '<div class="company_info">Контакты представителя</div>'; | ||
103 | - ?> | 76 | + <?= $form->field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ] ]) |
77 | + ->label('Название компании') | ||
78 | + ->textInput(); ?> | ||
79 | + <?= $form->field($company_info, 'staff', [ 'options' => [ 'class' => 'form-group company_info' ] ]) | ||
80 | + ->label('Количество сотрудников') | ||
81 | + ->input('number'); ?> | ||
82 | + <?= '<div class="company_info">Контакты представителя</div>'; ?> | ||
104 | 83 | ||
105 | 84 | ||
106 | <div class="input-blocks-wrapper"> | 85 | <div class="input-blocks-wrapper"> |
107 | <div class="input-blocks"> | 86 | <div class="input-blocks"> |
108 | - <?= $form->field ($user, 'firstname') | ||
109 | - ->label ('Имя') | ||
110 | - ->textInput (); | ||
111 | - ?> | 87 | + <?= $form->field($user, 'firstname') |
88 | + ->label('Имя') | ||
89 | + ->textInput(); ?> | ||
112 | </div> | 90 | </div> |
113 | </div> | 91 | </div> |
114 | 92 | ||
115 | - <?= $form->field ($user, 'lastname') | ||
116 | - ->label ('Фамилия') | ||
117 | - ->textInput (); | ||
118 | - ?> | ||
119 | - <?= $form->field ($user_info, 'country') | ||
120 | - ->label ('Ваша страна') | ||
121 | - ->textInput (); | ||
122 | - ?> | ||
123 | - <?= $form->field ($user_info, 'city') | ||
124 | - ->label ('Ваш город') | ||
125 | - ->textInput (); | ||
126 | - ?> | ||
127 | - <?= $form->field ($company_info, 'street', ['options' => ['class' => 'form-group company_info']]) | ||
128 | - ->label ('Улица') | ||
129 | - ->textInput (); | ||
130 | - ?> | ||
131 | - <?= $form->field ($company_info, 'house', ['options' => ['class' => 'form-group company_info']]) | ||
132 | - ->label ('Дом') | ||
133 | - ->textInput (); | ||
134 | - ?> | ||
135 | - <?= $form->field ($user, 'email') | ||
136 | - ->label ('Email') | ||
137 | - ->textInput (['disabled' => 'disabled']); | ||
138 | - ?> | ||
139 | - <?= $form->field ($company_info, 'hide_mail', ['options' => ['class' => 'form-group company_info'], 'template' => "{input}{label}\n{hint}\n{error}"]) | ||
140 | - ->label ('Не публиковать Email') | ||
141 | - ->checkbox (['checked'=>'checked'], false); | ||
142 | - ?> | ||
143 | - <?= $form->field ($user_info, 'busy') | ||
144 | - ->label ('Статус') | ||
145 | - ->radioList ([0 => 'Свободен', 1 => 'Занят']); | ||
146 | - ?> | ||
147 | - <?= $form->field ($user_info, 'member') | ||
148 | - ->label ('Членство в МФП') | ||
149 | - ->hint ('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') | ||
150 | - ->radioList ([0 => 'Не хочу', 1 => 'Хочу стать']); | ||
151 | - ?> | ||
152 | - <?= ImageUploader::widget([ | ||
153 | - 'model'=> $user_info, | ||
154 | - 'field'=>'image', | ||
155 | - 'width'=>100, | ||
156 | - 'height'=>100, | ||
157 | - 'multi'=>false, | ||
158 | - 'gallery' =>$user_info->image, | ||
159 | - 'name' => 'Загрузить аватар' | ||
160 | - ]); | ||
161 | - ?> | ||
162 | - <?= ImageUploader::widget([ | ||
163 | - 'model'=> $user_info, | ||
164 | - 'field'=>'poster', | ||
165 | - 'width'=>1200, | ||
166 | - 'height'=>600, | ||
167 | - 'multi'=>false, | ||
168 | - 'gallery' =>$user_info->poster, | ||
169 | - 'name' => 'Загрузить постер' | ||
170 | - ]); | ||
171 | - ?> | ||
172 | - <?= Html::submitButton('Обновить', ['class' => 'btn btn-primary']); | ||
173 | - $form->end (); | ||
174 | - ?> | 93 | + <?= $form->field($user, 'lastname') |
94 | + ->label('Фамилия') | ||
95 | + ->textInput(); ?> | ||
96 | + <?= $form->field($user_info, 'country') | ||
97 | + ->label('Ваша страна') | ||
98 | + ->textInput(); ?> | ||
99 | + <?= $form->field($user_info, 'city') | ||
100 | + ->label('Ваш город') | ||
101 | + ->textInput(); ?> | ||
102 | + <?= $form->field($company_info, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ]) | ||
103 | + ->label('Улица') | ||
104 | + ->textInput(); ?> | ||
105 | + <?= $form->field($company_info, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ]) | ||
106 | + ->label('Дом') | ||
107 | + ->textInput(); ?> | ||
108 | + <?= $form->field($user, 'email') | ||
109 | + ->label('Email') | ||
110 | + ->textInput([ 'disabled' => 'disabled' ]); ?> | ||
111 | + <?= $form->field($company_info, 'hide_mail', [ | ||
112 | + 'options' => [ 'class' => 'form-group company_info' ], | ||
113 | + 'template' => "{input}{label}\n{hint}\n{error}", | ||
114 | + ]) | ||
115 | + ->label('Не публиковать Email') | ||
116 | + ->checkbox([ 'checked' => 'checked' ], false); ?> | ||
117 | + <?= $form->field($user_info, 'busy') | ||
118 | + ->label('Статус') | ||
119 | + ->radioList([ | ||
120 | + 0 => 'Свободен', | ||
121 | + 1 => 'Занят', | ||
122 | + ]); ?> | ||
123 | + <?= $form->field($user_info, 'member') | ||
124 | + ->label('Членство в МФП') | ||
125 | + ->hint('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') | ||
126 | + ->radioList([ | ||
127 | + 0 => 'Не хочу', | ||
128 | + 1 => 'Хочу стать', | ||
129 | + ]); ?> | ||
130 | + <?= ImageUploader::widget([ | ||
131 | + 'model' => $user_info, | ||
132 | + 'field' => 'image', | ||
133 | + 'width' => 100, | ||
134 | + 'height' => 100, | ||
135 | + 'multi' => false, | ||
136 | + 'gallery' => $user_info->image, | ||
137 | + 'name' => 'Загрузить аватар', | ||
138 | + ]); ?> | ||
139 | + <?= ImageUploader::widget([ | ||
140 | + 'model' => $user_info, | ||
141 | + 'field' => 'poster', | ||
142 | + 'width' => 1200, | ||
143 | + 'height' => 600, | ||
144 | + 'multi' => false, | ||
145 | + 'gallery' => $user_info->poster, | ||
146 | + 'name' => 'Загрузить постер', | ||
147 | + ]); ?> | ||
148 | + <?= Html::submitButton('Обновить', [ 'class' => 'btn btn-primary' ]); | ||
149 | + $form->end(); ?> | ||
175 | </div> | 150 | </div> |