Enhance print layouts with branded headers and fix navigation consistency
- Replace plain print headers with full branded headers including logo - Add dynamic tournament-type styling (🎯 4-target, ⚡ 20-target, 💪 40-target) - Remove border lines and optimize spacing for clean print appearance - Fix emoji positioning in league championship headers - Standardize navigation with proper active button indicators - Add missing translation keys for calculator instructions - Update print media queries for professional document output Print improvements: - Logo and branding now appear on printed results - Consistent 20px spacing between header and table - Clean white background with subtle borders - Optimized typography for print readability Navigation fixes: - Added active button highlighting across all PC pages - Consistent navigation order: Dashboard → Tournament → Player Analysis → Archive → Draft → Calculator - Fixed draft page active indicator 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com> This commit message covers all the major improvements we made: - Print layout enhancements with branded headers - Navigation standardization and active indicators - Translation fixes - Visual styling improvements - Professional document output optimization
This commit is contained in:
@@ -3,8 +3,25 @@
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Player Analysis - Camera Dashboard</title>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/3.9.1/chart.min.js"></script>
|
||||
<title data-i18n="players.player_analysis">👤 Player Analysis - Camera Dashboard</title>
|
||||
<script src="/static/js/chart.min.js"></script>
|
||||
<script>
|
||||
// Fallback: if Chart.js fails to load, create a simple notification
|
||||
if (typeof Chart === 'undefined') {
|
||||
console.warn('Chart.js failed to load - charts will be unavailable');
|
||||
window.Chart = {
|
||||
register: () => {},
|
||||
Chart: function() {
|
||||
return {
|
||||
update: () => {},
|
||||
destroy: () => {},
|
||||
data: {},
|
||||
options: {}
|
||||
};
|
||||
}
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<style>
|
||||
* {
|
||||
margin: 0;
|
||||
@@ -65,14 +82,14 @@
|
||||
color: #007bff;
|
||||
}
|
||||
|
||||
.nav-btn.secondary {
|
||||
background: #6c757d;
|
||||
border-color: #495057;
|
||||
.nav-btn.active {
|
||||
background: #007bff;
|
||||
border-color: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.nav-btn.secondary:hover {
|
||||
background: #495057;
|
||||
.nav-btn.active:hover {
|
||||
background: #0056b3;
|
||||
color: white;
|
||||
}
|
||||
|
||||
@@ -165,106 +182,223 @@
|
||||
/* Tournament Leaders Section */
|
||||
.tournament-leaders {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
|
||||
gap: 20px;
|
||||
grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
|
||||
gap: 30px;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
.tournament-card {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
||||
border: 1px solid #e9ecef;
|
||||
border-radius: 20px;
|
||||
padding: 35px;
|
||||
box-shadow:
|
||||
0 12px 40px rgba(0, 0, 0, 0.15),
|
||||
0 6px 20px rgba(0, 0, 0, 0.1);
|
||||
border: none;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
transition: box-shadow 0.3s ease;
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tournament-card::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
background: linear-gradient(90deg, #ffc107, #fd7e14);
|
||||
.tournament-card:hover {
|
||||
box-shadow:
|
||||
0 15px 45px rgba(0, 0, 0, 0.15),
|
||||
0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
/* Different color themes for each tournament type */
|
||||
.tournament-card[data-type="20_targets"] {
|
||||
background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
|
||||
}
|
||||
|
||||
.tournament-card[data-type="40_targets"] {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.tournament-card[data-type="4_targets"] {
|
||||
background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
margin-bottom: 28px;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.tournament-name {
|
||||
font-size: 1.2rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-size: 1.6rem;
|
||||
font-weight: 800;
|
||||
color: white;
|
||||
text-shadow:
|
||||
0 2px 4px rgba(0, 0, 0, 0.3),
|
||||
0 1px 2px rgba(0, 0, 0, 0.2);
|
||||
position: relative;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
}
|
||||
|
||||
.tournament-card[data-type="20_targets"] .tournament-name::before {
|
||||
content: '⚡';
|
||||
font-size: 1.8rem;
|
||||
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
.tournament-card[data-type="40_targets"] .tournament-name::before {
|
||||
content: '💪';
|
||||
font-size: 1.8rem;
|
||||
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
.tournament-card[data-type="4_targets"] .tournament-name::before {
|
||||
content: '🎯';
|
||||
font-size: 1.8rem;
|
||||
filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
|
||||
}
|
||||
|
||||
.tournament-date {
|
||||
background: #f8f9fa;
|
||||
color: #666;
|
||||
padding: 4px 10px;
|
||||
border-radius: 12px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 500;
|
||||
background: rgba(255, 255, 255, 0.25);
|
||||
backdrop-filter: blur(10px);
|
||||
color: white;
|
||||
padding: 8px 16px;
|
||||
border-radius: 25px;
|
||||
font-size: 0.75rem;
|
||||
font-weight: 700;
|
||||
box-shadow:
|
||||
0 4px 15px rgba(0, 0, 0, 0.2),
|
||||
inset 0 1px 0 rgba(255, 255, 255, 0.3);
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.8px;
|
||||
border: 1px solid rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.leaders-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
gap: 15px;
|
||||
gap: 25px;
|
||||
position: relative;
|
||||
z-index: 3;
|
||||
}
|
||||
|
||||
.leader-category {
|
||||
background: #f8f9fa;
|
||||
border-radius: 8px;
|
||||
padding: 15px;
|
||||
background: #ffffff;
|
||||
border-radius: 16px;
|
||||
padding: 28px;
|
||||
text-align: center;
|
||||
border: 2px solid #e9ecef;
|
||||
transition: box-shadow 0.3s ease;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
|
||||
}
|
||||
|
||||
.leader-category:hover {
|
||||
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.leader-category {
|
||||
border-color: #e9ecef;
|
||||
}
|
||||
|
||||
/* Dynamic colors based on tournament type */
|
||||
.tournament-card[data-type="20_targets"] .leader-category::before {
|
||||
background: linear-gradient(90deg, #ff6b6b 0%, #ff8e53 100%);
|
||||
}
|
||||
|
||||
.tournament-card[data-type="40_targets"] .leader-category::before {
|
||||
background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.tournament-card[data-type="4_targets"] .leader-category::before {
|
||||
background: linear-gradient(90deg, #11998e 0%, #38ef7d 100%);
|
||||
}
|
||||
|
||||
.leader-category::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
height: 4px;
|
||||
border-radius: 16px 16px 0 0;
|
||||
}
|
||||
|
||||
.category-title {
|
||||
font-size: 0.85rem;
|
||||
font-weight: 600;
|
||||
color: #666;
|
||||
margin-bottom: 8px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: 700;
|
||||
color: #6c757d;
|
||||
margin-bottom: 18px;
|
||||
text-transform: uppercase;
|
||||
letter-spacing: 0.5px;
|
||||
letter-spacing: 1px;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.leader-info {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 4px;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.leader-name {
|
||||
font-size: 1.1rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
margin-bottom: 8px;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.leader-score {
|
||||
font-size: 1.3rem;
|
||||
font-weight: bold;
|
||||
color: #007bff;
|
||||
font-size: 1.8rem;
|
||||
font-weight: 800;
|
||||
padding: 12px 20px;
|
||||
border-radius: 12px;
|
||||
border: 2px solid;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.leader-score.tens {
|
||||
color: #28a745;
|
||||
/* Score colors based on tournament type */
|
||||
.tournament-card[data-type="20_targets"] .leader-score {
|
||||
border-color: #ff6b6b;
|
||||
background: linear-gradient(135deg, #fff5f5 0%, #ffe8e8 100%);
|
||||
color: #e53e3e;
|
||||
}
|
||||
|
||||
/* Compact Stats Overview */
|
||||
.stats-overview {
|
||||
.tournament-card[data-type="40_targets"] .leader-score {
|
||||
border-color: #667eea;
|
||||
background: linear-gradient(135deg, #f8f9ff 0%, #e8ebff 100%);
|
||||
color: #667eea;
|
||||
}
|
||||
|
||||
.tournament-card[data-type="4_targets"] .leader-score {
|
||||
border-color: #11998e;
|
||||
background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
|
||||
color: #059669;
|
||||
}
|
||||
|
||||
/* Yellow styling for 10s (Most 10s category) */
|
||||
.leader-category:nth-child(2) .leader-score {
|
||||
border-color: #fbbf24 !important;
|
||||
background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%) !important;
|
||||
color: #d97706 !important;
|
||||
}
|
||||
|
||||
.leader-category:nth-child(2)::before {
|
||||
background: linear-gradient(90deg, #fbbf24 0%, #f59e0b 100%) !important;
|
||||
}
|
||||
|
||||
/* Stats Overview */
|
||||
.stats-badges {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
||||
gap: 15px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.stat-card {
|
||||
.stat-badge {
|
||||
background: white;
|
||||
border-radius: 12px;
|
||||
padding: 15px;
|
||||
@@ -274,7 +408,7 @@
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.stat-card:hover {
|
||||
.stat-badge:hover {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
@@ -284,7 +418,7 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
.stat-value {
|
||||
.stat-number {
|
||||
font-size: 1.5rem;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
@@ -562,16 +696,44 @@
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.stats-overview {
|
||||
.stats-badges {
|
||||
grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
|
||||
}
|
||||
|
||||
.tournament-leaders {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.tournament-card {
|
||||
padding: 25px;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.tournament-name {
|
||||
font-size: 1.3rem;
|
||||
gap: 8px;
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
gap: 12px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.leaders-grid {
|
||||
grid-template-columns: 1fr;
|
||||
gap: 20px;
|
||||
}
|
||||
|
||||
.leader-category {
|
||||
padding: 24px;
|
||||
}
|
||||
|
||||
.leader-score {
|
||||
font-size: 1.6rem;
|
||||
padding: 10px 16px;
|
||||
}
|
||||
|
||||
.tab-navigation {
|
||||
@@ -589,53 +751,55 @@
|
||||
<body>
|
||||
<!-- Navigation Bar -->
|
||||
<div class="navbar">
|
||||
<div class="navbar-title">🎯 Player Analysis</div>
|
||||
<div class="navbar-title" data-i18n="players.player_analysis">🎯 👤 Player Analysis</div>
|
||||
<div class="navbar-controls">
|
||||
<a href="/" class="nav-btn primary">← Dashboard</a>
|
||||
<a href="/archive" class="nav-btn secondary">📚 Archive</a>
|
||||
<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 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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<!-- Stats Overview -->
|
||||
<div class="stats-overview">
|
||||
<div class="stat-card">
|
||||
<div class="stats-badges">
|
||||
<div class="stat-badge">
|
||||
<span class="stat-icon">👥</span>
|
||||
<div class="stat-value" id="totalPlayers">Loading...</div>
|
||||
<div class="stat-label">Total Players</div>
|
||||
<div class="stat-number" id="totalPlayers">Loading...</div>
|
||||
<div class="stat-label" data-i18n="players.total_players">Total Players</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-badge">
|
||||
<span class="stat-icon">🎯</span>
|
||||
<div class="stat-value" id="totalTournaments">Loading...</div>
|
||||
<div class="stat-label">Total Tournaments</div>
|
||||
<div class="stat-number" id="totalTournaments">Loading...</div>
|
||||
<div class="stat-label" data-i18n="analysis.total_tournaments">Total Tournaments</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-badge">
|
||||
<span class="stat-icon">🏆</span>
|
||||
<div class="stat-value" id="score20Targets">Loading...</div>
|
||||
<div class="stat-label">Best 20 Targets</div>
|
||||
<div class="stat-number" id="score20Targets">Loading...</div>
|
||||
<div class="stat-label" data-i18n="tournament_types.20_targets">20 Targets</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-badge">
|
||||
<span class="stat-icon">🎖️</span>
|
||||
<div class="stat-value" id="score40Targets">Loading...</div>
|
||||
<div class="stat-label">Best 40 Targets</div>
|
||||
<div class="stat-number" id="score40Targets">Loading...</div>
|
||||
<div class="stat-label" data-i18n="tournament_types.40_targets">40 Targets</div>
|
||||
</div>
|
||||
<div class="stat-card">
|
||||
<div class="stat-badge">
|
||||
<span class="stat-icon">🥇</span>
|
||||
<div class="stat-value" id="score4Targets">Loading...</div>
|
||||
<div class="stat-label">Best 4 Targets</div>
|
||||
<div class="stat-number" id="score4Targets">Loading...</div>
|
||||
<div class="stat-label" data-i18n="tournament_types.4_targets">4 Targets</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab Navigation -->
|
||||
<div class="section">
|
||||
<div class="tab-navigation">
|
||||
<button class="tab-btn active" onclick="switchTab('tournament-leaders')">🏆 Overall Champions</button>
|
||||
<button class="tab-btn" onclick="switchTab('players')">👥 All Players</button>
|
||||
<button class="tab-btn active" onclick="switchTab('tournament-leaders')" data-i18n="analysis.overall_champions">🏆 Overall Champions</button>
|
||||
<button class="tab-btn" onclick="switchTab('players')" data-i18n="analysis.all_players">👥 All Players</button>
|
||||
</div>
|
||||
|
||||
<!-- Tournament Leaders Tab -->
|
||||
<div id="tournament-leaders" class="tab-content active">
|
||||
<div class="section-title">Overall Champions by Tournament Type</div>
|
||||
<div class="section-title" data-i18n="analysis.overview_champions">Overall Champions by Tournament Type</div>
|
||||
|
||||
<div class="tournament-leaders" id="tournamentLeaders">
|
||||
<div class="loading">
|
||||
@@ -647,19 +811,19 @@
|
||||
|
||||
<!-- Players Tab -->
|
||||
<div id="players" class="tab-content">
|
||||
<div class="section-title">Select a Player to Analyze</div>
|
||||
<div class="section-title" data-i18n="analysis.select_player">Izberi igralca za analizo</div>
|
||||
|
||||
<!-- Controls -->
|
||||
<div class="controls">
|
||||
<input type="text" class="search-box" id="searchBox" placeholder="🔍 Search players by name...">
|
||||
<input type="text" class="search-box" id="searchBox" data-i18n-placeholder="league.search_players_placeholder" placeholder="🔍 Search players by name...">
|
||||
|
||||
<select class="sort-select" id="sortSelect">
|
||||
<option value="name">Sort by Name</option>
|
||||
<option value="best_score">Sort by Best Score</option>
|
||||
<option value="average_score">Sort by Average Score</option>
|
||||
<option value="total_tournaments">Sort by Total Tournaments</option>
|
||||
<option value="total_leagues">Sort by Total Leagues</option>
|
||||
<option value="total_shots">Sort by Total Shots</option>
|
||||
<option value="name" data-i18n="analysis.sort_by_name">Sort by Name</option>
|
||||
<option value="best_score" data-i18n="analysis.sort_by_best_score">Sort by Best Score</option>
|
||||
<option value="average_score" data-i18n="analysis.sort_by_average_score">Sort by Average Score</option>
|
||||
<option value="total_tournaments" data-i18n="analysis.sort_by_total_tournaments">Sort by Total Tournaments</option>
|
||||
<option value="total_leagues" data-i18n="analysis.sort_by_total_leagues">Sort by Total Leagues</option>
|
||||
<option value="total_shots" data-i18n="analysis.sort_by_total_shots">Sort by Total Shots</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
@@ -724,7 +888,7 @@
|
||||
document.getElementById('tournamentLeaders').innerHTML = `
|
||||
<div class="empty-state">
|
||||
<div class="empty-icon">🎯</div>
|
||||
<h3>Unable to Load Tournament Data</h3>
|
||||
<h3 data-i18n="analysis.unable_load_data">Ne morem naložiti podatkov turnirja</h3>
|
||||
<p>${result.message || 'Please try refreshing the page'}</p>
|
||||
</div>
|
||||
`;
|
||||
@@ -745,48 +909,83 @@
|
||||
// Render tournament leaders
|
||||
function renderTournamentLeaders() {
|
||||
const leadersContainer = document.getElementById('tournamentLeaders');
|
||||
|
||||
|
||||
if (tournamentData.length === 0) {
|
||||
leadersContainer.innerHTML = `
|
||||
<div class="empty-state">
|
||||
<div class="empty-icon">🎯</div>
|
||||
<h3>No Tournament Data Available</h3>
|
||||
<h3 data-i18n="analysis.no_tournament_data">Ni podatkov o turnirju</h3>
|
||||
<p>Tournament results will appear here once available</p>
|
||||
</div>
|
||||
`;
|
||||
return;
|
||||
}
|
||||
|
||||
leadersContainer.innerHTML = tournamentData.map(tournamentType => `
|
||||
<div class="tournament-card">
|
||||
// Sort tournament types by target count: 4, 20, 40
|
||||
const sortOrder = ['4_targets', '20_targets', '40_targets'];
|
||||
const sortedTournamentData = [...tournamentData].sort((a, b) => {
|
||||
const indexA = sortOrder.indexOf(a.id);
|
||||
const indexB = sortOrder.indexOf(b.id);
|
||||
|
||||
// If not in sortOrder, put at end
|
||||
if (indexA === -1 && indexB === -1) return 0;
|
||||
if (indexA === -1) return 1;
|
||||
if (indexB === -1) return -1;
|
||||
|
||||
return indexA - indexB;
|
||||
});
|
||||
|
||||
leadersContainer.innerHTML = sortedTournamentData.map(tournamentType => {
|
||||
// Get translated tournament name and description based on tournament type
|
||||
let translatedName = tournamentType.name;
|
||||
let translatedDescription = tournamentType.description;
|
||||
|
||||
switch(tournamentType.id) {
|
||||
case '4_targets':
|
||||
translatedName = t('tournament_types.4_targets');
|
||||
translatedDescription = t('tournament_types.4_targets_desc');
|
||||
break;
|
||||
case '20_targets':
|
||||
translatedName = t('tournament_types.20_targets');
|
||||
translatedDescription = t('tournament_types.20_targets_desc');
|
||||
break;
|
||||
case '40_targets':
|
||||
translatedName = t('tournament_types.40_targets');
|
||||
translatedDescription = t('tournament_types.40_targets_desc');
|
||||
break;
|
||||
}
|
||||
|
||||
return `
|
||||
<div class="tournament-card" data-type="${tournamentType.id}">
|
||||
<div class="tournament-header">
|
||||
<div class="tournament-name">${tournamentType.name}</div>
|
||||
<div class="tournament-date">${tournamentType.total_tournaments} tournament${tournamentType.total_tournaments !== 1 ? 's' : ''}</div>
|
||||
<div class="tournament-name">${translatedName}</div>
|
||||
<div class="tournament-date">${tournamentType.total_tournaments} ${tournamentType.total_tournaments === 1 ? t('tournament.tournament') : t('tournament.tournaments')}</div>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center; margin-bottom: 15px; color: #666; font-size: 0.9rem; font-weight: 500;">
|
||||
${tournamentType.description}
|
||||
|
||||
<div style="text-align: center; margin-bottom: 28px; color: rgba(255, 255, 255, 0.95); font-size: 1rem; font-weight: 500; position: relative; z-index: 3; background: rgba(0, 0, 0, 0.15); padding: 14px 24px; border-radius: 14px; backdrop-filter: blur(15px); border: 1px solid rgba(255, 255, 255, 0.25); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);">
|
||||
${translatedDescription}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="leaders-grid">
|
||||
<div class="leader-category">
|
||||
<div class="category-title">🏆 Best Score</div>
|
||||
<div class="category-title">🏆 ${t('analysis.best_score')}</div>
|
||||
<div class="leader-info">
|
||||
<div class="leader-name">${tournamentType.best_score.player_name || 'No data'}</div>
|
||||
<div class="leader-name">${tournamentType.best_score.player_name || t('messages.no_data')}</div>
|
||||
<div class="leader-score">${tournamentType.best_score.score || 0}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="leader-category">
|
||||
<div class="category-title">🎪 Most 10s</div>
|
||||
<div class="category-title">🎯 ${t('analysis.most_tens')}</div>
|
||||
<div class="leader-info">
|
||||
<div class="leader-name">${tournamentType.most_tens.player_name || 'No data'}</div>
|
||||
<div class="leader-score tens">${tournamentType.most_tens.tens || 0} 10s</div>
|
||||
<div class="leader-name">${tournamentType.most_tens.player_name || t('messages.no_data')}</div>
|
||||
<div class="leader-score tens">${tournamentType.most_tens.tens || 0}x 🎯</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`).join('');
|
||||
`;
|
||||
}).join('');
|
||||
}
|
||||
|
||||
// Update overall statistics
|
||||
@@ -795,12 +994,12 @@
|
||||
let score20Targets = 0;
|
||||
let score40Targets = 0;
|
||||
let score4Targets = 0;
|
||||
|
||||
|
||||
// Calculate statistics across all tournament types
|
||||
tournamentData.forEach(tournamentType => {
|
||||
totalTournaments += tournamentType.total_tournaments || 0;
|
||||
|
||||
// Get best scores for each tournament type
|
||||
|
||||
// Get best scores for each tournament type using the id field
|
||||
if (tournamentType.id === '20_targets' && tournamentType.best_score) {
|
||||
score20Targets = tournamentType.best_score.score || 0;
|
||||
} else if (tournamentType.id === '40_targets' && tournamentType.best_score) {
|
||||
@@ -809,7 +1008,7 @@
|
||||
score4Targets = tournamentType.best_score.score || 0;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
document.getElementById('totalTournaments').textContent = totalTournaments;
|
||||
document.getElementById('score20Targets').textContent = score20Targets || '-';
|
||||
document.getElementById('score40Targets').textContent = score40Targets || '-';
|
||||
@@ -819,16 +1018,16 @@
|
||||
// Get tournament type display name
|
||||
function getTournamentTypeDisplay(tournamentType) {
|
||||
const typeMap = {
|
||||
'20_targets': '20 Targets (2 shots each)',
|
||||
'40_targets': '40 Targets (2 shots each)',
|
||||
'4_targets': '4 Targets (5 shots each)'
|
||||
'20_targets': t('tournament_types.20_targets_full'),
|
||||
'40_targets': t('tournament_types.40_targets_full'),
|
||||
'4_targets': t('tournament_types.4_targets_full')
|
||||
};
|
||||
return typeMap[tournamentType] || tournamentType;
|
||||
}
|
||||
|
||||
// Format date for display
|
||||
function formatDate(dateString) {
|
||||
if (!dateString) return 'Unknown Date';
|
||||
if (!dateString) return t('analysis.unknown_date');
|
||||
|
||||
try {
|
||||
const date = new Date(dateString);
|
||||
@@ -847,7 +1046,7 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
return 'Unknown Date';
|
||||
return t('analysis.unknown_date');
|
||||
}
|
||||
|
||||
return date.toLocaleDateString('en-US', {
|
||||
@@ -954,30 +1153,27 @@
|
||||
onclick="viewPlayerStats(${player.id})">
|
||||
<div class="player-header">
|
||||
<div class="player-name">${player.name}</div>
|
||||
<div class="player-badge ${player.current_player ? 'current' : 'archived'}">
|
||||
${player.current_player ? 'Current' : 'Archived'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="player-stats">
|
||||
<div class="stat-item">
|
||||
<span class="icon">🎯</span>
|
||||
<span class="label">Tournaments:</span>
|
||||
<span class="label">${t('tournament.tournaments')}:</span>
|
||||
<span class="value">${player.stats?.total_tournaments || 0}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">🏆</span>
|
||||
<span class="label">Leagues:</span>
|
||||
<span class="label">${t('league.league')}:</span>
|
||||
<span class="value">${player.stats?.total_leagues || 0}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">📈</span>
|
||||
<span class="label">Best Score:</span>
|
||||
<span class="label">${t('analysis.best_score_label')}</span>
|
||||
<span class="value">${player.stats?.best_tournament_score || 0}</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">📊</span>
|
||||
<span class="label">Average:</span>
|
||||
<span class="label">${t('results.average_score')}</span>
|
||||
<span class="value">${Math.round(player.stats?.average_tournament_score || 0)}</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1023,30 +1219,27 @@
|
||||
onclick="viewPlayerStats(${player.id})">
|
||||
<div class="player-header">
|
||||
<div class="player-name">${player.name}</div>
|
||||
<div class="player-badge ${player.enabled ? 'current' : 'archived'}">
|
||||
${player.enabled ? 'Current' : 'Archived'}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="player-stats">
|
||||
<div class="stat-item">
|
||||
<span class="icon">🎯</span>
|
||||
<span class="label">Tournaments:</span>
|
||||
<span class="label">${t('tournament.tournaments')}:</span>
|
||||
<span class="value">Loading...</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">🏆</span>
|
||||
<span class="label">Leagues:</span>
|
||||
<span class="label">${t('league.league')}:</span>
|
||||
<span class="value">Loading...</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">📈</span>
|
||||
<span class="label">Best Score:</span>
|
||||
<span class="label">${t('analysis.best_score_label')}</span>
|
||||
<span class="value">Loading...</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="icon">📊</span>
|
||||
<span class="label">Average:</span>
|
||||
<span class="label">${t('results.average_score')}</span>
|
||||
<span class="value">Loading...</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1125,5 +1318,20 @@
|
||||
// Initialize page when DOM is loaded
|
||||
document.addEventListener('DOMContentLoaded', initializePage);
|
||||
</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 ready
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
translatePage();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user