Newest Main page regreshing. Updated calculator. Removed unused stuff.
This commit is contained in:
@@ -11,5 +11,6 @@
|
||||
"show_titles": true,
|
||||
"title_size": 1.4,
|
||||
"target_number_size": 1.7
|
||||
}
|
||||
},
|
||||
"tv_view": "cameras"
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
{
|
||||
"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"
|
||||
}
|
||||
@@ -1,460 +0,0 @@
|
||||
{
|
||||
"league": {
|
||||
"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
|
||||
},
|
||||
"archived_at": "2026-02-08T19:57:11.791065"
|
||||
}
|
||||
+21
-21
@@ -3,7 +3,7 @@
|
||||
{
|
||||
"id": 1,
|
||||
"name": "Domen Pleterski",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 2,
|
||||
@@ -23,7 +23,7 @@
|
||||
{
|
||||
"id": 5,
|
||||
"name": "Jože Verhnjak",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
@@ -43,17 +43,17 @@
|
||||
{
|
||||
"id": 9,
|
||||
"name": "Janez Božič",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 10,
|
||||
"name": "Mitja Čeh",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 11,
|
||||
"name": "Rado Kefer",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 12,
|
||||
@@ -63,32 +63,32 @@
|
||||
{
|
||||
"id": 13,
|
||||
"name": "Angelca Mrak",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 14,
|
||||
"name": "Karli Proje",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 15,
|
||||
"name": "Jan Pleterski",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 16,
|
||||
"name": "Silvo Poročnik",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 17,
|
||||
"name": "Dušan Onuk",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 18,
|
||||
"name": "Matjaž Pleterski",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 19,
|
||||
@@ -108,7 +108,7 @@
|
||||
{
|
||||
"id": 22,
|
||||
"name": "Doris Fesel",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 23,
|
||||
@@ -118,12 +118,12 @@
|
||||
{
|
||||
"id": 24,
|
||||
"name": "Jože Verdinek",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 25,
|
||||
"name": "Andrej Herman",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 26,
|
||||
@@ -138,12 +138,12 @@
|
||||
{
|
||||
"id": 28,
|
||||
"name": "Anže Kolar",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 29,
|
||||
"name": "Alen Kolar",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 30,
|
||||
@@ -158,7 +158,7 @@
|
||||
{
|
||||
"id": 32,
|
||||
"name": "David Strniša",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 33,
|
||||
@@ -188,7 +188,7 @@
|
||||
{
|
||||
"id": 38,
|
||||
"name": "Bojan Sudar",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 39,
|
||||
@@ -218,7 +218,7 @@
|
||||
{
|
||||
"id": 44,
|
||||
"name": "Anka Kačnik",
|
||||
"enabled": false
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"id": 45,
|
||||
@@ -248,12 +248,12 @@
|
||||
{
|
||||
"id": 50,
|
||||
"name": "Vid Ravnjak",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
},
|
||||
{
|
||||
"id": 51,
|
||||
"name": "Robi Ovčar",
|
||||
"enabled": true
|
||||
"enabled": false
|
||||
}
|
||||
]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+261
-240
@@ -31,39 +31,33 @@
|
||||
.tournament-header {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
padding: 15px 20px;
|
||||
text-align: center;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.08);
|
||||
padding: 10px 16px;
|
||||
flex-shrink: 0;
|
||||
position: relative;
|
||||
margin: 10px 15px 5px 15px;
|
||||
}
|
||||
|
||||
.tournament-header .nav-btn {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 15px;
|
||||
margin: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
font-size: 1rem;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
margin-bottom: 6px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.tournament-stats {
|
||||
color: #666;
|
||||
font-size: 0.9rem;
|
||||
margin-bottom: 12px;
|
||||
color: #888;
|
||||
font-size: 0.82rem;
|
||||
}
|
||||
|
||||
.tournament-controls {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
gap: 10px;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.round-nav-btn {
|
||||
@@ -94,7 +88,7 @@
|
||||
.current-round-display {
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
color: #28a745;
|
||||
color: #333;
|
||||
margin: 0 15px;
|
||||
min-width: 140px;
|
||||
text-align: center;
|
||||
@@ -387,6 +381,14 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.print-logo {
|
||||
display: block !important;
|
||||
height: 80px !important;
|
||||
max-width: 300px !important;
|
||||
object-fit: contain !important;
|
||||
margin: 0 auto 16px auto !important;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
@@ -410,20 +412,47 @@
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 24pt !important;
|
||||
font-weight: bold !important;
|
||||
color: #333 !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tournament-title,
|
||||
.tournament-stats {
|
||||
font-size: 12pt !important;
|
||||
color: #666 !important;
|
||||
margin-bottom: 0 !important;
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.current-round-info {
|
||||
.tournament-header {
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
align-items: center !important;
|
||||
justify-content: space-between !important;
|
||||
background: transparent !important;
|
||||
border: none !important;
|
||||
box-shadow: none !important;
|
||||
border-radius: 0 !important;
|
||||
padding: 0 0 16px 0 !important;
|
||||
margin-bottom: 16px !important;
|
||||
border-bottom: 1px solid #ddd !important;
|
||||
}
|
||||
|
||||
.print-logo {
|
||||
display: block !important;
|
||||
height: 80px !important;
|
||||
max-width: 300px !important;
|
||||
object-fit: contain !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.print-meta {
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
align-items: flex-end !important;
|
||||
font-size: 11pt !important;
|
||||
color: #555 !important;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.current-round-info,
|
||||
.round-badge,
|
||||
.round-print-info,
|
||||
.player-id,
|
||||
.no-tournament {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -431,209 +460,106 @@
|
||||
display: block !important;
|
||||
overflow: visible !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.round-row {
|
||||
background: white !important;
|
||||
border: 1px solid #ddd !important;
|
||||
background: transparent !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
page-break-inside: avoid;
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
margin-bottom: 15px;
|
||||
flex-shrink: 0 !important;
|
||||
margin: 0 !important;
|
||||
}
|
||||
|
||||
.round-row,
|
||||
.round-row.current,
|
||||
.round-row.completed,
|
||||
.round-row.waiting {
|
||||
border-left: 2px solid #ddd !important;
|
||||
box-shadow: none !important;
|
||||
page-break-inside: avoid !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.round-header {
|
||||
background: #f8f9fa !important;
|
||||
border: none !important;
|
||||
border-right: 1px solid #ddd !important;
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
padding: 10px 15px !important;
|
||||
min-width: 130px !important;
|
||||
margin-bottom: 6px !important;
|
||||
min-height: 0 !important;
|
||||
border-top: 1px solid #dee2e6 !important;
|
||||
border-right: 1px solid #dee2e6 !important;
|
||||
border-bottom: 1px solid #dee2e6 !important;
|
||||
border-left: 1px solid #dee2e6 !important;
|
||||
border-color: #dee2e6 !important;
|
||||
}
|
||||
|
||||
.round-row.current .round-header,
|
||||
.round-row.completed .round-header,
|
||||
.round-row.waiting .round-header {
|
||||
background: #f8f9fa !important;
|
||||
background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%) !important;
|
||||
}
|
||||
|
||||
.round-title {
|
||||
font-size: 14pt !important;
|
||||
font-weight: bold !important;
|
||||
}
|
||||
|
||||
.round-badge {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.round-print-info {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.round-time-field {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 8px !important;
|
||||
}
|
||||
|
||||
.round-time-label {
|
||||
font-size: 11pt !important;
|
||||
color: #666 !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
|
||||
.round-time-input {
|
||||
border: 2px solid #333 !important;
|
||||
border-radius: 4px !important;
|
||||
padding: 6px 10px !important;
|
||||
width: 100px !important;
|
||||
height: 32px !important;
|
||||
background: white !important;
|
||||
}
|
||||
|
||||
.round-checkbox-field {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 10px !important;
|
||||
}
|
||||
|
||||
.round-checkbox-label {
|
||||
font-size: 11pt !important;
|
||||
color: #666 !important;
|
||||
font-weight: 500 !important;
|
||||
}
|
||||
|
||||
.round-checkbox {
|
||||
width: 24px !important;
|
||||
height: 24px !important;
|
||||
border: 2px solid #333 !important;
|
||||
border-radius: 4px !important;
|
||||
background: white !important;
|
||||
display: inline-block !important;
|
||||
}
|
||||
|
||||
.positions-container {
|
||||
display: grid !important;
|
||||
grid-template-columns: repeat(6, 1fr) !important;
|
||||
gap: 8px !important;
|
||||
padding: 15px !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
border: 1px solid #5a8fd1 !important;
|
||||
border-radius: 4px !important;
|
||||
overflow: visible !important;
|
||||
background: white !important;
|
||||
box-shadow: none !important;
|
||||
min-height: 70px !important;
|
||||
page-break-inside: avoid;
|
||||
display: flex !important;
|
||||
flex-direction: row !important;
|
||||
flex-shrink: 0 !important;
|
||||
}
|
||||
|
||||
/* All cards in print have same blue color */
|
||||
.round-row.current .position-card,
|
||||
.round-row.completed .position-card,
|
||||
.round-row.waiting .position-card {
|
||||
border-color: #5a8fd1 !important;
|
||||
}
|
||||
|
||||
.position-header {
|
||||
background: #5a8fd1 !important;
|
||||
padding: 10px 0 !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
flex-shrink: 0 !important;
|
||||
min-width: 40px !important;
|
||||
width: 40px !important;
|
||||
min-height: 70px !important;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 12pt !important;
|
||||
font-weight: bold !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.position-body {
|
||||
padding: 6px 10px !important;
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
flex: 1 !important;
|
||||
background: white !important;
|
||||
overflow: hidden !important;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 10pt !important;
|
||||
font-weight: 600 !important;
|
||||
color: #2c3e50 !important;
|
||||
line-height: 1.2 !important;
|
||||
white-space: nowrap !important;
|
||||
overflow: hidden !important;
|
||||
text-overflow: ellipsis !important;
|
||||
max-width: 100% !important;
|
||||
}
|
||||
|
||||
.round-row.current .position-card .position-header,
|
||||
.round-row.completed .position-card .position-header,
|
||||
.round-row.waiting .position-card .position-header {
|
||||
background: #5a8fd1 !important;
|
||||
}
|
||||
|
||||
.position-card.empty .position-header {
|
||||
background: #9ca3af !important;
|
||||
.round-header {
|
||||
padding: 8px 12px !important;
|
||||
min-width: 90px !important;
|
||||
}
|
||||
|
||||
.round-title {
|
||||
font-size: 9pt !important;
|
||||
}
|
||||
|
||||
.round-badge {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.positions-container {
|
||||
gap: 5px !important;
|
||||
padding: 8px !important;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
box-shadow: none !important;
|
||||
transform: none !important;
|
||||
transition: none !important;
|
||||
page-break-inside: avoid !important;
|
||||
min-height: 48px !important;
|
||||
overflow: hidden !important;
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.position-header {
|
||||
min-width: 36px !important;
|
||||
width: 36px !important;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 14pt !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.position-body {
|
||||
padding: 10px !important;
|
||||
background: white !important;
|
||||
flex: 1 !important;
|
||||
display: flex !important;
|
||||
flex-direction: column !important;
|
||||
justify-content: center !important;
|
||||
align-items: center !important;
|
||||
}
|
||||
|
||||
.position-card.empty .position-body {
|
||||
background: #f8f9fa !important;
|
||||
font-size: 1.2rem !important;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 10pt !important;
|
||||
color: #2c3e50 !important;
|
||||
white-space: normal !important;
|
||||
overflow: visible !important;
|
||||
}
|
||||
|
||||
.position-card.empty .player-name {
|
||||
color: #6c757d !important;
|
||||
/* Done checkbox */
|
||||
.print-done-check {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
padding: 0 14px !important;
|
||||
flex-shrink: 0 !important;
|
||||
border-left: 1px solid rgba(0,0,0,0.1) !important;
|
||||
}
|
||||
|
||||
.player-id {
|
||||
.print-done-box {
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
border: 1.5px solid #555 !important;
|
||||
border-radius: 4px !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.print-done-label {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
@@ -641,68 +567,53 @@
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
/* Print header - show logo in tournament header */
|
||||
.print-header {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.tournament-header .print-logo {
|
||||
display: block !important;
|
||||
height: 60px !important;
|
||||
max-width: 160px !important;
|
||||
margin: 0 auto 10px auto !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* Print-only elements - hidden on screen */
|
||||
.print-header,
|
||||
.round-print-info,
|
||||
.tournament-header .print-logo {
|
||||
display: none;
|
||||
@media screen {
|
||||
.round-print-info,
|
||||
.print-logo,
|
||||
.print-meta,
|
||||
.print-done-check {
|
||||
display: none !important;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<script src="/static/js/i18n.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
<div class="navbar-title">🏆 <span data-i18n="draft.tournament_draft">Tournament Draft</span></div>
|
||||
<div class="navbar-title">🏆 Razpored Turnirja</div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||
<a href="/tournament" class="nav-btn">🏆 <span data-i18n="navigation.tournament">Tournament</span></a>
|
||||
<a href="/tournament/draft" class="nav-btn active">📋 <span data-i18n="tournament.view_draft">Draft</span></a>
|
||||
<a href="/tournament/draft" class="nav-btn active">📋 Razpored</a>
|
||||
<a href="/results/calculator" class="nav-btn">🎯 <span data-i18n="navigation.calculator">Results Calculator</span></a>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Print-only header with logo -->
|
||||
<div class="print-header">
|
||||
<img src="/static/logo.png" alt="Logo" class="print-logo" onerror="this.style.display='none'" />
|
||||
</div>
|
||||
|
||||
<div class="main-container">
|
||||
{% if tournament %}
|
||||
<div class="tournament-header">
|
||||
<button class="nav-btn" onclick="printDraft()" title="Print Tournament Draft">🖨️ <span data-i18n="general.print">Print</span></button>
|
||||
<img src="/static/logo.png" alt="Logo" class="print-logo" onerror="this.style.display='none'" />
|
||||
<img src="/static/logo.png" alt="Logo" class="print-logo" />
|
||||
<div class="tournament-title">🎯 <span data-i18n="draft.shooting_tournament">Shooting Tournament</span></div>
|
||||
<div class="tournament-stats">
|
||||
{{ tournament.total_players }} <span data-i18n="draft.players">players</span> • {{ tournament.total_rounds }} <span data-i18n="draft.rounds">rounds</span>
|
||||
{% if tournament.current_round %}
|
||||
<span class="current-round-info"><span data-i18n="draft.currently_on_round">Currently on Round</span> {{ tournament.current_round }}</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="print-meta">
|
||||
<div>{{ tournament.total_players }} <span data-i18n="draft.players">igralcev</span></div>
|
||||
<div id="printDate"></div>
|
||||
</div>
|
||||
|
||||
{% if tournament.current_round %}
|
||||
<div class="tournament-controls">
|
||||
<button class="round-nav-btn" id="prevRoundBtn" onclick="changeRound(-1)" title="Previous Round">
|
||||
← <span data-i18n="draft.previous">Previous</span>
|
||||
</button>
|
||||
<span class="current-round-display"><span data-i18n="draft.round">Round</span> {{ tournament.current_round }} <span data-i18n="draft.of">of</span> {{ tournament.total_rounds }}</span>
|
||||
<button class="round-nav-btn" id="nextRoundBtn" onclick="changeRound(1)" title="Next Round">
|
||||
<span data-i18n="draft.next">Next</span> →
|
||||
</button>
|
||||
<button class="round-nav-btn" id="prevRoundBtn" onclick="changeRound(-1)">←</button>
|
||||
<span class="current-round-display"><span data-i18n="draft.round">Round</span> {{ tournament.current_round }} / {{ tournament.total_rounds }}</span>
|
||||
<button class="round-nav-btn" id="nextRoundBtn" onclick="changeRound(1)">→</button>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<button class="nav-btn" onclick="printDraft()" title="Print">🖨️</button>
|
||||
</div>
|
||||
|
||||
<div class="rounds-container" data-total-rounds="{{ tournament.total_rounds }}">
|
||||
@@ -751,6 +662,10 @@
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="print-done-check">
|
||||
<span class="print-done-box"></span>
|
||||
<span class="print-done-label">Done</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -770,6 +685,24 @@
|
||||
let currentRound = {{ tournament.current_round if tournament else 1 }};
|
||||
const totalRounds = {{ tournament.total_rounds if tournament else 1 }};
|
||||
|
||||
// TV view toggle — only active when loaded as TV display (?tv=1)
|
||||
const isTvDisplay = new URLSearchParams(window.location.search).get('tv') === '1';
|
||||
if (isTvDisplay) {
|
||||
const btn = document.getElementById('btnSwitchView');
|
||||
if (btn) btn.style.display = '';
|
||||
}
|
||||
|
||||
async function switchToView() {
|
||||
try {
|
||||
await fetch('/api/tv/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ view: 'cameras' })
|
||||
});
|
||||
window.location.href = '/';
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
function updateRoundNavigation() {
|
||||
if (tournamentActive) {
|
||||
const prevBtn = document.getElementById('prevRoundBtn');
|
||||
@@ -822,8 +755,19 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Set print date
|
||||
const printDateEl = document.getElementById('printDate');
|
||||
if (printDateEl) {
|
||||
const now = new Date();
|
||||
printDateEl.textContent = now.toLocaleDateString('sl-SI', { day: '2-digit', month: '2-digit', year: 'numeric' });
|
||||
}
|
||||
|
||||
// Print function
|
||||
function printDraft() {
|
||||
document.querySelectorAll('.round-row').forEach(el => {
|
||||
el.classList.remove('current', 'completed', 'waiting');
|
||||
el.classList.add('waiting');
|
||||
});
|
||||
window.print();
|
||||
}
|
||||
|
||||
@@ -836,7 +780,7 @@
|
||||
window.location.reload();
|
||||
} else if (event.key === 'p' || event.key === 'P') {
|
||||
event.preventDefault();
|
||||
window.print();
|
||||
printDraft();
|
||||
} else if (tournamentActive) {
|
||||
if (event.key === 'ArrowLeft') {
|
||||
event.preventDefault();
|
||||
@@ -856,17 +800,94 @@
|
||||
setTimeout(() => {
|
||||
const currentRoundRow = document.querySelector('.round-row.current');
|
||||
if (currentRoundRow) {
|
||||
currentRoundRow.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'center'
|
||||
currentRoundRow.scrollIntoView({
|
||||
behavior: 'smooth',
|
||||
block: 'start'
|
||||
});
|
||||
}
|
||||
}, 500);
|
||||
}, 300);
|
||||
|
||||
console.log('🖥️ PC Tournament Draft (Vertical Rows) loaded');
|
||||
console.log('🏆 Tournament active:', tournamentActive);
|
||||
console.log(`📊 Displaying ${totalRounds} rounds in vertical layout`);
|
||||
// Poll for state changes
|
||||
let lastStateHash = null;
|
||||
setInterval(async () => {
|
||||
if (document.visibilityState !== 'visible') return;
|
||||
try {
|
||||
const response = await fetch('/api/dashboard/state');
|
||||
if (!response.ok) return;
|
||||
const data = await response.json();
|
||||
|
||||
// If tournament just became inactive, redirect to archive (not reload)
|
||||
if (!data.tournament_active) {
|
||||
if (data.archive_filename) {
|
||||
window.location.href = `/archive/tournament/${data.archive_filename}`;
|
||||
} else if (data.league_archive_filename) {
|
||||
window.location.href = `/archive/league/${data.league_archive_filename}`;
|
||||
} else {
|
||||
window.location.href = '/results';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Follow TV view changes when used as TV display
|
||||
if (isTvDisplay) {
|
||||
if (data.tv_view === 'cameras') { window.location.href = '/'; return; }
|
||||
if (data.tv_view === 'results') {
|
||||
if (data.archive_filename) {
|
||||
window.location.href = `/archive/tournament/${data.archive_filename}?tv=1`;
|
||||
} else if (data.league_archive_filename) {
|
||||
window.location.href = `/archive/league/${data.league_archive_filename}?tv=1`;
|
||||
} else {
|
||||
window.location.href = '/results?tv=1';
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Reload on round change to keep draft display in sync
|
||||
const hash = JSON.stringify({ round: data.current_round });
|
||||
if (lastStateHash !== null && hash !== lastStateHash) {
|
||||
window.location.reload();
|
||||
}
|
||||
lastStateHash = hash;
|
||||
updateTvViewBtn(data.tv_view || 'cameras');
|
||||
} catch (e) {}
|
||||
}, 3000);
|
||||
});
|
||||
|
||||
// ── TV VIEW TOGGLE ────────────────────────────────────────────────────────
|
||||
let currentTvView = 'cameras';
|
||||
|
||||
function updateTvViewBtn(view) {
|
||||
currentTvView = view;
|
||||
const btn = document.getElementById('btnTvView');
|
||||
if (!btn) return;
|
||||
if (view === 'draft') {
|
||||
btn.textContent = '📺';
|
||||
btn.style.background = '#28a745';
|
||||
btn.style.color = 'white';
|
||||
btn.style.borderColor = '#1e7e34';
|
||||
} else {
|
||||
btn.textContent = '📺';
|
||||
btn.style.background = '';
|
||||
btn.style.color = '';
|
||||
btn.style.borderColor = '';
|
||||
}
|
||||
}
|
||||
|
||||
async function toggleTvView() {
|
||||
const newView = currentTvView === 'draft' ? 'cameras' : 'draft';
|
||||
try {
|
||||
await fetch('/api/tv/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ view: newView })
|
||||
});
|
||||
updateTvViewBtn(newView);
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
// Load initial tv_view state
|
||||
fetch('/api/dashboard/state').then(r => r.json()).then(d => updateTvViewBtn(d.tv_view || 'cameras')).catch(() => {});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+29
-4
@@ -655,6 +655,12 @@
|
||||
</div>
|
||||
|
||||
<div style="display: flex; align-items: center; gap: 15px;">
|
||||
{% if settings.tournament_active %}
|
||||
<div class="datetime" style="text-align: right;">
|
||||
<div class="time" id="time"></div>
|
||||
<div class="date" id="date"></div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<button class="hamburger-menu" id="menuButton" data-i18n-title="general.settings">
|
||||
<div class="hamburger-line"></div>
|
||||
<div class="hamburger-line"></div>
|
||||
@@ -682,7 +688,7 @@
|
||||
</div>
|
||||
|
||||
<div class="tournament-actions">
|
||||
<a href="/tournament/draft" class="nav-link tournament-btn">📋 <span data-i18n="tournament.view_full_tournament_draft">Oglej si Celoten Žreb Turnirja</span></a>
|
||||
<a href="/tournament/draft" class="nav-link tournament-btn">📋 Razpored Turnirja</a>
|
||||
<a href="/results/calculator" class="nav-link tournament-btn">🎯 <span data-i18n="scoring.results_calculator">Calculator</span></a>
|
||||
<a href="/tournament" class="nav-link tournament-btn" id="manageTournamentLink">⚙️ <span data-i18n="tournament.manage_tournament">Upravljaj Turnir</span></a>
|
||||
</div>
|
||||
@@ -693,7 +699,6 @@
|
||||
<div class="settings-group">
|
||||
<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="/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" class="nav-link">📚 <span data-i18n="navigation.archive">Arhiv</span></a>
|
||||
</div>
|
||||
@@ -809,7 +814,7 @@
|
||||
const tournamentActive = {{ 'true' if settings.tournament_active else 'false' }};
|
||||
let currentRound = {{ settings.current_round if settings.tournament_active else 1 }};
|
||||
const totalRounds = {{ settings.total_rounds if settings.tournament_active else 1 }};
|
||||
|
||||
|
||||
// Remote control state
|
||||
const remoteControlled = {{ 'true' if settings.remote_controlled else 'false' }};
|
||||
let remotePollingInterval = null;
|
||||
@@ -1084,6 +1089,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
// TV view toggle (cameras ↔ draft)
|
||||
// Debounce function
|
||||
function debounce(func, wait) {
|
||||
let timeout;
|
||||
@@ -1479,10 +1485,29 @@
|
||||
|
||||
const data = await response.json();
|
||||
|
||||
// If switched to draft view and tournament is active, follow it
|
||||
if (data.tv_view === 'draft' && data.tournament_active) {
|
||||
window.location.href = '/tournament/draft?tv=1';
|
||||
return;
|
||||
}
|
||||
// If switched to results view, follow it (use explicit tv_url first, then fallback)
|
||||
if (data.tv_view === 'results') {
|
||||
if (data.tv_url) {
|
||||
window.location.href = data.tv_url.includes('?') ? data.tv_url + '&tv=1' : data.tv_url + '?tv=1';
|
||||
} else if (data.archive_filename) {
|
||||
window.location.href = `/archive/tournament/${data.archive_filename}?tv=1`;
|
||||
} else if (data.league_archive_filename) {
|
||||
window.location.href = `/archive/league/${data.league_archive_filename}?tv=1`;
|
||||
} else {
|
||||
window.location.href = '/results?tv=1';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Create a hash of the state to detect changes
|
||||
const stateHash = JSON.stringify(data);
|
||||
|
||||
// If state changed, reload the page
|
||||
// If structural state changed, reload the page
|
||||
if (lastDashboardStateHash !== null && stateHash !== lastDashboardStateHash) {
|
||||
console.log('🔄 Tournament state changed, reloading TV display...');
|
||||
window.location.reload();
|
||||
|
||||
@@ -293,7 +293,7 @@
|
||||
<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>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
|
||||
@@ -842,9 +842,10 @@
|
||||
<div class="navbar-title">🎖️ <span data-i18n="league.league_results">League Results</span></div>
|
||||
</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>
|
||||
<button class="nav-btn" id="btnTvView" onclick="toggleTvView()" title="Preklopi pogled na TV zaslonu">📺</button>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1284,6 +1285,59 @@
|
||||
window.print();
|
||||
}
|
||||
});
|
||||
|
||||
// ── TV VIEW TOGGLE ────────────────────────────────────────────────────────
|
||||
const isTvDisplay = new URLSearchParams(window.location.search).get('tv') === '1';
|
||||
let currentTvView = 'results';
|
||||
|
||||
function updateTvViewBtn(view) {
|
||||
currentTvView = view;
|
||||
const btn = document.getElementById('btnTvView');
|
||||
if (!btn) return;
|
||||
btn.style.background = (view === 'results') ? '#28a745' : '';
|
||||
btn.style.color = (view === 'results') ? 'white' : '';
|
||||
btn.style.borderColor = (view === 'results') ? '#1e7e34' : '';
|
||||
}
|
||||
|
||||
async function toggleTvView() {
|
||||
const newView = currentTvView === 'results' ? 'cameras' : 'results';
|
||||
try {
|
||||
const payload = { view: newView };
|
||||
if (newView === 'results') {
|
||||
// Pass the current page path so the TV follows to this league archive, not a tournament archive
|
||||
payload.tv_url = window.location.pathname;
|
||||
}
|
||||
await fetch('/api/tv/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
updateTvViewBtn(newView);
|
||||
if (isTvDisplay && newView === 'cameras') {
|
||||
window.location.href = '/';
|
||||
}
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
// Poll to stay in sync and follow back-redirect when in TV mode
|
||||
setInterval(async () => {
|
||||
if (document.visibilityState !== 'visible') return;
|
||||
try {
|
||||
const r = await fetch('/api/dashboard/state');
|
||||
if (!r.ok) return;
|
||||
const d = await r.json();
|
||||
updateTvViewBtn(d.tv_view || 'cameras');
|
||||
if (isTvDisplay && d.tv_view !== 'results') {
|
||||
if (d.tv_view === 'draft' && d.tournament_active) {
|
||||
window.location.href = '/tournament/draft?tv=1';
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
}, 3000);
|
||||
|
||||
fetch('/api/dashboard/state').then(r => r.json()).then(d => updateTvViewBtn(d.tv_view || 'cameras')).catch(() => {});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -458,9 +458,9 @@
|
||||
<div class="navbar">
|
||||
<div class="navbar-title" data-i18n="navigation.archive">📚 Arhiv</div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||
<a href="/archive/player-analysis" class="nav-btn">👤 <span data-i18n="players.player_analysis">Player Analysis</span></a>
|
||||
<a href="/archive" class="nav-btn active">📚 <span data-i18n="navigation.archive">Archive</span></a>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -709,9 +709,9 @@
|
||||
<div class="navbar">
|
||||
<div class="navbar-title" data-i18n="players.player_analysis">🎯 👤 Player Analysis</div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||
<a href="/archive/player-analysis" class="nav-btn active">👤 <span data-i18n="players.player_analysis">Player Analysis</span></a>
|
||||
<a href="/archive" class="nav-btn">📚 <span data-i18n="navigation.archive">Archive</span></a>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1143,9 +1143,9 @@
|
||||
<div class="navbar">
|
||||
<div class="navbar-title">📊 {{ player.name }} - <span data-i18n="players.player_stats">Stats</span></div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||
<a href="/archive/player-analysis" class="nav-btn active">👤 <span data-i18n="players.player_analysis">Player Analysis</span></a>
|
||||
<a href="/archive" class="nav-btn">📚 <span data-i18n="navigation.archive">Archive</span></a>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
+444
-189
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<title data-i18n="scoring.results_calculator">Results Calculator</title>
|
||||
<title data-i18n="scoring.results_calculator">Kalkulator</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<link rel="stylesheet" href="/static/css/base.css">
|
||||
<link rel="stylesheet" href="/static/css/navbar.css">
|
||||
@@ -45,34 +45,38 @@
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex-direction: row;
|
||||
align-items: stretch;
|
||||
padding: 0 0 70px 0;
|
||||
padding: 12px 16px;
|
||||
box-sizing: border-box;
|
||||
gap: 0;
|
||||
gap: 12px;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.scrollable-content {
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
/* Shared card style */
|
||||
.calc-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
padding: 5px 20px 20px 20px;
|
||||
box-sizing: border-box;
|
||||
gap: 0;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
/* All direct children of scrollable-content */
|
||||
.scrollable-content > *:not(.cards-wrapper) {
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
flex-shrink: 0;
|
||||
padding: 0;
|
||||
box-sizing: border-box;
|
||||
/* Middle column: scoring card + finish card stacked */
|
||||
.col-middle {
|
||||
flex: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
min-height: 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.col-middle .calc-card.scoring-card {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.header-section {
|
||||
@@ -207,36 +211,82 @@
|
||||
box-shadow: 0 4px 8px rgba(23, 162, 184, 0.3);
|
||||
}
|
||||
|
||||
.cards-wrapper {
|
||||
background: white;
|
||||
border-radius: 0;
|
||||
border: 0;
|
||||
box-shadow: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
.players-search-bar {
|
||||
padding: 8px 10px;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.players-search-wrap {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
gap: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
flex: 1;
|
||||
align-items: center;
|
||||
border: 1px solid #dee2e6;
|
||||
border-radius: 6px;
|
||||
background: white;
|
||||
overflow: hidden;
|
||||
min-height: 0;
|
||||
transition: border-color 0.15s;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.players-search-wrap:hover {
|
||||
transform: none !important;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
.players-search-wrap:focus-within {
|
||||
border-color: #28a745;
|
||||
}
|
||||
|
||||
.players-search-input {
|
||||
flex: 1;
|
||||
border: none !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
padding: 5px 8px;
|
||||
font-size: 0.8rem;
|
||||
background: transparent;
|
||||
outline: none !important;
|
||||
min-width: 0;
|
||||
width: auto;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.players-search-clear {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border: none;
|
||||
background: transparent;
|
||||
cursor: pointer;
|
||||
font-size: 0.7rem;
|
||||
color: #adb5bd;
|
||||
display: none;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
transition: color 0.15s;
|
||||
padding: 0;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.players-search-clear.visible {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.players-search-clear:hover {
|
||||
color: #dc3545;
|
||||
transform: none !important;
|
||||
}
|
||||
|
||||
.participants-list {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 8px;
|
||||
width: 280px;
|
||||
max-width: none;
|
||||
width: 240px;
|
||||
flex-shrink: 0;
|
||||
box-sizing: border-box;
|
||||
padding: 15px;
|
||||
background: white;
|
||||
border-right: 2px solid #e9ecef;
|
||||
padding: 12px;
|
||||
overflow-y: auto;
|
||||
overflow-x: hidden;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.participants-list::-webkit-scrollbar {
|
||||
@@ -335,8 +385,8 @@
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
padding: 15px;
|
||||
background: white;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
min-height: 0;
|
||||
gap: 0;
|
||||
}
|
||||
@@ -345,7 +395,7 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 100%;
|
||||
flex: 1;
|
||||
color: #999;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
@@ -1129,29 +1179,18 @@
|
||||
background: #e0a800;
|
||||
}
|
||||
|
||||
/* Bottom Finish Card - Full Width */
|
||||
/* Finish bar - standalone card */
|
||||
.finish-section {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(135deg, #f8f9fa 0%, #f0f1f3 100%);
|
||||
border-radius: 0;
|
||||
border: none;
|
||||
border-top: 3px solid #e9ecef;
|
||||
box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);
|
||||
padding: 0 20px;
|
||||
margin: 0;
|
||||
background: #f8f9fa;
|
||||
padding: 10px 20px;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 15px;
|
||||
z-index: 999;
|
||||
height: 70px;
|
||||
min-height: 70px;
|
||||
box-sizing: border-box;
|
||||
flex-shrink: 0;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.finish-title {
|
||||
@@ -1227,139 +1266,262 @@
|
||||
0% { transform: rotate(0deg); }
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
|
||||
/* ========== DRAFT PANEL (right) ========== */
|
||||
.draft-panel {
|
||||
width: 240px;
|
||||
flex-shrink: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.draft-panel-header {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 10px 10px;
|
||||
background: #f8f9fa;
|
||||
border-bottom: 1px solid #e9ecef;
|
||||
border-radius: 12px 12px 0 0;
|
||||
flex-shrink: 0;
|
||||
gap: 4px;
|
||||
}
|
||||
|
||||
.draft-round-nav {
|
||||
background: #f0f1f3;
|
||||
border: 2px solid #dee2e6;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-weight: bold;
|
||||
font-size: 0.9rem;
|
||||
color: #333;
|
||||
flex-shrink: 0;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.draft-round-nav:hover:not(:disabled) {
|
||||
background: #e9ecef;
|
||||
border-color: #28a745;
|
||||
color: #28a745;
|
||||
}
|
||||
|
||||
.draft-round-nav:disabled {
|
||||
opacity: 0.35;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.draft-round-label {
|
||||
font-size: 0.78rem;
|
||||
font-weight: 700;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
flex: 1;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.draft-positions {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
padding: 8px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.draft-positions::-webkit-scrollbar { width: 6px; }
|
||||
.draft-positions::-webkit-scrollbar-track { background: transparent; }
|
||||
.draft-positions::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
|
||||
|
||||
.draft-position-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
padding: 7px 9px;
|
||||
background: white;
|
||||
border: 2px solid #dee2e6;
|
||||
border-radius: 8px;
|
||||
cursor: pointer;
|
||||
transition: all 0.15s ease;
|
||||
}
|
||||
|
||||
.draft-position-row:hover {
|
||||
border-color: #5a8fd1;
|
||||
background: #f0f5fc;
|
||||
}
|
||||
|
||||
.draft-position-num {
|
||||
width: 26px;
|
||||
height: 26px;
|
||||
border-radius: 6px;
|
||||
background: #5a8fd1;
|
||||
color: white;
|
||||
font-size: 0.85rem;
|
||||
font-weight: 700;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.draft-position-row.empty .draft-position-num {
|
||||
background: #9ca3af;
|
||||
}
|
||||
|
||||
.draft-position-name {
|
||||
font-size: 0.8rem;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.draft-position-row.empty .draft-position-name {
|
||||
color: #adb5bd;
|
||||
font-style: italic;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.draft-panel-footer {
|
||||
margin-top: auto;
|
||||
padding: 12px;
|
||||
border-top: 1px solid #e9ecef;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
</style>
|
||||
<script src="/static/js/i18n.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
<div class="navbar-title">🎯 <span data-i18n="scoring.results_calculator">Results Calculator</span></div>
|
||||
<div class="navbar-title">🎯 <span data-i18n="scoring.results_calculator">Kalkulator</span></div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn">📺 <span data-i18n="navigation.dashboard">Dashboard</span></a>
|
||||
<a href="/tournament" class="nav-btn">🏆 <span data-i18n="navigation.tournament">Tournament</span></a>
|
||||
<a href="/tournament/draft" class="nav-btn">📋 <span data-i18n="tournament.view_draft">Draft</span></a>
|
||||
<a href="/results/calculator" class="nav-btn active">🎯 <span data-i18n="navigation.calculator">Results Calculator</span></a>
|
||||
<a href="/tournament/draft" class="nav-btn">📋 Razpored</a>
|
||||
<a href="/results/calculator" class="nav-btn active">🎯 <span data-i18n="navigation.calculator">Kalkulator</span></a>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<div class="container">
|
||||
<div class="scrollable-content">
|
||||
<div class="header-section tournament-{{ results.tournament_type if results and results.tournament_type else 'default' }}">
|
||||
<img src="/static/logo.png" alt="Logo" class="header-logo" onerror="this.style.display='none'" />
|
||||
<div class="header-title">
|
||||
{% if results and results.tournament_type == '4_targets' %}
|
||||
🎯 <span data-i18n="scoring.tournament_scoring">Tournament Scoring</span>
|
||||
{% elif results and results.tournament_type == '40_targets' %}
|
||||
💪 <span data-i18n="scoring.tournament_scoring">Tournament Scoring</span>
|
||||
{% else %}
|
||||
⚡ <span data-i18n="scoring.tournament_scoring">Tournament Scoring</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="header-subtitle" id="tournamentSubtitle">
|
||||
{% if results.tournament_type == '40_targets' %}
|
||||
<span data-i18n="scoring.enter_scores_40_targets">Enter scores for each participant (40 targets, 2 shots each). Score 0 = miss.</span>
|
||||
{% elif results.tournament_type == '4_targets' %}
|
||||
<span data-i18n="scoring.enter_scores_4_targets">Enter scores for each participant (4 targets, 5 shots each). Score 0 = miss.</span>
|
||||
{% else %}
|
||||
<span data-i18n="scoring.enter_scores_20_targets">Enter scores for each participant (20 targets, 2 shots each). Score 0 = miss.</span>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="progress-info">
|
||||
<div class="progress-item">
|
||||
<div class="progress-number" id="completedCount">0</div>
|
||||
<div class="progress-label" data-i18n="scoring.completed">Zaključeno</div>
|
||||
</div>
|
||||
<div class="progress-item">
|
||||
<div class="progress-number" id="totalParticipants">{{ results.participants|length }}</div>
|
||||
<div class="progress-label" data-i18n="scoring.total">Skupaj</div>
|
||||
</div>
|
||||
<div class="progress-item">
|
||||
<div class="progress-number" id="totalShots">0</div>
|
||||
<div class="progress-label" data-i18n="scoring.total_shots">Skupaj Strelov</div>
|
||||
</div>
|
||||
<div class="progress-item">
|
||||
<div class="progress-number" id="totalTens">0</div>
|
||||
<div class="progress-label" data-i18n="results.tens">Tens</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="cards-wrapper">
|
||||
<!-- Sidebar with participant list -->
|
||||
<div class="participants-list" id="participantsList">
|
||||
{% for player_id, participant in results.participants.items() %}
|
||||
<div class="participant-list-item {{ 'completed' if participant.completed else '' }}" onclick="selectParticipant({{ player_id }})" id="list-item-{{ player_id }}" data-player-id="{{ player_id }}">
|
||||
<div class="participant-list-item-content">
|
||||
<span class="participant-list-item-name">{{ participant.name }}</span>
|
||||
<span class="participant-list-item-score" id="list-score-{{ player_id }}">{{ participant.total_score }}</span>
|
||||
<span class="participant-list-item-tens" id="list-tens-{{ player_id }}">0</span>
|
||||
</div>
|
||||
<!-- LEFT: Players card -->
|
||||
<div class="calc-card" style="width:240px;flex-shrink:0;">
|
||||
<div class="players-search-bar">
|
||||
<div class="players-search-wrap">
|
||||
<input class="players-search-input" id="playerSearch" type="text" placeholder="🔍 Iskanje..." oninput="filterPlayers(this.value)">
|
||||
<button class="players-search-clear" onclick="clearPlayerSearch()" title="Clear">✕</button>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="participants-list" id="participantsList">
|
||||
{% for player_id, participant in results.participants.items() %}
|
||||
<div class="participant-list-item {{ 'completed' if participant.completed else '' }}" onclick="selectParticipant({{ player_id }})" id="list-item-{{ player_id }}" data-player-id="{{ player_id }}">
|
||||
<div class="participant-list-item-content">
|
||||
<span class="participant-list-item-name">{{ participant.name }}</span>
|
||||
<span class="participant-list-item-score" id="list-score-{{ player_id }}">{{ participant.total_score }}</span>
|
||||
<span class="participant-list-item-tens" id="list-tens-{{ player_id }}">0</span>
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Main card panel on the right -->
|
||||
<div class="main-card-panel" id="mainCardPanel">
|
||||
<div class="main-card-panel-empty" id="emptyPanel">
|
||||
👈 <span data-i18n="general.select">Select a participant</span>
|
||||
</div>
|
||||
{% for player_id, participant in results.participants.items() %}
|
||||
<div class="participant-card {{ 'completed' if participant.completed else 'in-progress' }}" id="card-{{ player_id }}" data-player-id="{{ player_id }}">
|
||||
<!-- Card Header on Top -->
|
||||
<div class="card-header-top">
|
||||
<div class="header-info">
|
||||
<div class="player-name">{{ participant.name }}</div>
|
||||
<div class="player-stats">
|
||||
<div style="display: flex; flex-direction: column; align-items: center;">
|
||||
<span class="total-score" id="total-{{ player_id }}">{{ participant.total_score }}</span>
|
||||
<span class="score-label" data-i18n="scoring.points">pts</span>
|
||||
<!-- MIDDLE: Scoring card + Finish card -->
|
||||
<div style="flex:1;display:flex;flex-direction:column;gap:12px;min-height:0;overflow:hidden;">
|
||||
|
||||
<!-- Scoring card -->
|
||||
<div class="calc-card" style="flex:1;min-height:0;">
|
||||
<div class="main-card-panel" id="mainCardPanel">
|
||||
<div class="main-card-panel-empty" id="emptyPanel">
|
||||
👈 <span data-i18n="general.select">Select a participant</span>
|
||||
</div>
|
||||
{% for player_id, participant in results.participants.items() %}
|
||||
<div class="participant-card {{ 'completed' if participant.completed else 'in-progress' }}" id="card-{{ player_id }}" data-player-id="{{ player_id }}">
|
||||
<!-- Card Header on Top -->
|
||||
<div class="card-header-top">
|
||||
<div class="header-info">
|
||||
<div class="player-name">{{ participant.name }}</div>
|
||||
<div class="player-stats">
|
||||
<div style="display: flex; flex-direction: column; align-items: center;">
|
||||
<span class="total-score" id="total-{{ player_id }}">{{ participant.total_score }}</span>
|
||||
<span class="score-label" data-i18n="scoring.points">pts</span>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center;">
|
||||
<span class="tens-count" id="tens-{{ player_id }}">0</span>
|
||||
<span class="tens-label">10s</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="display: flex; flex-direction: column; align-items: center;">
|
||||
<span class="tens-count" id="tens-{{ player_id }}">0</span>
|
||||
<span class="tens-label">10s</span>
|
||||
<div class="header-actions" onclick="event.stopPropagation();">
|
||||
<button class="header-btn clear-btn" onclick="clearParticipant({{ player_id }})" data-i18n-title="scoring.clear_all_scores">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
||||
<line x1="10" y1="11" x2="10" y2="17"></line>
|
||||
<line x1="14" y1="11" x2="14" y2="17"></line>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="header-btn zero-fill-btn" onclick="fillEmptyWithZeros({{ player_id }})" data-i18n-title="scoring.fill_empty_with_zero">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<line x1="12" y1="6" x2="12" y2="18"></line>
|
||||
<line x1="6" y1="12" x2="18" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- All Targets (scrollable) -->
|
||||
<div class="participant-targets-wrapper">
|
||||
<div class="targets-row" id="targets-{{ player_id }}">
|
||||
<!-- Targets will be populated by JavaScript -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-actions" onclick="event.stopPropagation();">
|
||||
<button class="header-btn clear-btn" onclick="clearParticipant({{ player_id }})" data-i18n-title="scoring.clear_all_scores">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<polyline points="3 6 5 6 21 6"></polyline>
|
||||
<path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path>
|
||||
<line x1="10" y1="11" x2="10" y2="17"></line>
|
||||
<line x1="14" y1="11" x2="14" y2="17"></line>
|
||||
</svg>
|
||||
</button>
|
||||
<button class="header-btn zero-fill-btn" onclick="fillEmptyWithZeros({{ player_id }})" data-i18n-title="scoring.fill_empty_with_zero">
|
||||
<svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<circle cx="12" cy="12" r="10"></circle>
|
||||
<line x1="12" y1="6" x2="12" y2="18"></line>
|
||||
<line x1="6" y1="12" x2="18" y2="12"></line>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- All Targets (Middle - scrollable) -->
|
||||
<div class="participant-targets-wrapper">
|
||||
<div class="targets-row" id="targets-{{ player_id }}">
|
||||
<!-- Targets will be populated by JavaScript -->
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="finish-section">
|
||||
<button class="fill-all-btn" onclick="fillAllPlayersRandom()">
|
||||
🎲 <span data-i18n="scoring.fill_all_players_random">Fill All Random</span>
|
||||
</button>
|
||||
<button class="finish-btn" id="finishBtn" onclick="finishTournament()" data-i18n="scoring.finish_tournament_button">🏁 Finish Tournament
|
||||
</button>
|
||||
<!-- Finish card -->
|
||||
<div class="calc-card finish-section">
|
||||
<button class="fill-all-btn" onclick="fillAllPlayersRandom()">
|
||||
🎲 <span data-i18n="scoring.fill_all_players_random">Fill All Random</span>
|
||||
</button>
|
||||
<button class="finish-btn" id="finishBtn" onclick="finishTournament()" data-i18n="scoring.finish_tournament_button">🏁 Finish Tournament
|
||||
</button>
|
||||
</div>
|
||||
|
||||
</div><!-- end middle column -->
|
||||
|
||||
<!-- RIGHT: Draft card -->
|
||||
{% if tournament and tournament.rounds %}
|
||||
<div class="calc-card draft-panel">
|
||||
<div class="draft-panel-header">
|
||||
<button class="draft-round-nav" id="draftPrevBtn" onclick="draftChangeRound(-1)">←</button>
|
||||
<span class="draft-round-label" id="draftRoundLabel">{{ tournament.current_round }} / {{ tournament.total_rounds }}</span>
|
||||
<button class="draft-round-nav" id="draftNextBtn" onclick="draftChangeRound(1)">→</button>
|
||||
</div>
|
||||
<div class="draft-positions" id="draftPositions">
|
||||
<!-- populated by JS -->
|
||||
</div>
|
||||
<div class="draft-panel-footer">
|
||||
<button class="nav-btn" id="btnTvDraft" onclick="toggleTvDraft()">📺 Pokaži Razpored</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div><!-- end container -->
|
||||
</div><!-- end content-wrapper -->
|
||||
|
||||
<script>
|
||||
let results = {{ results|tojson }};
|
||||
@@ -1431,7 +1593,7 @@
|
||||
totalTens += calculateTensCount(parseInt(playerId));
|
||||
}
|
||||
|
||||
document.getElementById('totalTens').textContent = totalTens;
|
||||
const ttEl = document.getElementById('totalTens'); if (ttEl) ttEl.textContent = totalTens;
|
||||
}
|
||||
|
||||
// Debounce function for auto-saving
|
||||
@@ -1723,8 +1885,8 @@
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById('completedCount').textContent = completedCount;
|
||||
document.getElementById('totalShots').textContent = totalShots;
|
||||
const ccEl = document.getElementById('completedCount'); if (ccEl) ccEl.textContent = completedCount;
|
||||
const tsEl = document.getElementById('totalShots'); if (tsEl) tsEl.textContent = totalShots;
|
||||
|
||||
// Update finish button state
|
||||
const finishBtn = document.getElementById('finishBtn');
|
||||
@@ -1762,32 +1924,14 @@
|
||||
}
|
||||
|
||||
async function saveAllPlayers() {
|
||||
const saveAllBtn = document.querySelector('.save-all-btn');
|
||||
const originalText = saveAllBtn.textContent;
|
||||
saveAllBtn.textContent = `💾 ${t('scoring.saving_all')}`;
|
||||
saveAllBtn.disabled = true;
|
||||
|
||||
try {
|
||||
const playerIds = Object.keys(results.participants);
|
||||
for (const playerId of playerIds) {
|
||||
await saveParticipant(parseInt(playerId), true);
|
||||
}
|
||||
|
||||
// Show success feedback
|
||||
saveAllBtn.textContent = `✅ ${t('scoring.all_saved')}`;
|
||||
saveAllBtn.style.background = '#28a745';
|
||||
|
||||
setTimeout(() => {
|
||||
saveAllBtn.textContent = originalText;
|
||||
saveAllBtn.style.background = '';
|
||||
saveAllBtn.disabled = false;
|
||||
}, 2000);
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error saving all players:', error);
|
||||
alert('Failed to save all player data. Please try again.');
|
||||
saveAllBtn.textContent = originalText;
|
||||
saveAllBtn.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2051,6 +2195,112 @@
|
||||
}
|
||||
}
|
||||
|
||||
// ── PLAYER SEARCH ────────────────────────────────────────────────────────
|
||||
function filterPlayers(query) {
|
||||
const q = query.trim().toLowerCase();
|
||||
const clearBtn = document.querySelector('.players-search-clear');
|
||||
if (clearBtn) clearBtn.classList.toggle('visible', q.length > 0);
|
||||
document.querySelectorAll('.participant-list-item').forEach(item => {
|
||||
const name = item.querySelector('.participant-list-item-name').textContent.toLowerCase();
|
||||
item.style.display = (!q || name.includes(q)) ? '' : 'none';
|
||||
});
|
||||
}
|
||||
|
||||
function clearPlayerSearch() {
|
||||
const input = document.getElementById('playerSearch');
|
||||
input.value = '';
|
||||
filterPlayers('');
|
||||
input.focus();
|
||||
}
|
||||
|
||||
// ── DRAFT PANEL ──────────────────────────────────────────────────────────
|
||||
{% if tournament and tournament.rounds %}
|
||||
const draftRounds = {{ tournament.rounds | tojson }};
|
||||
let draftCurrentRound = {{ tournament.current_round }};
|
||||
const draftTotalRounds = {{ tournament.total_rounds }};
|
||||
|
||||
function renderDraftPanel() {
|
||||
const round = draftRounds.find(r => r.round_number === draftCurrentRound);
|
||||
const positions = document.getElementById('draftPositions');
|
||||
const label = document.getElementById('draftRoundLabel');
|
||||
const prevBtn = document.getElementById('draftPrevBtn');
|
||||
const nextBtn = document.getElementById('draftNextBtn');
|
||||
|
||||
if (!positions || !label) return;
|
||||
|
||||
label.textContent = `${draftCurrentRound} / ${draftTotalRounds}`;
|
||||
if (prevBtn) prevBtn.disabled = draftCurrentRound <= 1;
|
||||
if (nextBtn) nextBtn.disabled = draftCurrentRound >= draftTotalRounds;
|
||||
|
||||
const players = round ? round.players : [];
|
||||
let html = '';
|
||||
for (let pos = 1; pos <= 6; pos++) {
|
||||
const player = players[pos - 1];
|
||||
if (player) {
|
||||
html += `<div class="draft-position-row" onclick="selectParticipant(${player.id})">
|
||||
<div class="draft-position-num">${pos}</div>
|
||||
<div class="draft-position-name">${player.name}</div>
|
||||
</div>`;
|
||||
} else {
|
||||
html += `<div class="draft-position-row empty">
|
||||
<div class="draft-position-num">${pos}</div>
|
||||
<div class="draft-position-name">—</div>
|
||||
</div>`;
|
||||
}
|
||||
}
|
||||
positions.innerHTML = html;
|
||||
}
|
||||
|
||||
async function draftChangeRound(direction) {
|
||||
const newRound = draftCurrentRound + direction;
|
||||
if (newRound < 1 || newRound > draftTotalRounds) return;
|
||||
|
||||
const prevBtn = document.getElementById('draftPrevBtn');
|
||||
const nextBtn = document.getElementById('draftNextBtn');
|
||||
if (prevBtn) prevBtn.disabled = true;
|
||||
if (nextBtn) nextBtn.disabled = true;
|
||||
|
||||
try {
|
||||
const response = await fetch(`/api/tournament/round/${newRound}`, {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' }
|
||||
});
|
||||
if (response.ok) {
|
||||
draftCurrentRound = newRound;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Round change failed:', e);
|
||||
}
|
||||
renderDraftPanel();
|
||||
}
|
||||
// TV draft toggle
|
||||
let currentTvView = 'cameras';
|
||||
|
||||
function updateTvDraftBtn(view) {
|
||||
currentTvView = view;
|
||||
const btn = document.getElementById('btnTvDraft');
|
||||
if (!btn) return;
|
||||
btn.style.background = (view === 'draft') ? '#28a745' : '';
|
||||
btn.style.color = (view === 'draft') ? 'white' : '';
|
||||
btn.style.borderColor = (view === 'draft') ? '#1e7e34' : '';
|
||||
btn.textContent = (view === 'draft') ? '📺 Skrij Razpored' : '📺 Pokaži Razpored';
|
||||
}
|
||||
|
||||
async function toggleTvDraft() {
|
||||
const newView = currentTvView === 'draft' ? 'cameras' : 'draft';
|
||||
try {
|
||||
await fetch('/api/tv/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ view: newView })
|
||||
});
|
||||
updateTvDraftBtn(newView);
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
fetch('/api/dashboard/state').then(r => r.json()).then(d => updateTvDraftBtn(d.tv_view || 'cameras')).catch(() => {});
|
||||
{% endif %}
|
||||
|
||||
// Keyboard shortcuts
|
||||
document.addEventListener('keydown', function(event) {
|
||||
if (event.ctrlKey && event.key === 's') {
|
||||
@@ -2091,7 +2341,12 @@
|
||||
|
||||
updateOverallProgress();
|
||||
updateOverallTens();
|
||||
|
||||
|
||||
// Initialize draft panel
|
||||
{% if tournament and tournament.rounds %}
|
||||
renderDraftPanel();
|
||||
{% endif %}
|
||||
|
||||
// Add input validation and navigation
|
||||
document.addEventListener('input', function(e) {
|
||||
if (e.target.classList.contains('shot-input')) {
|
||||
|
||||
@@ -620,37 +620,47 @@
|
||||
color: #333 !important;
|
||||
box-shadow: none !important;
|
||||
border: 2px solid #ddd !important;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
border-radius: 8px !important;
|
||||
padding: 16px 20px !important;
|
||||
margin-bottom: 16px;
|
||||
overflow: visible !important;
|
||||
position: static !important;
|
||||
}
|
||||
|
||||
.results-header::before {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.results-header * {
|
||||
position: static !important;
|
||||
z-index: auto !important;
|
||||
}
|
||||
|
||||
.header-logo {
|
||||
height: 60px !important;
|
||||
max-width: 160px !important;
|
||||
display: block !important;
|
||||
height: 50px !important;
|
||||
max-width: 140px !important;
|
||||
background-color: transparent !important;
|
||||
padding: 0 !important;
|
||||
border: none !important;
|
||||
filter: none !important;
|
||||
margin-bottom: 15px;
|
||||
}
|
||||
|
||||
.results-title {
|
||||
font-size: 24pt !important;
|
||||
font-weight: bold !important;
|
||||
color: #333 !important;
|
||||
text-shadow: none !important;
|
||||
backdrop-filter: none !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.results-subtitle {
|
||||
font-size: 14pt !important;
|
||||
color: #666 !important;
|
||||
.results-title {
|
||||
font-size: 20pt !important;
|
||||
font-weight: bold !important;
|
||||
color: #111 !important;
|
||||
text-shadow: none !important;
|
||||
margin-bottom: 15px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.results-subtitle {
|
||||
font-size: 11pt !important;
|
||||
color: #555 !important;
|
||||
text-shadow: none !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.results-meta {
|
||||
@@ -658,14 +668,14 @@
|
||||
}
|
||||
|
||||
.meta-number {
|
||||
color: #333 !important;
|
||||
font-size: 14pt !important;
|
||||
color: #111 !important;
|
||||
text-shadow: none !important;
|
||||
font-size: 16pt !important;
|
||||
}
|
||||
|
||||
.meta-label {
|
||||
font-size: 9pt !important;
|
||||
color: #666 !important;
|
||||
font-size: 10pt !important;
|
||||
}
|
||||
|
||||
.podium-section {
|
||||
@@ -707,9 +717,10 @@
|
||||
<div class="navbar-title">🏆 <span data-i18n="tournament.tournament_results">Tournament Results</span></div>
|
||||
</div>
|
||||
<div class="navbar-controls">
|
||||
<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" id="btnTvView" onclick="toggleTvView()" title="Preklopi pogled na TV zaslonu">📺</button>
|
||||
<a href="/" class="nav-btn">✕</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1048,6 +1059,55 @@
|
||||
window.print();
|
||||
}
|
||||
});
|
||||
|
||||
// ── TV VIEW TOGGLE ────────────────────────────────────────────────────────
|
||||
const isTvDisplay = new URLSearchParams(window.location.search).get('tv') === '1';
|
||||
let currentTvView = 'results';
|
||||
|
||||
function updateTvViewBtn(view) {
|
||||
currentTvView = view;
|
||||
const btn = document.getElementById('btnTvView');
|
||||
if (!btn) return;
|
||||
btn.style.background = (view === 'results') ? '#28a745' : '';
|
||||
btn.style.color = (view === 'results') ? 'white' : '';
|
||||
btn.style.borderColor= (view === 'results') ? '#1e7e34' : '';
|
||||
}
|
||||
|
||||
async function toggleTvView() {
|
||||
const newView = currentTvView === 'results' ? 'cameras' : 'results';
|
||||
try {
|
||||
await fetch('/api/tv/view', {
|
||||
method: 'POST',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ view: newView })
|
||||
});
|
||||
updateTvViewBtn(newView);
|
||||
if (isTvDisplay && newView === 'cameras') {
|
||||
window.location.href = '/';
|
||||
}
|
||||
} catch (e) { console.error(e); }
|
||||
}
|
||||
|
||||
// Poll to stay in sync and follow back-redirect when in TV mode
|
||||
let lastResultsStateHash = null;
|
||||
setInterval(async () => {
|
||||
if (document.visibilityState !== 'visible') return;
|
||||
try {
|
||||
const r = await fetch('/api/dashboard/state');
|
||||
if (!r.ok) return;
|
||||
const d = await r.json();
|
||||
updateTvViewBtn(d.tv_view || 'cameras');
|
||||
if (isTvDisplay && d.tv_view !== 'results') {
|
||||
if (d.tv_view === 'draft' && d.tournament_active) {
|
||||
window.location.href = '/tournament/draft?tv=1';
|
||||
} else {
|
||||
window.location.href = '/';
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
}, 3000);
|
||||
|
||||
fetch('/api/dashboard/state').then(r => r.json()).then(d => updateTvViewBtn(d.tv_view || 'cameras')).catch(() => {});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
+607
-594
File diff suppressed because it is too large
Load Diff
@@ -79,6 +79,7 @@ def load_results():
|
||||
def save_results(results_data):
|
||||
return ResultsStorage.save_results(results_data)
|
||||
|
||||
|
||||
def archive_tournament(tournament_data, results_data):
|
||||
return ArchiveStorage.archive_tournament(tournament_data, results_data)
|
||||
|
||||
@@ -1010,7 +1011,6 @@ def tournament():
|
||||
players_data = load_players()
|
||||
tournament_state = load_tournament_state()
|
||||
league_state = load_league_state()
|
||||
|
||||
return render_template('tournament.html',
|
||||
players=players_data['players'],
|
||||
tournament_state=tournament_state,
|
||||
@@ -1500,6 +1500,25 @@ def reset_tournament():
|
||||
except Exception as e:
|
||||
return jsonify({'status': 'error', 'message': str(e)}), 400
|
||||
|
||||
|
||||
@app.route('/api/tournament/cancel', methods=['POST'])
|
||||
def cancel_league_tournament():
|
||||
"""Cancel the current tournament within a league, rolling back the tournament counter"""
|
||||
try:
|
||||
if os.path.exists(TOURNAMENT_FILE):
|
||||
os.remove(TOURNAMENT_FILE)
|
||||
if os.path.exists(RESULTS_FILE):
|
||||
os.remove(RESULTS_FILE)
|
||||
# Roll back league's current_tournament counter
|
||||
league_state = load_league_state()
|
||||
if league_state and league_state.get('current_tournament', 1) > 1:
|
||||
league_state['current_tournament'] -= 1
|
||||
save_league_state(league_state)
|
||||
return jsonify({'status': 'success'})
|
||||
except Exception as e:
|
||||
return jsonify({'status': 'error', 'message': str(e)}), 400
|
||||
|
||||
|
||||
# RESULTS API Routes (Updated)
|
||||
@app.route('/api/results/participant/<int:player_id>', methods=['POST'])
|
||||
def update_participant_scores(player_id):
|
||||
@@ -1736,6 +1755,10 @@ def api_dashboard_state():
|
||||
"""Get current dashboard state for polling updates (TV display sync)"""
|
||||
tournament_state = load_tournament_state()
|
||||
league_state = load_league_state()
|
||||
results = load_results()
|
||||
|
||||
tournament_finished = results.get('tournament_finished', False) if results else False
|
||||
league_finished = league_state.get('league_finished', False) if league_state else False
|
||||
|
||||
response_data = {
|
||||
'tournament_active': tournament_state is not None,
|
||||
@@ -1744,7 +1767,9 @@ def api_dashboard_state():
|
||||
'league_active': league_state is not None,
|
||||
'league_tournament': None,
|
||||
'league_total': None,
|
||||
'player_names': []
|
||||
'player_names': [],
|
||||
'tournament_finished': tournament_finished,
|
||||
'league_finished': league_finished,
|
||||
}
|
||||
|
||||
if tournament_state:
|
||||
@@ -1769,8 +1794,56 @@ def api_dashboard_state():
|
||||
response_data['league_tournament'] = league_state.get('current_tournament', 1)
|
||||
response_data['league_total'] = league_state.get('total_tournaments', 6)
|
||||
|
||||
settings = load_settings()
|
||||
response_data['tv_view'] = settings.get('tv_view', 'cameras')
|
||||
response_data['tv_url'] = settings.get('tv_url')
|
||||
|
||||
response_data['event_active'] = False
|
||||
response_data['event_player_names'] = []
|
||||
|
||||
# When no active tournament/results, expose latest archive filename so clients can redirect correctly
|
||||
response_data['archive_filename'] = None
|
||||
response_data['league_archive_filename'] = None
|
||||
if not tournament_state and not results:
|
||||
try:
|
||||
archive_files = sorted(
|
||||
glob.glob(os.path.join(ARCHIVE_DIR, 'tournament_*.json')),
|
||||
key=os.path.getmtime, reverse=True
|
||||
)
|
||||
if archive_files:
|
||||
response_data['archive_filename'] = os.path.basename(archive_files[0])
|
||||
except Exception:
|
||||
pass
|
||||
try:
|
||||
league_archive_files = sorted(
|
||||
glob.glob(os.path.join(LEAGUE_ARCHIVE_DIR, 'league_*.json')),
|
||||
key=os.path.getmtime, reverse=True
|
||||
)
|
||||
if league_archive_files:
|
||||
response_data['league_archive_filename'] = os.path.basename(league_archive_files[0])
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return jsonify(response_data)
|
||||
|
||||
@app.route('/api/tv/view', methods=['POST'])
|
||||
def set_tv_view():
|
||||
"""Set the desired TV display view (cameras or draft)"""
|
||||
data = request.get_json() or {}
|
||||
view = data.get('view', 'cameras')
|
||||
if view not in ('cameras', 'draft', 'results'):
|
||||
return jsonify({'status': 'error', 'message': 'Invalid view'}), 400
|
||||
settings = load_settings()
|
||||
settings['tv_view'] = view
|
||||
# Optional explicit URL for the TV to navigate to (e.g. a specific league archive)
|
||||
tv_url = data.get('tv_url')
|
||||
if tv_url:
|
||||
settings['tv_url'] = tv_url
|
||||
elif view == 'cameras':
|
||||
settings.pop('tv_url', None)
|
||||
save_settings(settings)
|
||||
return jsonify({'status': 'success', 'tv_view': view})
|
||||
|
||||
# Add this route to your Flask app (around line 850, with the other mobile routes)
|
||||
|
||||
@app.route('/mobile/remote')
|
||||
|
||||
Reference in New Issue
Block a user