feat(track): replace alcohol checkbox with a selectable tile

This commit is contained in:
2026-04-14 15:09:25 +02:00
parent ab1d8bc677
commit e953d0fd42
2 changed files with 31 additions and 15 deletions
+23 -15
View File
@@ -6,7 +6,7 @@
<h3><?= e(format_display_date($entry['date'])) ?></h3>
</div>
<div class="section-head__actions">
<a class="ghost-link" href="/archive?date=<?= e(rawurlencode($entry['date'])) ?>">Im Archiv ansehen</a>
<a class="ghost-link" href="/archive?view=days&amp;date=<?= e(rawurlencode($entry['date'])) ?>">Im Archiv ansehen</a>
<a class="ghost-link" href="/track?date=<?= e(today()) ?>">Heute</a>
</div>
</div>
@@ -45,23 +45,31 @@
<input type="range" min="1" max="10" step="1" name="pain" value="<?= e((string) $entry['pain']) ?>">
</label>
<label class="checkbox-row checkbox-row--panel checkbox-row--tall">
<input type="checkbox" name="alcohol" value="1" <?= !empty($entry['alcohol']) ? 'checked' : '' ?>>
<span>
<strong>Alkohol</strong>
<small>Wenn du heute Alkohol getrunken hast, werden 5 Punkte abgezogen.</small>
</span>
</label>
<div class="sport-choice-field sport-choice-field--single">
<div class="sport-choice-list sport-choice-list--single">
<label class="sport-choice">
<input type="checkbox" name="alcohol" value="1" <?= !empty($entry['alcohol']) ? 'checked' : '' ?>>
<span class="sport-choice__card sport-choice__card--toggle">
<img src="<?= e(icon_path('alcohol')) ?>" alt="">
<strong>Alkohol</strong>Heute was getrunken?
</span>
</label>
</div>
</div>
</div>
<?php else: ?>
<div class="field-grid field-grid--single">
<label class="checkbox-row checkbox-row--panel">
<input type="checkbox" name="alcohol" value="1" <?= !empty($entry['alcohol']) ? 'checked' : '' ?>>
<span>
<strong>Alkohol</strong>
<small>Wenn du heute Alkohol getrunken hast, werden 5 Punkte abgezogen.</small>
</span>
</label>
<div class="sport-choice-field sport-choice-field--single">
<div class="sport-choice-list sport-choice-list--single">
<label class="sport-choice">
<input type="checkbox" name="alcohol" value="1" <?= !empty($entry['alcohol']) ? 'checked' : '' ?>>
<span class="sport-choice__card sport-choice__card--toggle">
<img src="<?= e(icon_path('alcohol')) ?>" alt="">
<strong>Alkohol</strong>Heute was getrunken?
</span>
</label>
</div>
</div>
</div>
<?php endif; ?>