From 51e0a2628c270e895652bb2f9ab274648df5b6b2 Mon Sep 17 00:00:00 2001 From: Yarik Date: Wed, 3 Feb 2016 10:43:59 +0200 Subject: [PATCH] test --- backend/web/js/option.js | 12 ++++++++++++ common/models/CompanyInfo.php | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ common/models/CompanyInfoSearch.php | 70 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ common/models/User.php | 15 +++++++++++++++ common/models/UserInfo.php | 26 +++++++++++++++++++++++--- console/migrations/m160202_090343_user_add_fields.php | 34 ++++++++++++++++++++++++++++++++++ console/migrations/m160202_094943_user_info_country_city.php | 30 ++++++++++++++++++++++++++++++ frontend/controllers/AccountsController.php | 108 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++- frontend/controllers/CompanyInfoController.php | 121 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/views/accounts/add-skills.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/contacts.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/employment.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/gallery.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/general.php | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/views/accounts/portfolio.php | 26 ++++++++++++++++++++++++++ frontend/views/accounts/service.php | 10 ++++++++++ frontend/views/accounts/setting.php | 44 ++++++++++++++++++++++++++++++++++++++++++++ frontend/views/chat/list.php | 2 +- frontend/views/company-info/_form.php | 31 +++++++++++++++++++++++++++++++ frontend/views/company-info/_search.php | 37 +++++++++++++++++++++++++++++++++++++ frontend/views/company-info/create.php | 21 +++++++++++++++++++++ frontend/views/company-info/index.php | 39 +++++++++++++++++++++++++++++++++++++++ frontend/views/company-info/update.php | 23 +++++++++++++++++++++++ frontend/views/company-info/view.php | 40 ++++++++++++++++++++++++++++++++++++++++ frontend/views/layouts/admin.php | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- frontend/views/layouts/gallery.php | 2 +- frontend/views/layouts/performer.php | 2 +- frontend/web/css/art_box.css | 3 +++ 28 files changed, 972 insertions(+), 10 deletions(-) create mode 100644 common/models/CompanyInfo.php create mode 100644 common/models/CompanyInfoSearch.php create mode 100644 console/migrations/m160202_090343_user_add_fields.php create mode 100644 console/migrations/m160202_094943_user_info_country_city.php create mode 100644 frontend/controllers/CompanyInfoController.php create mode 100644 frontend/views/accounts/add-skills.php create mode 100644 frontend/views/accounts/contacts.php create mode 100644 frontend/views/accounts/employment.php create mode 100644 frontend/views/accounts/gallery.php create mode 100644 frontend/views/accounts/general.php create mode 100644 frontend/views/accounts/portfolio.php create mode 100644 frontend/views/accounts/service.php create mode 100644 frontend/views/accounts/setting.php create mode 100644 frontend/views/company-info/_form.php create mode 100644 frontend/views/company-info/_search.php create mode 100644 frontend/views/company-info/create.php create mode 100644 frontend/views/company-info/index.php create mode 100644 frontend/views/company-info/update.php create mode 100644 frontend/views/company-info/view.php diff --git a/backend/web/js/option.js b/backend/web/js/option.js index 1786a9a..298e76e 100755 --- a/backend/web/js/option.js +++ b/backend/web/js/option.js @@ -17,6 +17,14 @@ function checkboxerInit() { $(value).trigger('change'); }); } +function accountRedraw() { + var type = $('input[name="User[type]"]:checked').val(); + if(type == 2) { + $('#form_definition').addClass('form_for_company'); + } else { + $('#form_definition').removeClass('form_for_company'); + } +} $(function() { var counter = 0; $(document).on('click', '.add_row', function() { @@ -137,4 +145,8 @@ $(function() { $(val).find('a[role=tab]').first().trigger('click'); }); checkboxerInit(); + accountRedraw(); + $(document).on('change', 'input[name="User[type]"]', function() { + accountRedraw(); + }); }); \ No newline at end of file diff --git a/common/models/CompanyInfo.php b/common/models/CompanyInfo.php new file mode 100644 index 0000000..e8f0b7b --- /dev/null +++ b/common/models/CompanyInfo.php @@ -0,0 +1,52 @@ + Yii::t('app', 'Company Info ID'), + 'name' => Yii::t('app', 'Name'), + 'staff' => Yii::t('app', 'Staff'), + 'street' => Yii::t('app', 'Street'), + 'house' => Yii::t('app', 'House'), + 'hide_mail' => Yii::t('app', 'Hide Mail'), + ]; + } +} diff --git a/common/models/CompanyInfoSearch.php b/common/models/CompanyInfoSearch.php new file mode 100644 index 0000000..4213d75 --- /dev/null +++ b/common/models/CompanyInfoSearch.php @@ -0,0 +1,70 @@ + $query, + ]); + + $this->load($params); + + if (!$this->validate()) { + // uncomment the following line if you do not want to return any records when validation fails + // $query->where('0=1'); + return $dataProvider; + } + + $query->andFilterWhere([ + 'company_info_id' => $this->company_info_id, + 'staff' => $this->staff, + 'hide_mail' => $this->hide_mail, + ]); + + $query->andFilterWhere(['like', 'name', $this->name]) + ->andFilterWhere(['like', 'street', $this->street]) + ->andFilterWhere(['like', 'house', $this->house]); + + return $dataProvider; + } +} diff --git a/common/models/User.php b/common/models/User.php index b199db1..1aec640 100755 --- a/common/models/User.php +++ b/common/models/User.php @@ -31,6 +31,9 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface const STATUS_DELETED = 0; const STATUS_ACTIVE = 10; public $profile; + public $old_password; + public $new_password; + public $password_reply; /** * @inheritdoc @@ -58,6 +61,8 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface return [ ['status', 'default', 'value' => self::STATUS_ACTIVE], ['status', 'in', 'range' => [self::STATUS_ACTIVE, self::STATUS_DELETED]], + [['username', 'lastname', 'firstname', 'middlename'], 'string', 'max' => 255], + [['type'], 'in', 'range' => [1, 2]], ]; } @@ -263,4 +268,14 @@ class User extends ActiveRecord implements IdentityInterface, UserRbacInterface public function getUserInfo(){ return $this->hasOne(UserInfo::className(), ['user_id' => 'id']); } + + public function getIsPerformer() + { + return true; + } + + public function getIsCustomer() + { + return true; + } } diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index accd2d8..7e21add 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -25,9 +25,28 @@ use Yii; * @property integer $delivery * @property double $prepayment * @property string $about + * @property integer $type */ class UserInfo extends \yii\db\ActiveRecord { + // Константа обознащающая физическое лицо + const USER_TYPE_FIZ = 1; + + // Константа обозначающая компанию + const USER_TYPE_COMPANY = 2; + + // Константа обозначающая, что компания/физ.лицо свободно + const USER_STATUS_FREE = 1; + + // Константа обозначающая, что компания/физ.лицо занято + const USER_STATUS_BUSY = 2; + + // Константа обозначающая, что компания/физ.лицо хочет стать членом МФП + const USER_MEMBER_FALSE = 1; + + // Константа обозначающая, что компания/физ.лицо не хочет стать членом МФП + const USER_MEMBER_TRUE = 2; + /** * @inheritdoc */ @@ -44,10 +63,11 @@ class UserInfo extends \yii\db\ActiveRecord return [ [['user_id', 'view_count', 'contract', 'estimate', 'purchase', 'delivery'], 'integer'], [['date_visit'], 'safe'], - [['experience', 'soft', 'guarantee', 'about'], 'string'], + [['experience', 'soft', 'guarantee', 'about', 'city', 'country'], 'string'], [['prepayment'], 'number'], - [['busy', 'rank', 'location'], 'string', 'max' => 50], - [['salary', 'job'], 'string', 'max' => 255] + [['rank', 'location'], 'string', 'max' => 50], + [['salary', 'job'], 'string', 'max' => 255], + [['busy', 'member'], 'boolean'], ]; } diff --git a/console/migrations/m160202_090343_user_add_fields.php b/console/migrations/m160202_090343_user_add_fields.php new file mode 100644 index 0000000..6a37820 --- /dev/null +++ b/console/migrations/m160202_090343_user_add_fields.php @@ -0,0 +1,34 @@ +addColumn('user', 'type', $this->smallInteger()); + $this->addColumn('user_info', 'image', $this->integer()); + $this->addColumn('user_info', 'poster', $this->integer()); + $this->addColumn('user_info', 'member', $this->smallInteger()); + + $this->createTable('{{%company_info}}', [ + 'company_info_id' => $this->primaryKey(), + 'name' => $this->string(255)->notNull(), + 'staff' => $this->integer(), + 'street' => $this->string(255), + 'house' => $this->string(255), + 'hide_mail' => $this->smallInteger(), + 'user_id' => $this->integer(), + ], null); + } + + public function down() + { + $this->dropColumn('user', 'type'); + $this->dropColumn('user_info', 'image'); + $this->dropColumn('user_info', 'poster'); + $this->dropColumn('user_info', 'member'); + $this->dropTable('company_info'); + } +} diff --git a/console/migrations/m160202_094943_user_info_country_city.php b/console/migrations/m160202_094943_user_info_country_city.php new file mode 100644 index 0000000..5603f81 --- /dev/null +++ b/console/migrations/m160202_094943_user_info_country_city.php @@ -0,0 +1,30 @@ +addColumn('user_info', 'country', $this->string(255)); + $this->addColumn('user_info', 'city', $this->string(255)); + } + + public function down() + { + $this->dropColumn('user_info', 'country'); + $this->dropColumn('user_info', 'city'); + } + + /* + // Use safeUp/safeDown to run migration code within a transaction + public function safeUp() + { + } + + public function safeDown() + { + } + */ +} diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index d62641b..80d629c 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -1,6 +1,7 @@ AccessControl::className(), 'rules' => [ [ - 'actions' => ['cabinet','change-password', 'bookmarks'], + //'actions' => ['cabinet','change-password', 'bookmarks', 'projects'], 'allow' => true, 'roles' => ['@'], ], @@ -75,6 +76,111 @@ class AccountsController extends Controller 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)) + { + $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]); + } + + 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']; + } + 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]); + } + + 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()]); + } + return $this->render('contacts', ['user_info' => $user_info]); + } + + public function actionService() + { + return $this->render('service'); + } + + public function actionAddSkills() + { + + } + + public function actionEmployment() + { + + } + + public function actionProjects() + { + return $this->render('projects'); + } + + public function actionGallery() + { + + } /** * @param $id diff --git a/frontend/controllers/CompanyInfoController.php b/frontend/controllers/CompanyInfoController.php new file mode 100644 index 0000000..3bf053a --- /dev/null +++ b/frontend/controllers/CompanyInfoController.php @@ -0,0 +1,121 @@ + [ + 'class' => VerbFilter::className(), + 'actions' => [ + 'delete' => ['post'], + ], + ], + ]; + } + + /** + * Lists all CompanyInfo models. + * @return mixed + */ + public function actionIndex() + { + $searchModel = new CompanyInfoSearch(); + $dataProvider = $searchModel->search(Yii::$app->request->queryParams); + + return $this->render('index', [ + 'searchModel' => $searchModel, + 'dataProvider' => $dataProvider, + ]); + } + + /** + * Displays a single CompanyInfo model. + * @param integer $id + * @return mixed + */ + public function actionView($id) + { + return $this->render('view', [ + 'model' => $this->findModel($id), + ]); + } + + /** + * Creates a new CompanyInfo model. + * If creation is successful, the browser will be redirected to the 'view' page. + * @return mixed + */ + public function actionCreate() + { + $model = new CompanyInfo(); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->company_info_id]); + } else { + return $this->render('create', [ + 'model' => $model, + ]); + } + } + + /** + * Updates an existing CompanyInfo model. + * If update is successful, the browser will be redirected to the 'view' page. + * @param integer $id + * @return mixed + */ + public function actionUpdate($id) + { + $model = $this->findModel($id); + + if ($model->load(Yii::$app->request->post()) && $model->save()) { + return $this->redirect(['view', 'id' => $model->company_info_id]); + } else { + return $this->render('update', [ + 'model' => $model, + ]); + } + } + + /** + * Deletes an existing CompanyInfo model. + * If deletion is successful, the browser will be redirected to the 'index' page. + * @param integer $id + * @return mixed + */ + public function actionDelete($id) + { + $this->findModel($id)->delete(); + + return $this->redirect(['index']); + } + + /** + * Finds the CompanyInfo model based on its primary key value. + * If the model is not found, a 404 HTTP exception will be thrown. + * @param integer $id + * @return CompanyInfo the loaded model + * @throws NotFoundHttpException if the model cannot be found + */ + protected function findModel($id) + { + if (($model = CompanyInfo::findOne($id)) !== null) { + 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 new file mode 100644 index 0000000..162a954 --- /dev/null +++ b/frontend/views/accounts/add-skills.php @@ -0,0 +1,26 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + +render('_form', [ + 'user' => $user, + 'user_info' => $user_info, +]); + +echo MultiLangForm::widget(['form'=>$form]); + +?> + + diff --git a/frontend/views/accounts/contacts.php b/frontend/views/accounts/contacts.php new file mode 100644 index 0000000..162a954 --- /dev/null +++ b/frontend/views/accounts/contacts.php @@ -0,0 +1,26 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + +render('_form', [ + 'user' => $user, + 'user_info' => $user_info, +]); + +echo MultiLangForm::widget(['form'=>$form]); + +?> + + diff --git a/frontend/views/accounts/employment.php b/frontend/views/accounts/employment.php new file mode 100644 index 0000000..162a954 --- /dev/null +++ b/frontend/views/accounts/employment.php @@ -0,0 +1,26 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + +render('_form', [ + 'user' => $user, + 'user_info' => $user_info, +]); + +echo MultiLangForm::widget(['form'=>$form]); + +?> + + diff --git a/frontend/views/accounts/gallery.php b/frontend/views/accounts/gallery.php new file mode 100644 index 0000000..162a954 --- /dev/null +++ b/frontend/views/accounts/gallery.php @@ -0,0 +1,26 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + +render('_form', [ + 'user' => $user, + 'user_info' => $user_info, +]); + +echo MultiLangForm::widget(['form'=>$form]); + +?> + + diff --git a/frontend/views/accounts/general.php b/frontend/views/accounts/general.php new file mode 100644 index 0000000..2dc12b6 --- /dev/null +++ b/frontend/views/accounts/general.php @@ -0,0 +1,74 @@ +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 Html::submitButton('Обновить', ['class' => 'btn btn-primary']); + $form->end (); + ?> +
diff --git a/frontend/views/accounts/portfolio.php b/frontend/views/accounts/portfolio.php new file mode 100644 index 0000000..162a954 --- /dev/null +++ b/frontend/views/accounts/portfolio.php @@ -0,0 +1,26 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + +render('_form', [ + 'user' => $user, + 'user_info' => $user_info, +]); + +echo MultiLangForm::widget(['form'=>$form]); + +?> + + diff --git a/frontend/views/accounts/service.php b/frontend/views/accounts/service.php new file mode 100644 index 0000000..4ec4085 --- /dev/null +++ b/frontend/views/accounts/service.php @@ -0,0 +1,10 @@ +title = 'Мой профиль'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ + + + diff --git a/frontend/views/accounts/setting.php b/frontend/views/accounts/setting.php new file mode 100644 index 0000000..bc0675f --- /dev/null +++ b/frontend/views/accounts/setting.php @@ -0,0 +1,44 @@ +title = 'Настройки профиля'; + $this->params['breadcrumbs'][] = $this->title; +?> + +

title ?>

+ +session->hasFlash ('passwordupdate')) + { + ?> + + Сменить пароль:

"; + echo $form->field ($user, 'old_password', ['template' => "{input}{label}\n{hint}\n{error}"]) + ->label ('Старый пароль') + ->passwordInput (['value' => '']); + echo $form->field ($user, 'new_password', ['template' => "{input}{label}\n{hint}\n{error}"]) + ->label ('Новый пароль') + ->passwordInput (['value' => '']); + echo $form->field ($user, 'password_reply', ['template' => "{input}{label}\n{hint}\n{error}"]) + ->label ('Повторите пароль') + ->passwordInput (['value' => '']); + echo Html::submitButton ('Обновить', ['class' => 'btn btn-primary']); + $form->end (); +?> + + diff --git a/frontend/views/chat/list.php b/frontend/views/chat/list.php index 48dabf4..9387e0e 100644 --- a/frontend/views/chat/list.php +++ b/frontend/views/chat/list.php @@ -1,10 +1,10 @@ title = 'Мой профиль'; $this->params['breadcrumbs'][] = $this->title; ?> -
diff --git a/frontend/views/company-info/_form.php b/frontend/views/company-info/_form.php new file mode 100644 index 0000000..85cb943 --- /dev/null +++ b/frontend/views/company-info/_form.php @@ -0,0 +1,31 @@ + + +
+ + + + field($model, 'name')->textInput() ?> + + field($model, 'staff')->textInput() ?> + + field($model, 'street')->textInput() ?> + + field($model, 'house')->textInput() ?> + + field($model, 'hide_mail')->textInput() ?> + +
+ isNewRecord ? Yii::t('app', 'Create') : Yii::t('app', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?> +
+ + + +
diff --git a/frontend/views/company-info/_search.php b/frontend/views/company-info/_search.php new file mode 100644 index 0000000..4db4f06 --- /dev/null +++ b/frontend/views/company-info/_search.php @@ -0,0 +1,37 @@ + + + diff --git a/frontend/views/company-info/create.php b/frontend/views/company-info/create.php new file mode 100644 index 0000000..f5c0c4b --- /dev/null +++ b/frontend/views/company-info/create.php @@ -0,0 +1,21 @@ +title = Yii::t('app', 'Create Company Info'); +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Company Infos'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/frontend/views/company-info/index.php b/frontend/views/company-info/index.php new file mode 100644 index 0000000..4417223 --- /dev/null +++ b/frontend/views/company-info/index.php @@ -0,0 +1,39 @@ +title = Yii::t('app', 'Company Infos'); +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ render('_search', ['model' => $searchModel]); ?> + +

+ 'btn btn-success']) ?> +

