Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,304 changes: 0 additions & 6,304 deletions composer.lock

This file was deleted.

Binary file modified docs/images/about-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/about-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/contact-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/contact-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/contact-success-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/contact-success-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/error-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/error-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/home-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/home-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/login-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified docs/images/login-light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion tests/Acceptance/HomeCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final class HomeCest
public function ensureThatHomePageWorks(AcceptanceTester $I)
{
$I->amOnPage(Url::toRoute('/site/index'));
$I->see('My Company');
$I->see(\Yii::$app->name);

$I->seeLink('About');
$I->click('About');
Expand Down
6 changes: 3 additions & 3 deletions views/layouts/_footer.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<footer id="footer" class="mt-auto py-3 bg-body-tertiary">
<div class="container">
<div class="row text-body-secondary">
<div class="col-md-6 text-center text-md-start">&copy; My Company <?= date('Y') ?></div>
<div class="col-md-6 text-center text-md-start">&copy; <?= Html::encode(Yii::$app->name) ?> <?= date('Y') ?></div>
<div class="col-md-6 text-center text-md-end">
<a href="https://www.yiiframework.com/" rel="external" class="text-body-secondary text-decoration-none">
<?= Yii::t(
Expand All @@ -19,15 +19,15 @@
['yii' => ''],
) ?>
<?= Html::img(
'@web/images/yii_logo_light.svg',
'@web/images/yii3_full_for_light.svg',
[
'alt' => 'Yii Framework',
'class' => 'align-text-bottom footer-logo-light',
'height' => '28',
],
) ?>
<?= Html::img(
'@web/images/yii_logo_dark.svg',
'@web/images/yii3_full_for_dark.svg',
[
'alt' => 'Yii Framework',
'class' => 'align-text-bottom footer-logo-dark',
Expand Down
28 changes: 16 additions & 12 deletions views/layouts/_head.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,22 @@
'content' => 'width=device-width, initial-scale=1',
],
);
$this->registerMetaTag(
[
'name' => 'description',
'content' => $this->params['meta_description'] ?? ''
],
);
$this->registerMetaTag(
[
'name' => 'keywords',
'content' => $this->params['meta_keywords'] ?? ''
],
);
if (!empty($this->params['meta_description'])) {
$this->registerMetaTag(
[
'name' => 'description',
'content' => $this->params['meta_description'],
],
);
}
if (!empty($this->params['meta_keywords'])) {
$this->registerMetaTag(
[
'name' => 'keywords',
'content' => $this->params['meta_keywords'],
],
);
}
$this->registerLinkTag(
[
'rel' => 'icon',
Expand Down
2 changes: 1 addition & 1 deletion views/layouts/_header.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
'url' => ['/site/logout'],
'linkOptions' => [
'data-method' => 'post',
'class' => 'logout',
'class' => 'nav-link logout',
],
'visible' => !Yii::$app->user->isGuest,
],
Expand Down
2 changes: 1 addition & 1 deletion views/layouts/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
<!DOCTYPE html>
<html lang="<?= Yii::$app->language ?>" class="h-100" data-bs-theme="light">
<head>
<title><?= Html::encode($this->title) ?></title>
<?php $this->head() ?>
<title><?= Html::encode($this->title) ?></title>
</head>
<body class="d-flex flex-column h-100">
<?php $this->beginBody() ?>
Expand Down
2 changes: 2 additions & 0 deletions views/site/about.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

$this->title = 'About';
$this->params['breadcrumbs'][] = $this->title;
$this->params['meta_description'] = 'Learn more about this Yii2-powered application.';
$this->params['meta_keywords'] = 'yii, yii2, about, php, framework';
?>
<div class="site-about d-flex align-items-center justify-content-center text-center">
<div class="site-about-content mx-auto">
Expand Down
147 changes: 97 additions & 50 deletions views/site/contact.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
use yii\bootstrap5\Html;
use yii\captcha\Captcha;

$this->title = 'Contact';
$this->title = 'Contact us';
Comment thread
terabytesoftw marked this conversation as resolved.
$this->params['breadcrumbs'][] = $this->title;
$this->params['meta_description'] = 'Get in touch with us. Send us a message using the contact form.';
$this->params['meta_keywords'] = 'yii, yii2, contact, support, feedback';
$htmlIcon = <<<HTML
<span class="input-group-text">%s</span>
<div class="form-floating flex-grow-1">{input}{label}</div>{error}{hint}
{label}<div class="input-group"><span class="input-group-text" aria-hidden="true">%s</span>{input}</div>{error}{hint}
HTML;
$labelOptions = ['class' => 'form-label fw-semibold small'];
?>
<?php if (Yii::$app->session->hasFlash('success')): ?>

Expand All @@ -38,71 +40,114 @@

<?php else: ?>

<div class="site-contact py-5">
<div class="site-contact d-flex align-items-center justify-content-center py-5">
<div class="card border-0 overflow-hidden login-split-card login-split-card-wide">
<div class="row g-0">

<h1 class="text-center"><?= Html::encode($this->title) ?></h1>
<!-- Brand panel -->
<div class="col-md-4 d-none d-md-flex login-brand-panel text-white">
<div class="d-flex flex-column justify-content-between p-4 p-lg-5 w-100">
<div>
<?= Html::img(
Yii::getAlias('@web/images/yii3_full_white_for_dark.svg'),
[
'alt' => 'Yii Framework',
'class' => 'mb-4',
'height' => 40,
],
) ?>
</div>
<div>
<h2 class="fw-bold mb-3 login-brand-title">
Get In<br>Touch
</h2>
<p class="opacity-75 mb-0 login-brand-text">
Have a question or business inquiry? We would love to hear from you.
</p>
</div>
</div>
</div>

<div class="row justify-content-center">
<div class="col-md-7 col-lg-6">
<!-- Form panel -->
<div class="col-md-8">
<div class="p-4 p-lg-5">
<div class="text-center mb-4">
<div class="d-md-none mb-3">
<?= Html::img(
Yii::getAlias('@web/images/yii3_full_black_for_light.svg'),
[
'alt' => 'Yii Framework',
'class' => 'login-mobile-logo',
'height' => 36,
],
) ?>
</div>
<h1 class="h3 fw-bold mb-1"><?= Html::encode($this->title) ?></h1>
<p class="text-body-secondary small">Fill out the form below and we will get back to you</p>
</div>

<p class="text-center text-body-secondary mb-4">
If you have business inquiries or other questions, please fill out the following form to contact us.
Thank you.
</p>
<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>

<div class="card border-0 bg-body p-4">
<div class="row">
<div class="col-sm-6 mb-3">
<?= $form->field($model, 'name', [
'options' => ['class' => 'mb-0'],
'template' => sprintf($htmlIcon, '&#128100;'),
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Name',
'autofocus' => true,
],
])->label('Your Name', $labelOptions) ?>
</div>

<div class="col-sm-6 mb-3">
<?= $form->field($model, 'email', [
'options' => ['class' => 'mb-0'],
'template' => sprintf($htmlIcon, '&#9993;'),
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'email@example.com',
],
])->label('Your Email', $labelOptions) ?>
</div>
</div>

