diff --git a/MIGRATION_README.md b/MIGRATION_README.md new file mode 100644 index 0000000..e69de29 diff --git a/SECURITY_NOTES.md b/SECURITY_NOTES.md new file mode 100644 index 0000000..e69de29 diff --git a/app/statistic/templates/statistic/overview.html b/app/statistic/templates/statistic/overview.html index 59429aa..21aa080 100644 --- a/app/statistic/templates/statistic/overview.html +++ b/app/statistic/templates/statistic/overview.html @@ -24,12 +24,7 @@ } .chart-container { - position: static; - min-height: 400px; - width: 100%; - margin: 20px 0; - overflow: visible; - clear: both; + display: none; /* Entfernt, da keine Charts mehr verwendet werden */ } .section-header { @@ -434,7 +429,7 @@ {% endif %} - +
-
-
- -
- - Wird geladen... -
-
-
- {% if circumstances_this_year %}
{% for item in circumstances_this_year %} @@ -469,6 +454,10 @@
{% endfor %}
+ {% else %} +
+

Keine Daten für {{ current_year }} verfügbar

+
{% endif %} @@ -480,16 +469,6 @@
Alle Jahre
-
-
- -
- - Wird geladen... -
-
-
- {% if circumstances_all_time %}
{% for item in circumstances_all_time %} @@ -500,6 +479,10 @@
{% endfor %}
+ {% else %} +
+

Keine Daten verfügbar

+
{% endif %} @@ -533,129 +516,6 @@ document.addEventListener('DOMContentLoaded', function() { } } }); - - // Initialize collapsed state - const circumstancesSection = document.getElementById('circumstancesSection'); - const circumstancesHeader = document.querySelector('[data-bs-target="#circumstancesSection"]'); - if (circumstancesSection && circumstancesHeader) { - circumstancesHeader.classList.add('collapsed'); - } - - // SVG Pie Chart Creator - function createPieChart(elementId, data) { - const element = document.getElementById(elementId); - if (!element) { - console.error('Pie chart element not found:', elementId); - return; - } - - if (!data || data.length === 0) { - element.innerHTML = '
Keine Daten
'; - return; - } - - console.log('Creating SVG pie chart for:', elementId, data); - - const validData = data.filter(item => item.percentage > 0).sort((a, b) => b.percentage - a.percentage); - - if (validData.length === 0) { - element.innerHTML = '
Keine Daten
'; - return; - } - - const size = 200; - const radius = 80; - const centerX = size / 2; - const centerY = size / 2; - - let svg = ``; - - let currentAngle = 0; - - validData.forEach((item, index) => { - const angle = (item.percentage / 100) * 360; - const startAngle = currentAngle; - const endAngle = currentAngle + angle; - - const startRad = (startAngle * Math.PI) / 180; - const endRad = (endAngle * Math.PI) / 180; - - const x1 = centerX + radius * Math.cos(startRad); - const y1 = centerY + radius * Math.sin(startRad); - const x2 = centerX + radius * Math.cos(endRad); - const y2 = centerY + radius * Math.sin(endRad); - - const largeArcFlag = angle > 180 ? 1 : 0; - - const pathData = [ - `M ${centerX} ${centerY}`, - `L ${x1} ${y1}`, - `A ${radius} ${radius} 0 ${largeArcFlag} 1 ${x2} ${y2}`, - 'Z' - ].join(' '); - - svg += ``; - svg += `${item.name}: ${item.percentage}%`; - svg += ``; - - currentAngle = endAngle; - }); - - svg += ''; - - element.style.position = 'relative'; - element.innerHTML = svg; - } - - // Lazy loading function - function initializePieCharts() { - console.log('Initializing pie charts...'); - - // Generate pie chart data for this year - {% if circumstances_this_year %} - const thisYearData = [ - {% for item in circumstances_this_year %} - { - name: '{{ item.name|escapejs }}', - percentage: {{ item.percentage }}, - color: '{{ item.color }}' - }{% if not forloop.last %},{% endif %} - {% endfor %} - ]; - console.log('This year data:', thisYearData); - createPieChart('pieChartThisYear', thisYearData); - {% endif %} - - // Generate pie chart data for all time - {% if circumstances_all_time %} - const allTimeData = [ - {% for item in circumstances_all_time %} - { - name: '{{ item.name|escapejs }}', - percentage: {{ item.percentage }}, - color: '{{ item.color }}' - }{% if not forloop.last %},{% endif %} - {% endfor %} - ]; - console.log('All time data:', allTimeData); - createPieChart('pieChartAllTime', allTimeData); - {% endif %} - } - - // LAZY LOADING: Initialize pie charts only when circumstances section is expanded - if (circumstancesSection) { - let chartsInitialized = false; - - circumstancesSection.addEventListener('shown.bs.collapse', function() { - console.log('Circumstances section expanded - lazy loading charts'); - if (!chartsInitialized) { - setTimeout(initializePieCharts, 100); - chartsInitialized = true; - } - }); - } else { - console.error('Circumstances section not found'); - } }); {% endblock %} diff --git a/migrate_live_data.sh b/migrate_live_data.sh new file mode 100644 index 0000000..e69de29