Bicycle/App/view/Index/index.html
Egor Isaev 69ce89a695 dev
2026-08-11 17:05:39 +03:00

57 lines
2.2 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
/**
* @package Bicycle
* @description index.html — главная страница = вход. Без общего layout: пока единственная страница проекта, своя HTML-обвязка прямо тут.
*
* @var string|null $error Сообщение об ошибке (неверные данные)
* @var array|null $user Текущий авторизованный пользователь (без пароля), null — гость
*/
use System\Classes\CSRF;
use System\Classes\ProfilerToolbar;
?>
<!DOCTYPE html>
<html lang="ru">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Бюджет</title>
<link rel="stylesheet" href="/vendor/twbs/bootstrap/dist/css/bootstrap.min.css">
</head>
<body class="d-flex align-items-center justify-content-center bg-body-secondary" style="min-height: 100vh;">
<div class="card shadow-sm" style="width: 100%; max-width: 400px;">
<div class="card-body p-4">
<h1 class="h3 mb-3">Вход</h1>
<?php if ($user !== null): ?>
<p>Вы вошли как <strong><?= htmlspecialchars($user['login'], ENT_QUOTES, 'UTF-8') ?></strong>.</p>
<?= ProfilerToolbar::render() ?>
<?php else: ?>
<?php if ($error !== null): ?>
<div class="alert alert-danger"><?= htmlspecialchars($error, ENT_QUOTES, 'UTF-8') ?></div>
<?php endif; ?>
<form method="post" action="/">
<?= CSRF::field() ?>
<div class="mb-3">
<label class="form-label">Логин
<input type="text" name="login" class="form-control" autocomplete="username" autofocus>
</label>
</div>
<div class="mb-3">
<label class="form-label">Пароль
<input type="password" name="password" class="form-control" autocomplete="current-password">
</label>
</div>
<button type="submit" class="btn btn-primary">Войти</button>
</form>
<?php endif; ?>
</div>
</div>
</body>
</html>