Оормил страницу 404

This commit is contained in:
Krivchikov Dmitry 2015-09-25 15:39:38 +03:00
parent 585312eb15
commit 75277da092
4 changed files with 142 additions and 18 deletions

View File

@ -135,8 +135,18 @@ class PageController extends Controller
static function action404($message)
{
self::renderPartial('error404.php', array(
'point' => Point::model()->getRandom(),
http_response_code(404);
self::$layout = 'layoutPage.php';
self::addStyle('/css/style.css?ver=' . App::getConfig('version'));
self::addStyle('/css/pageStyle.css?ver=' . App::getConfig('version'));
self::addStyle('/css/bootstrap.min.css');
self::addScript('/js/jquery-2.1.0.min.js');
self::addScript('/js/bootstrap.min.js');
App::setConfig('title', App::$defaultTitle);
self::render('error404.php', array(
'randomPoint' => Point::model()->getRandom(),
));
}

View File

@ -1,19 +1,18 @@
<!DOCTYPE html>
<html>
<head>
<title>Ошибка 404 - страница не найдена!</title>
</head>
<body>
<h1>Ошибка 404 - страница не найдена!</h1>
<hr/>
<br/>
<div id="pageSmoothBackground" style="background-image: url(<?= $randomPoint->getImg('middle') ?>);"></div>
<div class="container" style="background-color: rgba(255,255,255, 0.8);margin-top: -10px;padding-bottom: 30px; min-height: 100%;">
<noindex>
<div style="text-align: center;">
<h2>Не беда! Возможно вас заинтересует точка «<?= $point->name ?>»?</h2>
<a href="/point/<?= $point->id ?>">
<img src="<?= $point->getImg() ?>" style="max-width: 400px; margin: 0 20px 10px 0;" />
</a>
<img src="/img/404.png" style="margin: 50px 0;"/>
</div>
</noindex>
</body>
</html>
<div class="row">
<div class="col-md-12">
<a href="/point/<?= $randomPoint->id ?>" style="float: left; margin: 0 20px 0 0;"><img src="<?= $randomPoint->getImg() ?>" style="width: 200px;"/></a>
<h3 style="margin-top: 0;">Это интересно: <?= $randomPoint->name ?></h3>
<p>
<?= mb_substr($randomPoint->description, 0, 400, 'UTF-8') ?>
<a class="" href="/point/<?= $randomPoint->id ?>" role="button"><nobr> читать далее »</nobr></a>
</p>
</div>
</div>
</div>

BIN
public/img/404.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

115
source/404.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB