Commit bc54438e060770e4e533570b208eddd341fb259b
1 parent
7b140652
-Some fixes
Showing
3 changed files
with
84 additions
and
117 deletions
Show diff stats
console/controllers/CreateController.php
1 | <?php | 1 | <?php |
2 | - namespace console\controllers; | ||
3 | 2 | ||
4 | - use artbox\core\models\User; | ||
5 | - use yii\console\Controller; | ||
6 | - use yii\helpers\Console; | 3 | +namespace console\controllers; |
7 | 4 | ||
8 | - /** | ||
9 | - * Class CreateController | ||
10 | - * | ||
11 | - * @package console\controllers | ||
12 | - */ | ||
13 | - class CreateController extends Controller | 5 | +use artbox\core\models\User; |
6 | +use yii\console\Controller; | ||
7 | +use yii\helpers\Console; | ||
8 | + | ||
9 | +/** | ||
10 | + * Class CreateController | ||
11 | + * | ||
12 | + * @package console\controllers | ||
13 | + */ | ||
14 | +class CreateController extends Controller | ||
15 | +{ | ||
16 | + public function actionUser($username = null, $email = null, $password = null) | ||
14 | { | 17 | { |
15 | - public function actionUser($username = null, $email = null, $password = null) | ||
16 | - { | ||
17 | - $username = $username ? : 'admin'; | ||
18 | - $user = User::find() | ||
19 | - ->where([ 'username' => $username ]) | ||
20 | - ->one(); | ||
21 | - if (empty( $user )) { | ||
22 | - $user = new User(); | ||
23 | - $user->username = $username; | ||
24 | - } | ||
25 | - $user->email = $email ? : 'admin@example.com'; | ||
26 | - $user->setPassword($password ? : 'admin321'); | ||
27 | - $user->generateAuthKey(); | ||
28 | - | ||
29 | - if ($user->save()) { | ||
30 | - if ($user->isNewRecord) { | ||
31 | - $this->stdout('User created' . "\n", Console::FG_GREEN); | ||
32 | - } else { | ||
33 | - $this->stdout('User updated' . "\n", Console::FG_GREEN); | ||
34 | - } | 18 | + $username = $username ? : 'developer'; |
19 | + $user = User::find() | ||
20 | + ->where(['username' => $username]) | ||
21 | + ->one(); | ||
22 | + if (empty($user)) { | ||
23 | + $user = new User(); | ||
24 | + $user->username = $username; | ||
25 | + } | ||
26 | + $user->email = $email ? : 'dev@example.com'; | ||
27 | + $user->setPassword($password ? : 'kristal2021'); | ||
28 | + $user->generateAuthKey(); | ||
29 | + | ||
30 | + if ($user->save()) { | ||
31 | + if ($user->isNewRecord) { | ||
32 | + $this->stdout('User created' . "\n", Console::FG_GREEN); | ||
35 | } else { | 33 | } else { |
36 | - $this->stdout('Error!' . "\n", Console::FG_RED); | ||
37 | - return self::EXIT_CODE_ERROR; | 34 | + $this->stdout('User updated' . "\n", Console::FG_GREEN); |
38 | } | 35 | } |
39 | - return self::EXIT_CODE_NORMAL; | 36 | + } else { |
37 | + $this->stdout('Error!' . "\n", Console::FG_RED); | ||
38 | + | ||
39 | + return self::EXIT_CODE_ERROR; | ||
40 | } | 40 | } |
41 | - } | ||
42 | \ No newline at end of file | 41 | \ No newline at end of file |
42 | + | ||
43 | + return self::EXIT_CODE_NORMAL; | ||
44 | + } | ||
45 | +} |
frontend/views/site/index.php
@@ -30,7 +30,7 @@ _________________________________________________________ --> | @@ -30,7 +30,7 @@ _________________________________________________________ --> | ||
30 | </div> | 30 | </div> |
31 | 31 | ||
32 | <div class="col-sm-6 text-center-xs mtop90"> | 32 | <div class="col-sm-6 text-center-xs mtop90"> |
33 | - <p><?=\Yii::t('app', 'Приглашаем на диагностику.')?><br /><?=\Yii::t('app', 'Первая консультация — бесплатно.')?></p> | 33 | + <p><?=\Yii::t('app', 'Приглашаем на диагностику.')?><br /></p> |
34 | <p> | 34 | <p> |
35 | <a href="#" class="btn btn-template-transparent-black modal-link" data-form="appointment-modal" data-modalname="<?=\Yii::t('app', 'Записаться на приём')?>"><?=\Yii::t('app', 'Записаться')?></a> | 35 | <a href="#" class="btn btn-template-transparent-black modal-link" data-form="appointment-modal" data-modalname="<?=\Yii::t('app', 'Записаться на приём')?>"><?=\Yii::t('app', 'Записаться')?></a> |
36 | </p> | 36 | </p> |
@@ -113,42 +113,6 @@ _________________________________________________________ --> | @@ -113,42 +113,6 @@ _________________________________________________________ --> | ||
113 | </div> | 113 | </div> |
114 | </section> | 114 | </section> |
115 | 115 | ||
116 | -<section class="bar background-pentagon no-mb kristal-cont"> | ||
117 | - <div class="container"> | ||
118 | - <div class="row showcase"> | ||
119 | - <div class="col-md-3 col-sm-6"> | ||
120 | - <div class="item"> | ||
121 | - <h4><span class="counter">580</span><br> | ||
122 | - | ||
123 | - <?=\Yii::t('app', 'Клиентов')?></h4> | ||
124 | - </div> | ||
125 | - </div> | ||
126 | - <div class="col-md-3 col-sm-6"> | ||
127 | - <div class="item"> | ||
128 | - <h4><span class="counter">2</span><br> | ||
129 | - | ||
130 | - <?=\Yii::t('app', 'Года работы')?></h4> | ||
131 | - </div> | ||
132 | - </div> | ||
133 | - <div class="col-md-3 col-sm-6"> | ||
134 | - <div class="item"> | ||
135 | - <h4><span class="counter">7</span><br> | ||
136 | - | ||
137 | - <?=\Yii::t('app', 'Сертифицированных докторов')?></h4> | ||
138 | - </div> | ||
139 | - </div> | ||
140 | - <div class="col-md-3 col-sm-6"> | ||
141 | - <div class="item"> | ||
142 | - <h4><span class="counter">200</span><br> | ||
143 | - | ||
144 | - <?=\Yii::t('app', 'Видов услуг')?></h4> | ||
145 | - </div> | ||
146 | - </div> | ||
147 | - </div> | ||
148 | - <!-- /.row --> | ||
149 | - </div> | ||
150 | - <!-- /.container --> | ||
151 | -</section> | ||
152 | <!-- /.bar --> | 116 | <!-- /.bar --> |
153 | <section class="image-full-screen"> | 117 | <section class="image-full-screen"> |
154 | </section> | 118 | </section> |
@@ -208,4 +172,4 @@ _________________________________________________________ --> | @@ -208,4 +172,4 @@ _________________________________________________________ --> | ||
208 | <a href="#" class="btn bnm btn-template-transparent-primary modal-link" data-form="appointment-modal" data-modalname="<?=\Yii::t('app', 'Записаться на приём')?>"><?=\Yii::t('app', 'Записаться на приём')?></a> | 172 | <a href="#" class="btn bnm btn-template-transparent-primary modal-link" data-form="appointment-modal" data-modalname="<?=\Yii::t('app', 'Записаться на приём')?>"><?=\Yii::t('app', 'Записаться на приём')?></a> |
209 | </div> | 173 | </div> |
210 | </div> | 174 | </div> |
211 | -</div> | ||
212 | \ No newline at end of file | 175 | \ No newline at end of file |
176 | +</div> |
frontend/views/site/price.php
1 | <?php | 1 | <?php |
2 | + | ||
2 | use artbox\core\components\SeoComponent; | 3 | use artbox\core\components\SeoComponent; |
3 | use artbox\core\models\Image; | 4 | use artbox\core\models\Image; |
4 | use artbox\core\models\Page; | 5 | use artbox\core\models\Page; |
@@ -11,8 +12,8 @@ use yii\web\View; | @@ -11,8 +12,8 @@ use yii\web\View; | ||
11 | * @var SeoComponent $seo | 12 | * @var SeoComponent $seo |
12 | * @var Image[] $images | 13 | * @var Image[] $images |
13 | * @var string $lefts | 14 | * @var string $lefts |
14 | - * @var Page $page_stom | ||
15 | - * @var Page $page_cosm | 15 | + * @var Page $page_stom |
16 | + * @var Page $page_cosm | ||
16 | * @var string $body | 17 | * @var string $body |
17 | */ | 18 | */ |
18 | $seo = \Yii::$app->get('seo'); | 19 | $seo = \Yii::$app->get('seo'); |
@@ -21,53 +22,52 @@ $this->params[ 'breadcrumbs' ][] = $this->title; | @@ -21,53 +22,52 @@ $this->params[ 'breadcrumbs' ][] = $this->title; | ||
21 | ?> | 22 | ?> |
22 | 23 | ||
23 | <div id="content"> | 24 | <div id="content"> |
24 | - <div class="container price-page"> | ||
25 | - <div class="row"> | ||
26 | - <div class="col-md-8 col-md-offset-2"> | ||
27 | - <div class="tabs"> | ||
28 | - <ul class="nav nav-tabs nav-justified"> | ||
29 | - <li class="active"> | ||
30 | - <a href="#tab1" data-toggle="tab" aria-expanded="true"><?=\Yii::t('app', 'Стоматология')?></a> | ||
31 | - </li> | ||
32 | - <li class=""><a href="#tab2" data-toggle="tab" aria-expanded="false"><?=\Yii::t('app', 'Косметология')?></a> | ||
33 | - </li> | ||
34 | - </ul> | ||
35 | - <div class="tab-content"> | ||
36 | - <div class="tab-pane active" id="tab1"> | ||
37 | - <div class="row"> | ||
38 | - <div class="col-md-12"> | ||
39 | - <?php | ||
40 | - echo (isset($page_stom->lang))?$page_stom->lang->body:''; | ||
41 | - ?> | ||
42 | - </div> | ||
43 | - </div> | ||
44 | - </div> | ||
45 | - <div class="tab-pane" id="tab2"> | ||
46 | - <div class="row"> | ||
47 | - <div class="col-md-12"> | ||
48 | - <?php | ||
49 | - echo (isset($page_cosm->lang))?$page_cosm->lang->body:''; | ||
50 | - ?> | ||
51 | - </div> | ||
52 | - </div> | ||
53 | - </div> | ||
54 | - </div> | ||
55 | - <!-- /.tab-content --> | 25 | + <div class="container price-page"> |
26 | + <div class="row"> | ||
27 | + <div class="col-md-8 col-md-offset-2"> | ||
28 | + <div class="tabs"> | ||
29 | + <ul class="nav nav-tabs nav-justified"> | ||
30 | + <li class="active"> | ||
31 | + <a href="#tab1" data-toggle="tab" aria-expanded="true"><?= \Yii::t('app', 'Стоматология') ?></a> | ||
32 | + </li> | ||
33 | + <li class=""><a href="#tab2" data-toggle="tab" aria-expanded="false"><?= \Yii::t( | ||
34 | + 'app', | ||
35 | + 'Косметология' | ||
36 | + ) ?></a> | ||
37 | + </li> | ||
38 | + </ul> | ||
39 | + <div class="tab-content"> | ||
40 | + <div class="tab-pane active" id="tab1"> | ||
41 | + <div class="row"> | ||
42 | + <div class="col-md-12"> | ||
43 | + <?php | ||
44 | + echo (isset($page_stom->lang)) ? $page_stom->lang->body : ''; | ||
45 | + ?> | ||
46 | + </div> | ||
47 | + </div> | ||
48 | + </div> | ||
49 | + <div class="tab-pane" id="tab2"> | ||
50 | + <div class="row"> | ||
51 | + <div class="col-md-12"> | ||
52 | + <?php | ||
53 | + echo (isset($page_cosm->lang)) ? $page_cosm->lang->body : ''; | ||
54 | + ?> | ||
56 | </div> | 55 | </div> |
56 | + </div> | ||
57 | </div> | 57 | </div> |
58 | + </div> | ||
58 | </div> | 59 | </div> |
59 | - <!-- /.row --> | ||
60 | - | 60 | + </div> |
61 | </div> | 61 | </div> |
62 | - <!-- /.container --> | 62 | + </div> |
63 | </div> | 63 | </div> |
64 | -<!-- /#content --> | ||
65 | - | ||
66 | - | ||
67 | <div id="get-it" class="pages"> | 64 | <div id="get-it" class="pages"> |
68 | - <div class="container"> | ||
69 | - <div class="col-md-12 col-sm-12" style="text-align: center;"> | ||
70 | - <a href="#" class="btn bnm btn-template-transparent-primary modal-link" data-form="appointment-modal" data-modalname="<?=\Yii::t('app', 'Записаться на приём')?>"><?=\Yii::t('app', 'Записаться на приём')?></a> | ||
71 | - </div> | 65 | + <div class="container"> |
66 | + <div class="col-md-12 col-sm-12" style="text-align: center;"> | ||
67 | + <a href="#" class="btn bnm btn-template-transparent-primary modal-link" data-form="appointment-modal" data-modalname="<?= \Yii::t( | ||
68 | + 'app', | ||
69 | + 'Записаться на приём' | ||
70 | + ) ?>"><?= \Yii::t('app', 'Записаться на приём') ?></a> | ||
72 | </div> | 71 | </div> |
73 | -</div> | ||
74 | \ No newline at end of file | 72 | \ No newline at end of file |
73 | + </div> | ||
74 | +</div> |