Phase1 Bearbeitung

This commit is contained in:
2026-06-15 18:36:57 +02:00
parent e4fa714419
commit 06645f1e9c
29 changed files with 3367 additions and 300 deletions
+24 -11
View File
@@ -4,6 +4,12 @@ $flashError = flash($session, 'error');
$authState = $authState ?? $session->get('auth');
$tenant = $tenant ?? null;
$currentPath = current_path();
$tenantSlug = is_array($tenant) && isset($tenant['slug']) ? (string) $tenant['slug'] : '';
$tenantRole = is_array($authState) ? (string) ($authState['tenant_role'] ?? '') : '';
$hasTenantAccess = $tenantSlug !== ''
&& is_array($authState)
&& (($authState['tenant_slug'] ?? null) === $tenantSlug);
$isTenantAdmin = in_array($tenantRole, ['owner', 'admin'], true);
?>
<!DOCTYPE html>
<html lang="de">
@@ -25,18 +31,25 @@ $currentPath = current_path();
</span>
</a>
<nav class="top-nav">
<?php if (is_array($tenant) && isset($tenant['slug'])): ?>
<a href="<?= e(tenant_url($tenant['slug'])) ?>" class="<?= $currentPath === tenant_url($tenant['slug']) ? 'active' : '' ?>">Dashboard</a>
<a href="<?= e(tenant_url($tenant['slug'], 'members')) ?>" class="<?= str_contains($currentPath, '/members') ? 'active' : '' ?>">Mitglieder</a>
<a href="<?= e(tenant_url($tenant['slug'], 'products')) ?>" class="<?= str_contains($currentPath, '/products') ? 'active' : '' ?>">Produkte</a>
<a href="<?= e(tenant_url($tenant['slug'], 'bookings')) ?>" class="<?= str_contains($currentPath, '/bookings') ? 'active' : '' ?>">Digital</a>
<a href="<?= e(tenant_url($tenant['slug'], 'payments')) ?>" class="<?= str_contains($currentPath, '/payments') ? 'active' : '' ?>">Einzahlungen</a>
<a href="<?= e(tenant_url($tenant['slug'], 'paper-sheets')) ?>" class="<?= str_contains($currentPath, '/paper-sheets') ? 'active' : '' ?>">Papier</a>
<a href="<?= e(tenant_url($tenant['slug'], 'rfid')) ?>" class="<?= str_contains($currentPath, '/rfid') ? 'active' : '' ?>">RFID</a>
<?php if ($hasTenantAccess): ?>
<a href="<?= e(tenant_url($tenantSlug)) ?>" class="<?= $currentPath === tenant_url($tenantSlug) ? 'active' : '' ?>">Uebersicht</a>
<a href="<?= e(tenant_url($tenantSlug, 'bookings')) ?>" class="<?= str_contains($currentPath, '/bookings') ? 'active' : '' ?>">Buchen</a>
<?php if ($isTenantAdmin): ?>
<a href="<?= e(tenant_url($tenantSlug, 'members')) ?>" class="<?= str_contains($currentPath, '/members') ? 'active' : '' ?>">Mitglieder</a>
<a href="<?= e(tenant_url($tenantSlug, 'products')) ?>" class="<?= str_contains($currentPath, '/products') ? 'active' : '' ?>">Produkte</a>
<a href="<?= e(tenant_url($tenantSlug, 'payments')) ?>" class="<?= str_contains($currentPath, '/payments') ? 'active' : '' ?>">Einzahlungen</a>
<a href="<?= e(tenant_url($tenantSlug, 'paper-sheets')) ?>" class="<?= str_contains($currentPath, '/paper-sheets') ? 'active' : '' ?>">Papierlisten</a>
<a href="<?= e(tenant_url($tenantSlug, 'rfid')) ?>" class="<?= str_contains($currentPath, '/rfid') ? 'active' : '' ?>">RFID</a>
<?php endif; ?>
<?php elseif ($tenantSlug !== ''): ?>
<a href="/" class="<?= $currentPath === '/' ? 'active' : '' ?>">Start</a>
<a href="/register" class="<?= $currentPath === '/register' ? 'active' : '' ?>">Pilot registrieren</a>
<a href="<?= e(tenant_url($tenantSlug, 'login')) ?>" class="<?= $currentPath === tenant_url($tenantSlug, 'login') ? 'active' : '' ?>">Standort-Login</a>
<a href="/admin/login" class="<?= str_starts_with($currentPath, '/admin') ? 'active' : '' ?>">Plattform</a>
<?php else: ?>
<a href="/">Start</a>
<a href="/register">Registrieren</a>
<a href="/admin/login">Plattform</a>
<a href="/" class="<?= $currentPath === '/' ? 'active' : '' ?>">Start</a>
<a href="/register" class="<?= $currentPath === '/register' ? 'active' : '' ?>">Pilot registrieren</a>
<a href="/admin/login" class="<?= str_starts_with($currentPath, '/admin') ? 'active' : '' ?>">Plattform</a>
<?php endif; ?>
</nav>
</div>