"Refactor template files for better code organization (feat)"
This commit is contained in:
@@ -319,7 +319,7 @@
|
||||
</button>
|
||||
|
||||
<!-- User Menu Dropdown -->
|
||||
<div id="user-menu-dropdown" class="absolute right-0 mt-2 w-64 bg-white dark:bg-slate-800 rounded-lg shadow-lg border border-slate-200 dark:border-slate-600 z-50 hidden origin-top-right">
|
||||
<div id="user-dropdown" class="absolute right-0 mt-2 w-64 bg-white dark:bg-slate-800 rounded-lg shadow-lg border border-slate-200 dark:border-slate-600 z-50 hidden origin-top-right">
|
||||
<!-- User Info Header -->
|
||||
<div class="px-4 py-3 border-b border-slate-200 dark:border-slate-600">
|
||||
<div class="flex items-center space-x-3">
|
||||
@@ -581,6 +581,62 @@
|
||||
<script src="{{ url_for('static', filename='js/notifications.js') }}"></script>
|
||||
{% endif %}
|
||||
|
||||
<!-- Additional JavaScript Functions -->
|
||||
<script>
|
||||
/**
|
||||
* Logout-Handler für sicheres Abmelden
|
||||
*/
|
||||
function handleLogout() {
|
||||
// Bestätigung abfragen
|
||||
if (confirm('Möchten Sie sich wirklich abmelden?')) {
|
||||
// Loading-Animation anzeigen
|
||||
document.body.style.opacity = '0.7';
|
||||
document.body.style.pointerEvents = 'none';
|
||||
|
||||
// CSRF-Token aus Meta-Tag holen
|
||||
const csrfToken = document.querySelector('meta[name="csrf-token"]');
|
||||
|
||||
// Logout-Formular erstellen und absenden
|
||||
const form = document.createElement('form');
|
||||
form.method = 'POST';
|
||||
form.action = '{{ url_for("logout") }}';
|
||||
form.style.display = 'none';
|
||||
|
||||
// CSRF-Token hinzufügen falls verfügbar
|
||||
if (csrfToken) {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'hidden';
|
||||
input.name = 'csrf_token';
|
||||
input.value = csrfToken.getAttribute('content');
|
||||
form.appendChild(input);
|
||||
}
|
||||
|
||||
// Formular absenden
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialisierung aller UI-Komponenten nach DOM-Load
|
||||
*/
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
// Dark Mode Manager initialisieren
|
||||
if (typeof MYP !== 'undefined' && MYP.UI) {
|
||||
window.darkModeManager = new MYP.UI.DarkModeManager();
|
||||
window.mobileMenuManager = new MYP.UI.MobileMenuManager();
|
||||
window.userDropdownManager = new MYP.UI.UserDropdownManager();
|
||||
}
|
||||
|
||||
// MYP App für Offline-Funktionalität initialisieren
|
||||
if (typeof MYPApp !== 'undefined') {
|
||||
window.mypApp = new MYPApp();
|
||||
}
|
||||
|
||||
console.log('🚀 MYP Platform UI erfolgreich initialisiert');
|
||||
});
|
||||
</script>
|
||||
|
||||
{% block scripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user