Merge APP_V2/main: Combine quality updates with league features

- Merged remote changes: Liga krog3 and league state management
- Resolved merge conflicts in locale files and templates
- Kept local v1.0.1 version and styling improvements
- Added league combine functionality from remote
- Preserved new league_state.json and tournament_results.json
- Integrated i18n improvements

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-08 19:35:27 +01:00
17 changed files with 2913 additions and 49 deletions
+28
View File
@@ -851,6 +851,7 @@
</div>
<div class="navbar-controls">
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
<button class="nav-btn" onclick="exportLeagueJSON()">💾 <span data-i18n="general.export">Export JSON</span></button>
<button class="nav-btn" onclick="window.print()">🖨️ <span data-i18n="general.print">Print</span></button>
</div>
</div>
@@ -1154,6 +1155,8 @@
tournamentCells += '<td><span class="tournament-score joker">🃏</span></td>';
} else {
const score = result.score;
const tensCount = result.tens_count || 0;
// Check if this specific tournament index should be excluded
const isExcluded = best4Logic.excludedIndices.includes(participatedTournamentIndex) && best4Logic.allScores.length > 4;
const scoreClass = isExcluded ? 'excluded' : 'counted';
@@ -1254,6 +1257,31 @@
// Initialize when page loads
document.addEventListener('DOMContentLoaded', initializePage);
// Export league data as JSON
function exportLeagueJSON() {
const leagueData = {{ league | tojson | safe }};
// Wrap in archive format for compatibility
const archiveData = {
league: leagueData,
archived_at: new Date().toISOString()
};
const dataStr = JSON.stringify(archiveData, null, 2);
const dataBlob = new Blob([dataStr], { type: 'application/json' });
const url = URL.createObjectURL(dataBlob);
const link = document.createElement('a');
link.href = url;
// Generate filename with league info
const leagueId = leagueData.league_id || 'league';
const date = new Date().toISOString().slice(0, 10);
link.download = `${leagueId}_${date}.json`;
link.click();
URL.revokeObjectURL(url);
}
// Keyboard shortcuts
document.addEventListener('keydown', function(event) {
if (event.key === 'r' || event.key === 'R') {