114 lines
6.2 KiB
PHP
114 lines
6.2 KiB
PHP
<?php
|
||
$assetVersion = defined('ASSET_VERSION') ? ASSET_VERSION : time();
|
||
$appBaseUrl = rtrim($GLOBALS['app_base_url'] ?? '', '/');
|
||
$assetBase = $appBaseUrl !== '' ? $appBaseUrl : '';
|
||
$appApiBase = rtrim($GLOBALS['app_api_base'] ?? '', '/');
|
||
$debugRedirect = isset($_GET['debug_redirect']);
|
||
?>
|
||
<!doctype html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="utf-8"/>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||
<title>Email Template System – Konto</title>
|
||
<script>document.documentElement.classList.add('auth-pending');</script>
|
||
<style>html.auth-pending body{visibility:hidden;}</style>
|
||
<script>
|
||
window.APP_BASE_URL = <?= json_encode($appBaseUrl, JSON_UNESCAPED_SLASHES) ?>;
|
||
window.APP_API_BASE = <?= json_encode($appApiBase, JSON_UNESCAPED_SLASHES) ?>;
|
||
</script>
|
||
<script src="https://cdn.tailwindcss.com"></script>
|
||
<?php if ($debugRedirect): ?>
|
||
<script src="<?= $assetBase ?>/assets/js/debug-location.js?v=<?= htmlspecialchars($assetVersion, ENT_QUOTES) ?>"></script>
|
||
<?php endif; ?>
|
||
<link rel="stylesheet" href="<?= $assetBase ?>/assets/css/admin.css?v=<?= htmlspecialchars($assetVersion, ENT_QUOTES) ?>">
|
||
<link rel="stylesheet" href="<?= $assetBase ?>/assets/css/toast.css?v=<?= htmlspecialchars($assetVersion, ENT_QUOTES) ?>">
|
||
<style>
|
||
:root { color-scheme: light; }
|
||
.btn{display:inline-flex;align-items:center;gap:.5rem;padding:.35rem .7rem;border-radius:.7rem;border:1px solid #e5e7eb;background:#fff;font-size:.9rem;cursor:pointer;}
|
||
.btn:hover{background:#f8fafc}
|
||
.btn-avatar{padding:.35rem;border-radius:999px;width:42px;height:42px;justify-content:center;font-weight:600;background:#0ea5e9;color:#fff;border:none}
|
||
.btn-avatar[aria-disabled="true"]{pointer-events:none;}
|
||
.btn-avatar:hover{background:#0284c7}
|
||
.section-card{background:#fff;border:1px solid #e2e8f0;border-radius:1rem;padding:1.25rem;margin-bottom:1.5rem}
|
||
.section-card h4{margin:0 0 1rem;font-size:1rem;font-weight:600;color:#0f172a}
|
||
.input{width:100%;border:1px solid #cbd5f5;border-radius:.5rem;padding:.5rem .75rem}
|
||
.user-tabs{display:flex;gap:.5rem;margin-bottom:1.25rem}
|
||
.team-table{width:100%;border-collapse:collapse;font-size:.9rem}
|
||
.team-table th,.team-table td{padding:.35rem .5rem;border-bottom:1px solid #e2e8f0;text-align:left}
|
||
.badge{display:inline-flex;align-items:center;padding:.1rem .5rem;border-radius:999px;font-size:.75rem;background:#e2e8f0;color:#0f172a}
|
||
.chip{display:inline-flex;align-items:center;padding:.15rem .55rem;border-radius:999px;background:#f1f5f9;color:#0f172a;border:1px solid #e2e8f0;font-size:.8rem}
|
||
.user-menu{position:absolute;top:calc(100% + .5rem);right:0;min-width:180px;background:#fff;border:1px solid #e2e8f0;border-radius:.75rem;box-shadow:0 20px 35px rgba(15,23,42,.15);padding:.35rem;z-index:40}
|
||
.user-menu-item{display:block;width:100%;text-align:left;padding:.45rem .75rem;border-radius:.6rem;font-size:.9rem;color:#0f172a}
|
||
.user-menu-item:hover{background:#f1f5f9}
|
||
</style>
|
||
</head>
|
||
<body class="bg-slate-50 text-slate-800" data-page="account">
|
||
<header class="sticky top-0 z-30 bg-white/90 border-b backdrop-blur">
|
||
<div class="max-w-5xl mx-auto px-4 py-4 flex items-center gap-3">
|
||
<a href="<?= $appBaseUrl ?>/index.php" class="btn" title="Zurück zur Übersicht">← Übersicht</a>
|
||
<h1 class="font-semibold text-lg">Mein Konto</h1>
|
||
<div class="ms-auto flex gap-2 items-center">
|
||
<div class="relative" id="userMenu">
|
||
<button id="btn-user" type="button" class="btn-avatar" aria-haspopup="true" aria-expanded="false">
|
||
<span id="userAvatar">U</span>
|
||
</button>
|
||
<div id="userMenuPanel" class="user-menu hidden" role="menu">
|
||
<a href="<?= $appBaseUrl ?>/admin/profile.php" class="user-menu-item" data-menu="profile">Profil</a>
|
||
<a href="<?= $appBaseUrl ?>/admin/dashboard.php" class="user-menu-item" data-role="admin">Dashboard</a>
|
||
<a href="<?= $appBaseUrl ?>/admin/settings.php" class="user-menu-item" data-role="admin">Administration</a>
|
||
<button id="btn-logout" type="button" class="user-menu-item text-red-600">Logout</button>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</header>
|
||
|
||
<main class="max-w-5xl mx-auto p-4 md:p-6">
|
||
<div class="user-tabs">
|
||
<button type="button" data-user-tab="profile" class="btn bg-sky-50 text-sky-700 flex-1">Profil</button>
|
||
<button type="button" data-user-tab="security" class="btn flex-1">Passwort</button>
|
||
</div>
|
||
|
||
<section data-user-panel="profile" class="section-card">
|
||
<h4>Profil</h4>
|
||
<form id="profileForm" class="space-y-3">
|
||
<label class="block text-sm text-slate-600">Name
|
||
<input type="text" id="profile_name" name="name" class="input mt-1" required>
|
||
</label>
|
||
<label class="block text-sm text-slate-600">E-Mail
|
||
<input type="email" id="profile_email" name="email" class="input mt-1" required>
|
||
</label>
|
||
<div class="flex justify-end">
|
||
<button type="submit" class="btn">Speichern</button>
|
||
</div>
|
||
</form>
|
||
</section>
|
||
|
||
<section data-user-panel="security" class="section-card hidden">
|
||
<h4>Passwort ändern</h4>
|
||
<form id="passwordForm" class="space-y-3">
|
||
<label class="block text-sm text-slate-600">Aktuelles Passwort
|
||
<input type="password" name="current_password" class="input mt-1" required>
|
||
</label>
|
||
<label class="block text-sm text-slate-600">Neues Passwort (min. 8 Zeichen)
|
||
<input type="password" name="new_password" class="input mt-1" required minlength="8">
|
||
</label>
|
||
<div class="flex justify-end">
|
||
<button type="submit" class="btn">Aktualisieren</button>
|
||
</div>
|
||
</form>
|
||
</section>
|
||
|
||
<section class="section-card">
|
||
<p class="text-sm text-slate-600">Teammitglieder, Absender und Integrationen verwaltest du im Bereich <strong>Administration</strong>. Öffne ihn über das Avatar-Menü oben rechts.</p>
|
||
</section>
|
||
</main>
|
||
|
||
<div id="toast-root"></div>
|
||
|
||
<script src="<?= $assetBase ?>/assets/js/toast.js?v=<?= htmlspecialchars($assetVersion, ENT_QUOTES) ?>"></script>
|
||
<script type="module" src="<?= $assetBase ?>/assets/js/account.js?v=<?= htmlspecialchars($assetVersion, ENT_QUOTES) ?>"></script>
|
||
</body>
|
||
</html>
|