Bicycle/App/view/layout.html
2026-08-11 22:35:26 +03:00

81 lines
3.9 KiB
HTML

<?php
/**
* @package Bicycle
* @description layout.html — главный шаблон сайта. Навигация — прямая разметка здесь,
* не строится из PHP-массива в контроллере (см. CLAUDE.md → Controller hierarchy).
*
* @var string $content Содержимое страницы
*/
use Services\Auth;
use System\Classes\ProfilerToolbar;
$auth_user = Auth::instance()->getUser();
?>
<!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">
<link rel="stylesheet" href="/vendor/twbs/bootstrap-icons/font/bootstrap-icons.css">
<link rel="stylesheet" href="/App/media/css/dashboard.css">
<?php $this->getStyles(); ?>
</head>
<body>
<svg width="0" height="0" style="position:absolute">
<defs>
<symbol id="ic-home" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M3 10.5 12 3l9 7.5"/>
<path d="M5 9.5V20a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1V9.5"/>
</symbol>
<symbol id="ic-card" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<rect x="2" y="5" width="20" height="14" rx="2"/>
<line x1="2" y1="10" x2="22" y2="10"/>
</symbol>
<symbol id="ic-tag" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M12 2 2 12l9 9 11-11V2Z"/>
<circle cx="7.5" cy="7.5" r="1.5"/>
</symbol>
<symbol id="ic-swap" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M7 7h11l-3-3"/>
<path d="M17 17H6l3 3"/>
</symbol>
<symbol id="ic-target" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<circle cx="12" cy="12" r="9"/>
<circle cx="12" cy="12" r="5"/>
<circle cx="12" cy="12" r="1.5"/>
</symbol>
<symbol id="ic-logout" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"/>
<polyline points="16 17 21 12 16 7"/>
<line x1="21" y1="12" x2="9" y2="12"/>
</symbol>
</defs>
</svg>
<?php if ($auth_user !== null): ?>
<a href="/login/logout" title="Выйти (<?= htmlspecialchars($auth_user['login'], ENT_QUOTES, 'UTF-8') ?>)"
style="position:fixed;top:1rem;right:1rem;z-index:30;color:#85858f;">
<svg style="width:1.3rem;height:1.3rem;"><use href="#ic-logout"/></svg>
</a>
<?php endif; ?>
<main>
<?= $content ?>
</main>
<?php if ($auth_user !== null): ?>
<nav class="dock">
<a href="/" class="dock-item active"><span class="ic"><svg class="ico"><use href="#ic-home"/></svg></span>Обзор</a>
<div class="dock-item"><span class="ic"><svg class="ico"><use href="#ic-card"/></svg></span>Счета</div>
<div class="dock-item"><span class="ic"><svg class="ico"><use href="#ic-tag"/></svg></span>Категории</div>
<div class="dock-item"><span class="ic"><svg class="ico"><use href="#ic-swap"/></svg></span>Операции</div>
<div class="dock-item"><span class="ic"><svg class="ico"><use href="#ic-target"/></svg></span>Цели</div>
</nav>
<?php endif; ?>
<script src="/vendor/components/jquery/jquery.min.js"></script>
<script src="/vendor/twbs/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<?php $this->getScripts(); ?>
<?= ProfilerToolbar::render() ?>
</body>
</html>