100 lines
4.4 KiB
HTML
100 lines
4.4 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||
<title>Freundesbuch – Admin</title>
|
||
<link rel="stylesheet" href="/assets/style.css" />
|
||
<link rel="stylesheet" href="/admin/admin.css" />
|
||
</head>
|
||
<body>
|
||
<div class="top-bar card" style="border-radius:0;">
|
||
<h1 style="margin:0;">📖 Freundesbuch</h1>
|
||
<div style="display:flex; gap:0.6em; flex-wrap:wrap;">
|
||
<a class="btn" href="/book" target="_blank" rel="noopener">🎠 Freundesbuch anschauen</a>
|
||
<button class="secondary" id="logoutBtn">Abmelden</button>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="container">
|
||
<section class="card" id="settingsCard">
|
||
<h2>Einstellungen</h2>
|
||
<label for="publicBaseUrl">Öffentliche URL (für Freigabe-Links hinter einem Reverse-Proxy)</label>
|
||
<div class="inline-form">
|
||
<input type="text" id="publicBaseUrl" placeholder="https://freundesbuch.example.com" />
|
||
<button type="button" id="saveSettingsBtn">Speichern</button>
|
||
</div>
|
||
<p class="muted" style="margin-top:0.4em;">Leer lassen, um automatisch die aktuell aufgerufene Adresse zu verwenden.</p>
|
||
<div id="settingsSaved" class="saved-msg2"></div>
|
||
</section>
|
||
|
||
<section class="card" id="createCard" style="margin-top:1.4em;">
|
||
<h2>Neuen Freund anlegen</h2>
|
||
<form id="createForm" class="inline-form">
|
||
<input type="text" id="newName" placeholder="Name des Freundes" required />
|
||
<button type="submit">+ Anlegen</button>
|
||
</form>
|
||
<div id="createErr"></div>
|
||
</section>
|
||
|
||
<section class="card" id="transferCard" style="margin-top:1.4em;">
|
||
<h2>Sichern & Wiederherstellen</h2>
|
||
<div class="transfer-row">
|
||
<div>
|
||
<h3 style="font-size:1.2rem;">Ganzes Buch</h3>
|
||
<button type="button" id="bookExportBtn" class="secondary">⬇️ Buch exportieren (ZIP)</button>
|
||
</div>
|
||
<div>
|
||
<label for="bookImportFile">Buch importieren</label>
|
||
<input type="file" id="bookImportFile" accept=".zip" />
|
||
<label style="font-weight:normal; display:flex; align-items:center; gap:0.4em; margin-top:0.4em;">
|
||
<input type="checkbox" id="bookImportReplace" style="width:auto;" />
|
||
Bestehende Freunde vorher löschen
|
||
</label>
|
||
<button type="button" id="bookImportBtn" class="secondary" style="margin-top:0.4em;">⬆️ Importieren</button>
|
||
</div>
|
||
</div>
|
||
<hr style="border:none; border-top:1px solid var(--line); margin:1.2em 0;" />
|
||
<div>
|
||
<h3 style="font-size:1.2rem;">Einzelnen Freund importieren</h3>
|
||
<p class="muted">Legt einen neuen Freund aus einer zuvor exportierten ZIP-Datei an.</p>
|
||
<input type="file" id="friendImportFile" accept=".zip" />
|
||
<button type="button" id="friendImportBtn" class="secondary" style="margin-top:0.4em;">⬆️ Importieren</button>
|
||
</div>
|
||
<div id="transferMsg"></div>
|
||
</section>
|
||
|
||
<section style="margin-top:2em;">
|
||
<h2>Deine Freunde</h2>
|
||
<div id="friendGrid" class="friend-grid"></div>
|
||
<p id="emptyMsg" class="muted" style="display:none;">Noch keine Freunde angelegt – leg oben den ersten an!</p>
|
||
</section>
|
||
</div>
|
||
|
||
<!-- Share-Dialog -->
|
||
<div id="shareModal" class="modal-backdrop" style="display:none;">
|
||
<div class="card modal">
|
||
<h3>Freigabe für <span id="shareFriendName"></span></h3>
|
||
<p class="muted">Vergib ein eigenes Passwort. Dein Freund kann sich über den Link damit anmelden und nur seine eigene Seite bearbeiten.</p>
|
||
<label for="sharePw">Freigabe-Passwort</label>
|
||
<input type="text" id="sharePw" placeholder="z. B. Sommerferien2026" />
|
||
<div style="display:flex; gap:0.6em; margin-top:1em; flex-wrap:wrap;">
|
||
<button id="shareEnableBtn">Freigabe aktivieren / Passwort setzen</button>
|
||
<button class="danger" id="shareDisableBtn">Freigabe beenden</button>
|
||
<button class="secondary" id="shareCloseBtn">Schließen</button>
|
||
</div>
|
||
<div id="shareLinkBox" style="margin-top:1em; display:none;">
|
||
<label>Link zum Teilen</label>
|
||
<div style="display:flex; gap:0.5em;">
|
||
<input type="text" id="shareLinkInput" readonly />
|
||
<button type="button" id="copyLinkBtn" class="secondary">Kopieren</button>
|
||
</div>
|
||
</div>
|
||
<div id="shareErr"></div>
|
||
</div>
|
||
</div>
|
||
|
||
<script src="/admin/admin.js"></script>
|
||
</body>
|
||
</html>
|