From e9a7d3aacae1abed62a1e7454603f44223985360 Mon Sep 17 00:00:00 2001 From: b1ek Date: Mon, 19 Aug 2024 22:44:46 +1000 Subject: [PATCH] refactor: remove useless pages --- controllers/SiteController.php | 62 ------------------------------- views/site/about.php | 18 --------- views/site/contact.php | 68 ---------------------------------- views/site/index.php | 26 +++++++++++-- views/site/login.php | 55 --------------------------- 5 files changed, 23 insertions(+), 206 deletions(-) delete mode 100644 views/site/about.php delete mode 100644 views/site/contact.php delete mode 100644 views/site/login.php diff --git a/controllers/SiteController.php b/controllers/SiteController.php index 67c3f50..13e07f3 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -63,66 +63,4 @@ class SiteController extends Controller { return $this->render('index'); } - - /** - * Login action. - * - * @return Response|string - */ - public function actionLogin() - { - if (!Yii::$app->user->isGuest) { - return $this->goHome(); - } - - $model = new LoginForm(); - if ($model->load(Yii::$app->request->post()) && $model->login()) { - return $this->goBack(); - } - - $model->password = ''; - return $this->render('login', [ - 'model' => $model, - ]); - } - - /** - * Logout action. - * - * @return Response - */ - public function actionLogout() - { - Yii::$app->user->logout(); - - return $this->goHome(); - } - - /** - * Displays contact page. - * - * @return Response|string - */ - public function actionContact() - { - $model = new ContactForm(); - if ($model->load(Yii::$app->request->post()) && $model->contact(Yii::$app->params['adminEmail'])) { - Yii::$app->session->setFlash('contactFormSubmitted'); - - return $this->refresh(); - } - return $this->render('contact', [ - 'model' => $model, - ]); - } - - /** - * Displays about page. - * - * @return string - */ - public function actionAbout() - { - return $this->render('about'); - } } diff --git a/views/site/about.php b/views/site/about.php deleted file mode 100644 index ea006ec..0000000 --- a/views/site/about.php +++ /dev/null @@ -1,18 +0,0 @@ -title = 'About'; -$this->params['breadcrumbs'][] = $this->title; -?> -
-

title) ?>

- -

- This is the About page. You may modify the following file to customize its content: -

- - -
diff --git a/views/site/contact.php b/views/site/contact.php deleted file mode 100644 index 597fabc..0000000 --- a/views/site/contact.php +++ /dev/null @@ -1,68 +0,0 @@ -title = 'Contact'; -$this->params['breadcrumbs'][] = $this->title; -?> -
-

title) ?>

- - session->hasFlash('contactFormSubmitted')): ?> - -
- Thank you for contacting us. We will respond to you as soon as possible. -
- -

- Note that if you turn on the Yii debugger, you should be able - to view the mail message on the mail panel of the debugger. - mailer->useFileTransport): ?> - Because the application is in development mode, the email is not sent but saved as - a file under mailer->fileTransportPath) ?>. - Please configure the useFileTransport property of the mail - application component to be false to enable email sending. - -

- - - -

- If you have business inquiries or other questions, please fill out the following form to contact us. - Thank you. -

- -
-
- - 'contact-form']); ?> - - field($model, 'name')->textInput(['autofocus' => true]) ?> - - field($model, 'email') ?> - - field($model, 'subject') ?> - - field($model, 'body')->textarea(['rows' => 6]) ?> - - field($model, 'verifyCode')->widget(Captcha::class, [ - 'template' => '
{image}
{input}
', - ]) ?> - -
- 'btn btn-primary', 'name' => 'contact-button']) ?> -
- - - -
-
- - -
diff --git a/views/site/index.php b/views/site/index.php index 4bb5f7c..7f00a2d 100644 --- a/views/site/index.php +++ b/views/site/index.php @@ -1,5 +1,7 @@ title = 'banki.shop test'; @@ -7,11 +9,29 @@ $this->title = 'banki.shop test';
-

Congratulations!

+

Dashboard

-

You have successfully created your Yii-powered application.

+

Get started with Yii

+
-

Get started with Yii

+
+
+

List parameters

+
+

+ This page has most functionality: list, edit, add image, etc.. +

+ Go to page +
+
+ +
+

List parameters in JSON

+ +
diff --git a/views/site/login.php b/views/site/login.php deleted file mode 100644 index db003c0..0000000 --- a/views/site/login.php +++ /dev/null @@ -1,55 +0,0 @@ -title = 'Login'; -$this->params['breadcrumbs'][] = $this->title; -?> -
-

title) ?>

- -

Please fill out the following fields to login:

- -
-
- - 'login-form', - 'fieldConfig' => [ - 'template' => "{label}\n{input}\n{error}", - 'labelOptions' => ['class' => 'col-lg-1 col-form-label mr-lg-3'], - 'inputOptions' => ['class' => 'col-lg-3 form-control'], - 'errorOptions' => ['class' => 'col-lg-7 invalid-feedback'], - ], - ]); ?> - - field($model, 'username')->textInput(['autofocus' => true]) ?> - - field($model, 'password')->passwordInput() ?> - - field($model, 'rememberMe')->checkbox([ - 'template' => "
{input} {label}
\n
{error}
", - ]) ?> - -
-
- 'btn btn-primary', 'name' => 'login-button']) ?> -
-
- - - -
- You may login with admin/admin or demo/demo.
- To modify the username/password, please check out the code app\models\User::$users. -
- -
-
-