d9de37d3d8
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
74 lines
2.9 KiB
HTML
74 lines
2.9 KiB
HTML
{{define "layout"}}
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>QBank</title>
|
|
<!-- Development: Tailwind CDN. Production: replaced by make tailwind output. -->
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="manifest" href="/static/manifest.json">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="default">
|
|
<meta name="apple-mobile-web-app-title" content="QBank">
|
|
<link rel="apple-touch-icon" href="/static/icon-192.png">
|
|
<meta name="theme-color" content="#2563eb">
|
|
<script>if ('serviceWorker' in navigator) navigator.serviceWorker.register('/sw.js');</script>
|
|
</head>
|
|
<body class="bg-gray-50 min-h-screen text-gray-900">
|
|
|
|
{{if .User}}
|
|
<header class="bg-blue-600 text-white shadow-md">
|
|
<div class="max-w-2xl mx-auto px-4 py-3 flex items-center justify-between">
|
|
<a href="/" class="text-lg font-bold tracking-tight">QBank</a>
|
|
<div class="flex items-center gap-3">
|
|
<nav class="hidden sm:flex items-center gap-5 text-sm font-medium">
|
|
<a href="/" class="hover:underline underline-offset-2">Library</a>
|
|
<a href="/upload" class="hover:underline underline-offset-2">Upload</a>
|
|
<a href="/test/new" class="hover:underline underline-offset-2">Take Test</a>
|
|
<a href="/history" class="hover:underline underline-offset-2">History</a>
|
|
</nav>
|
|
<span class="text-sm opacity-75 hidden sm:inline">{{.User.Name}}</span>
|
|
<form method="post" action="/logout">
|
|
<input type="hidden" name="csrf_token" value="{{.CSRFToken}}">
|
|
<button type="submit"
|
|
class="text-xs bg-blue-700 hover:bg-blue-800 px-3 py-1.5 rounded-md font-medium">
|
|
Logout
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<nav class="sm:hidden border-t border-blue-500 overflow-x-auto">
|
|
<div class="flex px-4 py-2 gap-5 text-sm font-medium whitespace-nowrap items-center">
|
|
<a href="/" class="hover:underline">Library</a>
|
|
<a href="/upload" class="hover:underline">Upload</a>
|
|
<a href="/test/new" class="hover:underline">Take Test</a>
|
|
<a href="/history" class="hover:underline">History</a>
|
|
<span class="opacity-75 ml-auto">{{.User.Name}}</span>
|
|
</div>
|
|
</nav>
|
|
</header>
|
|
{{else}}
|
|
<header class="bg-blue-600 text-white shadow-md">
|
|
<div class="max-w-2xl mx-auto px-4 py-3">
|
|
<span class="text-lg font-bold tracking-tight">QBank</span>
|
|
</div>
|
|
</header>
|
|
{{end}}
|
|
|
|
{{if .Flash}}
|
|
<div class="max-w-2xl mx-auto px-4 pt-4">
|
|
<div class="bg-green-50 border border-green-200 text-green-800 text-sm px-4 py-3 rounded-md">
|
|
{{.Flash}}
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
|
|
<main class="max-w-2xl mx-auto px-4 py-6">
|
|
{{block "content" .}}{{end}}
|
|
</main>
|
|
|
|
</body>
|
|
</html>
|
|
{{end}}
|