finished auth overhaul and started tenants

This commit is contained in:
2025-10-14 01:30:22 +02:00
parent 5591a77870
commit 02fc60151f
10 changed files with 215 additions and 86 deletions

View File

@@ -41,59 +41,64 @@
<!-- Header -->
<header class="bg-surface border-b border-border shadow-sm">
<div
class="max-w-7xl mx-auto px-6 py-4
grid grid-cols-2 items-center gap-4"
>
<!-- 1) form in column 1 -->
<form
method="POST"
action="/retrieve-token"
class="relative z-10 flex flex-col space-y-2"
>
<input
type="text"
name="user_name"
value="{{ user_name }}"
class="bg-transparent text-muted text-sm font-medium w-auto min-w-max whitespace-nowrap px-2 py-1 rounded-md border border-transparent focus:border-primary focus:outline-none focus:bg-background"
size="{{ user_name|length }}"
disabled
id="usernameInput"
/>
<div class="w-auto min-w-max whitespace-nowrap">
<button
type="button"
onclick="enableUsernameEdit()"
class="text-sm text-white bg-primary px-3 py-1 rounded-md hover:bg-blue-700"
id="editBtn"
<div
class="w-full px-6 py-4
flex items-center justify-between"
>
Username ändern
<div class="relative z-20">
<button id="menu-toggle" class="text-white hover:text-gray-300 focus:outline-none p-2 rounded-md">
<svg class="w-6 h-6" fill="none" stroke="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path>
</svg>
</button>
<button
type="submit"
class="hidden text-sm text-white bg-primary px-3 py-1 rounded-md hover:bg-blue-700"
id="saveBtn"
>
Save
</button>
</div>
</form>
<!-- 2) admin button in column 2 -->
<div class="flex justify-end">
<a href="/admin">
<button class="bg-primary hover:bg-blue-700 text-white px-3 py-1 rounded-md transition">
Admin
</button>
</a>
<div class="hamburger-menu">
<button class="menu-toggle" aria-controls="course-selector">Menu</button>
<select id="course-selector" name="course_selection" onchange="this.form.submit()">
<option value="" disabled selected>Select a Course</option>
{% for course in courses %}
<option value="{{ course.id }}">
{{ course.display_name }}
</option>
{% endfor %}
</select>
</div>
</div>
</header>
<div class="flex items-center space-x-1 relative z-10">
<span class="text-white text-base font-medium whitespace-nowrap py-1">
User: {{ user_name }}
</span>
<form method="POST" action="/logout">
<button
type="submit"
class="text-sm text-white bg-red-600 px-3 py-1 rounded-md hover:bg-red-700 transition"
>
Logout
</button>
</form>
<a href="/admin" class="ml-4">
<button class="bg-primary hover:bg-blue-700 text-white px-3 py-1 rounded-md transition">
Admin
</button>
</a>
</div>
</div>
</header>
<script>
document.getElementById('menu-toggle').addEventListener('click', function() {
document.getElementById('course-menu').classList.toggle('hidden');
});
</script> <!-- Main Content -->
<!-- Main Content -->
<main class="max-w-5xl mx-auto px-6 py-10 space-y-12">
<h3 class="text-3xl font-bold text-center mb-8">GRNVS Tutorium SS 25</h3>
<h3 class="text-3xl font-bold text-center mb-8">{{course_display_name}}</h3>
{% if active_banner %}