Tipps: Alle offenen Runden zum Vortippen anbieten

This commit is contained in:
torsten 2026-11-10 13:22:23 +01:00
parent c6a5111685
commit 63d73efc42
5 changed files with 47 additions and 5 deletions

View file

@ -28,7 +28,7 @@ require __DIR__ . '/partials/header.php';
<p>Abgabe bis <?php echo $tippableLock->format('d.m.Y H:i'); ?> Uhr</p>
<?php endif; ?>
<p>
<a class="home-tipp-link" href="/index.php?page=tipp_round&amp;id=<?php echo (int)$tippableRound['id']; ?>">Jetzt tippen</a>
<a class="home-tipp-link" href="/index.php?page=tipps">Jetzt tippen</a>
</p>
</div>
<?php endif; ?>

View file

@ -20,6 +20,8 @@ $teamLogo = function ($name) {
<div>Bereits verwendete Joker: <?php echo htmlspecialchars($jokerUsage); ?></div>
<div>Maximale Anzahl gleicher Joker: <?php echo $maxIdenticalJokertipps; ?></div>
<p><a href="/index.php?page=tipps">Weitere Runden vortippen</a></p>
<p><strong>
<span class="team-cell"><?php $l1 = $teamLogo($game['team1']); if ($l1): ?><img src="<?php echo htmlspecialchars($l1); ?>" alt="" class="team-logo" loading="lazy"><?php endif; ?><?php echo htmlspecialchars($game['team1']); ?></span>
:

View file

@ -14,6 +14,10 @@ $teamLogo = function ($name) {
$cache[$name] = ($team && Team::logoExists($team)) ? Team::logoUrl($team) : null;
return $cache[$name];
};
$openRounds = array_values(array_filter($rounds, function ($round) {
return !$round['locked'] && !empty($round['games']);
}));
?>
<p>Aktive Saison: <?php echo htmlspecialchars($activeSeason['name']); ?></p>
@ -23,6 +27,15 @@ $teamLogo = function ($name) {
<section class="tipp-round" id="round-<?php echo (int)$round['id']; ?>"
data-lock-time="<?php echo $round['lock_time'] ? (int)$round['lock_time']->getTimestamp() : ''; ?>">
<h2><?php echo htmlspecialchars($round['name']); ?></h2>
<?php if ((int)$round['id'] === (int)$firstTippableRoundId && count($openRounds) > 1): ?>
<nav class="tipp-open-rounds" aria-label="Weitere offene Runden">
<strong>Weitere Runden vortippen:</strong>
<?php foreach ($openRounds as $openRound): ?>
<?php if ((int)$openRound['id'] === (int)$round['id']) continue; ?>
<a href="/index.php?page=tipp_round&amp;id=<?php echo (int)$openRound['id']; ?>"><?php echo htmlspecialchars($openRound['name']); ?></a>
<?php endforeach; ?>
</nav>
<?php endif; ?>
<?php if ($round['lock_time']): ?>
<div>Runde sperrt sich: <?php echo $round['lock_time']->format('d.m.Y H:i'); ?></div>
<?php endif; ?>
@ -154,6 +167,31 @@ $teamLogo = function ($name) {
<?php endif; ?>
<style>
.tipp-open-rounds {
margin: 0 0 1.8em;
padding: 0.7em 0.9em;
background: #eef7f0;
border: 1px solid var(--line);
border-radius: 8px;
}
.tipp-open-rounds strong {
display: block;
margin-bottom: 0.4em;
}
.tipp-open-rounds a {
display: inline-block;
margin: 0.15em 0.35em 0.15em 0;
padding: 0.3em 0.7em;
background: #fff;
border: 1px solid var(--pitch);
border-radius: 999px;
text-decoration: none;
font-weight: 700;
}
.tipp-open-rounds a:hover {
background: var(--pitch);
color: #fff;
}
.tipp-round { margin-bottom: 2.5em; }
.tipp-round h2 { margin-bottom: 0.3em; scroll-margin-top: 1em; }
.tipp-round .joker-icon { width: 1.5em; height: 1.5em; }

View file

@ -20,6 +20,8 @@ $teamLogo = function ($name) {
<div>Bereits verwendete Joker: <?php echo htmlspecialchars($jokerUsage); ?></div>
<div>Maximale Anzahl gleicher Joker: <?php echo $maxIdenticalJokertipps; ?></div>
<p><a href="/index.php?page=tipps">Weitere Runden vortippen</a></p>
<?php if ($error): ?>
<p style="color: red;"><?php echo htmlspecialchars($error); ?></p>
<?php endif; ?>