From 5f49082a7972ca75f201b2c247de72dacfd1b807 Mon Sep 17 00:00:00 2001 From: Yarik Date: Fri, 5 Feb 2016 16:20:03 +0200 Subject: [PATCH] test --- backend/web/js/option.js | 5 +++-- common/config/.gitignore | 3 ++- frontend/assets/AppAsset.php | 2 +- frontend/controllers/AccountsController.php | 470 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- frontend/views/accounts/add-skills.php | 19 +++++-------------- frontend/views/accounts/description.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/general.php | 159 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------- frontend/views/accounts/service.php | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------ frontend/views/layouts/admin.php | 4 ++++ 9 files changed, 480 insertions(+), 288 deletions(-) create mode 100644 frontend/views/accounts/description.php diff --git a/backend/web/js/option.js b/backend/web/js/option.js index 298e76e..64e5ce4 100755 --- a/backend/web/js/option.js +++ b/backend/web/js/option.js @@ -19,10 +19,11 @@ function checkboxerInit() { } function accountRedraw() { var type = $('input[name="User[type]"]:checked').val(); + console.log(type); if(type == 2) { - $('#form_definition').addClass('form_for_company'); - } else { $('#form_definition').removeClass('form_for_company'); + } else { + $('#form_definition').addClass('form_for_company'); } } $(function() { diff --git a/common/config/.gitignore b/common/config/.gitignore index e1ff6ce..c8e6738 100755 --- a/common/config/.gitignore +++ b/common/config/.gitignore @@ -1,2 +1,3 @@ /params-local.php -/main-local.php \ No newline at end of file +/main-local.php +/main-remote.php \ No newline at end of file diff --git a/frontend/assets/AppAsset.php b/frontend/assets/AppAsset.php index f529779..a488c50 100755 --- a/frontend/assets/AppAsset.php +++ b/frontend/assets/AppAsset.php @@ -19,7 +19,7 @@ class AppAsset extends AssetBundle public $css = [ 'css/style.css', '/admin/css/flags32.css', - 'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', + //'https://fonts.googleapis.com/css?family=Roboto:400,700&subset=cyrillic,latin', ]; public $js = [ '/js/script.js', diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index e2fc84d..7b7a9b4 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -1,237 +1,327 @@ [ - 'class' => AccessControl::className(), - 'rules' => [ - [ - //'actions' => ['cabinet','change-password', 'bookmarks', 'projects'], - 'allow' => true, - 'roles' => ['@'], + public function behaviors() + { + return [ + 'access' => [ + 'class' => AccessControl::className(), + 'rules' => [ + [ + //'actions' => ['cabinet','change-password', 'bookmarks', 'projects'], + 'allow' => true, + 'roles' => [ '@' ], + ], ], ], - ], - ]; - } - + ]; + } - public function actionCabinet() - { + public function actionCabinet() + { + $user = $this->findUser(Yii::$app->user->identity->id); - $user = $this->findUser(Yii::$app->user->identity->id); + $langs = Language::getActiveLanguages(); - $langs = Language::getActiveLanguages(); + if($user->load(Yii::$app->request->post()) && $user->save()) { + $user->userInfo->load(Yii::$app->request->post()); + $user->userInfo->save(); + Fields::saveFieldData(Yii::$app->request->post('Fields'), $user->id, $user::className(), 'ru'); + return $this->render('cabinet', [ + 'user' => $user, + 'user_info' => $user->userInfo, + 'langs' => $langs, + ]); - if ($user->load(Yii::$app->request->post()) && $user->save()) { - $user->userInfo->load(Yii::$app->request->post()); - $user->userInfo->save(); - Fields::saveFieldData( Yii::$app->request->post('Fields'), $user->id, $user::className(),'ru'); - return $this->render('cabinet', [ - 'user' => $user, - 'user_info' => $user->userInfo, - 'langs' => $langs, - ]); + } else { - } else { + return $this->render('cabinet', [ + 'user' => $user, + 'user_info' => $user->userInfo, + 'langs' => $langs, + ]); - return $this->render('cabinet', [ - 'user' => $user, - 'user_info' => $user->userInfo, - 'langs' => $langs, - ]); + } } + public function actionBookmarks() + { + return $this->render('bookmarks'); + } - } - - public function actionBookmarks() - { - return $this->render('bookmarks'); - } - - public function actionGeneral() - { - $user_info = UserInfo::find()->where(['user_id' => \Yii::$app->user->getId()])->one(); - $company_info = CompanyInfo::find()->where(['user_id' => \Yii::$app->user->getId()])->one(); - $user = \Yii::$app->user->identity; - if(empty($user_info)) + public function actionGeneral() { - $user_info = new UserInfo(['user_id' => \Yii::$app->user->getId()]); + $user_info = UserInfo::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->one(); + $company_info = CompanyInfo::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->one(); + $user = \Yii::$app->user->identity; + if(empty( $user_info )) { + $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); + } + if(empty( $company_info )) { + $company_info = new CompanyInfo([ 'user_id' => \Yii::$app->user->getId() ]); + } + $post = \Yii::$app->request->post(); + if(!empty( $post )) { + $user_info->load($post); + $company_info->load($post); + $user->load($post); + if($user_info->save() && $user->save() && $company_info->save()) { + \Yii::$app->session->setFlash('userinfoupdate', 'Информация успешно обновлена'); + } else { + \Yii::$app->session->setFlash('userinfoupdate', 'Ошибка обновления. Проверьте форму'); + } + } + return $this->render('general', [ + 'user_info' => $user_info, + 'user' => $user, + 'company_info' => $company_info, + ]); } - if(empty($company_info)) + + public function actionPortfolio() { - $company_info = new CompanyInfo(['user_id' => \Yii::$app->user->getId()]); + } - $post = \Yii::$app->request->post(); - if(!empty($post)) + + /** + * $user User + */ + public function actionSetting() { - $user_info->load($post); - $company_info->load($post); - $user->load($post); - if($user_info->save() && $user->save() && $company_info->save()) - { - \Yii::$app->session->setFlash('userinfoupdate', 'Информация успешно обновлена'); - } else { - \Yii::$app->session->setFlash('userinfoupdate', 'Ошибка обновления. Проверьте форму'); + $user = \Yii::$app->user->identity; + $post = \Yii::$app->request->post('User'); + if(!empty( $post )) { + if(empty( $post[ 'new_password' ] )) { + $user->addError('new_password', 'Введите новый пароль'); + } else { + $user->new_password = $post[ 'new_password' ]; + } + if(empty( $post[ 'old_password' ] )) { + $user->addError('old_password', 'Введите новый пароль'); + } else { + $user->old_password = $post[ 'old_password' ]; + } + if(empty( $post[ 'password_reply' ] ) || $post[ 'password_reply' ] !== $post[ 'new_password' ]) { + $user->addError('password_reply', 'Неправильный повтор пароля'); + } else { + $user->password_reply = $post[ 'password_reply' ]; + } + if(!$user->hasErrors()) { + if($user->validatePassword($user->old_password)) { + $user->setPassword($user->new_password); + $user->generateAuthKey(); + if($user->save()) { + \Yii::$app->session->setFlash('passwordupdate', 'Пароль успешно обновлен'); + } + } else { + $user->addError('old_password', 'Неправильный старый пароль'); + } + } } + return $this->render('setting', [ 'user' => $user ]); } - return $this->render('general', ['user_info' => $user_info, 'user' => $user, 'company_info' => $company_info]); - } - - public function actionPortfolio() - { - - } - /** - * $user User - */ - public function actionSetting() - { - $user = \Yii::$app->user->identity; - $post = \Yii::$app->request->post('User'); - if(!empty($post)) { - if(empty($post['new_password'])) { - $user->addError('new_password', 'Введите новый пароль'); - } else { - $user->new_password = $post['new_password']; + public function actionContacts() + { + $user_info = UserInfo::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->one(); + if(empty( $user_info )) { + $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); } - if(empty($post['old_password'])) { - $user->addError('old_password', 'Введите новый пароль'); - } else { - $user->old_password = $post['old_password']; + if(!empty( \Yii::$app->request->post() )) { + Fields::saveFieldData(Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(), 'ru'); + $user_info->load(\Yii::$app->request->post()); + $user_info->save(); } - if(empty($post['password_reply']) || $post['password_reply'] !== $post['new_password']) { - $user->addError('password_reply', 'Неправильный повтор пароля'); - } else { - $user->password_reply = $post['password_reply']; + return $this->render('contacts', [ 'user_info' => $user_info ]); + } + + public function actionService() + { + $user_info = UserInfo::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->one(); + if(empty( $user_info )) { + $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); } - if(!$user->hasErrors()) { - if($user->validatePassword($user->old_password)) { - $user->setPassword($user->new_password); - $user->generateAuthKey(); - if($user->save()) { - \Yii::$app->session->setFlash('passwordupdate', 'Пароль успешно обновлен'); - } - } else { - $user->addError('old_password', 'Неправильный старый пароль'); + $post = \Yii::$app->request->post(); + if(!empty( $post )) { + $user_info->load($post); + $user_info->save(); + $user_specialization_values = [ ]; + $user_payment_values = [ ]; + UserSpecialization::deleteAll([ 'user_id' => \Yii::$app->user->getId() ]); + UserPayment::deleteAll([ 'user_id' => \Yii::$app->user->getId() ]); + foreach($post[ 'UserSpecialization' ][ 'specialization_id' ] as $index => $value) { + $user_specialization_values[] = (new UserSpecialization([ 'user_id' => \Yii::$app->user->getId(), + 'specialization_id' => $value, + ]))->save(); + } + foreach($post[ 'UserPayment' ][ 'payment_id' ] as $index => $value) { + $user_payment_values[] = (new UserPayment([ 'user_id' => \Yii::$app->user->getId(), + 'payment_id' => $value, + ]))->save(); } } + $user_specialization = UserSpecialization::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->select([ 'specialization_id' ]) + ->column(); + $user_payment = UserPayment::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->select([ 'payment_id' ]) + ->column(); + $user_specialization_input = new UserSpecialization([ 'user_id' => \Yii::$app->user->getId() ]); + $user_payment_input = new UserPayment([ 'user_id' => \Yii::$app->user->getId() ]); + $specialization = Specialization::find() + ->select([ + 'specialization_name', + 'specialization_id', + ]) + ->indexBy('specialization_id') + ->asArray() + ->column(); + $payment = Payment::find() + ->select([ + 'name', + 'payment_id', + ]) + ->indexBy('payment_id') + ->asArray() + ->column(); + return $this->render('service', [ + 'user_info' => $user_info, + 'specialization' => $specialization, + 'user_specialization' => $user_specialization, + 'user_specialization_input' => $user_specialization_input, + 'payment' => $payment, + 'user_payment' => $user_payment, + 'user_payment_input' => $user_payment_input, + ]); } - return $this->render('setting', ['user' => $user]); - } - public function actionContacts() - { - $user_info = UserInfo::find()->where(['user_id' => \Yii::$app->user->getId()])->one(); - if(empty($user_info)) { - $user_info = new UserInfo(['user_id' => \Yii::$app->user->getId()]); - } - if(!empty(\Yii::$app->request->post())) { - Fields::saveFieldData( Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(),'ru'); - $user_info->load(\Yii::$app->request->post()); - $user_info->save(); - $user_info; + public function actionAddSkills() + { + return $this->render('add-skills'); } - return $this->render('contacts', ['user_info' => $user_info]); - } - - public function actionService() - { - return $this->render('service'); - } - - public function actionAddSkills() - { - } - - public function actionEmployment() - { - $post = \Yii::$app->request->post(); - if(!empty($post)) { - $job = []; - for($i = 0; $i < count($post['Job']); $i++) { - $job[$i] = new Job(['user_id' => \Yii::$app->user->getId(), 'current' => 0]); + public function actionDescription() + { + $user_info = UserInfo::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->one(); + if(empty( $user_info )) { + $user_info = new UserInfo([ 'user_id' => \Yii::$app->user->getId() ]); + } + $post = \Yii::$app->request->post(); + if(!empty($post)) { + $user_info->load($post); + $user_info->save(); } - if(Job::loadMultiple($job, $post)) { - $job[0]->current = 1; - if(Job::validateMultiple($job)) { - Job::deleteAll(['user_id' => \Yii::$app->user->getId()]); - foreach($job as $onejob) { - $onejob->save(false); + return $this->render('description', [ 'user_info' => $user_info ]); + } + + public function actionEmployment() + { + $post = \Yii::$app->request->post(); + if(!empty( $post )) { + $job = [ ]; + for($i = 0; $i < count($post[ 'Job' ]); $i++) { + $job[ $i ] = new Job([ + 'user_id' => \Yii::$app->user->getId(), + 'current' => 0, + ]); + } + if(Job::loadMultiple($job, $post)) { + $job[ 0 ]->current = 1; + if(Job::validateMultiple($job)) { + Job::deleteAll([ 'user_id' => \Yii::$app->user->getId() ]); + foreach($job as $onejob) { + $onejob->save(false); + } } } + } else { + $job = Job::find() + ->where([ 'user_id' => \Yii::$app->user->getId() ]) + ->orderBy([ 'current' => SORT_DESC ]) + ->all(); + if(empty( $job )) { + $job[] = new Job([ + 'user_id' => \Yii::$app->user->getId(), + 'current' => 0, + ]); + } + if(!$job[ 0 ]->current) { + array_unshift($job, new Job([ + 'user_id' => \Yii::$app->user->getId(), + 'current' => 1, + ])); + } } - } else { - $job = Job::find()->where(['user_id' => \Yii::$app->user->getId()])->orderBy(['current' => SORT_DESC])->all(); - if(empty($job)) { - $job[] = new Job(['user_id' => \Yii::$app->user->getId(), 'current' => 0]); - } - if(!$job[0]->current) { - array_unshift($job, new Job(['user_id' => \Yii::$app->user->getId(), 'current' => 1])); - } + return $this->render('employment', [ 'job' => $job ]); } - return $this->render('employment', ['job' => $job]); - } - - public function actionProjects() - { - return $this->render('projects'); - } - - public function actionGallery() - { - } + public function actionProjects() + { + return $this->render('projects'); + } - public function actionGetForm($lastindex) - { - return $this->renderAjax('_job_form', ['index' => $lastindex+1]); - } + public function actionGallery() + { - /** - * @param $id - * @return User - * @throws NotFoundHttpException - */ - protected function findUser($id) - { + } - if ($model = User::findOne(["id"=>$id])) { - return $model; - } else { - throw new NotFoundHttpException('The requested page does not exist.'); + public function actionGetForm($lastindex) + { + return $this->renderAjax('_job_form', [ 'index' => $lastindex + 1 ]); } - } + /** + * @param $id + * + * @return User + * @throws NotFoundHttpException + */ + protected function findUser($id) + { + if($model = User::findOne([ "id" => $id ])) { + return $model; + } else { + throw new NotFoundHttpException('The requested page does not exist.'); + } + } -} + } diff --git a/frontend/views/accounts/add-skills.php b/frontend/views/accounts/add-skills.php index 162a954..b6bb1c4 100755 --- a/frontend/views/accounts/add-skills.php +++ b/frontend/views/accounts/add-skills.php @@ -4,23 +4,14 @@ use yii\helpers\Html; use yii\widgets\ActiveForm; use \common\widgets\MultiLangForm; - $this->title = 'Мой профиль'; + $this->title = 'Дополнительные навыки'; $this->params['breadcrumbs'][] = $this->title; ?> -

title ?>

- - - render('_form', [ - 'user' => $user, - 'user_info' => $user_info, -]); - -echo MultiLangForm::widget(['form'=>$form]); - + $form = ActiveForm::begin(); ?> - +end(); +?> \ No newline at end of file diff --git a/frontend/views/accounts/description.php b/frontend/views/accounts/description.php new file mode 100644 index 0000000..56d56a1 --- /dev/null +++ b/frontend/views/accounts/description.php @@ -0,0 +1,26 @@ +title = 'Описание'; + $this->params[ 'breadcrumbs' ][] = $this->title; +?> +

title ?>

+ + field($user_info, 'about')->label(false)->widget(CKEditor::className()) ?> + 'btn btn-primary' ]) ?> + end(); + ?> diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php index caceae1..8a1cc6d 100755 --- a/frontend/views/accounts/general.php +++ b/frontend/views/accounts/general.php @@ -5,90 +5,101 @@ * @var CompanyInfo $company_info */ use common\models\CompanyInfo; - use common\models\Option; use common\models\User; use common\models\UserInfo; use common\widgets\ImageUploader; use yii\helpers\Html; use yii\widgets\ActiveForm; - use \common\widgets\MultiLangForm; $this->title = 'Учетные данные'; - $this->params['breadcrumbs'][] = $this->title; + $this->params[ 'breadcrumbs' ][] = $this->title; ?>

title ?>

field ($user, 'isPerformer', ['template' => "{label}:\n{input}\n{hint}\n{error}"]) - ->label ('Я - исполнитель') - ->hint ('Отображается если указать специализации услуг в личном кабинете.') - ->checkbox ([], false); - echo $form->field ($user, 'isCustomer', ['template' => "{label}:\n{input}\n{hint}\n{error}"]) - ->label ('Я - заказчик') - ->hint ('Отображается если созданы заказы.') - ->checkbox ([], false); - echo $form->field ($user, 'type') - ->label ('Кто вы') - ->radioList ([1 => 'Частное лицо', 2 => 'Компания']); - echo $form->field ($company_info, 'name', ['options' => ['class' => 'form-group company_info']]) - ->label ('Название компании') - ->textInput (); - echo $form->field ($company_info, 'staff', ['options' => ['class' => 'form-group company_info']]) - ->label ('Количество сотрудников') - ->input ('number'); - echo '
Контакты представителя
'; - echo $form->field ($user, 'lastname') - ->label ('Фамилия') - ->textInput (); - echo $form->field ($user, 'firstname') - ->label ('Имя') - ->textInput (); - echo $form->field ($user_info, 'country') - ->label ('Ваша страна') - ->textInput (); - echo $form->field ($user_info, 'city') - ->label ('Ваш город') - ->textInput (); - echo $form->field ($company_info, 'street', ['options' => ['class' => 'form-group company_info']]) - ->label ('Улица') - ->textInput (); - echo $form->field ($company_info, 'house', ['options' => ['class' => 'form-group company_info']]) - ->label ('Дом') - ->textInput (); - echo $form->field ($user, 'email') - ->label ('Email') - ->textInput (['disabled' => 'disabled']); - echo $form->field ($company_info, 'hide_mail', ['options' => ['class' => 'form-group company_info'], 'template' => "{input}{label}\n{hint}\n{error}"]) - ->label ('Не публиковать Email') - ->checkbox ([], false); - echo $form->field ($user_info, 'busy') - ->label ('Статус') - ->radioList ([0 => 'Свободен', 1 => 'Занят']); - echo $form->field ($user_info, 'member') - ->label ('Членство в МФП') - ->hint ('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') - ->radioList ([0 => 'Не хочу', 1 => 'Хочу стать']); - echo ImageUploader::widget([ - 'model'=> $user_info, - 'field'=>'image', - 'width'=>100, - 'height'=>100, - 'multi'=>false, - 'gallery' =>$user_info->image, - 'name' => 'Загрузить аватар' - ]); - echo ImageUploader::widget([ - 'model'=> $user_info, - 'field'=>'poster', - 'width'=>1200, - 'height'=>600, - 'multi'=>false, - 'gallery' =>$user_info->poster, - 'name' => 'Загрузить постер' - ]); - echo Html::submitButton('Обновить', ['class' => 'btn btn-primary']); - $form->end (); + $form = ActiveForm::begin(); + ?> + field($user, 'isPerformer', [ 'template' => "{label}:\n{input}\n{hint}\n{error}" ]) + ->label('Я - исполнитель') + ->hint('Отображается если указать специализации услуг в личном кабинете.') + ->checkbox([ ], false) ?> + field($user, 'isCustomer', [ 'template' => "{label}:\n{input}\n{hint}\n{error}" ]) + ->label('Я - заказчик') + ->hint('Отображается если созданы заказы.') + ->checkbox([ ], false) ?> + field($user, 'type') + ->label('Кто вы') + ->radioList([ + 1 => 'Частное лицо', + 2 => 'Компания', + ]) ?> + field($company_info, 'name', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Название компании') + ->textInput() ?> + field($company_info, 'staff', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Количество сотрудников') + ->input('number') ?> +
Контакты представителя
+ field($user, 'lastname') + ->label('Фамилия') + ->textInput() ?> + field($user, 'firstname') + ->label('Имя') + ->textInput() ?> + field($user_info, 'country') + ->label('Ваша страна') + ->textInput() ?> + field($user_info, 'city') + ->label('Ваш город') + ->textInput() ?> + field($company_info, 'street', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Улица') + ->textInput() ?> + field($company_info, 'house', [ 'options' => [ 'class' => 'form-group company_info' ] ]) + ->label('Дом') + ->textInput() ?> + field($user, 'email') + ->label('Email') + ->textInput([ 'disabled' => 'disabled' ]) ?> + field($company_info, 'hide_mail', [ + 'options' => [ 'class' => 'form-group company_info' ], + 'template' => "{input}{label}\n{hint}\n{error}", + ]) + ->label('Не публиковать Email') + ->checkbox([ ], false) ?> + field($user_info, 'busy') + ->label('Статус') + ->radioList([ + 0 => 'Свободен', + 1 => 'Занят', + ]) ?> + field($user_info, 'member') + ->label('Членство в МФП') + ->hint('Выберите если хотите стать членом МФП и наш менеджер свяжется с Вами.') + ->radioList([ + 0 => 'Не хочу', + 1 => 'Хочу стать', + ]) ?> + $user_info, + 'field' => 'image', + 'width' => 100, + 'height' => 100, + 'multi' => false, + 'gallery' => $user_info->image, + 'name' => 'Загрузить аватар', + ]) ?> + $user_info, + 'field' => 'poster', + 'width' => 1200, + 'height' => 600, + 'multi' => false, + 'gallery' => $user_info->poster, + 'name' => 'Загрузить постер', + ]) ?> + 'btn btn-primary' ]) ?> + end(); ?>
diff --git a/frontend/views/accounts/service.php b/frontend/views/accounts/service.php index 4ec4085..d8066de 100755 --- a/frontend/views/accounts/service.php +++ b/frontend/views/accounts/service.php @@ -1,10 +1,78 @@ title = 'Мой профиль'; - $this->params['breadcrumbs'][] = $this->title; + $this->params[ 'breadcrumbs' ][] = $this->title; + $user_specialization_input->specialization_id = $user_specialization; + $user_payment_input->payment_id = $user_payment; ?> -

title ?>

- - - - +

Рекомендуем детально заполнить для исполнителя. Это сильно влияет на количество заказов.

+ +field($user_info, 'salary', [ + 'template' => "{label}: от {input} за час\n{hint}\n{error}", + 'options' => [ 'class' => 'form-inline' ], +]) + ->label('Стоимость работ') + ->textInput() ?> +field($user_specialization_input, 'specialization_id') + ->label('Специализация услуг') + ->checkboxList($specialization) ?> +field($user_info, 'guarantee', [ + 'template' => "{label}: {input} лет\n{hint}\n{error}", + 'options' => [ 'class' => 'form-inline' ], +]) + ->label('Гарантия качества работ') + ->textInput() ?> +field($user_info, 'contract', [ 'options' => [ 'class' => 'form-inline' ] ]) + ->label('Работа по договору') + ->radioList([ + 0 => 'Да', + 1 => 'Нет', + ], [ 'class' => 'form-control-static' ]) ?> +field($user_info, 'estimate', [ 'options' => [ 'class' => 'form-inline' ] ]) + ->label('Предоставляете смету') + ->radioList([ + 0 => 'Да', + 1 => 'Нет', + ], [ 'class' => 'form-control-static' ]) ?> +field($user_info, 'purchase', [ 'options' => [ 'class' => 'form-inline' ] ]) + ->label('Делаете сами закупку материалов') + ->radioList([ + 0 => 'Да', + 1 => 'Нет', + ], [ 'class' => 'form-control-static' ]) ?> +field($user_info, 'delivery', [ 'options' => [ 'class' => 'form-inline' ] ]) + ->label('Занимаетесь сами доставкой материалов') + ->radioList([ + 0 => 'Да', + 1 => 'Нет', + ], [ 'class' => 'form-control-static' ]) ?> +field($user_info, 'prepayment', [ + 'template' => "{label}: {input} %\n{hint}\n{error}", + 'options' => [ 'class' => 'form-inline' ], +]) + ->label('Минимальная предоплата за работы') + ->textInput() ?> +field($user_payment_input, 'payment_id') + ->label('Способы оплаты') + ->checkboxList($payment) ?> + +end(); +?> diff --git a/frontend/views/layouts/admin.php b/frontend/views/layouts/admin.php index cd1cfd5..af2de81 100755 --- a/frontend/views/layouts/admin.php +++ b/frontend/views/layouts/admin.php @@ -28,6 +28,10 @@ $this->beginContent('@app/views/layouts/main.php'); 'url' => ['accounts/general'], ], [ + 'label' => 'Описание', + 'url' => ['accounts/description'], + ], + [ 'label' => 'Портфолио', 'url' => ['accounts/portfolio'], ], -- libgit2 0.21.4