Add Putzliga mood import
This commit is contained in:
@@ -114,6 +114,7 @@ $formatBalanceValue = static function (?array $entry) use ($settings): string {
|
||||
<?php $eventComment = trim((string) ($item['comment'] ?? '')); ?>
|
||||
<?php if (preg_match('/^\s*-\s*(?:Stimmung|Energie|Stress)\s*:\s*[+-]?\d+\s*$/u', $eventComment) === 1) { $eventComment = ''; } ?>
|
||||
<?php $isImportedHealth = (string) ($item['source'] ?? '') === 'health_auto_export'; ?>
|
||||
<?php $isPutzliga = (string) ($item['source'] ?? '') === 'putzliga'; ?>
|
||||
<?php $sportType = $eventType === 'sport' ? find_sport_type($settings, (string) ($item['sport_type_id'] ?? '')) : null; ?>
|
||||
<?php $isImportedWalkSport = $isImportedHealth && $eventType === 'sport' && str_contains(strtolower((string) ($sportType['label'] ?? $eventComment)), 'spaziergang'); ?>
|
||||
<?php $eventTone = signal_value_class(normalize_signal_value($item['mood'] ?? 0)); ?>
|
||||
@@ -184,6 +185,7 @@ $formatBalanceValue = static function (?array $entry) use ($settings): string {
|
||||
'sleep_deep' => (float) ($item['sleep_deep'] ?? 0),
|
||||
'sleep_rem' => (float) ($item['sleep_rem'] ?? 0),
|
||||
'sleep_core' => (float) ($item['sleep_core'] ?? 0),
|
||||
'task_titles' => is_array($item['task_titles'] ?? null) ? $item['task_titles'] : [],
|
||||
]); ?>
|
||||
<?php $hasEventImage = is_string($item['image_url'] ?? null); ?>
|
||||
<?php $routeMap = is_array($item['route_map'] ?? null) ? $item['route_map'] : null; ?>
|
||||
@@ -220,6 +222,14 @@ $formatBalanceValue = static function (?array $entry) use ($settings): string {
|
||||
<p class="timeline-card__value"><?= e((string) $item['comment']) ?></p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($isPutzliga && is_array($item['task_titles'] ?? null) && $item['task_titles'] !== []): ?>
|
||||
<div class="timeline-card__stats" aria-label="Erledigte Aufgaben">
|
||||
<?php foreach ($item['task_titles'] as $taskTitle): ?>
|
||||
<span><?= e((string) $taskTitle) ?></span>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($eventType === 'sleep' && $sleepActualTotal > 0): ?>
|
||||
<div class="sleep-phase-bar" aria-label="Schlafdauer" style="--sleep-optimal-left: <?= e((string) $sleepOptimalPercent) ?>%; --sleep-actual-left: <?= e((string) $sleepActualPercent) ?>%">
|
||||
<svg class="sleep-phase-bar__svg" viewBox="0 0 100 10" preserveAspectRatio="none" aria-hidden="true" focusable="false">
|
||||
|
||||
Reference in New Issue
Block a user