Startseite: Tippen dauerhaft sichtbar verlinken

This commit is contained in:
torsten 2026-11-10 13:15:01 +01:00
parent 7a283029bf
commit c6a5111685
5 changed files with 69 additions and 9 deletions

View file

@ -133,10 +133,13 @@ class Round {
*
* @param int $seasonId
* @param int $userId
* @param array|null $round Optional bereits ermittelte erste tippbare Runde
* @return array|null Null, wenn kein Hinweis angezeigt werden soll
*/
public static function getLockWarning($seasonId, $userId) {
$round = self::getFirstTippable($seasonId);
public static function getLockWarning($seasonId, $userId, $round = null) {
if ($round === null) {
$round = self::getFirstTippable($seasonId);
}
if (!$round || empty($round['games'])) {
return null;
}

View file

@ -20,6 +20,19 @@ require __DIR__ . '/partials/header.php';
</div>
<?php endif; ?>
<?php if (!empty($tippableRound) && empty($lockWarning)): ?>
<?php $tippableLock = Round::getLockTime($tippableRound['games']); ?>
<div class="home-tipp-cta">
<p><strong><?php echo htmlspecialchars($tippableRound['name']); ?></strong></p>
<?php if ($tippableLock): ?>
<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>
</p>
</div>
<?php endif; ?>
<?php if (!empty($lockWarning)): ?>
<div class="lock-warning" role="status">
<?php if ($lockWarning['missing_tipps']): ?>
@ -84,4 +97,42 @@ require __DIR__ . '/partials/header.php';
<p>Keine Saison gefunden.</p>
<?php endif; ?>
<style>
/* Dauerhafter Einstieg in die Tippabgabe. Bewusst im HTML statt im
stylesheet, damit die Aktion auch in einer PWA mit altem CSS-Cache
sofort sichtbar ist. */
.home-tipp-cta {
max-width: 56rem;
margin: 0.8em auto 1.6em;
padding: 0.9em 1.1em;
text-align: center;
background: #eef7f0;
border: 2px solid var(--pitch);
border-left: 8px solid var(--pitch);
border-radius: 8px;
}
.home-tipp-cta p {
margin: 0.25em 0;
}
.home-tipp-cta .home-tipp-link {
display: inline-block;
margin-top: 0.35em;
padding: 0.55em 1.4em;
font-family: var(--font-display);
font-size: 1rem;
font-weight: 700;
letter-spacing: 0.05em;
text-transform: uppercase;
text-decoration: none;
color: #fff;
background: var(--pitch-dark);
border-radius: 999px;
box-shadow: 0 2px 0 rgba(11, 61, 35, 0.9);
}
.home-tipp-cta .home-tipp-link:hover {
background: var(--pitch);
color: #fff;
}
</style>
<?php require __DIR__ . '/partials/footer.php'; ?>

View file

@ -70,8 +70,8 @@ if (App\Core\Auth::check()) {
</span>
</span>
<?php endif; ?>
<a href="/index.php?page=tipps">Tipps</a>
<a href="/index.php?page=ranking">Rangliste</a>
<a href="/index.php?page=tipps">Tipps</a>
<span class="nav-dropdown">
<a href="#" onclick="return false;">Info</a>
<span class="nav-dropdown-content">
@ -88,6 +88,7 @@ if (App\Core\Auth::check()) {
<span class="nav-dropdown">
<a href="#" onclick="return false;">( <?php echo htmlspecialchars(App\Core\Auth::user()['name']); ?> )</a>
<span class="nav-dropdown-content">
<a href="/index.php?page=tipps">Tipps</a>
<a href="/index.php?page=settings">Einstellungen</a>
<a href="/index.php?page=logout">Abmelden</a>
</span>