Fix: Geburtstag aller Hunde + Kotbeutel-Stationen in Stats (SW by-v962)
- worlds.js: bdayDog = _dogs.find(...) — Geburtstag gilt für alle Hunde, nicht nur den aktiven - Banner, KI-Call, "Was hat sich X gewünscht?" nutzen bdayDog.name - stats.py: kotbeutel-Count aus user_map_pois WHERE type='kotbeutel' - landing: Stats-Band 5. Kachel "Kotbeutel-Stationen"
This commit is contained in:
parent
ebff9d820d
commit
07db68aea2
6 changed files with 28 additions and 18 deletions
|
|
@ -3,7 +3,7 @@
|
|||
Router, State-Management, Navigation, Initialisierung.
|
||||
============================================================ */
|
||||
|
||||
const APP_VER = '961'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VER = '962'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
|
||||
const APP_VERSION = '1.5.1'; // ← semantische Version, wird bei make release gesetzt
|
||||
const IS_STAGING = location.hostname === 'staging.banyaro.app';
|
||||
// Cache-Bust-Parameter nach Update-Reload sofort entfernen
|
||||
|
|
|
|||
|
|
@ -1342,8 +1342,9 @@ window.Worlds = (() => {
|
|||
if (mmdd === `${mt}-${dt}`) return 'tomorrow';
|
||||
return null;
|
||||
}
|
||||
const bday = _birthdayState(dog.geburtstag);
|
||||
const bdayYear = dog.geburtstag ? new Date().getFullYear() - parseInt(dog.geburtstag.slice(0, 4)) : null;
|
||||
const bdayDog = _dogs.find(d => _birthdayState(d.geburtstag)) || null;
|
||||
const bday = bdayDog ? _birthdayState(bdayDog.geburtstag) : null;
|
||||
const bdayYear = bdayDog?.geburtstag ? new Date().getFullYear() - parseInt(bdayDog.geburtstag.slice(0, 4)) : null;
|
||||
|
||||
const [streakRes, diaryRes] = await Promise.allSettled([
|
||||
_cachedGet(`streak_${dog.id}`, `/streak/${dog.id}`),
|
||||
|
|
@ -1428,8 +1429,8 @@ window.Worlds = (() => {
|
|||
</div>
|
||||
<div style="font-weight:800;font-size:var(--text-sm);color:#fff;letter-spacing:0.01em">
|
||||
${bday === 'today'
|
||||
? `Alles Gute zum ${bdayYear}. Geburtstag, ${_esc(dog.name)}!`
|
||||
: `Morgen hat ${_esc(dog.name)} Geburtstag!`}
|
||||
? `Alles Gute zum ${bdayYear}. Geburtstag, ${_esc(bdayDog.name)}!`
|
||||
: `Morgen hat ${_esc(bdayDog.name)} Geburtstag!`}
|
||||
</div>
|
||||
<div style="display:flex;gap:8px;align-items:center">
|
||||
<svg class="ph-icon bday-fw3" style="width:1rem;height:1rem;color:#e8c96e"><use href="/icons/phosphor.svg#sparkle"></use></svg>
|
||||
|
|
@ -1443,7 +1444,7 @@ window.Worlds = (() => {
|
|||
</div>` : ''}
|
||||
<div style="display:flex;align-items:center;gap:4px;font-size:10px;color:rgba(196,132,58,0.9);font-weight:700;margin-top:2px">
|
||||
<svg class="ph-icon" style="width:11px;height:11px"><use href="/icons/phosphor.svg#magic-wand"></use></svg>
|
||||
${bday === 'today' ? 'Was hat sich Ban Yaro gewünscht?' : 'KI-Überraschungsideen'}
|
||||
${bday === 'today' ? `Was hat sich ${_esc(bdayDog.name)} gewünscht?` : 'KI-Überraschungsideen'}
|
||||
</div>
|
||||
</div>
|
||||
${bday === 'today' && new Date().getHours() >= 18 ? `
|
||||
|
|
@ -1563,10 +1564,10 @@ window.Worlds = (() => {
|
|||
|
||||
try {
|
||||
const res = await API.post('/ki/geburtstag', {
|
||||
dog_id: dog.id,
|
||||
name: dog.name,
|
||||
rasse: dog.rasse || null,
|
||||
alter: dog.alter_jahre ? Math.round(dog.alter_jahre) : null,
|
||||
dog_id: bdayDog.id,
|
||||
name: bdayDog.name,
|
||||
rasse: bdayDog.rasse || null,
|
||||
alter: bdayDog.alter_jahre ? Math.round(bdayDog.alter_jahre) : null,
|
||||
mode: bdayMode,
|
||||
});
|
||||
const body = ov.querySelector('#bday-ki-body');
|
||||
|
|
|
|||
|
|
@ -824,6 +824,10 @@
|
|||
<div class="stats-band-num" id="big-posts">…</div>
|
||||
<div class="stats-band-label">Forum-Beiträge</div>
|
||||
</div>
|
||||
<div class="stats-band-item fade-up">
|
||||
<div class="stats-band-num" id="big-kotbeutel">…</div>
|
||||
<div class="stats-band-label">Kotbeutel-Stationen</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
|
@ -1579,7 +1583,8 @@
|
|||
set('big-users', d.users);
|
||||
set('big-dogs', d.dogs);
|
||||
set('big-km', d.km);
|
||||
set('big-posts', d.forum_posts);
|
||||
set('big-posts', d.forum_posts);
|
||||
set('big-kotbeutel', d.kotbeutel);
|
||||
|
||||
var heroStats = document.getElementById('hero-stats');
|
||||
if (heroStats && d.users > 0) heroStats.style.display = 'flex';
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
Offline-Cache + Push Notifications + Tile-Cache
|
||||
============================================================ */
|
||||
|
||||
const CACHE_VERSION = 'by-v961';
|
||||
const CACHE_VERSION = 'by-v962';
|
||||
const CACHE_STATIC = `${CACHE_VERSION}-static`;
|
||||
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten
|
||||
const CACHE_API = 'ban-yaro-api-v1'; // API-Response-Cache
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue