Author: Pedro Lucas Porcellis <porcellis@eletrotupi.com>
layout: add a secondary nav to logout and add tags
app/views/layout.php | 28 ++++++++++++++++++----------
diff --git a/app/views/layout.php b/app/views/layout.php index 74d117cec2786f0d6307d6ab0978d096ade19938..8a0b476d8b41a0670a50dc6beefa158ebe806eee 100644 --- a/app/views/layout.php +++ b/app/views/layout.php @@ -6,23 +6,31 @@ <title><?= $title ?? 'Dinheiro' ?></title> <script src="https://cdn.tailwindcss.com"></script> </head> + <body class="bg-gray-100 text-gray-800"> - <header class="bg-white shadow"> - <div class="max-w-4xl mx-auto px-4 py-6"> - <a href="/" class="text-2xl font-bold text-blue-700"> - Dinheiro - </a> - </div> + <header class="bg-white shadow flex items-center"> + <div class="max-w-4xl mx-auto px-4 py-6"> + <a href="/" class="text-2xl font-bold text-blue-700"> + Dinheiro + </a> + </div> + + <? if (isset($_SESSION['user_id'])): ?> + <nav class="max-w-4xl mx-auto px-4 py-2"> + <a href="/tags" class="text-blue-700 mr-5">Tags</a> + <a href="/logout" class="text-blue-700">Sair</a> + </nav> + <? endif; ?> </header> <main class="max-w-4xl mx-auto px-4 py-8"> - <?= $content ?> + <?= $content ?> </main> <footer class="bg-white border-t mt-8"> - <div class="max-w-4xl mx-auto px-4 py-4 text-sm text-gray-500"> - © <?= date('Y') ?> Dinheiro - </div> + <div class="max-w-4xl mx-auto px-4 py-4 text-sm text-gray-500"> + © <?= date('Y') ?> Dinheiro + </div> </footer> </body> </html>