Files
hamprint/templates/base.html
2026-05-12 19:35:15 +03:00

54 lines
2.8 KiB
HTML

{% load tailwind_cli %}<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{% block title %}hamprint — public 3D print dashboard{% endblock %}</title>
{% tailwind_css %}
<style>
body { font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
</style>
{% block extra_head %}{% endblock %}
</head>
<body class="min-h-screen bg-slate-50 text-slate-900">
<nav class="border-b border-slate-200 bg-white">
<div class="mx-auto max-w-6xl px-4 py-3 flex items-center justify-between">
<a href="/" class="flex items-center gap-2">
<span class="inline-grid place-items-center w-8 h-8 rounded-md bg-amber-500 text-white font-bold">h</span>
<span class="font-bold text-lg tracking-tight">hamprint</span>
<span class="hidden sm:inline text-xs text-slate-500 ml-1">· hamlab.lt</span>
</a>
<div class="flex items-center gap-1">
<a href="/" class="px-3 py-1.5 text-sm rounded-md {% if request.path == '/' %}text-slate-900 bg-slate-100 font-medium{% else %}text-slate-700 hover:bg-slate-100{% endif %}">Dashboard</a>
{% if user.is_authenticated %}
<a href="{% url 'dashboard:my_prints' %}" class="px-3 py-1.5 text-sm rounded-md {% if request.resolver_match.view_name == 'dashboard:my_prints' %}text-slate-900 bg-slate-100 font-medium{% else %}text-slate-700 hover:bg-slate-100{% endif %}">My prints</a>
{% endif %}
<a href="/submit/" class="px-3 py-1.5 text-sm rounded-md bg-amber-500 text-white hover:bg-amber-600 font-medium">+ Submit a print</a>
{% if user.is_authenticated %}
<div class="ml-2 flex items-center gap-2 px-2 py-1 rounded-md hover:bg-slate-100">
<span class="w-7 h-7 rounded-full bg-gradient-to-br from-emerald-400 to-blue-500 grid place-items-center text-white text-xs font-bold">{{ user.username|slice:":1"|upper }}</span>
<span class="text-sm text-slate-700 hidden sm:inline">{{ user.username }}</span>
</div>
{% else %}
<a href="{% url 'account_login' %}" class="px-3 py-1.5 text-sm rounded-md text-slate-700 hover:bg-slate-100">Sign in</a>
{% endif %}
</div>
</div>
</nav>
<main class="mx-auto max-w-6xl px-4 py-8">
{% block content %}{% endblock %}
</main>
<footer class="mt-12 border-t border-slate-200 bg-white">
<div class="mx-auto max-w-6xl px-4 py-6 flex flex-col sm:flex-row sm:items-center sm:justify-between gap-2 text-sm text-slate-500">
<p>A community service of <a href="https://hamlab.lt" class="font-medium text-slate-700 hover:underline">hamlab.lt</a></p>
{% if user.is_staff %}<p>Operators: <a href="{% url 'admin:index' %}" class="hover:underline">admin panel</a>.</p>{% endif %}
</div>
</footer>
</body>
</html>