<?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
<div class="mb-3">
<?= $form->field($model, 'subject', [
'options' => ['class' => 'mb-0'],
'template' => sprintf($htmlIcon, '&#128172;'),
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Subject',
],
])->label('Subject', $labelOptions) ?>
</div>

<?= $form->field($model, 'name', [
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Name',
'autofocus' => true,
],
'options' => ['class' => 'input-group has-validation mb-3'],
'template' => sprintf($htmlIcon, '&#128100;'),
]) ?>

<?= $form->field($model, 'email', [
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Email',
],
'options' => ['class' => 'input-group has-validation mb-3'],
'template' => sprintf($htmlIcon, '&#9993;'),
]) ?>

<?= $form->field($model, 'subject', [
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Subject',
],
'options' => ['class' => 'input-group has-validation mb-3'],
'template' => sprintf($htmlIcon, '&#128172;'),
]) ?>

<?= $form->field($model, 'body', [
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Body',
],
'options' => ['class' => 'form-floating mb-4'],
'template' => '{input}{label}{error}{hint}',
])->textarea() ?>
<div class="mb-3">
<?= $form->field($model, 'body', [
'options' => ['class' => 'mb-0'],
'template' => '{label}{input}{error}{hint}',
'inputOptions' => [
'class' => 'form-control',
'placeholder' => 'Your message...',
],
])->textarea()->label('Message', $labelOptions) ?>
</div>

<div class="d-flex align-items-center gap-3 flex-wrap">
<?= $form->field($model, 'verifyCode', [
'enableLabel' => false,
'options' => ['class' => ''],
'inputOptions' => ['aria-label' => 'Verification code'],
])->widget(Captcha::class, [
'template' => '<div class="d-flex align-items-center gap-2">{image}{input}</div>',
]) ?>

<?= Html::submitButton(
'Submit',
[
'class' => 'btn btn-primary px-4 ms-auto',
'class' => 'btn login-btn text-white px-4 ms-auto',
'name' => 'contact-button',
],
) ?>
Expand All @@ -112,7 +157,9 @@

</div>
</div>

</div>
</div>
</div>

<?php endif; ?>
3 changes: 2 additions & 1 deletion views/site/error.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
/** @var Exception $exception */

use yii\helpers\Html;
use yii\web\HttpException;

$this->title = $name;
$statusCode = $exception->statusCode ?? 500;
$statusCode = $exception instanceof HttpException ? $exception->statusCode : 500;
?>
<div class="site-error d-flex align-items-center justify-content-center text-center">
<div class="site-error-content mx-auto">
Expand Down
Loading
Loading