+ + $dataProvider, + 'filterModel' => $searchModel, + 'columns' => [ + ['class' => 'yii\grid\SerialColumn'], + + 'company_info_id', + 'name', + 'staff', + 'street', + 'house', + // 'hide_mail', + + ['class' => 'yii\grid\ActionColumn'], + ], + ]); ?> + +
diff --git a/frontend/views/company-info/update.php b/frontend/views/company-info/update.php new file mode 100644 index 0000000..39c7a64 --- /dev/null +++ b/frontend/views/company-info/update.php @@ -0,0 +1,23 @@ +title = Yii::t('app', 'Update {modelClass}: ', [ + 'modelClass' => 'Company Info', +]) . ' ' . $model->name; +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Company Infos'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = ['label' => $model->name, 'url' => ['view', 'id' => $model->company_info_id]]; +$this->params['breadcrumbs'][] = Yii::t('app', 'Update'); +?> +
+ +

title) ?>

+ + render('_form', [ + 'model' => $model, + ]) ?> + +
diff --git a/frontend/views/company-info/view.php b/frontend/views/company-info/view.php new file mode 100644 index 0000000..3375a85 --- /dev/null +++ b/frontend/views/company-info/view.php @@ -0,0 +1,40 @@ +title = $model->name; +$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Company Infos'), 'url' => ['index']]; +$this->params['breadcrumbs'][] = $this->title; +?> +
+ +

