Dashboard V2
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" class="dark">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Admin-Bereich</title>
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
<body class="bg-gray-100 dark:bg-gray-900 text-gray-800 dark:text-white p-6">
|
||||
<h1 class="text-3xl font-bold mb-4">Admin-Bereich</h1>
|
||||
<!-- templates/admin.html -->
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Admin-Bereich{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto p-4 sm:p-6 lg:p-8">
|
||||
<h1 class="text-3xl font-bold mb-6">Admin-Bereich</h1>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
@@ -18,122 +16,134 @@
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<!-- Neuen Benutzer anlegen -->
|
||||
<div class="mb-8 p-4 rounded bg-white dark:bg-gray-800">
|
||||
<h2 class="text-xl font-semibold mb-2">Neuen Benutzer anlegen</h2>
|
||||
<form method="POST">
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="new_username">Benutzername</label>
|
||||
<input type="text" name="new_username" id="new_username" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="new_password">Passwort</label>
|
||||
<input type="password" name="new_password" id="new_password" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox" name="new_is_admin" class="form-checkbox h-5 w-5 text-blue-600">
|
||||
<span class="ml-2">Als Admin markieren</span>
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="bg-green-500 text-white py-2 px-4 rounded hover:bg-green-600">Anlegen</button>
|
||||
</form>
|
||||
<!-- Benutzer anlegen -->
|
||||
<div class="glassmorphism p-4 rounded shadow-lg mb-8">
|
||||
<h2 class="text-xl font-semibold mb-2">Neuen Benutzer anlegen</h2>
|
||||
<form method="POST" action="{{ url_for('admin_panel') }}" class="space-y-4">
|
||||
<div>
|
||||
<label class="block mb-1">Benutzername</label>
|
||||
<input type="text" name="new_username" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block mb-1">Passwort</label>
|
||||
<input type="password" name="new_password" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="inline-flex items-center">
|
||||
<input type="checkbox" name="new_is_admin" class="form-checkbox h-5 w-5 text-blue-600" />
|
||||
<span class="ml-2">Als Admin markieren</span>
|
||||
</label>
|
||||
</div>
|
||||
<button type="submit" class="bg-green-500 text-white py-2 px-4 rounded hover:bg-green-600">
|
||||
Erstellen
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Benutzer-Übersicht oder einzelner Benutzer für Bookmarks -->
|
||||
{% if users is not none %}
|
||||
<div class="mb-8 p-4 rounded bg-white dark:bg-gray-800">
|
||||
<h2 class="text-xl font-semibold mb-2">Benutzerverwaltung</h2>
|
||||
<table class="table-auto w-full">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="px-2 py-1 border-b">ID</th>
|
||||
<th class="px-2 py-1 border-b">Benutzername</th>
|
||||
<th class="px-2 py-1 border-b">Admin?</th>
|
||||
<th class="px-2 py-1 border-b">Aktion</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for user in users %}
|
||||
<tr>
|
||||
<td class="px-2 py-1 border-b">{{ user.id }}</td>
|
||||
<td class="px-2 py-1 border-b">{{ user.username }}</td>
|
||||
<td class="px-2 py-1 border-b">{{ 'Ja' if user.is_admin else 'Nein' }}</td>
|
||||
<td class="px-2 py-1 border-b">
|
||||
<form action="{{ url_for('delete_user', user_id=user.id) }}" method="POST" class="inline-block" onsubmit="return confirm('Benutzer wirklich löschen?')">
|
||||
<button class="bg-red-500 text-white px-2 py-1 rounded hover:bg-red-600 text-sm">Löschen</button>
|
||||
</form>
|
||||
<a href="{{ url_for('manage_bookmarks', user_id=user.id) }}" class="bg-blue-500 text-white px-2 py-1 rounded hover:bg-blue-600 text-sm ml-2">Lesezeichen</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if single_user is defined and single_user %}
|
||||
<!-- Bookmarks verwalten für einen User -->
|
||||
<div class="mb-8 p-4 rounded bg-white dark:bg-gray-800">
|
||||
<h2 class="text-xl font-semibold mb-2">Lesezeichen für {{ single_user.username }}</h2>
|
||||
<form method="POST">
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="title">Titel</label>
|
||||
<input type="text" name="title" id="title" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="url">URL</label>
|
||||
<input type="text" name="url" id="url" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="icon_class">Icon (FontAwesome Klasse)</label>
|
||||
<input type="text" name="icon_class" id="icon_class" class="p-2 border rounded w-full" placeholder="z.B. fas fa-bookmark">
|
||||
</div>
|
||||
<button type="submit" class="bg-green-500 text-white py-2 px-4 rounded hover:bg-green-600">Hinzufügen</button>
|
||||
</form>
|
||||
|
||||
<!-- Bookmark-Liste -->
|
||||
<ul class="mt-4 space-y-2">
|
||||
{% for bm in bookmarks %}
|
||||
<li class="flex items-center justify-between bg-gray-100 dark:bg-gray-700 p-2 rounded">
|
||||
<div>
|
||||
<i class="{{ bm.icon_class }} mr-2"></i>
|
||||
<a href="{{ bm.url }}" target="_blank" class="text-blue-600 hover:underline">{{ bm.title }}</a>
|
||||
</div>
|
||||
<form action="{{ url_for('delete_bookmark', bookmark_id=bm.id, user_id=single_user.id) }}" method="POST" onsubmit="return confirm('Lesezeichen wirklich löschen?')">
|
||||
<button class="text-red-500 hover:text-red-700"><i class="fas fa-trash-alt"></i></button>
|
||||
<!-- Benutzerübersicht -->
|
||||
<div class="glassmorphism p-4 rounded shadow-lg mb-8">
|
||||
<h2 class="text-xl font-semibold mb-2">Benutzerverwaltung</h2>
|
||||
<table class="w-full table-auto">
|
||||
<thead>
|
||||
<tr class="border-b">
|
||||
<th class="px-2 py-1">ID</th>
|
||||
<th class="px-2 py-1">Username</th>
|
||||
<th class="px-2 py-1">Admin?</th>
|
||||
<th class="px-2 py-1"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for u in users %}
|
||||
<tr class="border-b">
|
||||
<td class="px-2 py-1">{{ u.id }}</td>
|
||||
<td class="px-2 py-1">{{ u.username }}</td>
|
||||
<td class="px-2 py-1">{{ 'Ja' if u.is_admin else 'Nein' }}</td>
|
||||
<td class="px-2 py-1 text-right">
|
||||
{% if u.id != session.user_id %}
|
||||
<form method="POST" action="{{ url_for('delete_user', user_id=u.id) }}" onsubmit="return confirm('Benutzer wirklich löschen?')">
|
||||
<button class="bg-red-500 text-white px-2 py-1 rounded hover:bg-red-600 text-sm">
|
||||
Löschen
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
{% else %}
|
||||
<span class="text-xs text-gray-400">[Eigener Account]</span>
|
||||
{% endif %}
|
||||
<a href="{{ url_for('manage_bookmarks', user_id=u.id) }}" class="ml-3 bg-blue-500 text-white px-2 py-1 rounded hover:bg-blue-600 text-sm">
|
||||
Lesezeichen
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Benachrichtigungen für einzelne User oder für alle -->
|
||||
<div class="mb-8 p-4 rounded bg-white dark:bg-gray-800">
|
||||
<h2 class="text-xl font-semibold mb-2">Benachrichtigung erstellen</h2>
|
||||
<form action="{{ url_for('add_notification') }}" method="POST">
|
||||
<div class="mb-2">
|
||||
<label class="block mb-1" for="message">Nachricht</label>
|
||||
<textarea name="message" id="message" rows="2" class="p-2 border rounded w-full" required></textarea>
|
||||
</div>
|
||||
<div class="mb-4">
|
||||
<label class="block mb-1" for="user_id">Für Benutzer</label>
|
||||
<select name="user_id" id="user_id" class="p-2 border rounded w-full">
|
||||
<option value="all">Alle</option>
|
||||
{% if users %}
|
||||
{% for u in users %}
|
||||
<option value="{{ u.id }}">{{ u.username }}</option>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="bg-purple-500 text-white py-2 px-4 rounded hover:bg-purple-600">Senden</button>
|
||||
</form>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- Benachrichtigung erstellen -->
|
||||
<div class="glassmorphism p-4 rounded shadow-lg mb-8">
|
||||
<h2 class="text-xl font-semibold mb-2">Benachrichtigung erstellen</h2>
|
||||
<form method="POST" action="{{ url_for('add_notification') }}" class="space-y-4">
|
||||
<div>
|
||||
<label class="block mb-1">Nachricht</label>
|
||||
<textarea name="message" class="p-2 border rounded w-full" rows="2" required></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block mb-1">Für Benutzer</label>
|
||||
<select name="user_id" class="p-2 border rounded w-full">
|
||||
<option value="all">Alle</option>
|
||||
{% for u in users %}
|
||||
<option value="{{ u.id }}">{{ u.username }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="bg-purple-500 text-white py-2 px-4 rounded hover:bg-purple-600">
|
||||
Senden
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Falls man Lesezeichen für EINEN User verwaltet -->
|
||||
{% if single_user is defined and single_user %}
|
||||
<div class="glassmorphism p-4 rounded shadow-lg mb-8">
|
||||
<h2 class="text-xl font-semibold mb-2">
|
||||
Lesezeichen für {{ single_user.username }}
|
||||
</h2>
|
||||
<form method="POST" class="space-y-4">
|
||||
<div>
|
||||
<label class="block mb-1">Titel</label>
|
||||
<input type="text" name="title" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block mb-1">URL</label>
|
||||
<input type="text" name="url" class="p-2 border rounded w-full" required>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block mb-1">Icon (FontAwesome CSS-Klasse)</label>
|
||||
<input type="text" name="icon_class" class="p-2 border rounded w-full" placeholder="z.B. fas fa-user">
|
||||
</div>
|
||||
<button type="submit" class="bg-green-500 text-white py-2 px-4 rounded hover:bg-green-600">
|
||||
Hinzufügen
|
||||
</button>
|
||||
</form>
|
||||
|
||||
<!-- Tabelle der vorhandenen Bookmarks -->
|
||||
<ul class="mt-4 space-y-2">
|
||||
{% for bm in bookmarks %}
|
||||
<li class="bg-gray-100 dark:bg-gray-700 p-2 rounded flex justify-between items-center">
|
||||
<div>
|
||||
<i class="{{ bm.icon_class }} mr-2"></i>
|
||||
<a href="{{ bm.url }}" target="_blank" class="text-blue-600 hover:underline">{{ bm.title }}</a>
|
||||
</div>
|
||||
<form method="POST" action="{{ url_for('delete_bookmark', bookmark_id=bm.id, user_id=single_user.id) }}" onsubmit="return confirm('Lesezeichen wirklich löschen?')">
|
||||
<button class="text-red-500 hover:text-red-700"><i class="fas fa-trash-alt"></i></button>
|
||||
</form>
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<a href="{{ url_for('dashboard') }}" class="inline-block bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600">
|
||||
Zurück zum Dashboard
|
||||
Zurück zum Dashboard
|
||||
</a>
|
||||
</body>
|
||||
</html>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.9.1/gsap.min.js"></script>
|
||||
|
||||
<!-- Tailwind Dark-Mode-Konfiguration -->
|
||||
<!-- Dark-Mode-Einstellung -->
|
||||
<script>
|
||||
tailwind.config = {
|
||||
darkMode: 'class',
|
||||
@@ -42,7 +42,6 @@
|
||||
.dark .glassmorphism {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
|
||||
.dark input[type="text"],
|
||||
.dark input[type="email"],
|
||||
.dark input[type="password"],
|
||||
@@ -51,7 +50,13 @@
|
||||
background-color: #374151;
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
/* Suchfeld ohne sichtbaren Hintergrund oder Umrandung */
|
||||
.search-input {
|
||||
background: none;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
/* Dock-Icons */
|
||||
.dock-icon {
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
@@ -61,12 +66,12 @@
|
||||
</style>
|
||||
</head>
|
||||
<body class="min-h-screen bg-gray-100 dark:bg-gray-900 text-gray-800 dark:text-gray-100 transition-colors duration-300"
|
||||
style="background-image: url('{{ url_for('static', filename='24.png') }}');">
|
||||
|
||||
style="background-image: url('{{ url_for('static', filename='1.png') }}');">
|
||||
|
||||
{% block content %}{% endblock %}
|
||||
|
||||
<script>
|
||||
// Dark mode per localStorage
|
||||
// Dark Mode init
|
||||
if (localStorage.getItem('darkMode') === 'true' ||
|
||||
(!('darkMode' in localStorage) && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
||||
document.documentElement.classList.add('dark');
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
<!-- templates/dashboard.html -->
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Dashboard{% endblock %}
|
||||
|
||||
@@ -23,16 +22,17 @@
|
||||
<div id="clock" class="text-xl sm:text-2xl font-semibold"></div>
|
||||
</div>
|
||||
|
||||
<!-- Websuche unter dem Datum -->
|
||||
<!-- Websuche: ohne Input-BG/Border -->
|
||||
<div class="glassmorphism p-4 shadow-lg mb-6 w-full max-w-lg">
|
||||
<form id="searchForm" class="flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 items-center justify-center">
|
||||
<input type="text" id="searchInput" placeholder="Suche..."
|
||||
class="flex-grow p-2 border rounded text-gray-800" />
|
||||
<select id="searchEngine" class="p-2 border rounded text-gray-800">
|
||||
<form id="searchForm" style="background-color: transparent !important;" class="flex flex-col sm:flex-row items-center justify-center">
|
||||
<input type="text" style="background-color: transparent !important;" id="searchInput" placeholder="Suche..."
|
||||
class="flex-grow bg-transparent border-0 outline-none placeholder-gray-500 text-gray-800
|
||||
dark:placeholder-gray-300" />
|
||||
<select id="searchEngine" style="background-color: transparent !important;" class="bg-transparent border-0 outline-none text-gray-800 dark:text-white ml-2">
|
||||
<option value="qwant">Qwant</option>
|
||||
<option value="google">Google</option>
|
||||
</select>
|
||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600">
|
||||
<button type="submit" class="bg-green-500 text-white px-4 py-2 rounded hover:bg-green-600 ml-2">
|
||||
Los
|
||||
</button>
|
||||
</form>
|
||||
@@ -138,7 +138,7 @@
|
||||
<i class="fas fa-home text-white text-xl"></i>
|
||||
</button>
|
||||
|
||||
<!-- Falls du trotzdem einen "Support" willst, kannst du es hier lassen -->
|
||||
<!-- Support-Button (öffnet Support-Modal V1) -->
|
||||
<button class="dock-icon w-12 h-12 flex items-center justify-center bg-purple-500 hover:bg-purple-600 rounded-xl
|
||||
transition-colors duration-200" data-modal="supportModal">
|
||||
<i class="fas fa-question-circle text-white text-xl"></i>
|
||||
@@ -152,9 +152,17 @@
|
||||
<i class="fas fa-user-shield text-white text-xl"></i>
|
||||
</a>
|
||||
{% endif %}
|
||||
|
||||
<!-- Einstellungen (öffnet Settings-Modal V1) -->
|
||||
<button class="dock-icon w-12 h-12 flex items-center justify-center bg-yellow-700 hover:bg-yellow-800 rounded-xl
|
||||
transition-colors duration-200" data-modal="settingsModal">
|
||||
<i class="fas fa-cog text-white text-xl"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<!-- Modals (z.B. Home, Support usw.) -->
|
||||
<!-- =========================== MODALS =========================== -->
|
||||
|
||||
<!-- Home Modal -->
|
||||
<div id="homeModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="glassmorphism bg-white dark:bg-gray-800 p-6 rounded max-w-md w-full mx-auto">
|
||||
<h2 class="text-2xl font-bold mb-4">Willkommen Zuhause!</h2>
|
||||
@@ -172,13 +180,78 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Support Modal (aus V1, mit ProblemType/E-Mail/Nachricht + sendSupportMessage) -->
|
||||
<div id="supportModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center z-50">
|
||||
<div class="glassmorphism bg-white dark:bg-gray-800 p-6 rounded max-w-md w-full mx-auto">
|
||||
<h2 class="text-2xl font-bold mb-4">Support</h2>
|
||||
<p class="mb-4">Beschreiben Sie Ihr Problem</p>
|
||||
<!-- ... -->
|
||||
<button class="mt-4 bg-gray-300 dark:bg-gray-700 hover:bg-gray-400 dark:hover:bg-gray-800 text-gray-800 dark:text-white
|
||||
font-bold py-2 px-4 rounded close-modal">
|
||||
<div class="glassmorphism bg-white dark:bg-gray-800 p-8 rounded-lg max-w-md w-full mx-auto shadow-lg">
|
||||
<h2 class="text-2xl font-bold mb-4">Support kontaktieren</h2>
|
||||
|
||||
<!-- Dropdown zur Kategorisierung des Problems -->
|
||||
<label for="problemType" class="block mb-2 text-lg font-semibold">Art des Problems</label>
|
||||
<select id="problemType" class="w-full p-2 border rounded mb-4 text-gray-800 dark:bg-gray-700 dark:text-white">
|
||||
<option value="Technisches Problem">Technisches Problem</option>
|
||||
<option value="Account Problem">Account Problem</option>
|
||||
<option value="Sonstiges">Sonstiges</option>
|
||||
</select>
|
||||
|
||||
<!-- Eingabefeld für E-Mail -->
|
||||
<label for="emailInput" class="block mb-2 text-lg font-semibold">Ihre E-Mail</label>
|
||||
<input type="email" id="emailInput" class="w-full p-2 border rounded mb-4 text-gray-800 dark:bg-gray-700 dark:text-white"
|
||||
placeholder="Ihre E-Mail-Adresse" />
|
||||
|
||||
<!-- Eingabefeld für Nachricht -->
|
||||
<label for="messageInput" class="block mb-2 text-lg font-semibold">Nachricht</label>
|
||||
<textarea id="messageInput" class="w-full p-2 border rounded mb-4 text-gray-800 dark:bg-gray-700 dark:text-white" rows="4"
|
||||
placeholder="Beschreiben Sie Ihr Problem"></textarea>
|
||||
|
||||
<!-- Button zum Senden der Nachricht -->
|
||||
<button id="sendSupportMessage" class="bg-purple-500 text-white px-4 py-2 rounded hover:bg-purple-600 transition-colors duration-200">
|
||||
Nachricht senden
|
||||
</button>
|
||||
|
||||
<!-- Schließen-Button -->
|
||||
<button class="mt-4 bg-blue-500 text-white px-4 py-2 rounded hover:bg-blue-600 transition-colors duration-200 close-modal">
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Settings Modal (aus V1, mit Wallpaper-Auswahl, Stadt, etc.) -->
|
||||
<div id="settingsModal" class="fixed inset-0 bg-black bg-opacity-50 hidden items-center justify-center overflow-auto z-50">
|
||||
<div class="glassmorphism bg-white dark:bg-gray-800 p-6 rounded-lg w-full max-w-md max-h-screen overflow-y-auto mx-4 shadow-lg">
|
||||
<h2 class="text-2xl font-bold mb-4">Einstellungen</h2>
|
||||
<p>Hier können Sie Ihre Einstellungen anpassen und das System nach Ihren Wünschen konfigurieren.</p>
|
||||
|
||||
<!-- Hintergrundbild auswählen -->
|
||||
<h3 class="text-lg font-semibold mb-2 mt-4">Hintergrundbild auswählen</h3>
|
||||
<div id="wallpaperSelection" class="grid grid-cols-2 sm:grid-cols-3 gap-2 mb-4">
|
||||
{% for i in range(1, 27) %}
|
||||
<img src="{{ url_for('static', filename=i ~ '.png') }}" alt="Wallpaper {{ i }}"
|
||||
class="w-full h-auto wallpaper-thumb cursor-pointer border-2
|
||||
{% if wallpaper == i ~ '.png' %}border-blue-500{% else %}border-transparent{% endif %}
|
||||
rounded"
|
||||
data-wallpaper="{{ i }}.png">
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<!-- Stadt ändern -->
|
||||
<h3 class="text-lg font-semibold mb-2">Stadt ändern</h3>
|
||||
<input type="text" id="cityInput" class="w-full p-2 border rounded mb-4 text-gray-800 dark:bg-gray-700 dark:text-white"
|
||||
placeholder="Ihre Stadt" value="{{ city }}" />
|
||||
|
||||
<!-- Unsichtbarer Wetter-Toggle (V1-Fallback) -->
|
||||
<div style="display: none;">
|
||||
<h3 class="text-lg font-semibold mb-2">Wochenvorhersage anzeigen</h3>
|
||||
<label class="inline-flex items-center mt-2">
|
||||
<input type="checkbox" id="weatherForecastToggle" class="form-checkbox h-5 w-5 text-blue-600"
|
||||
{% if show_forecast %}checked{% endif %} />
|
||||
<span class="ml-2 text-gray-700 dark:text-gray-300">Wochenvorhersage anzeigen</span>
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<button id="saveSettings" class="mt-4 bg-yellow-500 text-white px-4 py-2 rounded hover:bg-yellow-600 transition-colors duration-200">
|
||||
Speichern
|
||||
</button>
|
||||
<button class="mt-4 ml-2 bg-gray-500 text-white px-4 py-2 rounded hover:bg-gray-600 transition-colors duration-200 close-modal">
|
||||
Schließen
|
||||
</button>
|
||||
</div>
|
||||
@@ -227,7 +300,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Modals (Home, Support)
|
||||
// Modals (Home, Support, Settings)
|
||||
const modals = document.querySelectorAll('[id$="Modal"]');
|
||||
const modalTriggers = document.querySelectorAll('[data-modal]');
|
||||
const closeModalButtons = document.querySelectorAll('.close-modal');
|
||||
@@ -256,7 +329,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
// Websuche
|
||||
// Websuche (inline)
|
||||
const searchForm = document.getElementById('searchForm');
|
||||
const searchInput = document.getElementById('searchInput');
|
||||
const searchEngine = document.getElementById('searchEngine');
|
||||
@@ -272,5 +345,82 @@
|
||||
}
|
||||
window.open(url, '_blank');
|
||||
});
|
||||
|
||||
// Support Modal: Nachricht senden (aus V1)
|
||||
const sendSupportMessage = document.getElementById('sendSupportMessage');
|
||||
if (sendSupportMessage) {
|
||||
sendSupportMessage.addEventListener('click', () => {
|
||||
const email = document.getElementById('emailInput').value.trim();
|
||||
const problemType = document.getElementById('problemType').value;
|
||||
const message = document.getElementById('messageInput').value.trim();
|
||||
if (email && message) {
|
||||
fetch('/send_support_message', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ email, problemType, message })
|
||||
}).then(response => {
|
||||
if (response.ok) {
|
||||
alert('Ihre Nachricht wurde erfolgreich gesendet.');
|
||||
const modal = document.getElementById('supportModal');
|
||||
modal.classList.remove('flex');
|
||||
modal.classList.add('hidden');
|
||||
} else {
|
||||
alert('Fehler beim Senden der Nachricht.');
|
||||
}
|
||||
});
|
||||
} else {
|
||||
alert('Bitte E-Mail und Nachricht ausfüllen.');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Settings Modal (Wallpaper, Stadt, etc.) aus V1
|
||||
// Lese/Schreibe Settings per '/get_settings' und '/save_settings'
|
||||
let selectedWallpaper = '{{ wallpaper }}';
|
||||
|
||||
// Markiere ausgewähltes Wallpaper
|
||||
const wallpaperThumbs = document.querySelectorAll('.wallpaper-thumb');
|
||||
wallpaperThumbs.forEach(thumb => {
|
||||
thumb.addEventListener('click', function() {
|
||||
wallpaperThumbs.forEach(t => t.classList.remove('border-blue-500'));
|
||||
wallpaperThumbs.forEach(t => t.classList.add('border-transparent'));
|
||||
this.classList.remove('border-transparent');
|
||||
this.classList.add('border-blue-500');
|
||||
selectedWallpaper = this.getAttribute('data-wallpaper');
|
||||
});
|
||||
});
|
||||
|
||||
const saveSettingsBtn = document.getElementById('saveSettings');
|
||||
if (saveSettingsBtn) {
|
||||
saveSettingsBtn.addEventListener('click', () => {
|
||||
const city = document.getElementById('cityInput').value.trim();
|
||||
const showForecast = document.getElementById('weatherForecastToggle').checked;
|
||||
// Alte Settings laden
|
||||
fetch('/get_settings')
|
||||
.then(response => response.json())
|
||||
.then(settings => {
|
||||
const bookmarks = settings.bookmarks || [];
|
||||
// Neue Settings absenden
|
||||
fetch('/save_settings', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
wallpaper: selectedWallpaper,
|
||||
city: city,
|
||||
show_forecast: showForecast,
|
||||
bookmarks: bookmarks
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
if (data.success) {
|
||||
location.reload();
|
||||
} else {
|
||||
alert('Fehler beim Speichern der Einstellungen.');
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{% endblock content %}
|
||||
|
||||
33
Dashboard_V2/templates/reset_password.html
Normal file
33
Dashboard_V2/templates/reset_password.html
Normal file
@@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Passwort zurücksetzen{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="container mx-auto p-4 sm:p-6 lg:p-8">
|
||||
<h1 class="text-2xl font-bold mb-4">Neues Passwort setzen</h1>
|
||||
|
||||
{% with messages = get_flashed_messages(with_categories=true) %}
|
||||
{% if messages %}
|
||||
{% for category, msg in messages %}
|
||||
<div class="mb-2 bg-{{category}}-500 text-white p-2 rounded">
|
||||
{{ msg }}
|
||||
</div>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
{% endwith %}
|
||||
|
||||
<form method="POST" action="{{ url_for('reset_password', token=token) }}"
|
||||
class="max-w-md glassmorphism p-4">
|
||||
<label class="block mb-2" for="pw1">Neues Passwort</label>
|
||||
<input type="password" name="pw1" id="pw1"
|
||||
class="w-full p-2 border rounded text-gray-800 mb-4" required>
|
||||
|
||||
<label class="block mb-2" for="pw2">Passwort bestätigen</label>
|
||||
<input type="password" name="pw2" id="pw2"
|
||||
class="w-full p-2 border rounded text-gray-800 mb-4" required>
|
||||
|
||||
<button type="submit" class="bg-green-500 hover:bg-green-600 text-white px-4 py-2 rounded">
|
||||
Passwort ändern
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
{% endblock content %}
|
||||
Reference in New Issue
Block a user