📝 🚀 "Refactor backend templates

This commit is contained in:
2025-06-01 01:41:52 +02:00
parent 20e81b11d3
commit dfad0937d1
15 changed files with 2760 additions and 1064 deletions

View File

@@ -149,8 +149,8 @@
{% endblock %}
{% block extra_js %}
<!-- Chart.js CDN -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/4.4.0/chart.min.js"></script>
<!-- Chart.js - Lokale Version -->
<script src="{{ url_for('static', filename='js/charts/chart.min.js') }}"></script>
<!-- Global Refresh Functions -->
<script src="{{ url_for('static', filename='js/global-refresh-functions.js') }}"></script>
@@ -196,7 +196,9 @@ async function loadBasicStats() {
} catch (error) {
console.error('Fehler beim Laden der Basis-Statistiken:', error);
showToast('Fehler beim Laden der Statistiken', 'error');
if (typeof showFlashMessage === 'function') {
showFlashMessage('Fehler beim Laden der Statistiken', 'error');
}
}
}
@@ -251,7 +253,9 @@ function animateCounter(element, start, end, finalText) {
// Statistiken neu laden
function refreshStats() {
// Feedback für den Benutzer
showToast('Statistiken werden aktualisiert...', 'info');
if (typeof showFlashMessage === 'function') {
showFlashMessage('Statistiken werden aktualisiert...', 'info');
}
// Basis-Statistiken laden
loadBasicStats();
@@ -263,7 +267,9 @@ function refreshStats() {
// Erfolgsmeldung
setTimeout(() => {
showToast('Statistiken erfolgreich aktualisiert', 'success');
if (typeof showFlashMessage === 'function') {
showFlashMessage('Statistiken erfolgreich aktualisiert', 'success');
}
}, 1000);
}
@@ -272,19 +278,5 @@ function exportStats() {
// Direkter Download vom API-Endpunkt
window.location.href = '/api/stats/export';
}
// Helper-Funktion für Toast-Benachrichtigungen
function showToast(message, type) {
if (window.showToast) {
window.showToast(message, type);
} else {
// Fallback für einfache Alert
if (type === 'error') {
alert('Fehler: ' + message);
} else {
console.log(type + ': ' + message);
}
}
}
</script>
{% endblock %}