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:
+1
-1
@@ -10,4 +10,4 @@ class Config:
|
|||||||
SECRET_KEY = os.getenv('SECRET_KEY', 'your-secret-key-for-sessions')
|
SECRET_KEY = os.getenv('SECRET_KEY', 'your-secret-key-for-sessions')
|
||||||
DEBUG = os.getenv('DEBUG', 'False').lower() == 'true'
|
DEBUG = os.getenv('DEBUG', 'False').lower() == 'true'
|
||||||
HOST = os.getenv('HOST', '0.0.0.0')
|
HOST = os.getenv('HOST', '0.0.0.0')
|
||||||
PORT = int(os.getenv('PORT', 5000))
|
PORT = int(os.getenv('PORT', 5001))
|
||||||
|
|||||||
+2
-1
@@ -131,7 +131,8 @@ class Tournament:
|
|||||||
'name': player['name'],
|
'name': player['name'],
|
||||||
'targets': targets,
|
'targets': targets,
|
||||||
'total_score': 0,
|
'total_score': 0,
|
||||||
'completed': False
|
'completed': False,
|
||||||
|
'joker_selected': False # Track if joker was selected in calculator
|
||||||
}
|
}
|
||||||
|
|
||||||
return results
|
return results
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
},
|
},
|
||||||
"display_options": {
|
"display_options": {
|
||||||
"show_titles": true,
|
"show_titles": true,
|
||||||
"title_size": 1.2,
|
"title_size": 1.4,
|
||||||
"target_number_size": 1.4
|
"target_number_size": 1.7
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,134 @@
|
|||||||
|
{
|
||||||
|
"league": {
|
||||||
|
"league_id": "league_20251115_093831",
|
||||||
|
"created_at": "2025-11-15T09:38:31.193555",
|
||||||
|
"tournament_type": "20_targets",
|
||||||
|
"total_tournaments": 5,
|
||||||
|
"current_tournament": 0,
|
||||||
|
"participants": {
|
||||||
|
"1": {
|
||||||
|
"name": "Domen Pleterski",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"name": "Jože Verhnjak",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"name": "Branko Pokeržnik",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"name": "Janez Božič",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"name": "Mitja Čeh",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"name": "Rado Kefer",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"14": {
|
||||||
|
"name": "Karli Proje",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"15": {
|
||||||
|
"name": "Jan Pleterski",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"16": {
|
||||||
|
"name": "Silvo Poročnik",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"17": {
|
||||||
|
"name": "Dušan Onuk",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"18": {
|
||||||
|
"name": "Matjaž Pleterski",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"22": {
|
||||||
|
"name": "Doris Fesel",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"24": {
|
||||||
|
"name": "Jože Verdinek",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"50": {
|
||||||
|
"name": "Vid Ravnjak",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"51": {
|
||||||
|
"name": "Robi Ovčar",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"completed_tournaments": [],
|
||||||
|
"league_finished": false
|
||||||
|
},
|
||||||
|
"archived_at": "2025-11-15T09:39:06.974580"
|
||||||
|
}
|
||||||
@@ -0,0 +1,457 @@
|
|||||||
|
{
|
||||||
|
"league_id": "league_20251115_094741",
|
||||||
|
"created_at": "2025-11-15T09:47:41.711914",
|
||||||
|
"tournament_type": "20_targets",
|
||||||
|
"total_tournaments": 5,
|
||||||
|
"current_tournament": 3,
|
||||||
|
"participants": {
|
||||||
|
"1": {
|
||||||
|
"name": "Domen Pleterski",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 320,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 320,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 640,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"5": {
|
||||||
|
"name": "Jože Verhnjak",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 295,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 293,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 293,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 881,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"7": {
|
||||||
|
"name": "Branko Pokeržnik",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 316,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 332,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 318,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 966,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"9": {
|
||||||
|
"name": "Janez Božič",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 264,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 276,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 261,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 801,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"10": {
|
||||||
|
"name": "Mitja Čeh",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 329,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 312,
|
||||||
|
"tens_count": 4,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 307,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 948,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"11": {
|
||||||
|
"name": "Rado Kefer",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 275,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 314,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 589,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"14": {
|
||||||
|
"name": "Karli Proje",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"15": {
|
||||||
|
"name": "Jan Pleterski",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 269,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 267,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 536,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"16": {
|
||||||
|
"name": "Silvo Poročnik",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 293,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 278,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 282,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 853,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"17": {
|
||||||
|
"name": "Dušan Onuk",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 313,
|
||||||
|
"tens_count": 4,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 325,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 192,
|
||||||
|
"tens_count": 3,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 830,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"18": {
|
||||||
|
"name": "Matjaž Pleterski",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 280,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 276,
|
||||||
|
"tens_count": 4,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 307,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 863,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"22": {
|
||||||
|
"name": "Doris Fesel",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 0,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"24": {
|
||||||
|
"name": "Jože Verdinek",
|
||||||
|
"joker_used": false,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 311,
|
||||||
|
"tens_count": 5,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 315,
|
||||||
|
"tens_count": 5,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 312,
|
||||||
|
"tens_count": 2,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 938,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"50": {
|
||||||
|
"name": "Vid Ravnjak",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 302,
|
||||||
|
"tens_count": 6,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 309,
|
||||||
|
"tens_count": 4,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 611,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
},
|
||||||
|
"51": {
|
||||||
|
"name": "Robi Ovčar",
|
||||||
|
"joker_used": true,
|
||||||
|
"tournament_results": [
|
||||||
|
{
|
||||||
|
"tournament": 1,
|
||||||
|
"score": 269,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 2,
|
||||||
|
"score": 0,
|
||||||
|
"tens_count": 0,
|
||||||
|
"participated": false,
|
||||||
|
"joker": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament": 3,
|
||||||
|
"score": 265,
|
||||||
|
"tens_count": 1,
|
||||||
|
"participated": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"total_score": 534,
|
||||||
|
"final_score": 0,
|
||||||
|
"tournaments_participated": 0
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"completed_tournaments": [
|
||||||
|
{
|
||||||
|
"tournament_number": 1,
|
||||||
|
"tournament_type": "20_targets",
|
||||||
|
"finished_at": "2025-11-15T11:50:43.358782",
|
||||||
|
"results_summary": {
|
||||||
|
"participants": 15,
|
||||||
|
"shots_per_participant": 40,
|
||||||
|
"total_shots": 600,
|
||||||
|
"format_description": "20 Targets (2 shots each)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament_number": 2,
|
||||||
|
"tournament_type": "20_targets",
|
||||||
|
"finished_at": "2025-12-13T12:13:29.550924",
|
||||||
|
"results_summary": {
|
||||||
|
"participants": 12,
|
||||||
|
"shots_per_participant": 40,
|
||||||
|
"total_shots": 480,
|
||||||
|
"format_description": "20 Targets (2 shots each)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tournament_number": 3,
|
||||||
|
"tournament_type": "20_targets",
|
||||||
|
"finished_at": "2026-01-10T11:34:15.800129",
|
||||||
|
"results_summary": {
|
||||||
|
"participants": 14,
|
||||||
|
"shots_per_participant": 40,
|
||||||
|
"total_shots": 560,
|
||||||
|
"format_description": "20 Targets (2 shots each)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"league_finished": false
|
||||||
|
}
|
||||||
+45
-35
@@ -8,17 +8,17 @@
|
|||||||
{
|
{
|
||||||
"id": 2,
|
"id": 2,
|
||||||
"name": "Nik Pleterski",
|
"name": "Nik Pleterski",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 3,
|
"id": 3,
|
||||||
"name": "Ivan Tandler",
|
"name": "Ivan Tandler",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 4,
|
"id": 4,
|
||||||
"name": "Mateja Pleterski",
|
"name": "Mateja Pleterski",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 5,
|
"id": 5,
|
||||||
@@ -28,7 +28,7 @@
|
|||||||
{
|
{
|
||||||
"id": 6,
|
"id": 6,
|
||||||
"name": "Mateja Senica",
|
"name": "Mateja Senica",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 7,
|
"id": 7,
|
||||||
@@ -38,7 +38,7 @@
|
|||||||
{
|
{
|
||||||
"id": 8,
|
"id": 8,
|
||||||
"name": "Franc Žigart",
|
"name": "Franc Žigart",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 9,
|
"id": 9,
|
||||||
@@ -58,12 +58,12 @@
|
|||||||
{
|
{
|
||||||
"id": 12,
|
"id": 12,
|
||||||
"name": "Matej Kvasnik",
|
"name": "Matej Kvasnik",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 13,
|
"id": 13,
|
||||||
"name": "Angelca Mrak",
|
"name": "Angelca Mrak",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 14,
|
"id": 14,
|
||||||
@@ -93,17 +93,17 @@
|
|||||||
{
|
{
|
||||||
"id": 19,
|
"id": 19,
|
||||||
"name": "Franc Rizmal",
|
"name": "Franc Rizmal",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 20,
|
"id": 20,
|
||||||
"name": "Jože Preglav",
|
"name": "Jože Preglav",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 21,
|
"id": 21,
|
||||||
"name": "Marko Blimen",
|
"name": "Marko Blimen",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 22,
|
"id": 22,
|
||||||
@@ -113,7 +113,7 @@
|
|||||||
{
|
{
|
||||||
"id": 23,
|
"id": 23,
|
||||||
"name": "Robi Krautberger",
|
"name": "Robi Krautberger",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 24,
|
"id": 24,
|
||||||
@@ -123,126 +123,136 @@
|
|||||||
{
|
{
|
||||||
"id": 25,
|
"id": 25,
|
||||||
"name": "Andrej Herman",
|
"name": "Andrej Herman",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 26,
|
"id": 26,
|
||||||
"name": "Jakob Herman",
|
"name": "Jakob Herman",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 27,
|
"id": 27,
|
||||||
"name": "Janez Mrak",
|
"name": "Janez Mrak",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 28,
|
"id": 28,
|
||||||
"name": "Anže Kolar",
|
"name": "Anže Kolar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 29,
|
"id": 29,
|
||||||
"name": "Alen Kolar",
|
"name": "Alen Kolar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 30,
|
"id": 30,
|
||||||
"name": "Maja Hirtl",
|
"name": "Maja Hirtl",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 31,
|
"id": 31,
|
||||||
"name": "Dejan Kučnik",
|
"name": "Dejan Kučnik",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 32,
|
"id": 32,
|
||||||
"name": "David Strniša",
|
"name": "David Strniša",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 33,
|
"id": 33,
|
||||||
"name": "Namir Uzunović",
|
"name": "Namir Uzunović",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 34,
|
"id": 34,
|
||||||
"name": "Jože Planinšec",
|
"name": "Jože Planinšec",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 35,
|
"id": 35,
|
||||||
"name": "Vanja Kolar",
|
"name": "Vanja Kolar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 36,
|
"id": 36,
|
||||||
"name": "Klara Wankmuller",
|
"name": "Klara Wankmuller",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 37,
|
"id": 37,
|
||||||
"name": "Milan Stramec",
|
"name": "Milan Stramec",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 38,
|
"id": 38,
|
||||||
"name": "Bojan Sudar",
|
"name": "Bojan Sudar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 39,
|
"id": 39,
|
||||||
"name": "Tia Sudar",
|
"name": "Tia Sudar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 40,
|
"id": 40,
|
||||||
"name": "Jaka Cvar",
|
"name": "Jaka Cvar",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 41,
|
"id": 41,
|
||||||
"name": "Tadej Štruc",
|
"name": "Tadej Štruc",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 42,
|
"id": 42,
|
||||||
"name": "Jure Glaser",
|
"name": "Jure Glaser",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 43,
|
"id": 43,
|
||||||
"name": "Marko Pokržnik",
|
"name": "Marko Pokržnik",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 44,
|
"id": 44,
|
||||||
"name": "Anka Kačnik",
|
"name": "Anka Kačnik",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 45,
|
"id": 45,
|
||||||
"name": "Lidija Blimen",
|
"name": "Lidija Blimen",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 46,
|
"id": 46,
|
||||||
"name": "Tijana Štumpfl",
|
"name": "Tijana Štumpfl",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 47,
|
"id": 47,
|
||||||
"name": "Ljuba Mršak",
|
"name": "Ljuba Mršak",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 48,
|
"id": 48,
|
||||||
"name": "Janja Salcman",
|
"name": "Janja Salcman",
|
||||||
"enabled": true
|
"enabled": false
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": 49,
|
"id": 49,
|
||||||
"name": "Jolanda Verhnjak",
|
"name": "Jolanda Verhnjak",
|
||||||
|
"enabled": false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 50,
|
||||||
|
"name": "Vid Ravnjak",
|
||||||
|
"enabled": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": 51,
|
||||||
|
"name": "Robi Ovčar",
|
||||||
"enabled": true
|
"enabled": true
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
+32
-2
@@ -23,6 +23,7 @@
|
|||||||
"enable_selected": "Enable Selected",
|
"enable_selected": "Enable Selected",
|
||||||
"disable_selected": "Disable Selected",
|
"disable_selected": "Disable Selected",
|
||||||
"print": "Print",
|
"print": "Print",
|
||||||
|
"export": "Export JSON",
|
||||||
"visible": "Visible",
|
"visible": "Visible",
|
||||||
"date": "Date",
|
"date": "Date",
|
||||||
"view": "View",
|
"view": "View",
|
||||||
@@ -96,7 +97,8 @@
|
|||||||
"created": "Created",
|
"created": "Created",
|
||||||
"tournaments": "Tournaments",
|
"tournaments": "Tournaments",
|
||||||
"league_tournament": "League Tournament",
|
"league_tournament": "League Tournament",
|
||||||
"finished": "Finished"
|
"finished": "Finished",
|
||||||
|
"view_current_results": "View Current Standings"
|
||||||
},
|
},
|
||||||
"tournament_types": {
|
"tournament_types": {
|
||||||
"4_targets": "4 Targets",
|
"4_targets": "4 Targets",
|
||||||
@@ -142,6 +144,33 @@
|
|||||||
"highest_score": "Highest Score",
|
"highest_score": "Highest Score",
|
||||||
"average_final": "Average Final",
|
"average_final": "Average Final",
|
||||||
"5_tournament_league": "5 Tournament League - Best 4 Count",
|
"5_tournament_league": "5 Tournament League - Best 4 Count",
|
||||||
|
"combine_leagues": "Combine Leagues",
|
||||||
|
"combine_mode": "Combine Leagues",
|
||||||
|
"convert_mode": "Convert Tournaments to League",
|
||||||
|
"upload_league_files": "Upload League JSON Files",
|
||||||
|
"upload_tournament_files": "Upload Tournament JSON Files",
|
||||||
|
"combine_leagues_desc": "Upload multiple league JSON files to combine them into a single results table.",
|
||||||
|
"convert_tournaments_desc": "Upload 1-5 tournament JSON files to create a league. You can upload partial leagues as tournaments complete. Final scoring uses best 4 results when all 5 are uploaded.",
|
||||||
|
"click_browse": "Click to browse",
|
||||||
|
"drag_drop_files": "or drag and drop league JSON files here",
|
||||||
|
"supports_multiple": "Supports multiple file selection",
|
||||||
|
"clear_all": "Clear All",
|
||||||
|
"combine_preview": "Combine & Preview",
|
||||||
|
"convert_to_league": "Convert to League",
|
||||||
|
"valid_league": "Valid League",
|
||||||
|
"valid_tournament": "Valid Tournament",
|
||||||
|
"participants": "participants",
|
||||||
|
"tournaments": "tournaments",
|
||||||
|
"invalid_format": "Invalid file format",
|
||||||
|
"select_mode": "Select Mode",
|
||||||
|
"start_over": "Start Over",
|
||||||
|
"export_combined_results": "Export Combined Results",
|
||||||
|
"combined_league_info": "Combined League Information",
|
||||||
|
"uploaded_files": "Uploaded Files",
|
||||||
|
"remove": "Remove",
|
||||||
|
"type": "Type",
|
||||||
|
"failed_parse_json": "Failed to parse JSON",
|
||||||
|
"invalid_tournament_format": "Invalid tournament file format",
|
||||||
"joker_used_badge": "Joker Used",
|
"joker_used_badge": "Joker Used",
|
||||||
"search_players_placeholder": "Search players by name...",
|
"search_players_placeholder": "Search players by name...",
|
||||||
"no_players_found": "No players found matching your search criteria.",
|
"no_players_found": "No players found matching your search criteria.",
|
||||||
@@ -169,7 +198,8 @@
|
|||||||
"camera": "Camera",
|
"camera": "Camera",
|
||||||
"tournaments": "Tournaments",
|
"tournaments": "Tournaments",
|
||||||
"results.most_tens": "Most 10s",
|
"results.most_tens": "Most 10s",
|
||||||
"progress": "Progress"
|
"progress": "Progress",
|
||||||
|
"combine_leagues": "Combine Leagues"
|
||||||
},
|
},
|
||||||
"results": {
|
"results": {
|
||||||
"results": "Results",
|
"results": "Results",
|
||||||
|
|||||||
+22
-2
@@ -23,6 +23,7 @@
|
|||||||
"enable_selected": "Omogoči Izbrane",
|
"enable_selected": "Omogoči Izbrane",
|
||||||
"disable_selected": "Onemogoči Izbrane",
|
"disable_selected": "Onemogoči Izbrane",
|
||||||
"print": "Natisni",
|
"print": "Natisni",
|
||||||
|
"export": "Izvozi JSON",
|
||||||
"visible": "Vidni",
|
"visible": "Vidni",
|
||||||
"date": "Datum",
|
"date": "Datum",
|
||||||
"view": "Oglej",
|
"view": "Oglej",
|
||||||
@@ -97,7 +98,8 @@
|
|||||||
"league_completed": "Liga Zaključena",
|
"league_completed": "Liga Zaključena",
|
||||||
"section_title": "Sekcija",
|
"section_title": "Sekcija",
|
||||||
"finished": "Zaključeno",
|
"finished": "Zaključeno",
|
||||||
"targets": "Število Tarč"
|
"targets": "Število Tarč",
|
||||||
|
"view_current_results": "Oglej Trenutne Rezultate"
|
||||||
},
|
},
|
||||||
"tournament_types": {
|
"tournament_types": {
|
||||||
"4_targets": "4 Tarče",
|
"4_targets": "4 Tarče",
|
||||||
@@ -174,7 +176,25 @@
|
|||||||
"camera": "Kamera",
|
"camera": "Kamera",
|
||||||
"tournaments": "Turnirji",
|
"tournaments": "Turnirji",
|
||||||
"results.most_tens": "Največ Desetk",
|
"results.most_tens": "Največ Desetk",
|
||||||
"progress": "Stanje"
|
"progress": "Stanje",
|
||||||
|
"combine_leagues": "Združi Lige",
|
||||||
|
"combine_mode": "Združi Lige",
|
||||||
|
"convert_mode": "Pretvori Turnirje v Ligo",
|
||||||
|
"upload_league_files": "Naloži Datoteke Lig",
|
||||||
|
"upload_tournament_files": "Naloži Datoteke Turnirjev",
|
||||||
|
"combine_leagues_desc": "Naloži več datotek lig JSON, da jih združiš v eno tabelo rezultatov.",
|
||||||
|
"convert_tournaments_desc": "Naloži 1-5 datotek turnirjev JSON za ustvarjanje lige. Lahko naložiš delne lige ko turnirji napredujejo. Končno točkovanje uporablja najboljše 4 rezultate, ko so vseh 5 naloženih.",
|
||||||
|
"click_browse": "Klikni za brskanje",
|
||||||
|
"drag_drop_files": "ali povleci in spusti datoteke JSON lig tukaj",
|
||||||
|
"supports_multiple": "Podpira izbiro več datotek",
|
||||||
|
"combine_preview": "Združi in Predoglej",
|
||||||
|
"convert_to_league": "Pretvori v Ligo",
|
||||||
|
"valid_league": "Veljavna Liga",
|
||||||
|
"valid_tournament": "Veljaven Turnir",
|
||||||
|
"participants": "udeleženci",
|
||||||
|
"invalid_format": "Neveljavna oblika datoteke",
|
||||||
|
"select_mode": "Izberi Način",
|
||||||
|
"start_over": "Začni Znova"
|
||||||
},
|
},
|
||||||
"results": {
|
"results": {
|
||||||
"results": "Rezultati",
|
"results": "Rezultati",
|
||||||
|
|||||||
+8
-1
@@ -274,4 +274,11 @@ document.addEventListener('DOMContentLoaded', initI18n);
|
|||||||
// Export functions for global use
|
// Export functions for global use
|
||||||
window.t = t;
|
window.t = t;
|
||||||
window.changeLanguage = changeLanguage;
|
window.changeLanguage = changeLanguage;
|
||||||
window.createLanguageSelector = createLanguageSelector;
|
window.createLanguageSelector = createLanguageSelector;
|
||||||
|
|
||||||
|
// Export i18n object with useful functions
|
||||||
|
window.i18n = {
|
||||||
|
t: t,
|
||||||
|
updatePageTranslations: translatePage,
|
||||||
|
changeLanguage: changeLanguage
|
||||||
|
};
|
||||||
@@ -693,6 +693,7 @@
|
|||||||
<div class="settings-group">
|
<div class="settings-group">
|
||||||
<h4 data-i18n="league.tournaments">Turnirji</h4>
|
<h4 data-i18n="league.tournaments">Turnirji</h4>
|
||||||
<a href="/tournament" class="nav-link" id="tournamentModeLink">🏆 <span data-i18n="tournament.tournament_mode">Način Turnirja</span></a>
|
<a href="/tournament" class="nav-link" id="tournamentModeLink">🏆 <span data-i18n="tournament.tournament_mode">Način Turnirja</span></a>
|
||||||
|
<a href="/league/combine" class="nav-link">🔗 <span data-i18n="league.combine_leagues">Combine Leagues</span></a>
|
||||||
<a href="/archive/player-analysis" class="nav-link">👤 <span data-i18n="players.player_analysis">Analiza Igralcev</span></a>
|
<a href="/archive/player-analysis" class="nav-link">👤 <span data-i18n="players.player_analysis">Analiza Igralcev</span></a>
|
||||||
<a href="/archive" class="nav-link">📚 <span data-i18n="navigation.archive">Arhiv</span></a>
|
<a href="/archive" class="nav-link">📚 <span data-i18n="navigation.archive">Arhiv</span></a>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,771 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="sl">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title data-i18n="league.combine_leagues">Combine Leagues</title>
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/base.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/navbar.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/buttons.css') }}">
|
||||||
|
<link rel="stylesheet" href="{{ url_for('static', filename='css/components.css') }}">
|
||||||
|
<style>
|
||||||
|
* {
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
|
||||||
|
html, body {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background: #f5f5f5;
|
||||||
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
|
||||||
|
min-height: 100vh;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.container {
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
padding: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar {
|
||||||
|
background: white;
|
||||||
|
border-bottom: 1px solid #e1e5e9;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
padding: 15px 25px;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.navbar-title {
|
||||||
|
font-size: 1.8rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
margin: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn {
|
||||||
|
background: #f8f9fa;
|
||||||
|
border: 2px solid #e9ecef;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 12px 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
color: #333;
|
||||||
|
text-decoration: none;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.nav-btn:hover {
|
||||||
|
background: #e9ecef;
|
||||||
|
border-color: #28a745;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
color: #28a745;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-section {
|
||||||
|
background: white;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 10px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-area {
|
||||||
|
border: 3px dashed #28a745;
|
||||||
|
border-radius: 10px;
|
||||||
|
padding: 40px;
|
||||||
|
text-align: center;
|
||||||
|
background: #f8f9fa;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-area:hover {
|
||||||
|
background: #e9f7ed;
|
||||||
|
border-color: #1e7e34;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-area.drag-over {
|
||||||
|
background: #d4edda;
|
||||||
|
border-color: #28a745;
|
||||||
|
box-shadow: 0 4px 12px rgba(40, 167, 69, 0.2);
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-input {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.upload-icon {
|
||||||
|
font-size: 48px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.uploaded-files {
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item {
|
||||||
|
background: #f8f9fa;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
border-left: 4px solid #28a745;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-item.error {
|
||||||
|
border-left-color: #dc3545;
|
||||||
|
background: #f8d7da;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-name {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #2c3e50;
|
||||||
|
}
|
||||||
|
|
||||||
|
.file-details {
|
||||||
|
font-size: 0.9em;
|
||||||
|
color: #6c757d;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-btn {
|
||||||
|
background: #dc3545;
|
||||||
|
color: white;
|
||||||
|
border: none;
|
||||||
|
padding: 8px 15px;
|
||||||
|
border-radius: 5px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.3s;
|
||||||
|
}
|
||||||
|
|
||||||
|
.remove-btn:hover {
|
||||||
|
background: #c82333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-buttons {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
margin-top: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn {
|
||||||
|
padding: 12px 24px;
|
||||||
|
border: 2px solid;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-size: 16px;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
flex: 1;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
background: #28a745;
|
||||||
|
color: white;
|
||||||
|
border-color: #1e7e34;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background: #1e7e34;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:disabled {
|
||||||
|
background: #6c757d;
|
||||||
|
border-color: #5a6268;
|
||||||
|
cursor: not-allowed;
|
||||||
|
opacity: 0.6;
|
||||||
|
transform: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
background: #f8f9fa;
|
||||||
|
color: #333;
|
||||||
|
border-color: #e9ecef;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary:hover {
|
||||||
|
background: #e9ecef;
|
||||||
|
border-color: #dc3545;
|
||||||
|
color: #dc3545;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||||
|
transform: translateY(-1px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-section {
|
||||||
|
background: white;
|
||||||
|
padding: 30px;
|
||||||
|
border-radius: 10px;
|
||||||
|
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.preview-section.active {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box {
|
||||||
|
background: #d4edda;
|
||||||
|
border-left: 4px solid #28a745;
|
||||||
|
padding: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border-radius: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.info-box h3 {
|
||||||
|
margin: 0 0 10px 0;
|
||||||
|
color: #155724;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stats-grid {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
|
||||||
|
gap: 15px;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-card {
|
||||||
|
background: #f8f9fa;
|
||||||
|
padding: 15px;
|
||||||
|
border-radius: 8px;
|
||||||
|
text-align: center;
|
||||||
|
border-left: 4px solid #28a745;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-value {
|
||||||
|
font-size: 32px;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #28a745;
|
||||||
|
}
|
||||||
|
|
||||||
|
.stat-label {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #6c757d;
|
||||||
|
margin-top: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn {
|
||||||
|
flex: 1;
|
||||||
|
padding: 12px 20px;
|
||||||
|
border: 2px solid #28a745;
|
||||||
|
background: white;
|
||||||
|
color: #28a745;
|
||||||
|
border-radius: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
font-weight: bold;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn:hover {
|
||||||
|
background: #e9f7ed;
|
||||||
|
transform: translateY(-1px);
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mode-btn.active {
|
||||||
|
background: #28a745;
|
||||||
|
color: white;
|
||||||
|
border-color: #1e7e34;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div class="navbar">
|
||||||
|
<h1 class="navbar-title">🔗 <span data-i18n="league.combine_leagues">Combine Leagues</span></h1>
|
||||||
|
<a href="/" class="nav-btn">← <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
|
<div class="upload-section">
|
||||||
|
<div style="margin-bottom: 20px;">
|
||||||
|
<label style="display: block; margin-bottom: 10px; font-weight: bold; color: #2c3e50;">
|
||||||
|
<span data-i18n="league.select_mode">Select Mode</span>:
|
||||||
|
</label>
|
||||||
|
<div style="display: flex; gap: 10px;">
|
||||||
|
<button class="mode-btn active" id="combineMode" onclick="switchMode('combine')">
|
||||||
|
🔗 <span data-i18n="league.combine_mode">Combine Leagues</span>
|
||||||
|
</button>
|
||||||
|
<button class="mode-btn" id="convertMode" onclick="switchMode('convert')">
|
||||||
|
🔄 <span data-i18n="league.convert_mode">Convert Tournaments to League</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="combineSection">
|
||||||
|
<h2>📤 <span data-i18n="league.upload_league_files">Upload League JSON Files</span></h2>
|
||||||
|
<p style="color: #6c757d; margin-bottom: 20px;">
|
||||||
|
<span data-i18n="league.combine_leagues_desc">Upload multiple league JSON files to combine them into a single results table.</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div id="convertSection" style="display: none;">
|
||||||
|
<h2>📤 <span data-i18n="league.upload_tournament_files">Upload Tournament JSON Files</span></h2>
|
||||||
|
<p style="color: #6c757d; margin-bottom: 20px;">
|
||||||
|
<span data-i18n="league.convert_tournaments_desc">Upload 1-5 tournament JSON files to create a league. You can upload partial leagues as tournaments complete. Final scoring uses best 4 results when all 5 are uploaded.</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="upload-area" id="uploadArea">
|
||||||
|
<div class="upload-icon">📁</div>
|
||||||
|
<p><strong data-i18n="league.click_browse">Click to browse</strong> <span data-i18n="league.drag_drop_files">or drag and drop league JSON files here</span></p>
|
||||||
|
<p style="font-size: 0.9em; color: #6c757d;"><span data-i18n="league.supports_multiple">Supports multiple file selection</span></p>
|
||||||
|
<input type="file" id="fileInput" class="file-input" accept=".json" multiple>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="uploaded-files" id="uploadedFiles"></div>
|
||||||
|
|
||||||
|
<div class="action-buttons">
|
||||||
|
<button class="btn btn-secondary" id="clearBtn" disabled>
|
||||||
|
🗑️ <span data-i18n="scoring.clear_all">Clear All</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary" id="processBtn" disabled>
|
||||||
|
<span id="processBtnText">🔗 <span data-i18n="league.combine_preview">Combine & Preview</span></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="preview-section" id="previewSection">
|
||||||
|
<div class="info-box">
|
||||||
|
<h3>ℹ️ <span data-i18n="league.combined_league_info">Combined League Information</span></h3>
|
||||||
|
<div id="combinedInfo"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="stats-grid" id="statsGrid"></div>
|
||||||
|
|
||||||
|
<div id="resultsDisplay"></div>
|
||||||
|
|
||||||
|
<div class="action-buttons" style="margin-top: 20px;">
|
||||||
|
<button class="btn btn-secondary" onclick="window.location.reload()">
|
||||||
|
🔄 <span data-i18n="league.start_over">Start Over</span>
|
||||||
|
</button>
|
||||||
|
<button class="btn btn-primary" id="exportBtn">
|
||||||
|
💾 <span data-i18n="league.export_combined_results">Export Combined Results</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="/static/js/i18n.js"></script>
|
||||||
|
<script>
|
||||||
|
let uploadedLeagues = [];
|
||||||
|
let currentMode = 'combine'; // 'combine' or 'convert'
|
||||||
|
|
||||||
|
const uploadArea = document.getElementById('uploadArea');
|
||||||
|
const fileInput = document.getElementById('fileInput');
|
||||||
|
const uploadedFilesDiv = document.getElementById('uploadedFiles');
|
||||||
|
const clearBtn = document.getElementById('clearBtn');
|
||||||
|
const processBtn = document.getElementById('processBtn');
|
||||||
|
const processBtnText = document.getElementById('processBtnText');
|
||||||
|
const previewSection = document.getElementById('previewSection');
|
||||||
|
|
||||||
|
// Helper function to get translated text
|
||||||
|
function t(key) {
|
||||||
|
if (window.i18n && window.i18n.t) {
|
||||||
|
return window.i18n.t(key);
|
||||||
|
}
|
||||||
|
// Fallback if i18n not loaded yet
|
||||||
|
return key.split('.').pop();
|
||||||
|
}
|
||||||
|
|
||||||
|
function switchMode(mode) {
|
||||||
|
currentMode = mode;
|
||||||
|
|
||||||
|
// Update button states
|
||||||
|
document.getElementById('combineMode').classList.toggle('active', mode === 'combine');
|
||||||
|
document.getElementById('convertMode').classList.toggle('active', mode === 'convert');
|
||||||
|
|
||||||
|
// Update sections
|
||||||
|
document.getElementById('combineSection').style.display = mode === 'combine' ? 'block' : 'none';
|
||||||
|
document.getElementById('convertSection').style.display = mode === 'convert' ? 'block' : 'none';
|
||||||
|
|
||||||
|
// Update button text with translations
|
||||||
|
processBtnText.innerHTML = mode === 'combine'
|
||||||
|
? '🔗 <span data-i18n="league.combine_preview">Combine & Preview</span>'
|
||||||
|
: '🔄 <span data-i18n="league.convert_to_league">Convert to League</span>';
|
||||||
|
// Re-apply translations after DOM change
|
||||||
|
if (window.i18n) window.i18n.updatePageTranslations();
|
||||||
|
|
||||||
|
// Clear uploaded files
|
||||||
|
uploadedLeagues = [];
|
||||||
|
updateFileList();
|
||||||
|
previewSection.classList.remove('active');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Click to upload
|
||||||
|
uploadArea.addEventListener('click', () => fileInput.click());
|
||||||
|
|
||||||
|
// Drag and drop
|
||||||
|
uploadArea.addEventListener('dragover', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
uploadArea.classList.add('drag-over');
|
||||||
|
});
|
||||||
|
|
||||||
|
uploadArea.addEventListener('dragleave', () => {
|
||||||
|
uploadArea.classList.remove('drag-over');
|
||||||
|
});
|
||||||
|
|
||||||
|
uploadArea.addEventListener('drop', (e) => {
|
||||||
|
e.preventDefault();
|
||||||
|
uploadArea.classList.remove('drag-over');
|
||||||
|
handleFiles(e.dataTransfer.files);
|
||||||
|
});
|
||||||
|
|
||||||
|
// File input change
|
||||||
|
fileInput.addEventListener('change', (e) => {
|
||||||
|
handleFiles(e.target.files);
|
||||||
|
});
|
||||||
|
|
||||||
|
function handleFiles(files) {
|
||||||
|
Array.from(files).forEach(file => {
|
||||||
|
if (file.type === 'application/json' || file.name.endsWith('.json')) {
|
||||||
|
const reader = new FileReader();
|
||||||
|
reader.onload = (e) => {
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(e.target.result);
|
||||||
|
|
||||||
|
if (currentMode === 'combine') {
|
||||||
|
// Validate it's a league file (handles both archived and raw formats)
|
||||||
|
let leagueData = null;
|
||||||
|
if (data.league && data.league.participants) {
|
||||||
|
// Archived format (wrapped)
|
||||||
|
leagueData = data.league;
|
||||||
|
} else if (data.participants) {
|
||||||
|
// Raw league format (unwrapped)
|
||||||
|
leagueData = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leagueData) {
|
||||||
|
uploadedLeagues.push({
|
||||||
|
filename: file.name,
|
||||||
|
data: data,
|
||||||
|
leagueData: leagueData, // Store the actual league data
|
||||||
|
valid: true,
|
||||||
|
type: 'league'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uploadedLeagues.push({
|
||||||
|
filename: file.name,
|
||||||
|
error: 'Invalid league file format',
|
||||||
|
valid: false,
|
||||||
|
type: 'league'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Convert mode - validate it's a tournament file
|
||||||
|
if (data.tournament && data.results && data.results.participants) {
|
||||||
|
uploadedLeagues.push({
|
||||||
|
filename: file.name,
|
||||||
|
data: data,
|
||||||
|
valid: true,
|
||||||
|
type: 'tournament'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
uploadedLeagues.push({
|
||||||
|
filename: file.name,
|
||||||
|
error: t('league.invalid_tournament_format'),
|
||||||
|
valid: false,
|
||||||
|
type: 'tournament'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateFileList();
|
||||||
|
} catch (error) {
|
||||||
|
uploadedLeagues.push({
|
||||||
|
filename: file.name,
|
||||||
|
error: t('league.failed_parse_json'),
|
||||||
|
valid: false
|
||||||
|
});
|
||||||
|
updateFileList();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
reader.readAsText(file);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateFileList() {
|
||||||
|
uploadedFilesDiv.innerHTML = '';
|
||||||
|
|
||||||
|
if (uploadedLeagues.length > 0) {
|
||||||
|
const heading = document.createElement('h3');
|
||||||
|
heading.textContent = `📋 ${t('league.uploaded_files')} (${uploadedLeagues.length})`;
|
||||||
|
uploadedFilesDiv.appendChild(heading);
|
||||||
|
|
||||||
|
uploadedLeagues.forEach((league, index) => {
|
||||||
|
const fileItem = document.createElement('div');
|
||||||
|
fileItem.className = 'file-item' + (league.valid ? '' : ' error');
|
||||||
|
|
||||||
|
const fileInfo = document.createElement('div');
|
||||||
|
fileInfo.className = 'file-info';
|
||||||
|
|
||||||
|
const fileName = document.createElement('div');
|
||||||
|
fileName.className = 'file-name';
|
||||||
|
fileName.textContent = league.filename;
|
||||||
|
|
||||||
|
const fileDetails = document.createElement('div');
|
||||||
|
fileDetails.className = 'file-details';
|
||||||
|
|
||||||
|
if (league.valid) {
|
||||||
|
if (league.type === 'league') {
|
||||||
|
const participantCount = Object.keys(league.leagueData.participants).length;
|
||||||
|
const tournamentCount = league.leagueData.total_tournaments || 0;
|
||||||
|
fileDetails.textContent = `✓ ${t('league.valid_league')} | ${participantCount} ${t('league.participants')} | ${tournamentCount} ${t('league.tournaments')}`;
|
||||||
|
} else {
|
||||||
|
const participantCount = Object.keys(league.data.results.participants).length;
|
||||||
|
const tournamentType = league.data.results.tournament_type || '20_targets';
|
||||||
|
fileDetails.textContent = `✓ ${t('league.valid_tournament')} | ${participantCount} ${t('league.participants')} | ${t('league.type')}: ${tournamentType}`;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
fileDetails.textContent = `✗ ${league.error}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
fileInfo.appendChild(fileName);
|
||||||
|
fileInfo.appendChild(fileDetails);
|
||||||
|
|
||||||
|
const removeBtn = document.createElement('button');
|
||||||
|
removeBtn.className = 'remove-btn';
|
||||||
|
removeBtn.textContent = `✗ ${t('league.remove')}`;
|
||||||
|
removeBtn.onclick = () => removeFile(index);
|
||||||
|
|
||||||
|
fileItem.appendChild(fileInfo);
|
||||||
|
fileItem.appendChild(removeBtn);
|
||||||
|
uploadedFilesDiv.appendChild(fileItem);
|
||||||
|
});
|
||||||
|
|
||||||
|
clearBtn.disabled = false;
|
||||||
|
|
||||||
|
const validCount = uploadedLeagues.filter(l => l.valid).length;
|
||||||
|
if (currentMode === 'combine') {
|
||||||
|
processBtn.disabled = validCount < 1; // Allow preview with 1+ files
|
||||||
|
} else {
|
||||||
|
// Convert mode requires 1-5 tournament files
|
||||||
|
processBtn.disabled = validCount < 1 || validCount > 5;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
clearBtn.disabled = true;
|
||||||
|
processBtn.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function removeFile(index) {
|
||||||
|
uploadedLeagues.splice(index, 1);
|
||||||
|
updateFileList();
|
||||||
|
}
|
||||||
|
|
||||||
|
clearBtn.addEventListener('click', () => {
|
||||||
|
uploadedLeagues = [];
|
||||||
|
updateFileList();
|
||||||
|
previewSection.classList.remove('active');
|
||||||
|
});
|
||||||
|
|
||||||
|
processBtn.addEventListener('click', async () => {
|
||||||
|
const validFiles = uploadedLeagues.filter(l => l.valid);
|
||||||
|
|
||||||
|
if (currentMode === 'combine') {
|
||||||
|
if (validFiles.length < 1) {
|
||||||
|
alert('Please upload at least 1 valid league file');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send to backend for combination
|
||||||
|
const response = await fetch('/api/league/combine', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
leagues: validFiles.map(l => l.leagueData)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
// Store in session and redirect to preview
|
||||||
|
const previewResponse = await fetch('/league/set-preview', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
league: result.combined_league
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (previewResponse.ok) {
|
||||||
|
const previewResult = await previewResponse.json();
|
||||||
|
window.location.href = previewResult.redirect_url;
|
||||||
|
} else {
|
||||||
|
alert('Failed to preview league');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert('Failed to combine leagues');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Convert mode
|
||||||
|
if (validFiles.length < 1 || validFiles.length > 5) {
|
||||||
|
alert('Please upload 1-5 valid tournament files');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Send to backend for conversion
|
||||||
|
const response = await fetch('/api/league/convert', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
tournaments: validFiles.map(l => l.data)
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (response.ok) {
|
||||||
|
const result = await response.json();
|
||||||
|
|
||||||
|
// Store in session and redirect to preview
|
||||||
|
const previewResponse = await fetch('/league/set-preview', {
|
||||||
|
method: 'POST',
|
||||||
|
headers: {
|
||||||
|
'Content-Type': 'application/json',
|
||||||
|
},
|
||||||
|
body: JSON.stringify({
|
||||||
|
league: result.combined_league
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
if (previewResponse.ok) {
|
||||||
|
const previewResult = await previewResponse.json();
|
||||||
|
window.location.href = previewResult.redirect_url;
|
||||||
|
} else {
|
||||||
|
alert('Failed to preview league');
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
alert('Failed to convert tournaments to league');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function displayCombinedResults(result) {
|
||||||
|
// Display combined info
|
||||||
|
const sourceType = result.is_partial !== undefined ?
|
||||||
|
(result.is_partial ? 'tournament files (Partial League)' : 'tournament files (Complete League)') :
|
||||||
|
'league files';
|
||||||
|
|
||||||
|
document.getElementById('combinedInfo').innerHTML = `
|
||||||
|
<p><strong>Combined from:</strong> ${result.source_count} ${sourceType}</p>
|
||||||
|
<p><strong>Tournament Type:</strong> ${result.tournament_type}</p>
|
||||||
|
<p><strong>Total Participants:</strong> ${result.total_participants}</p>
|
||||||
|
${result.is_partial ? '<p style="color: #ff9800;"><strong>⚠️ Partial League:</strong> Upload more tournaments to complete the league (5 total needed)</p>' : ''}
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Display stats
|
||||||
|
const statsGrid = document.getElementById('statsGrid');
|
||||||
|
statsGrid.innerHTML = `
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-value">${result.total_participants}</div>
|
||||||
|
<div class="stat-label">Total Players</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-value">${result.total_tournaments}</div>
|
||||||
|
<div class="stat-label">Total Tournaments</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-value">${result.highest_score}</div>
|
||||||
|
<div class="stat-label">Highest Score</div>
|
||||||
|
</div>
|
||||||
|
<div class="stat-card">
|
||||||
|
<div class="stat-value">${result.avg_score}</div>
|
||||||
|
<div class="stat-label">Average Score</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
|
// Store combined data for export
|
||||||
|
window.combinedLeagueData = result.combined_league;
|
||||||
|
|
||||||
|
// Redirect to results display with combined data
|
||||||
|
displayResultsTable(result.participants);
|
||||||
|
}
|
||||||
|
|
||||||
|
function displayResultsTable(participants) {
|
||||||
|
const resultsDisplay = document.getElementById('resultsDisplay');
|
||||||
|
|
||||||
|
let html = `
|
||||||
|
<h2>🏆 Combined Results</h2>
|
||||||
|
<table style="width: 100%; border-collapse: collapse; margin-top: 20px;">
|
||||||
|
<thead>
|
||||||
|
<tr style="background: #667eea; color: white;">
|
||||||
|
<th style="padding: 12px; text-align: left;">Rank</th>
|
||||||
|
<th style="padding: 12px; text-align: left;">Player</th>
|
||||||
|
<th style="padding: 12px; text-align: center;">Final Score</th>
|
||||||
|
<th style="padding: 12px; text-align: center;">Total Score</th>
|
||||||
|
<th style="padding: 12px; text-align: center;">Tournaments</th>
|
||||||
|
<th style="padding: 12px; text-align: center;">10s</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
`;
|
||||||
|
|
||||||
|
participants.forEach((p, i) => {
|
||||||
|
html += `
|
||||||
|
<tr style="border-bottom: 1px solid #dee2e6; ${i % 2 === 0 ? 'background: #f8f9fa;' : ''}">
|
||||||
|
<td style="padding: 12px; font-weight: bold;">${i + 1}</td>
|
||||||
|
<td style="padding: 12px;">${p.name}</td>
|
||||||
|
<td style="padding: 12px; text-align: center; font-weight: bold; color: #667eea;">${p.final_score}</td>
|
||||||
|
<td style="padding: 12px; text-align: center;">${p.total_score}</td>
|
||||||
|
<td style="padding: 12px; text-align: center;">${p.tournaments_participated}</td>
|
||||||
|
<td style="padding: 12px; text-align: center;">${p.total_tens}</td>
|
||||||
|
</tr>
|
||||||
|
`;
|
||||||
|
});
|
||||||
|
|
||||||
|
html += `
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
`;
|
||||||
|
|
||||||
|
resultsDisplay.innerHTML = html;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('exportBtn').addEventListener('click', () => {
|
||||||
|
if (window.combinedLeagueData) {
|
||||||
|
// Wrap in archive format to be compatible with results display
|
||||||
|
const archiveData = {
|
||||||
|
league: window.combinedLeagueData,
|
||||||
|
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;
|
||||||
|
link.download = `combined_league_${new Date().toISOString().slice(0, 10)}.json`;
|
||||||
|
link.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -851,6 +851,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="navbar-controls">
|
<div class="navbar-controls">
|
||||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
<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>
|
<button class="nav-btn" onclick="window.print()">🖨️ <span data-i18n="general.print">Print</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1154,6 +1155,8 @@
|
|||||||
tournamentCells += '<td><span class="tournament-score joker">🃏</span></td>';
|
tournamentCells += '<td><span class="tournament-score joker">🃏</span></td>';
|
||||||
} else {
|
} else {
|
||||||
const score = result.score;
|
const score = result.score;
|
||||||
|
const tensCount = result.tens_count || 0;
|
||||||
|
|
||||||
// Check if this specific tournament index should be excluded
|
// Check if this specific tournament index should be excluded
|
||||||
const isExcluded = best4Logic.excludedIndices.includes(participatedTournamentIndex) && best4Logic.allScores.length > 4;
|
const isExcluded = best4Logic.excludedIndices.includes(participatedTournamentIndex) && best4Logic.allScores.length > 4;
|
||||||
const scoreClass = isExcluded ? 'excluded' : 'counted';
|
const scoreClass = isExcluded ? 'excluded' : 'counted';
|
||||||
@@ -1254,6 +1257,31 @@
|
|||||||
// Initialize when page loads
|
// Initialize when page loads
|
||||||
document.addEventListener('DOMContentLoaded', initializePage);
|
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
|
// Keyboard shortcuts
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
if (event.key === 'r' || event.key === 'R') {
|
if (event.key === 'r' || event.key === 'R') {
|
||||||
|
|||||||
@@ -718,6 +718,44 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.joker-checkbox-wrapper {
|
||||||
|
margin-top: 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joker-label {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 6px 12px;
|
||||||
|
background: #fff3cd;
|
||||||
|
border: 2px solid #ffc107;
|
||||||
|
border-radius: 8px;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joker-label:hover {
|
||||||
|
background: #ffc107;
|
||||||
|
border-color: #ff9800;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joker-checkbox-calc {
|
||||||
|
cursor: pointer;
|
||||||
|
width: 18px;
|
||||||
|
height: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joker-checkbox-calc:disabled {
|
||||||
|
cursor: not-allowed;
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
.joker-text {
|
||||||
|
font-size: 0.9rem;
|
||||||
|
font-weight: 600;
|
||||||
|
color: #856404;
|
||||||
|
}
|
||||||
|
|
||||||
.participant-status {
|
.participant-status {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -1970,6 +2008,49 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Handle joker checkbox change
|
||||||
|
function handleJokerChange(playerId) {
|
||||||
|
const checkbox = document.getElementById(`joker-calc-${playerId}`);
|
||||||
|
const isChecked = checkbox.checked;
|
||||||
|
|
||||||
|
// If checked, warn user that all scores will be set to zero
|
||||||
|
if (isChecked) {
|
||||||
|
if (confirm('Marking this player as using their Joker will set all their scores to zero. Continue?')) {
|
||||||
|
// Set all scores to zero
|
||||||
|
const participant = results.participants[playerId];
|
||||||
|
if (participant && participant.targets) {
|
||||||
|
Object.keys(participant.targets).forEach(targetId => {
|
||||||
|
const target = participant.targets[targetId];
|
||||||
|
Object.keys(target).forEach(shotKey => {
|
||||||
|
if (shotKey.startsWith('shot')) {
|
||||||
|
target[shotKey] = 0;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
}
|
||||||
|
participant.total_score = 0;
|
||||||
|
participant.completed = true; // Mark as completed since joker is used
|
||||||
|
participant.joker_selected = true; // Mark joker as selected in results
|
||||||
|
|
||||||
|
// Update UI
|
||||||
|
updateParticipantTotal(playerId);
|
||||||
|
updateParticipantStatus(playerId);
|
||||||
|
updateParticipantTens(playerId);
|
||||||
|
updateOverallProgress();
|
||||||
|
updateOverallTens();
|
||||||
|
|
||||||
|
// Disable the checkbox so it can't be unchecked
|
||||||
|
checkbox.disabled = true;
|
||||||
|
|
||||||
|
// Save the change
|
||||||
|
savePlayerData(playerId);
|
||||||
|
} else {
|
||||||
|
// User cancelled, uncheck the box
|
||||||
|
checkbox.checked = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Keyboard shortcuts
|
// Keyboard shortcuts
|
||||||
document.addEventListener('keydown', function(event) {
|
document.addEventListener('keydown', function(event) {
|
||||||
if (event.ctrlKey && event.key === 's') {
|
if (event.ctrlKey && event.key === 's') {
|
||||||
@@ -1984,7 +2065,7 @@
|
|||||||
// Initialize targets for all players
|
// Initialize targets for all players
|
||||||
Object.keys(results.participants).forEach(playerId => {
|
Object.keys(results.participants).forEach(playerId => {
|
||||||
initializeTargetsForPlayer(parseInt(playerId));
|
initializeTargetsForPlayer(parseInt(playerId));
|
||||||
|
|
||||||
// Update initial states
|
// Update initial states
|
||||||
for (let i = 1; i <= numTargets; i++) {
|
for (let i = 1; i <= numTargets; i++) {
|
||||||
updateTargetGroupStyling(parseInt(playerId), i);
|
updateTargetGroupStyling(parseInt(playerId), i);
|
||||||
@@ -1992,7 +2073,22 @@
|
|||||||
updateParticipantStatus(parseInt(playerId));
|
updateParticipantStatus(parseInt(playerId));
|
||||||
updateParticipantTens(parseInt(playerId));
|
updateParticipantTens(parseInt(playerId));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Initialize joker checkboxes for league tournaments
|
||||||
|
{% if league_state %}
|
||||||
|
const leagueState = {{ league_state | tojson | safe }};
|
||||||
|
Object.keys(results.participants).forEach(playerId => {
|
||||||
|
const checkbox = document.getElementById(`joker-calc-${playerId}`);
|
||||||
|
if (checkbox && leagueState.participants && leagueState.participants[playerId]) {
|
||||||
|
const participant = leagueState.participants[playerId];
|
||||||
|
if (participant.joker_used) {
|
||||||
|
checkbox.checked = true;
|
||||||
|
checkbox.disabled = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
updateOverallProgress();
|
updateOverallProgress();
|
||||||
updateOverallTens();
|
updateOverallTens();
|
||||||
|
|
||||||
|
|||||||
@@ -708,6 +708,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="navbar-controls">
|
<div class="navbar-controls">
|
||||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||||
|
<button class="nav-btn" onclick="exportResultsJSON()">💾 <span data-i18n="general.export">Export JSON</span></button>
|
||||||
<button class="nav-btn" onclick="printResults()">🖨️ <span data-i18n="general.print">Print</span></button>
|
<button class="nav-btn" onclick="printResults()">🖨️ <span data-i18n="general.print">Print</span></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1007,6 +1008,33 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Export results as JSON
|
||||||
|
function exportResultsJSON() {
|
||||||
|
const tournamentData = {{ tournament | tojson | safe }};
|
||||||
|
const resultsData = {{ results | tojson | safe }};
|
||||||
|
|
||||||
|
// Wrap in archive format for compatibility
|
||||||
|
const archiveData = {
|
||||||
|
tournament: tournamentData,
|
||||||
|
results: resultsData,
|
||||||
|
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 tournament info
|
||||||
|
const tournamentId = tournamentData.tournament_id || 'tournament';
|
||||||
|
const date = new Date().toISOString().slice(0, 10);
|
||||||
|
link.download = `${tournamentId}_${date}.json`;
|
||||||
|
|
||||||
|
link.click();
|
||||||
|
URL.revokeObjectURL(url);
|
||||||
|
}
|
||||||
|
|
||||||
// Initialize when page loads
|
// Initialize when page loads
|
||||||
document.addEventListener('DOMContentLoaded', initializePage);
|
document.addEventListener('DOMContentLoaded', initializePage);
|
||||||
|
|
||||||
|
|||||||
@@ -767,14 +767,22 @@
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
transition: all 0.2s ease;
|
transition: all 0.2s ease;
|
||||||
min-width: 200px;
|
min-width: 200px;
|
||||||
text-decoration: none;
|
text-decoration: none !important;
|
||||||
font-family: Arial, sans-serif;
|
font-family: Arial, sans-serif;
|
||||||
|
display: inline-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn:hover {
|
.action-btn:hover {
|
||||||
background: #1e7e34;
|
background: #1e7e34;
|
||||||
transform: translateY(-1px);
|
transform: translateY(-1px);
|
||||||
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
|
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.3);
|
||||||
|
text-decoration: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn:focus,
|
||||||
|
.action-btn:active,
|
||||||
|
.action-btn:visited {
|
||||||
|
text-decoration: none !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.action-btn:disabled {
|
.action-btn:disabled {
|
||||||
@@ -800,6 +808,16 @@
|
|||||||
background: #c82333;
|
background: #c82333;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.action-btn.info {
|
||||||
|
background: #007bff;
|
||||||
|
border-color: #0056b3;
|
||||||
|
}
|
||||||
|
|
||||||
|
.action-btn.info:hover {
|
||||||
|
background: #0056b3;
|
||||||
|
box-shadow: 0 4px 8px rgba(0, 123, 255, 0.4);
|
||||||
|
}
|
||||||
|
|
||||||
.player-count {
|
.player-count {
|
||||||
margin: 20px 0;
|
margin: 20px 0;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
@@ -1606,7 +1624,7 @@
|
|||||||
<input type="checkbox"
|
<input type="checkbox"
|
||||||
class="joker-checkbox"
|
class="joker-checkbox"
|
||||||
id="joker_{{ player_id }}"
|
id="joker_{{ player_id }}"
|
||||||
{% if participant.joker_used %}disabled{% endif %}
|
{% if participant.joker_used %}disabled checked{% endif %}
|
||||||
data-player-id="{{ player_id }}">
|
data-player-id="{{ player_id }}">
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -1614,6 +1632,11 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="action-buttons">
|
<div class="action-buttons">
|
||||||
|
{% if league_state.completed_tournaments|length > 0 %}
|
||||||
|
<a href="/results" class="action-btn info">
|
||||||
|
📊 <span data-i18n="tournament.view_current_results">View Current Standings</span>
|
||||||
|
</a>
|
||||||
|
{% endif %}
|
||||||
<button class="action-btn success" onclick="startNextTournament()">
|
<button class="action-btn success" onclick="startNextTournament()">
|
||||||
🚀 <span data-i18n="league.start_tournament_number">Začni Turnir</span> {{ league_state.current_tournament + 1 }}
|
🚀 <span data-i18n="league.start_tournament_number">Začni Turnir</span> {{ league_state.current_tournament + 1 }}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -1087,7 +1087,21 @@ def results_display():
|
|||||||
translations=get_translations(),
|
translations=get_translations(),
|
||||||
current_language=get_current_language())
|
current_language=get_current_language())
|
||||||
|
|
||||||
# Priority 1.5: Check if current results are from a finished league (even if league state was archived)
|
# Priority 1.5: Check if results contain league_data (from league preview/combiner)
|
||||||
|
elif results and results.get('league_data'):
|
||||||
|
league_data = results.get('league_data')
|
||||||
|
calculate_league_final_scores(league_data)
|
||||||
|
participants = get_league_final_rankings(league_data)
|
||||||
|
|
||||||
|
return render_template('league_scoreboard_display.html',
|
||||||
|
league=league_data,
|
||||||
|
participants=participants,
|
||||||
|
results=None,
|
||||||
|
preview_mode=True,
|
||||||
|
translations=get_translations(),
|
||||||
|
current_language=get_current_language())
|
||||||
|
|
||||||
|
# Priority 1.6: Check if current results are from a finished league (even if league state was archived)
|
||||||
elif results and results.get('league_tournament_number'):
|
elif results and results.get('league_tournament_number'):
|
||||||
# This is a league tournament result, but league state was archived
|
# This is a league tournament result, but league state was archived
|
||||||
# Try to find the archived league data
|
# Try to find the archived league data
|
||||||
@@ -1580,6 +1594,8 @@ def finish_tournament():
|
|||||||
'participated': False,
|
'participated': False,
|
||||||
'joker': True
|
'joker': True
|
||||||
})
|
})
|
||||||
|
# Mark joker as used for this player
|
||||||
|
participant['joker_used'] = True
|
||||||
|
|
||||||
# Calculate total shots correctly for any tournament type
|
# Calculate total shots correctly for any tournament type
|
||||||
tournament_type = results.get('tournament_type', '20_targets')
|
tournament_type = results.get('tournament_type', '20_targets')
|
||||||
|
|||||||
Reference in New Issue
Block a user