Commit fb24e16701fd607d04ebe47e9bc3a20bea81ca5d
Merge remote-tracking branch 'origin/master'
Showing
4 changed files
with
226 additions
and
33 deletions
Show diff stats
1 | +<?php | ||
2 | + | ||
3 | + namespace backend\controllers; | ||
4 | + | ||
5 | + use artbox\core\admin\interfaces\ControllerInterface; | ||
6 | + use backend\actions\Index; | ||
7 | + use common\models\Customer; | ||
8 | + use yii\web\Controller; | ||
9 | + use yii\web\NotFoundHttpException; | ||
10 | + | ||
11 | + class RequestController extends Controller implements ControllerInterface | ||
12 | + { | ||
13 | + public function actions() | ||
14 | + { | ||
15 | + return [ | ||
16 | + 'index' => [ | ||
17 | + 'class' => Index::class, | ||
18 | + 'columns' => [ | ||
19 | + 'name' => [ | ||
20 | + 'type' => Index::ACTION_COL, | ||
21 | + 'columnConfig' => [ | ||
22 | + 'buttonsTemplate' => '{edit}{delete}' | ||
23 | + ] | ||
24 | + ], | ||
25 | + 'secondname' => [ | ||
26 | + 'type' => Index::STRING_COL, | ||
27 | + ], | ||
28 | + 'organization' => [ | ||
29 | + 'type' => Index::STRING_COL, | ||
30 | + ], | ||
31 | + ], | ||
32 | + 'model' => Customer::class, | ||
33 | + 'hasLanguage' => false, | ||
34 | + 'enableMassDelete' => true, | ||
35 | + 'modelPrimaryKey' => 'id', | ||
36 | + 'create' => false, | ||
37 | + ], | ||
38 | + ]; | ||
39 | + } | ||
40 | + | ||
41 | + public function actionUpdate($id) | ||
42 | + { | ||
43 | + $model = $this->findModel($id); | ||
44 | + | ||
45 | + return $this->render( | ||
46 | + 'update', | ||
47 | + [ | ||
48 | + 'model' => $model, | ||
49 | + ] | ||
50 | + ); | ||
51 | + } | ||
52 | + | ||
53 | + /** | ||
54 | + * @param $id | ||
55 | + * | ||
56 | + * @return \common\models\Customer|mixed|null | ||
57 | + * @throws \yii\web\NotFoundHttpException | ||
58 | + */ | ||
59 | + public function findModel($id) | ||
60 | + { | ||
61 | + $model = Customer::findOne($id); | ||
62 | + if ($model) { | ||
63 | + return $model; | ||
64 | + } else { | ||
65 | + throw new NotFoundHttpException(); | ||
66 | + } | ||
67 | + } | ||
68 | + /** | ||
69 | + * Create new model | ||
70 | + * | ||
71 | + * @return mixed | ||
72 | + */ | ||
73 | + public function newModel() | ||
74 | + { | ||
75 | + return new Customer(); | ||
76 | + } | ||
77 | + /** | ||
78 | + * @param $id | ||
79 | + * | ||
80 | + * @return bool|mixed | ||
81 | + * @throws \Throwable | ||
82 | + * @throws \yii\db\StaleObjectException | ||
83 | + * @throws \yii\web\NotFoundHttpException | ||
84 | + */ | ||
85 | + public function deleteModel($id) | ||
86 | + { | ||
87 | + $model = $this->findModel($id); | ||
88 | + | ||
89 | + if ($model->delete()) { | ||
90 | + return true; | ||
91 | + } else { | ||
92 | + return false; | ||
93 | + } | ||
94 | + } | ||
95 | + } | ||
0 | \ No newline at end of file | 96 | \ No newline at end of file |
backend/views/layouts/main.php
@@ -7,16 +7,11 @@ | @@ -7,16 +7,11 @@ | ||
7 | 7 | ||
8 | use artbox\core\assets\ArtboxCoreAsset; | 8 | use artbox\core\assets\ArtboxCoreAsset; |
9 | use artbox\core\models\User; | 9 | use artbox\core\models\User; |
10 | - use artbox\core\models\UserData; | ||
11 | - use artbox\core\widgets\FeedbackWidget; | ||
12 | use artbox\core\widgets\FlashWidget; | 10 | use artbox\core\widgets\FlashWidget; |
13 | - use artbox\order\assets\OrderAsset; | ||
14 | - use noam148\imagemanager\components\ImageManagerGetPath; | ||
15 | use yii\bootstrap\Html; | 11 | use yii\bootstrap\Html; |
16 | use yii\web\View; | 12 | use yii\web\View; |
17 | use yii\widgets\Breadcrumbs; | 13 | use yii\widgets\Breadcrumbs; |
18 | use yiister\gentelella\widgets\Menu; | 14 | use yiister\gentelella\widgets\Menu; |
19 | - use backend\assets\AppAsset; | ||
20 | 15 | ||
21 | ArtboxCoreAsset::register($this); | 16 | ArtboxCoreAsset::register($this); |
22 | // AppAsset::register($this); | 17 | // AppAsset::register($this); |
@@ -167,7 +162,9 @@ | @@ -167,7 +162,9 @@ | ||
167 | </ul> | 162 | </ul> |
168 | </li> | 163 | </li> |
169 | <li role="presentation"> | 164 | <li role="presentation"> |
170 | - <?= FeedbackWidget::widget(); ?> | 165 | + <a href="<?=\yii\helpers\Url::to(['/request'])?>" class="info-number feedback-widget" aria-expanded="false"> |
166 | + <i class="fa fa-envelope-o"></i> | ||
167 | + </a> | ||
171 | </li> | 168 | </li> |
172 | </ul> | 169 | </ul> |
173 | </nav> | 170 | </nav> |
backend/views/layouts/menu_items.php
@@ -43,36 +43,35 @@ | @@ -43,36 +43,35 @@ | ||
43 | [ | 43 | [ |
44 | 'label' => \Yii::t('core', 'Categories'), | 44 | 'label' => \Yii::t('core', 'Categories'), |
45 | 'url' => [ '/page-category/index' ], | 45 | 'url' => [ '/page-category/index' ], |
46 | - | ||
47 | ], | 46 | ], |
48 | - ], | ||
49 | - ], | ||
50 | - | ||
51 | - | ||
52 | - | ||
53 | - | ||
54 | - [ | ||
55 | - 'label' => \Yii::t('core', 'SEO'), | ||
56 | - 'url' => '#', | ||
57 | - 'template' => '<a href="#"><b class="seo"></b><span>{label}</span>{badge}</a>', | ||
58 | - 'items' => [ | ||
59 | [ | 47 | [ |
60 | - 'label' => \Yii::t('core', 'Seo pages'), | ||
61 | - 'url' => [ '/seo/alias/index' ], | ||
62 | - 'icon' => 'file-text', | ||
63 | - ], | ||
64 | - [ | ||
65 | - 'label' => \Yii::t('core', 'Robots'), | ||
66 | - 'url' => [ '/seo/settings/robots' ], | ||
67 | - 'icon' => 'android', | ||
68 | - ], | ||
69 | - [ | ||
70 | - 'label' => \Yii::t('core', 'Sitemap'), | ||
71 | - 'url' => [ '/seo/sitemap/index' ], | ||
72 | - 'icon' => 'map-signs', | 48 | + 'label' => \Yii::t('app', 'Speakers'), |
49 | + 'url' => [ '/speaker/index' ], | ||
73 | ], | 50 | ], |
74 | ], | 51 | ], |
75 | ], | 52 | ], |
53 | +// [ | ||
54 | +// 'label' => \Yii::t('core', 'SEO'), | ||
55 | +// 'url' => '#', | ||
56 | +// 'template' => '<a href="#"><b class="seo"></b><span>{label}</span>{badge}</a>', | ||
57 | +// 'items' => [ | ||
58 | +// [ | ||
59 | +// 'label' => \Yii::t('core', 'Seo pages'), | ||
60 | +// 'url' => [ '/seo/alias/index' ], | ||
61 | +// 'icon' => 'file-text', | ||
62 | +// ], | ||
63 | +// [ | ||
64 | +// 'label' => \Yii::t('core', 'Robots'), | ||
65 | +// 'url' => [ '/seo/settings/robots' ], | ||
66 | +// 'icon' => 'android', | ||
67 | +// ], | ||
68 | +// [ | ||
69 | +// 'label' => \Yii::t('core', 'Sitemap'), | ||
70 | +// 'url' => [ '/seo/sitemap/index' ], | ||
71 | +// 'icon' => 'map-signs', | ||
72 | +// ], | ||
73 | +// ], | ||
74 | +// ], | ||
76 | [ | 75 | [ |
77 | 'label' => \Yii::t('app', 'Blog'), | 76 | 'label' => \Yii::t('app', 'Blog'), |
78 | 'url' => '#', | 77 | 'url' => '#', |
@@ -95,7 +94,6 @@ | @@ -95,7 +94,6 @@ | ||
95 | ], | 94 | ], |
96 | ], | 95 | ], |
97 | ], | 96 | ], |
98 | - | ||
99 | [ | 97 | [ |
100 | 'label' => \Yii::t('app', 'Настройки'), | 98 | 'label' => \Yii::t('app', 'Настройки'), |
101 | 'url' => [ '/settings' ], | 99 | 'url' => [ '/settings' ], |
@@ -105,7 +103,6 @@ | @@ -105,7 +103,6 @@ | ||
105 | return \Yii::$app->controller->id === 'settings'; | 103 | return \Yii::$app->controller->id === 'settings'; |
106 | }, | 104 | }, |
107 | ], | 105 | ], |
108 | - | ||
109 | [ | 106 | [ |
110 | 'label' => \Yii::t('app', 'Slides'), | 107 | 'label' => \Yii::t('app', 'Slides'), |
111 | 'url' => [ '/slide/index' ], | 108 | 'url' => [ '/slide/index' ], |
1 | +<?php | ||
2 | + | ||
3 | + /** | ||
4 | + * @var View $this | ||
5 | + * @var \common\models\Customer $model | ||
6 | + */ | ||
7 | + | ||
8 | + use yii\web\View; | ||
9 | + use yii\widgets\ActiveForm; | ||
10 | + use yiister\gentelella\widgets\Panel; | ||
11 | + | ||
12 | + $this->title = ' asda sada'; | ||
13 | + | ||
14 | +?> | ||
15 | + | ||
16 | + | ||
17 | +<div class="alias-update"> | ||
18 | + <?php $form = ActiveForm::begin(); ?> | ||
19 | + <?php | ||
20 | + $xPanel = Panel::begin( | ||
21 | + [ | ||
22 | + 'header' => $this->title, | ||
23 | + ] | ||
24 | + ); | ||
25 | + ?> | ||
26 | + | ||
27 | + <div class="wrapp-blocks-edit-page"> | ||
28 | + | ||
29 | + <?= $form->field($model, 'secondname') | ||
30 | + ->textInput() ?> | ||
31 | + | ||
32 | + <?= $form->field($model, 'name') | ||
33 | + ->textInput() ?> | ||
34 | + | ||
35 | + <?= $form->field($model, 'dignity') | ||
36 | + ->textInput() ?> | ||
37 | + | ||
38 | + <?= $form->field($model, 'gender') | ||
39 | + ->dropDownList( | ||
40 | + [ | ||
41 | + 1 => 'Мужской', | ||
42 | + 2 => 'Женский', | ||
43 | + ] | ||
44 | + ) ?> | ||
45 | + | ||
46 | + <?= $form->field($model, 'birth') | ||
47 | + ->textInput() ?> | ||
48 | + | ||
49 | + <?= $form->field($model, 'citizenship') | ||
50 | + ->textInput() ?> | ||
51 | + | ||
52 | + | ||
53 | + <?= $form->field($model, 'passport') | ||
54 | + ->textInput() ?> | ||
55 | + | ||
56 | + <?= $form->field($model, 'email') | ||
57 | + ->textInput() ?> | ||
58 | + | ||
59 | + <?= $form->field($model, 'organization') | ||
60 | + ->textInput() ?> | ||
61 | + | ||
62 | + <?= $form->field($model, 'conference') | ||
63 | + ->checkbox( | ||
64 | + [ | ||
65 | + 'class' => 'flat', | ||
66 | + ] | ||
67 | + ) ?> | ||
68 | + | ||
69 | + <?= $form->field($model, 'geee') | ||
70 | + ->checkbox( | ||
71 | + [ | ||
72 | + 'class' => 'flat', | ||
73 | + ] | ||
74 | + ) ?> | ||
75 | + | ||
76 | + <?= $form->field($model, 'gere') | ||
77 | + ->checkbox( | ||
78 | + [ | ||
79 | + 'class' => 'flat', | ||
80 | + ] | ||
81 | + ) ?> | ||
82 | + | ||
83 | + <div class="style buttons-page-wr"> | ||
84 | + <a class="btn btn-success">Скачать фото <i class="fa fa-download"></i></a> | ||
85 | + </div> | ||
86 | + | ||
87 | + </div> | ||
88 | + | ||
89 | + <?php | ||
90 | + $xPanel::end(); | ||
91 | + ?> | ||
92 | + | ||
93 | + <div class="style buttons-page-wr"> | ||
94 | + <?= \yii\helpers\Html::submitButton( | ||
95 | + 'Сохранить', | ||
96 | + [ 'class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-success' ] | ||
97 | + ) ?> | ||
98 | + </div> | ||
99 | + | ||
100 | + | ||
101 | + <?php ActiveForm::end(); ?> | ||
102 | + | ||
103 | +</div> | ||
104 | + |