c61c1448e4
- 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
1068 lines
34 KiB
HTML
1068 lines
34 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title data-i18n="navigation.archive">📚 Arhiv</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<style>
|
|
* {
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
html, body {
|
|
margin: 0;
|
|
padding: 0;
|
|
background: #f5f5f5;
|
|
font-family: Arial, sans-serif;
|
|
min-height: 100vh;
|
|
}
|
|
|
|
/* Standardized Navigation Bar */
|
|
.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;
|
|
}
|
|
|
|
/* Standardized Container */
|
|
.container {
|
|
max-width: 1400px;
|
|
margin: 0 auto;
|
|
padding: 20px;
|
|
}
|
|
|
|
/* White Scrollbar for main page */
|
|
body::-webkit-scrollbar {
|
|
width: 12px;
|
|
}
|
|
|
|
body::-webkit-scrollbar-track {
|
|
background: white;
|
|
}
|
|
|
|
body::-webkit-scrollbar-thumb {
|
|
background: #e0e0e0;
|
|
border-radius: 6px;
|
|
border: 2px solid white;
|
|
}
|
|
|
|
body::-webkit-scrollbar-thumb:hover {
|
|
background: #c0c0c0;
|
|
}
|
|
|
|
.section {
|
|
background: white;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
padding: 20px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.section-title {
|
|
font-size: 1.3rem;
|
|
font-weight: bold;
|
|
color: #333;
|
|
margin-bottom: 15px;
|
|
border-bottom: 3px solid #007bff;
|
|
padding-bottom: 5px;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.section-controls {
|
|
display: flex;
|
|
gap: 10px;
|
|
align-items: center;
|
|
}
|
|
|
|
.filter-btn {
|
|
background: #f8f9fa;
|
|
border: 1px solid #dee2e6;
|
|
padding: 6px 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.filter-btn.active {
|
|
background: #007bff;
|
|
color: white;
|
|
border-color: #007bff;
|
|
}
|
|
|
|
.filter-btn:hover {
|
|
background: #e9ecef;
|
|
}
|
|
|
|
.filter-btn.active:hover {
|
|
background: #0056b3;
|
|
}
|
|
|
|
/* Stats Overview */
|
|
.stats-badges {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
gap: 15px;
|
|
margin-bottom: 20px;
|
|
}
|
|
|
|
.stat-badge {
|
|
background: white;
|
|
border-radius: 12px;
|
|
padding: 15px;
|
|
text-align: center;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
border: 1px solid #e9ecef;
|
|
transition: transform 0.3s ease;
|
|
}
|
|
|
|
.stat-badge:hover {
|
|
transform: translateY(-2px);
|
|
}
|
|
|
|
.stat-icon {
|
|
font-size: 1.5rem;
|
|
margin-bottom: 8px;
|
|
display: block;
|
|
}
|
|
|
|
.stat-number {
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
color: #333;
|
|
margin-bottom: 5px;
|
|
}
|
|
|
|
.stat-label {
|
|
color: #666;
|
|
font-size: 0.75rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
|
|
/* Enhanced Archive Grid */
|
|
.archive-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
|
|
gap: 20px;
|
|
}
|
|
|
|
.archive-card {
|
|
background: white;
|
|
border-radius: 12px;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
|
|
border: 1px solid #e9ecef;
|
|
transition: all 0.2s ease;
|
|
cursor: pointer;
|
|
overflow: hidden;
|
|
position: relative;
|
|
}
|
|
|
|
.archive-card:hover {
|
|
transform: translateY(-2px);
|
|
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
|
|
}
|
|
|
|
.archive-header {
|
|
background: #f8f9fa;
|
|
padding: 15px 20px;
|
|
border-bottom: 1px solid #e9ecef;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.archive-card.league .archive-header {
|
|
background: #e8f5e8;
|
|
}
|
|
|
|
.archive-card.tournament .archive-header {
|
|
background: #fff3cd;
|
|
}
|
|
|
|
.archive-card.tournament-40 .archive-header {
|
|
background: #f8d7da;
|
|
}
|
|
|
|
.archive-card.tournament-20 .archive-header {
|
|
background: #fff3cd;
|
|
}
|
|
|
|
.archive-card.tournament-4 .archive-header {
|
|
background: #d1edff;
|
|
}
|
|
|
|
.archive-card.tournament-other .archive-header {
|
|
background: #f8f9fa;
|
|
}
|
|
|
|
.archive-title {
|
|
font-size: 1.2rem;
|
|
font-weight: bold;
|
|
color: #333;
|
|
margin-bottom: 3px;
|
|
}
|
|
|
|
.archive-subtitle {
|
|
font-size: 0.85rem;
|
|
color: #666;
|
|
}
|
|
|
|
.archive-badge {
|
|
padding: 6px 12px;
|
|
border-radius: 15px;
|
|
font-size: 0.75rem;
|
|
font-weight: bold;
|
|
text-transform: uppercase;
|
|
}
|
|
|
|
.badge-league {
|
|
background: #28a745;
|
|
color: white;
|
|
}
|
|
|
|
.badge-tournament {
|
|
background: #ffc107;
|
|
color: #856404;
|
|
}
|
|
|
|
.badge-40-targets {
|
|
background: #dc3545;
|
|
color: white;
|
|
}
|
|
|
|
.badge-20-targets {
|
|
background: #ffc107;
|
|
color: #856404;
|
|
}
|
|
|
|
.badge-4-targets {
|
|
background: #17a2b8;
|
|
color: white;
|
|
}
|
|
|
|
.archive-content {
|
|
padding: 15px 20px;
|
|
}
|
|
|
|
.archive-info {
|
|
display: grid;
|
|
grid-template-columns: 1fr 1fr;
|
|
gap: 12px;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.info-item {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 6px;
|
|
font-size: 0.85rem;
|
|
color: #666;
|
|
}
|
|
|
|
.info-icon {
|
|
font-size: 1rem;
|
|
}
|
|
|
|
.info-value {
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
|
|
.archive-actions {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
gap: 8px;
|
|
padding-top: 12px;
|
|
border-top: 1px solid #f0f0f0;
|
|
}
|
|
|
|
.action-btn {
|
|
border: none;
|
|
padding: 8px 12px;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
font-size: 0.8rem;
|
|
font-weight: bold;
|
|
transition: all 0.2s ease;
|
|
text-decoration: none;
|
|
display: inline-block;
|
|
text-align: center;
|
|
}
|
|
|
|
.view-btn {
|
|
background: #007bff;
|
|
color: white;
|
|
flex: 1;
|
|
}
|
|
|
|
.view-btn:hover {
|
|
background: #0056b3;
|
|
transform: translateY(-1px);
|
|
}
|
|
|
|
.edit-btn {
|
|
background: #28a745;
|
|
color: white;
|
|
}
|
|
|
|
.edit-btn:hover {
|
|
background: #1e7e34;
|
|
}
|
|
|
|
.delete-btn {
|
|
background: #dc3545;
|
|
color: white;
|
|
}
|
|
|
|
.delete-btn:hover {
|
|
background: #c82333;
|
|
}
|
|
|
|
/* Empty State */
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 40px 20px;
|
|
color: #666;
|
|
}
|
|
|
|
.empty-state h3 {
|
|
font-size: 1.3rem;
|
|
margin-bottom: 8px;
|
|
color: #333;
|
|
}
|
|
|
|
.empty-icon {
|
|
font-size: 3rem;
|
|
margin-bottom: 15px;
|
|
opacity: 0.5;
|
|
}
|
|
|
|
/* Modal Styles */
|
|
.modal-overlay {
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0, 0, 0, 0.5);
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
z-index: 1000;
|
|
opacity: 0;
|
|
visibility: hidden;
|
|
transition: all 0.2s ease;
|
|
}
|
|
|
|
.modal-overlay.active {
|
|
opacity: 1;
|
|
visibility: visible;
|
|
}
|
|
|
|
.modal {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 20px;
|
|
max-width: 500px;
|
|
width: 90%;
|
|
max-height: 80vh;
|
|
overflow-y: auto;
|
|
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
|
|
transform: scale(0.9);
|
|
transition: transform 0.2s ease;
|
|
}
|
|
|
|
.modal-overlay.active .modal {
|
|
transform: scale(1);
|
|
}
|
|
|
|
.modal-title {
|
|
font-size: 1.1rem;
|
|
font-weight: bold;
|
|
color: #333;
|
|
margin-bottom: 15px;
|
|
}
|
|
|
|
.modal-message {
|
|
color: #666;
|
|
margin-bottom: 15px;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.modal-buttons {
|
|
display: flex;
|
|
gap: 10px;
|
|
justify-content: flex-end;
|
|
margin-top: 20px;
|
|
}
|
|
|
|
.modal-btn {
|
|
padding: 8px 15px;
|
|
border: none;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-weight: 500;
|
|
transition: background-color 0.2s ease;
|
|
}
|
|
|
|
.modal-btn.cancel {
|
|
background: #6c757d;
|
|
color: white;
|
|
}
|
|
|
|
.modal-btn.cancel:hover {
|
|
background: #5a6268;
|
|
}
|
|
|
|
.modal-btn.confirm {
|
|
background: #dc3545;
|
|
color: white;
|
|
}
|
|
|
|
.modal-btn.confirm:hover {
|
|
background: #c82333;
|
|
}
|
|
|
|
.modal-btn.primary {
|
|
background: #007bff;
|
|
color: white;
|
|
}
|
|
|
|
.modal-btn.primary:hover {
|
|
background: #0056b3;
|
|
}
|
|
|
|
/* Edit Form Styles */
|
|
.edit-form {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 15px;
|
|
}
|
|
|
|
.form-group {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 5px;
|
|
}
|
|
|
|
.form-label {
|
|
font-weight: bold;
|
|
color: #333;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.form-input {
|
|
padding: 8px 12px;
|
|
border: 1px solid #ddd;
|
|
border-radius: 4px;
|
|
font-size: 0.9rem;
|
|
}
|
|
|
|
.form-input:focus {
|
|
outline: none;
|
|
border-color: #007bff;
|
|
}
|
|
|
|
.form-select {
|
|
padding: 8px 12px;
|
|
border: 1px solid #ddd;
|
|
border-radius: 4px;
|
|
font-size: 0.9rem;
|
|
background: white;
|
|
}
|
|
|
|
.form-select:focus {
|
|
outline: none;
|
|
border-color: #007bff;
|
|
}
|
|
|
|
/* Hidden class for filtering */
|
|
.hidden {
|
|
display: none !important;
|
|
}
|
|
|
|
/* Mobile responsive */
|
|
@media (max-width: 768px) {
|
|
.navbar {
|
|
padding: 12px 20px;
|
|
flex-direction: column;
|
|
gap: 15px;
|
|
}
|
|
|
|
.navbar-controls {
|
|
flex-wrap: wrap;
|
|
justify-content: center;
|
|
}
|
|
|
|
.container {
|
|
padding: 15px;
|
|
height: auto;
|
|
}
|
|
|
|
.archive-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.stats-badges {
|
|
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
|
|
}
|
|
|
|
.archive-header {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 8px;
|
|
}
|
|
|
|
.archive-info {
|
|
grid-template-columns: 1fr;
|
|
gap: 8px;
|
|
}
|
|
|
|
.archive-actions {
|
|
flex-direction: column;
|
|
align-items: stretch;
|
|
gap: 8px;
|
|
}
|
|
|
|
.action-btn {
|
|
text-align: center;
|
|
}
|
|
|
|
.section-title {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 10px;
|
|
}
|
|
|
|
.section-controls {
|
|
flex-wrap: wrap;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<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="/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 active">📚 <span data-i18n="navigation.archive">Archive</span></a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="container">
|
|
<!-- Stats Overview -->
|
|
<div class="stats-badges">
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">🎖️</span>
|
|
<div class="stat-number">{{ leagues|length if leagues else 0 }}</div>
|
|
<div class="stat-label" data-i18n="league.completed_leagues">Zaključene Lige</div>
|
|
</div>
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">🏆</span>
|
|
<div class="stat-number">{{ tournaments|length if tournaments else 0 }}</div>
|
|
<div class="stat-label" data-i18n="analysis.total_tournaments">Skupaj Turnirjev</div>
|
|
</div>
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">💪</span>
|
|
<div class="stat-number">{{ tournaments|selectattr('tournament_type', 'equalto', '40_targets')|list|length if tournaments else 0 }}</div>
|
|
<div class="stat-label" data-i18n="tournament_types.40_target_tournaments">40-Tarčni Turnirji</div>
|
|
</div>
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">⚡</span>
|
|
<div class="stat-number">{{ tournaments|selectattr('tournament_type', 'equalto', '20_targets')|list|length if tournaments else 0 }}</div>
|
|
<div class="stat-label" data-i18n="tournament_types.20_target_tournaments">20-Tarčni Turnirji</div>
|
|
</div>
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">🎯</span>
|
|
<div class="stat-number">{{ tournaments|selectattr('tournament_type', 'equalto', '4_targets')|list|length if tournaments else 0 }}</div>
|
|
<div class="stat-label" data-i18n="tournament_types.4_target_tournaments">4-Tarčni Turnirji</div>
|
|
</div>
|
|
<div class="stat-badge">
|
|
<span class="stat-icon">👥</span>
|
|
<div class="stat-number">{{ stats.total_players if stats else 0 }}</div>
|
|
<div class="stat-label" data-i18n="players.enabled_players">Omogočeni Igralci</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Leagues Section -->
|
|
{% if leagues %}
|
|
<div class="section">
|
|
<div class="section-title">
|
|
<span data-i18n="messages.league_championships">🎖️ Ligaška Prvenstva</span>
|
|
</div>
|
|
<div class="archive-grid" id="leagues-grid">
|
|
{% for league in leagues %}
|
|
<div class="archive-card league" data-status="{{ 'completed' if league.completed_tournaments == league.total_tournaments else 'incomplete' }}" data-date="{{ league.archived_at }}" onclick="viewLeague('{{ league.filename }}')">
|
|
<div class="archive-header">
|
|
<div>
|
|
<div class="archive-title" data-i18n="messages.league_championship">League Championship</div>
|
|
<div class="archive-subtitle">{{ league.created_at[:10] if league.created_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</div>
|
|
</div>
|
|
<span class="archive-badge badge-league" data-i18n="league.league">Liga</span>
|
|
</div>
|
|
<div class="archive-content">
|
|
<div class="archive-info">
|
|
<div class="info-item">
|
|
<span class="info-icon">👥</span>
|
|
<span class="info-value">{{ league.participants_count }} <span data-i18n="players.players_label">players</span></span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🎯</span>
|
|
<span class="info-value">{{ league.tournament_type.replace('_', ' ')|title }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">📅</span>
|
|
<span class="info-value">{{ league.archived_at[:10] if league.archived_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">✅</span>
|
|
<span class="info-value">{{ league.completed_tournaments }}/{{ league.total_tournaments }} <span data-i18n="tournament.tournaments">tournaments</span></span>
|
|
</div>
|
|
</div>
|
|
<div class="archive-actions">
|
|
<a href="/archive/league/{{ league.filename }}" class="action-btn view-btn">🏆 <span data-i18n="general.view">View</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Tournaments Section - Organized by Target Count -->
|
|
{% if tournaments %}
|
|
|
|
<!-- 40-Target Tournaments -->
|
|
{% set tournaments_40 = tournaments|selectattr('tournament_type', 'equalto', '40_targets')|list %}
|
|
{% if tournaments_40 %}
|
|
<div class="section">
|
|
<div class="section-title">
|
|
<span data-i18n="tournament_types.40_target_tournaments">💪 40-Tarčni Turnirji</span>
|
|
</div>
|
|
<div class="archive-grid" id="tournaments-40-grid">
|
|
{% for tournament in tournaments_40 %}
|
|
<div class="archive-card tournament-40" data-status="{{ 'finished' if tournament.tournament_finished else 'incomplete' }}" data-date="{{ tournament.archived_at }}" data-targets="40" onclick="viewTournament('{{ tournament.filename }}')">
|
|
<div class="archive-header">
|
|
<div>
|
|
<div class="archive-title" data-i18n="messages.40_target_tournament">40-Tarčni Turnir</div>
|
|
<div class="archive-subtitle">{{ tournament.created_at[:10] if tournament.created_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</div>
|
|
</div>
|
|
<span class="archive-badge badge-40-targets" data-i18n="tournament_types.40_targets">40 Targets</span>
|
|
</div>
|
|
<div class="archive-content">
|
|
<div class="archive-info">
|
|
<div class="info-item">
|
|
<span class="info-icon">👥</span>
|
|
<span class="info-value">{{ tournament.participants_count }} <span data-i18n="players.players_label">players</span></span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🎯</span>
|
|
<span class="info-value">{{ tournament.tournament_type.replace('_', ' ')|title }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">📅</span>
|
|
<span class="info-value">{{ tournament.archived_at[:10] if tournament.archived_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🏁</span>
|
|
<span class="info-value">{{ (translations.tournament.finished if translations else 'Finished') if tournament.tournament_finished else (translations.scoring.in_progress if translations else 'Incomplete') }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="archive-actions">
|
|
<a href="/archive/tournament/{{ tournament.filename }}" class="action-btn view-btn">📊 <span data-i18n="general.view">View</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- 20-Target Tournaments -->
|
|
{% set tournaments_20 = tournaments|selectattr('tournament_type', 'equalto', '20_targets')|list %}
|
|
{% if tournaments_20 %}
|
|
<div class="section">
|
|
<div class="section-title">
|
|
<span data-i18n="tournament_types.20_target_tournaments">⚡ 20-Tarčni Turnirji</span>
|
|
</div>
|
|
<div class="archive-grid" id="tournaments-20-grid">
|
|
{% for tournament in tournaments_20 %}
|
|
<div class="archive-card tournament-20" data-status="{{ 'finished' if tournament.tournament_finished else 'incomplete' }}" data-date="{{ tournament.archived_at }}" data-targets="20" onclick="viewTournament('{{ tournament.filename }}')">
|
|
<div class="archive-header">
|
|
<div>
|
|
<div class="archive-title" data-i18n="messages.20_target_tournament">20-Tarčni Turnir</div>
|
|
<div class="archive-subtitle">{{ tournament.created_at[:10] if tournament.created_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</div>
|
|
</div>
|
|
<span class="archive-badge badge-20-targets" data-i18n="tournament_types.20_targets">20 Targets</span>
|
|
</div>
|
|
<div class="archive-content">
|
|
<div class="archive-info">
|
|
<div class="info-item">
|
|
<span class="info-icon">👥</span>
|
|
<span class="info-value">{{ tournament.participants_count }} <span data-i18n="players.players_label">players</span></span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🎯</span>
|
|
<span class="info-value">{{ tournament.tournament_type.replace('_', ' ')|title }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">📅</span>
|
|
<span class="info-value">{{ tournament.archived_at[:10] if tournament.archived_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🏁</span>
|
|
<span class="info-value">{{ (translations.tournament.finished if translations else 'Finished') if tournament.tournament_finished else (translations.scoring.in_progress if translations else 'Incomplete') }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="archive-actions">
|
|
<a href="/archive/tournament/{{ tournament.filename }}" class="action-btn view-btn">📊 <span data-i18n="general.view">View</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- 4-Target Tournaments -->
|
|
{% set tournaments_4 = tournaments|selectattr('tournament_type', 'equalto', '4_targets')|list %}
|
|
{% if tournaments_4 %}
|
|
<div class="section">
|
|
<div class="section-title">
|
|
<span data-i18n="tournament_types.4_target_tournaments">🎯 4-Tarčni Turnirji</span>
|
|
</div>
|
|
<div class="archive-grid" id="tournaments-4-grid">
|
|
{% for tournament in tournaments_4 %}
|
|
<div class="archive-card tournament-4" data-status="{{ 'finished' if tournament.tournament_finished else 'incomplete' }}" data-date="{{ tournament.archived_at }}" data-targets="4" onclick="viewTournament('{{ tournament.filename }}')">
|
|
<div class="archive-header">
|
|
<div>
|
|
<div class="archive-title" data-i18n="messages.4_target_tournament">4-Tarčni Turnir</div>
|
|
<div class="archive-subtitle">{{ tournament.created_at[:10] if tournament.created_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</div>
|
|
</div>
|
|
<span class="archive-badge badge-4-targets" data-i18n="tournament_types.4_targets">4 Targets</span>
|
|
</div>
|
|
<div class="archive-content">
|
|
<div class="archive-info">
|
|
<div class="info-item">
|
|
<span class="info-icon">👥</span>
|
|
<span class="info-value">{{ tournament.participants_count }} <span data-i18n="players.players_label">players</span></span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🎯</span>
|
|
<span class="info-value">{{ tournament.tournament_type.replace('_', ' ')|title }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">📅</span>
|
|
<span class="info-value">{{ tournament.archived_at[:10] if tournament.archived_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🏁</span>
|
|
<span class="info-value">{{ (translations.tournament.finished if translations else 'Finished') if tournament.tournament_finished else (translations.scoring.in_progress if translations else 'Incomplete') }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="archive-actions">
|
|
<a href="/archive/tournament/{{ tournament.filename }}" class="action-btn view-btn">📊 <span data-i18n="general.view">View</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Other/Unknown Target Count Tournaments -->
|
|
{% set tournaments_other = tournaments|rejectattr('tournament_type', 'in', ['4_targets', '20_targets', '40_targets'])|list %}
|
|
{% if tournaments_other %}
|
|
<div class="section">
|
|
<div class="section-title">
|
|
<span data-i18n="messages.other_tournaments">🏆 Drugi Turnirji</span>
|
|
</div>
|
|
<div class="archive-grid" id="tournaments-other-grid">
|
|
{% for tournament in tournaments_other %}
|
|
<div class="archive-card tournament-other" data-status="{{ 'finished' if tournament.tournament_finished else 'incomplete' }}" data-date="{{ tournament.archived_at }}" data-targets="other" onclick="viewTournament('{{ tournament.filename }}')">
|
|
<div class="archive-header">
|
|
<div>
|
|
<div class="archive-title">{{ translations.tournament.tournament if translations else 'Turnir' }} ({{ tournament.tournament_type or (translations.messages.unknown if translations else 'Neznano') }})</div>
|
|
<div class="archive-subtitle">{{ tournament.created_at[:10] if tournament.created_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</div>
|
|
</div>
|
|
<span class="archive-badge badge-tournament" data-i18n="tournament.tournament">Turnir</span>
|
|
</div>
|
|
<div class="archive-content">
|
|
<div class="archive-info">
|
|
<div class="info-item">
|
|
<span class="info-icon">👥</span>
|
|
<span class="info-value">{{ tournament.participants_count }} <span data-i18n="players.players_label">players</span></span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🎯</span>
|
|
<span class="info-value">{{ tournament.tournament_type.replace('_', ' ')|title }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">📅</span>
|
|
<span class="info-value">{{ tournament.archived_at[:10] if tournament.archived_at != 'Unknown' else translations.messages.unknown_date if translations else 'Neznan Datum' }}</span>
|
|
</div>
|
|
<div class="info-item">
|
|
<span class="info-icon">🏁</span>
|
|
<span class="info-value">{{ (translations.tournament.finished if translations else 'Finished') if tournament.tournament_finished else (translations.scoring.in_progress if translations else 'Incomplete') }}</span>
|
|
</div>
|
|
</div>
|
|
<div class="archive-actions">
|
|
<a href="/archive/tournament/{{ tournament.filename }}" class="action-btn view-btn">📊 <span data-i18n="general.view">View</span></a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
<!-- Empty State -->
|
|
{% if not leagues and not tournaments %}
|
|
<div class="section">
|
|
<div class="empty-state">
|
|
<div class="empty-icon">📚</div>
|
|
<h3 data-i18n="messages.no_archives_found">Ni Najdenih Arhivov</h3>
|
|
<p data-i18n="messages.complete_tournaments_msg">Zaključi nekaj turnirjev ali lig, da jih vidiš arhivirane tukaj</p>
|
|
<a href="/tournament" class="nav-btn primary" style="margin-top: 15px;" data-i18n="messages.start_tournament">🏆 Začni Turnir</a>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<!-- Confirmation Modal -->
|
|
<div class="modal-overlay" id="confirmationModal">
|
|
<div class="modal">
|
|
<div class="modal-title" id="modalTitle" data-i18n="messages.confirm_action">Potrdi Dejanje</div>
|
|
<div class="modal-message" id="modalMessage" data-i18n="messages.are_you_sure_proceed">Ali ste prepričani, da želite nadaljevati?</div>
|
|
<div class="modal-buttons">
|
|
<button class="modal-btn cancel" onclick="closeModal()" data-i18n="general.cancel">Prekliči</button>
|
|
<button class="modal-btn confirm" id="confirmBtn" onclick="confirmAction()" data-i18n="general.confirm">Potrdi</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Edit Modal -->
|
|
<div class="modal-overlay" id="editModal">
|
|
<div class="modal">
|
|
<div class="modal-title" id="editModalTitle" data-i18n="messages.edit_archive">Uredi Arhiv</div>
|
|
<form class="edit-form" id="editForm">
|
|
<div class="form-group">
|
|
<label class="form-label" data-i18n="messages.archive_name">Ime Arhiva</label>
|
|
<input type="text" class="form-input" id="editName" data-i18n="[placeholder]messages.enter_archive_name" placeholder="Vnesite ime arhiva">
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label" data-i18n="messages.format_type">Tip Formata</label>
|
|
<select class="form-select" id="editType">
|
|
<option value="single_elimination" data-i18n="messages.single_elimination">Ena Eliminacija</option>
|
|
<option value="double_elimination" data-i18n="messages.double_elimination">Dvojna Eliminacija</option>
|
|
<option value="round_robin" data-i18n="messages.round_robin">Vsak z Vsakim</option>
|
|
<option value="swiss" data-i18n="messages.swiss_system">Švicarski Sistem</option>
|
|
<option value="league" data-i18n="messages.league_championship">League Championship</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group" id="targetCountGroup">
|
|
<label class="form-label" data-i18n="messages.target_format">Format Tarč</label>
|
|
<select class="form-select" id="editTargetCount">
|
|
<option value="4_targets">4 Targets (5 shots each)</option>
|
|
<option value="20_targets">20 Targets (2 shots each)</option>
|
|
<option value="40_targets">40 Targets (2 shots each)</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">Notes</label>
|
|
<input type="text" class="form-input" id="editNotes" placeholder="Add notes about this tournament">
|
|
</div>
|
|
</form>
|
|
<div class="modal-buttons">
|
|
<button class="modal-btn cancel" onclick="closeEditModal()" data-i18n="general.cancel">Prekliči</button>
|
|
<button class="modal-btn primary" onclick="saveEdit()" data-i18n="messages.save_changes">Shrani Spremembe</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
let pendingAction = null;
|
|
let editingItem = null;
|
|
|
|
// Navigation functions
|
|
function viewTournament(filename) {
|
|
window.location.href = `/archive/tournament/${filename}`;
|
|
}
|
|
|
|
function viewLeague(filename) {
|
|
window.location.href = `/archive/league/${filename}`;
|
|
}
|
|
|
|
// Delete function
|
|
async function deleteArchive(type, filename) {
|
|
showModal(
|
|
t('messages.delete_archive'),
|
|
`${t('messages.are_you_sure_delete')} ${type}? ${t('messages.action_cannot_undone')}.`,
|
|
async () => {
|
|
try {
|
|
const response = await fetch(`/api/archive/delete/${type}/${filename}`, {
|
|
method: 'POST'
|
|
});
|
|
|
|
const result = await response.json();
|
|
|
|
if (result.status === 'success') {
|
|
alert(t('messages.archive_deleted'));
|
|
location.reload();
|
|
} else {
|
|
alert('Error deleting archive: ' + result.message);
|
|
}
|
|
} catch (error) {
|
|
alert('Error deleting archive: ' + error.message);
|
|
}
|
|
closeModal();
|
|
}
|
|
);
|
|
}
|
|
|
|
// Filtering functions
|
|
function filterLeagues(filter) {
|
|
const cards = document.querySelectorAll('#leagues-grid .archive-card');
|
|
const buttons = document.querySelectorAll('#leagues-grid').parentElement.querySelectorAll('.filter-btn');
|
|
|
|
// Update active button
|
|
buttons.forEach(btn => btn.classList.remove('active'));
|
|
event.target.classList.add('active');
|
|
|
|
// Filter cards
|
|
cards.forEach(card => {
|
|
const isCompleted = card.dataset.status === 'completed';
|
|
const date = new Date(card.dataset.date);
|
|
const isRecent = (Date.now() - date.getTime()) < (30 * 24 * 60 * 60 * 1000); // Last 30 days
|
|
|
|
let show = true;
|
|
if (filter === 'completed' && !isCompleted) show = false;
|
|
if (filter === 'recent' && !isRecent) show = false;
|
|
|
|
card.classList.toggle('hidden', !show);
|
|
});
|
|
}
|
|
|
|
// Modal functions
|
|
function showModal(title, message, confirmCallback) {
|
|
document.getElementById('modalTitle').textContent = title;
|
|
document.getElementById('modalMessage').textContent = message;
|
|
pendingAction = confirmCallback;
|
|
document.getElementById('confirmationModal').classList.add('active');
|
|
}
|
|
|
|
function closeModal() {
|
|
document.getElementById('confirmationModal').classList.remove('active');
|
|
pendingAction = null;
|
|
}
|
|
|
|
function closeEditModal() {
|
|
document.getElementById('editModal').classList.remove('active');
|
|
editingItem = null;
|
|
}
|
|
|
|
function confirmAction() {
|
|
if (pendingAction) {
|
|
pendingAction();
|
|
}
|
|
}
|
|
|
|
// Click outside modal to close
|
|
document.getElementById('confirmationModal').addEventListener('click', function(e) {
|
|
if (e.target === this) {
|
|
closeModal();
|
|
}
|
|
});
|
|
|
|
document.getElementById('editModal').addEventListener('click', function(e) {
|
|
if (e.target === this) {
|
|
closeEditModal();
|
|
}
|
|
});
|
|
</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> |