Add weekly progress and validation
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
<p><?= e($habit['description']) ?></p>
|
||||
<small>
|
||||
<?= e($habit['category_name'] ?? 'Ohne Kategorie') ?> |
|
||||
Ziel: <?= (int) $habit['target_per_week'] ?>x pro Woche
|
||||
Woche: <?= (int) $habit['completed_this_week'] ?> / <?= (int) $habit['target_per_week'] ?> erledigt
|
||||
</small>
|
||||
</div>
|
||||
</div>
|
||||
@@ -64,4 +64,3 @@
|
||||
</article>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
id="title"
|
||||
name="title"
|
||||
type="text"
|
||||
maxlength="120"
|
||||
class="<?= !empty($errors['title']) ? 'input-error' : '' ?>"
|
||||
value="<?= e($habit['title'] ?? '') ?>"
|
||||
required
|
||||
@@ -24,10 +25,13 @@
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="description">Beschreibung <span>optional</span></label>
|
||||
<textarea id="description" name="description" rows="4"><?= e($habit['description'] ?? '') ?></textarea>
|
||||
<textarea id="description" name="description" rows="4" maxlength="1000"><?= e($habit['description'] ?? '') ?></textarea>
|
||||
<?php if (!empty($errors['description'])): ?>
|
||||
<small class="field-error"><?= e($errors['description']) ?></small>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="category_id">Kategorie</label>
|
||||
<select id="category_id" name="category_id">
|
||||
<select id="category_id" name="category_id" class="<?= !empty($errors['category_id']) ? 'input-error' : '' ?>">
|
||||
<option value="">Keine Kategorie</option>
|
||||
<?php foreach ($categories as $category): ?>
|
||||
<option value="<?= (int) $category['id'] ?>" <?= (string) ($habit['category_id'] ?? '') === (string) $category['id'] ? 'selected' : '' ?>>
|
||||
@@ -35,6 +39,9 @@
|
||||
</option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
<?php if (!empty($errors['category_id'])): ?>
|
||||
<small class="field-error"><?= e($errors['category_id']) ?></small>
|
||||
<?php endif; ?>
|
||||
|
||||
<label for="target_per_week">Ziel pro Woche</label>
|
||||
<input
|
||||
@@ -55,4 +62,3 @@
|
||||
<button type="submit"><?= $isEdit ? 'Speichern' : 'Erstellen' ?></button>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user