title) ?>

+ +

+ $model->company_info_id], ['class' => 'btn btn-primary']) ?> + $model->company_info_id], [ + 'class' => 'btn btn-danger', + 'data' => [ + 'confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), + 'method' => 'post', + ], + ]) ?> +

+ + $model, + 'attributes' => [ + 'company_info_id', + 'name', + 'staff', + 'street', + 'house', + 'hide_mail', + ], + ]) ?> + +
diff --git a/frontend/views/layouts/admin.php b/frontend/views/layouts/admin.php index fdac227..1516565 100755 --- a/frontend/views/layouts/admin.php +++ b/frontend/views/layouts/admin.php @@ -25,7 +25,58 @@ $this->beginContent('@app/views/layouts/main.php'); isset($this->params['breadcrumbs']) ? $this->params['breadcrumbs'] : [], ]) ?> - +
-
- +
endContent() ?> \ No newline at end of file diff --git a/frontend/views/layouts/gallery.php b/frontend/views/layouts/gallery.php index f789491..38c4835 100644 --- a/frontend/views/layouts/gallery.php +++ b/frontend/views/layouts/gallery.php @@ -34,7 +34,7 @@ $this->beginContent('@app/views/layouts/main.php'); 'url' => ['performer/common'], ], [ - 'label' => 'Выполненные работы', + 'label' => 'Портфолио', 'url' => ['performer/portfolio'], ], [ diff --git a/frontend/views/layouts/performer.php b/frontend/views/layouts/performer.php index 53f2095..82d0b2e 100644 --- a/frontend/views/layouts/performer.php +++ b/frontend/views/layouts/performer.php @@ -34,7 +34,7 @@ $this->beginContent('@app/views/layouts/main.php'); 'url' => ['performer/common'], ], [ - 'label' => 'Выполненные работы', + 'label' => 'Портфолио', 'url' => ['performer/portfolio'], ], [ diff --git a/frontend/web/css/art_box.css b/frontend/web/css/art_box.css index 5dcf7f6..bdecb69 100644 --- a/frontend/web/css/art_box.css +++ b/frontend/web/css/art_box.css @@ -1,4 +1,7 @@ .glyphicon_right{ top: -55px; left: 50px; +} +.form_for_company .company_info { + display: none; } \ No newline at end of file -- libgit2 0.21.4