- updated draft with printout
- added correction to results for 10s
This commit is contained in:
+354
-84
@@ -253,50 +253,89 @@
|
||||
}
|
||||
|
||||
.position-card {
|
||||
background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
|
||||
border: 2px solid #e9ecef;
|
||||
border-radius: 8px;
|
||||
padding: 8px 6px;
|
||||
text-align: center;
|
||||
background: white;
|
||||
border: 2px solid #9ca3af;
|
||||
border-radius: 10px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 6px rgba(156, 163, 175, 0.2);
|
||||
min-height: 70px;
|
||||
}
|
||||
|
||||
/* Current round - blue cards */
|
||||
.round-row.current .position-card {
|
||||
border-color: #5a8fd1;
|
||||
box-shadow: 0 2px 6px rgba(90, 143, 209, 0.2);
|
||||
}
|
||||
|
||||
.round-row.current .position-card .position-header {
|
||||
background: #5a8fd1;
|
||||
}
|
||||
|
||||
/* Completed round - green cards */
|
||||
.round-row.completed .position-card {
|
||||
border-color: #28a745;
|
||||
box-shadow: 0 2px 6px rgba(40, 167, 69, 0.2);
|
||||
}
|
||||
|
||||
.round-row.completed .position-card .position-header {
|
||||
background: #28a745;
|
||||
}
|
||||
|
||||
/* Waiting round - gray cards */
|
||||
.round-row.waiting .position-card {
|
||||
border-color: #9ca3af;
|
||||
box-shadow: 0 2px 6px rgba(156, 163, 175, 0.2);
|
||||
}
|
||||
|
||||
.round-row.waiting .position-card .position-header {
|
||||
background: #9ca3af;
|
||||
}
|
||||
|
||||
.position-header {
|
||||
background: #9ca3af;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-shrink: 0;
|
||||
min-width: 50px;
|
||||
width: 50px;
|
||||
}
|
||||
|
||||
.position-card.empty .position-header {
|
||||
background: #9ca3af;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 1.6rem;
|
||||
font-weight: 700;
|
||||
color: white;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.position-body {
|
||||
padding: 10px 12px;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
transition: all 0.3s ease;
|
||||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
|
||||
min-height: 60px;
|
||||
flex: 1;
|
||||
background: white;
|
||||
border-radius: 0 8px 8px 0;
|
||||
}
|
||||
|
||||
.position-card.filled {
|
||||
border-color: #28a745;
|
||||
background: linear-gradient(135deg, #f8fff9 0%, #ffffff 100%);
|
||||
box-shadow: 0 3px 10px rgba(40, 167, 69, 0.15);
|
||||
}
|
||||
|
||||
.position-card.empty {
|
||||
border-color: #dee2e6;
|
||||
background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 1.2rem;
|
||||
font-weight: 700;
|
||||
color: #007bff;
|
||||
margin-bottom: 4px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
.position-card.empty .position-number {
|
||||
color: #6c757d;
|
||||
.position-card.empty .position-body {
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 1rem;
|
||||
font-size: 1.15rem;
|
||||
font-weight: 600;
|
||||
color: #2c3e50;
|
||||
line-height: 1.2;
|
||||
margin-bottom: 4px;
|
||||
line-height: 1.3;
|
||||
word-wrap: break-word;
|
||||
max-width: 100%;
|
||||
text-align: center;
|
||||
@@ -309,14 +348,7 @@
|
||||
}
|
||||
|
||||
.player-id {
|
||||
background: #28a745;
|
||||
color: white;
|
||||
padding: 2px 6px;
|
||||
border-radius: 8px;
|
||||
font-size: 0.65rem;
|
||||
font-weight: 600;
|
||||
display: inline-block;
|
||||
letter-spacing: 0.3px;
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* No Tournament State */
|
||||
@@ -341,24 +373,251 @@
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
|
||||
/* Auto-refresh indicator */
|
||||
.refresh-indicator {
|
||||
position: fixed;
|
||||
bottom: 20px;
|
||||
right: 20px;
|
||||
background: rgba(0, 123, 255, 0.9);
|
||||
color: white;
|
||||
padding: 8px 15px;
|
||||
border-radius: 20px;
|
||||
font-size: 0.8rem;
|
||||
font-weight: bold;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
z-index: 999;
|
||||
/* PRINT STYLES */
|
||||
@media print {
|
||||
.navbar,
|
||||
.tournament-controls {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
html, body {
|
||||
height: auto !important;
|
||||
overflow: visible !important;
|
||||
background: white !important;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.main-container {
|
||||
height: auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.tournament-header {
|
||||
background: white !important;
|
||||
color: #333 !important;
|
||||
box-shadow: none !important;
|
||||
border: 2px solid #ddd !important;
|
||||
padding: 20px;
|
||||
margin-bottom: 20px;
|
||||
page-break-inside: avoid;
|
||||
}
|
||||
|
||||
.tournament-title {
|
||||
font-size: 24pt !important;
|
||||
font-weight: bold !important;
|
||||
color: #333 !important;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.tournament-stats {
|
||||
font-size: 12pt !important;
|
||||
color: #666 !important;
|
||||
margin-bottom: 0 !important;
|
||||
}
|
||||
|
||||
.current-round-info {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.rounds-container {
|
||||
display: block !important;
|
||||
overflow: visible !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.round-row {
|
||||
background: white !important;
|
||||
border: 1px solid #ddd !important;
|
||||
border-radius: 0 !important;
|
||||
box-shadow: none !important;
|
||||
margin-bottom: 15px;
|
||||
page-break-inside: avoid;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.round-row.current,
|
||||
.round-row.completed,
|
||||
.round-row.waiting {
|
||||
border-left: 1px solid #ddd !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
.round-header {
|
||||
background: #f8f9fa !important;
|
||||
border: none !important;
|
||||
border-bottom: 1px solid #ddd !important;
|
||||
display: flex !important;
|
||||
justify-content: space-between !important;
|
||||
align-items: center !important;
|
||||
padding: 10px 15px !important;
|
||||
}
|
||||
|
||||
.round-row.current .round-header,
|
||||
.round-row.completed .round-header,
|
||||
.round-row.waiting .round-header {
|
||||
background: #f8f9fa !important;
|
||||
}
|
||||
|
||||
.round-title {
|
||||
font-size: 14pt !important;
|
||||
font-weight: bold !important;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.round-badge {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.round-print-info {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 20px !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(3, 1fr) !important;
|
||||
gap: 10px !important;
|
||||
padding: 15px !important;
|
||||
}
|
||||
|
||||
.position-card {
|
||||
border: 1px solid #5a8fd1 !important;
|
||||
border-radius: 8px !important;
|
||||
overflow: hidden !important;
|
||||
background: white !important;
|
||||
box-shadow: none !important;
|
||||
min-height: 60px !important;
|
||||
page-break-inside: avoid;
|
||||
display: flex !important;
|
||||
flex-direction: row !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: 0 !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
flex-shrink: 0 !important;
|
||||
min-width: 40px !important;
|
||||
width: 40px !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;
|
||||
}
|
||||
|
||||
.position-number {
|
||||
font-size: 14pt !important;
|
||||
color: white !important;
|
||||
}
|
||||
|
||||
.position-body {
|
||||
padding: 8px 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;
|
||||
}
|
||||
|
||||
.player-name {
|
||||
font-size: 11pt !important;
|
||||
color: #2c3e50 !important;
|
||||
}
|
||||
|
||||
.position-card.empty .player-name {
|
||||
color: #6c757d !important;
|
||||
}
|
||||
|
||||
.player-id {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.no-tournament {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
.refresh-indicator.show {
|
||||
opacity: 1;
|
||||
/* Print-only elements - hidden on screen */
|
||||
.print-header,
|
||||
.round-print-info,
|
||||
.tournament-header .print-logo {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
@@ -372,17 +631,24 @@
|
||||
<a href="/archive" class="nav-btn">📚 <span data-i18n="navigation.archive">Archive</span></a>
|
||||
<a href="/tournament/draft" class="nav-btn active">📋 <span data-i18n="tournament.view_draft">Draft</span></a>
|
||||
<a href="/results/calculator" class="nav-btn">🎯 <span data-i18n="navigation.calculator">Results Calculator</span></a>
|
||||
<button class="nav-btn" onclick="printDraft()">🖨️ <span data-i18n="general.print">Print</span></button>
|
||||
</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">
|
||||
<img src="/static/logo.png" alt="Logo" class="print-logo" onerror="this.style.display='none'" />
|
||||
<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 data-i18n="draft.currently_on_round">Currently on Round</span> {{ 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>
|
||||
|
||||
@@ -413,19 +679,35 @@
|
||||
{% else %}
|
||||
<div class="round-badge waiting-badge" data-i18n="draft.wait">Wait</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Print-only fields -->
|
||||
<div class="round-print-info">
|
||||
<div class="round-time-field">
|
||||
<span class="round-time-label"><span data-i18n="draft.time">Time</span>:</span>
|
||||
<div class="round-time-input"></div>
|
||||
</div>
|
||||
<div class="round-checkbox-field">
|
||||
<span class="round-checkbox-label"><span data-i18n="draft.completed">Completed</span>:</span>
|
||||
<div class="round-checkbox"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="positions-container">
|
||||
{% for position in range(1, 7) %}
|
||||
{% set player = round.players[position-1] if position <= round.players|length else none %}
|
||||
<div class="position-card {{ 'filled' if player else 'empty' }}">
|
||||
<div class="position-number">{{ position }}</div>
|
||||
{% if player %}
|
||||
<div class="player-name">{{ player.name }}</div>
|
||||
<div class="player-id">ID: {{ player.id }}</div>
|
||||
{% else %}
|
||||
<div class="player-name" data-i18n="draft.empty">Empty</div>
|
||||
{% endif %}
|
||||
<div class="position-header">
|
||||
<div class="position-number">{{ position }}</div>
|
||||
</div>
|
||||
<div class="position-body">
|
||||
{% if player %}
|
||||
<div class="player-name">{{ player.name }}</div>
|
||||
<div class="player-id">ID: {{ player.id }}</div>
|
||||
{% else %}
|
||||
<div class="player-name" data-i18n="draft.empty">Empty</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
@@ -442,11 +724,6 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Auto-refresh indicator -->
|
||||
<div class="refresh-indicator" id="refreshIndicator">
|
||||
🔄 <span data-i18n="draft.updating">Updating...</span>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Tournament state
|
||||
const tournamentActive = {{ 'true' if tournament else 'false' }};
|
||||
@@ -505,18 +782,9 @@
|
||||
}
|
||||
}
|
||||
|
||||
// Auto-refresh functionality
|
||||
function setupAutoRefresh() {
|
||||
setInterval(() => {
|
||||
if (document.visibilityState === 'visible' && tournamentActive) {
|
||||
const indicator = document.getElementById('refreshIndicator');
|
||||
indicator.classList.add('show');
|
||||
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 1000);
|
||||
}
|
||||
}, 15000); // 15 seconds
|
||||
// Print function
|
||||
function printDraft() {
|
||||
window.print();
|
||||
}
|
||||
|
||||
// Keyboard shortcuts
|
||||
@@ -526,6 +794,9 @@
|
||||
} else if (event.key === 'r' || event.key === 'R') {
|
||||
event.preventDefault();
|
||||
window.location.reload();
|
||||
} else if (event.key === 'p' || event.key === 'P') {
|
||||
event.preventDefault();
|
||||
window.print();
|
||||
} else if (tournamentActive) {
|
||||
if (event.key === 'ArrowLeft') {
|
||||
event.preventDefault();
|
||||
@@ -540,8 +811,7 @@
|
||||
// Initialize
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
updateRoundNavigation();
|
||||
setupAutoRefresh();
|
||||
|
||||
|
||||
// Scroll to current round
|
||||
setTimeout(() => {
|
||||
const currentRoundRow = document.querySelector('.round-row.current');
|
||||
|
||||
Reference in New Issue
Block a user