new translation fix and some overall imrpovement to how the tournament and league workflow works.
This commit is contained in:
@@ -4,86 +4,13 @@
|
||||
<meta charset="UTF-8" />
|
||||
<title data-i18n="scoring.results_calculator">Results Calculator</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">
|
||||
<link rel="stylesheet" href="/static/css/buttons.css">
|
||||
<link rel="stylesheet" href="/static/css/components.css">
|
||||
<link rel="stylesheet" href="/static/css/responsive.css">
|
||||
<style>
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background: #f5f5f5;
|
||||
font-family: Arial, sans-serif;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background: white;
|
||||
color: black;
|
||||
padding: 15px 25px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px solid #ccc;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.navbar-title {
|
||||
font-size: 1.8rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.navbar-controls {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.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: #007bff;
|
||||
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
|
||||
transform: translateY(-1px);
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.nav-btn.active {
|
||||
background: #007bff;
|
||||
border-color: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.active:hover {
|
||||
background: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.danger {
|
||||
background: #dc3545;
|
||||
border-color: #c82333;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.danger:hover {
|
||||
background: #c82333;
|
||||
color: white;
|
||||
}
|
||||
|
||||
/* Results Calculator specific styles */
|
||||
.container {
|
||||
max-width: 1000px;
|
||||
margin: 0 auto;
|
||||
@@ -409,7 +336,7 @@
|
||||
|
||||
.targets-grid {
|
||||
display: grid;
|
||||
gap: 10px;
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
max-width: 100%;
|
||||
}
|
||||
@@ -420,11 +347,11 @@
|
||||
}
|
||||
|
||||
.targets-grid.targets-20 {
|
||||
grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
||||
}
|
||||
|
||||
.targets-grid.targets-40 {
|
||||
grid-template-columns: repeat(auto-fit, minmax(70px, 1fr));
|
||||
grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
|
||||
}
|
||||
|
||||
/* Responsive adjustments */
|
||||
@@ -483,7 +410,7 @@
|
||||
.target-group {
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 8px;
|
||||
padding: 10px;
|
||||
padding: 15px 12px;
|
||||
background: #f8f9fa;
|
||||
text-align: center;
|
||||
}
|
||||
@@ -494,10 +421,10 @@
|
||||
}
|
||||
|
||||
.target-number {
|
||||
font-size: 0.8rem;
|
||||
font-size: 1rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
margin-bottom: 5px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.shots-container {
|
||||
@@ -512,17 +439,24 @@
|
||||
|
||||
.shot-input {
|
||||
width: 100%;
|
||||
padding: 6px;
|
||||
border: 1px solid #ddd;
|
||||
border-radius: 4px;
|
||||
padding: 12px 8px;
|
||||
border: 2px solid #ddd;
|
||||
border-radius: 6px;
|
||||
text-align: center;
|
||||
font-size: 0.9rem;
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
background-color: #ffffff;
|
||||
min-height: 45px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.shots-container.shots-5 .shot-input {
|
||||
padding: 4px;
|
||||
font-size: 0.8rem;
|
||||
padding: 10px 6px;
|
||||
font-size: 1rem;
|
||||
min-height: 40px;
|
||||
}
|
||||
|
||||
.shot-input:focus {
|
||||
@@ -668,6 +602,7 @@
|
||||
100% { transform: rotate(360deg); }
|
||||
}
|
||||
</style>
|
||||
<script src="/static/js/i18n.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div class="navbar">
|
||||
@@ -675,8 +610,6 @@
|
||||
<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="/archive/player-analysis" class="nav-btn">👤 <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="/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>
|
||||
</div>
|
||||
@@ -1347,20 +1280,20 @@
|
||||
|
||||
async function finishTournament() {
|
||||
const allCompleted = Object.values(results.participants).every(p => p.completed);
|
||||
|
||||
|
||||
if (!allCompleted) {
|
||||
alert('Please complete scoring for all participants before finishing the tournament.');
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (!confirm('Are you sure you want to finish the tournament? This will finalize all results and make them viewable.')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
const finishBtn = document.getElementById('finishBtn');
|
||||
finishBtn.disabled = true;
|
||||
finishBtn.textContent = '🔄 Finishing Tournament...';
|
||||
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/results/finish', {
|
||||
method: 'POST',
|
||||
@@ -1368,10 +1301,12 @@
|
||||
'Content-Type': 'application/json',
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
if (response.ok) {
|
||||
alert('Tournament finished successfully! Redirecting to results...');
|
||||
// Small delay to ensure the alert is seen
|
||||
const responseData = await response.json();
|
||||
|
||||
// Always show results first when tournament finishes
|
||||
alert('Tournament finished successfully! Showing results...');
|
||||
setTimeout(() => {
|
||||
window.location.href = '/results';
|
||||
}, 1000);
|
||||
@@ -1439,19 +1374,5 @@
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<!-- Internationalization Support -->
|
||||
<script src="/static/js/i18n.js"></script>
|
||||
<script>
|
||||
// Initialize translations with server data
|
||||
if (typeof {{ translations|tojson }} !== 'undefined') {
|
||||
currentTranslations = {{ translations|tojson }};
|
||||
currentLanguage = '{{ current_language }}';
|
||||
}
|
||||
// Apply translations when DOM is loaded
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
translatePage();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user