Startseite: Tippen dauerhaft sichtbar verlinken
This commit is contained in:
parent
7a283029bf
commit
c6a5111685
5 changed files with 69 additions and 9 deletions
|
|
@ -10,13 +10,13 @@ Diese Datei ersetzt die Erkundung. Erst hier nachschlagen, dann gezielt mit
|
|||
Abschnitt zu lesen. `docs/legacy/` ist absichtlich ausgeblendet (siehe
|
||||
`.ignore`); dort liegt der alte Laravel-Stand.
|
||||
|
||||
Umfang: 11318 Zeilen in 66 Dateien.
|
||||
Umfang: 11373 Zeilen in 66 Dateien.
|
||||
|
||||
## Einstiegspunkte
|
||||
|
||||
| Datei | Zeilen | Zweck |
|
||||
|---|---|---|
|
||||
| `tippspiel/public/index.php` | 1195 | Front-Controller; Routing ist eine if/elseif-Kette auf `?page=` |
|
||||
| `tippspiel/public/index.php` | 1200 | Front-Controller; Routing ist eine if/elseif-Kette auf `?page=` |
|
||||
| `tippspiel/src/autoload.php` | 26 | PSR-4-artiger Autoloader für `App\` |
|
||||
| `tools/schema.sql` | 204 | Schema der neuen DB (Tabellen, Indizes) |
|
||||
| `tippspiel/public/sw.js` | 114 | Service Worker für Web-Push |
|
||||
|
|
@ -85,7 +85,7 @@ ohne View.
|
|||
| `tippspiel/src/Models/Question.php` | 164 | Spielerfragen an die Admins inklusive Antworten | `create($userId, $question)`, `findByUser($userId)`, `findAllForAdmin()`, `findById($id)`, `answer($id, $answer, $adminId)`, `hasNewAnswer($userId)`, `hasOpenQuestion()`, `markAnswersSeen($userId)`, … |
|
||||
| `tippspiel/src/Models/Quota.php` | 171 | Ausschüttungsbeträge einer Saison (aus Legacy portiert) | `computePayouts($seasonId)`, `get6Divisor($number)`, `getBySeason($seasonId)`, `getMapBySeason($seasonId)`, `editableNames()`, `defaults()`, `validate($quotas)`, `saveForSeason($seasonId, $quotas)` |
|
||||
| `tippspiel/src/Models/Ranking.php` | 623 | Rangliste, Tagessieg, Ausschüttungen einer Saison | `compute($seasonId, $maxRoundId)`, `roundTable($result)`, `payoutItems($result)`, `roundSummary($result)`, `getJackpotStatus($seasonId)`, `computeForMoneyRanking($seasonId)`, `moneyRanking($result, $withBankData)` |
|
||||
| `tippspiel/src/Models/Round.php` | 182 | Runden lesen, Reihenfolge, erste tippbare Runde | `getById($id)`, `getBySeason($seasonId)`, `updateName($id, $name)`, `updateReport($id, $report)`, `reportToText($report)`, `getLockTime($games)`, `isCompleted($games)`, `isLocked($games)`, … |
|
||||
| `tippspiel/src/Models/Round.php` | 185 | Runden lesen, Reihenfolge, erste tippbare Runde | `getById($id)`, `getBySeason($seasonId)`, `updateName($id, $name)`, `updateReport($id, $report)`, `reportToText($report)`, `getLockTime($games)`, `isCompleted($games)`, `isLocked($games)`, … |
|
||||
| `tippspiel/src/Models/Roundmail.php` | 310 | Rundmail-Protokoll und Erinnerungsversand | `count($excludeReminders)`, `getPage($limit, $offset, $excludeReminders)`, `findById($id)`, `create($userId, $recipients, $topic, $messageHtml, …)`, `textToHtml($text)`, `parseRecipients($list)`, `recipientGroups($seasonId, $tippableRound)`, `sendReminder($appUrl)`, … |
|
||||
| `tippspiel/src/Models/Season.php` | 280 | Saisons; global aktive Saison aus settings.current_season_id | `getCurrent()`, `getViewSeason()`, `viewSeasonId()`, `setViewSeason($id)`, `getAll()`, `findById($id)`, `create($data)`, `update($id, $data)`, … |
|
||||
| `tippspiel/src/Models/Setting.php` | 80 | Systemeinstellungen aus der settings-Tabelle | `isRegistrationOpen()`, `setRegistrationOpen($open)`, `getMessage()`, `setMessage($message)` |
|
||||
|
|
@ -105,7 +105,7 @@ ohne View.
|
|||
| `tippspiel/src/Views/admin/seasons.php` | 217 | Saisons verwalten |
|
||||
| `tippspiel/src/Views/admin/users.php` | 190 | Benutzer verwalten (inkl. Tipp-/Joker-Lücken) |
|
||||
| `tippspiel/src/Views/error.php` | 34 | Fehlerseite (vom ErrorHandler genutzt) |
|
||||
| `tippspiel/src/Views/home.php` | 87 | Startseite: Begrüßung und abgeschlossene Runden |
|
||||
| `tippspiel/src/Views/home.php` | 138 | Startseite: Begrüßung und abgeschlossene Runden |
|
||||
| `tippspiel/src/Views/info/guide.php` | 207 | Anleitung für Spieler |
|
||||
| `tippspiel/src/Views/info/guide_admin.php` | 144 | Anleitung für Admins |
|
||||
| `tippspiel/src/Views/info/money_ranking.php` | 49 | Geldrangliste |
|
||||
|
|
@ -115,7 +115,7 @@ ohne View.
|
|||
| `tippspiel/src/Views/info/quotas.php` | 61 | Quoten und Ausschüttung der Saison |
|
||||
| `tippspiel/src/Views/login.php` | 55 | Login-Formular |
|
||||
| `tippspiel/src/Views/partials/footer.php` | 32 | Seitenabschluss und Skripte |
|
||||
| `tippspiel/src/Views/partials/header.php` | 101 | HTML-Kopf, Navigation inkl. Admin-Menü und Saison-Umschalter |
|
||||
| `tippspiel/src/Views/partials/header.php` | 102 | HTML-Kopf, Navigation inkl. Admin-Menü und Saison-Umschalter |
|
||||
| `tippspiel/src/Views/questions.php` | 138 | Fragen der Spieler und Admin-Antworten |
|
||||
| `tippspiel/src/Views/ranking.php` | 433 | Rangliste (Runde/Saison) inkl. Joker-Wertung |
|
||||
| `tippspiel/src/Views/register.php` | 81 | Registrierung inkl. Zahlungshinweis |
|
||||
|
|
|
|||
|
|
@ -1160,8 +1160,13 @@ if ($page === 'reminder') {
|
|||
$message = Setting::getMessage();
|
||||
// Profil-Warnungen gelten immer, nicht nur im Zeitfenster vor dem Lock.
|
||||
$profileWarnings = User::getProfileWarnings((int)Auth::id());
|
||||
// Erste offene Runde einmal ermitteln und für Startseiten-Call-to-Action
|
||||
// und den Lock-Hinweis gemeinsam nutzen.
|
||||
$tippableRound = $currentSeason
|
||||
? Round::getFirstTippable((int)$currentSeason['id'])
|
||||
: null;
|
||||
$lockWarning = $currentSeason
|
||||
? Round::getLockWarning((int)$currentSeason['id'], (int)Auth::id())
|
||||
? Round::getLockWarning((int)$currentSeason['id'], (int)Auth::id(), $tippableRound)
|
||||
: null;
|
||||
$rounds = [];
|
||||
$roundSummaries = [];
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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&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'; ?>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue