diff --git a/backend/static/js/pages/health.js b/backend/static/js/pages/health.js
index 540e507..09885c1 100644
--- a/backend/static/js/pages/health.js
+++ b/backend/static/js/pages/health.js
@@ -31,17 +31,17 @@ window.Page_health = (() => {
async function refresh() {
if (!_appState.activeDog) return;
- if (!_container.querySelector('#health-tabs')) {
- await _render();
+ if (_appState.dogs.length > 1) {
+ _renderDogPicker();
return;
}
- await _loadAll();
- _renderTab();
+ _data = {};
+ await _renderHealth();
}
async function onDogChange() {
_data = {};
- await _render();
+ await _renderHealth();
}
function openNew() {
@@ -49,7 +49,7 @@ window.Page_health = (() => {
}
// ----------------------------------------------------------
- // RENDER — Hauptstruktur
+ // RENDER — Einstieg: Picker bei mehreren Hunden, sonst direkt
// ----------------------------------------------------------
async function _render() {
if (!_appState.activeDog) {
@@ -62,6 +62,50 @@ window.Page_health = (() => {
return;
}
+ if (_appState.dogs.length > 1) {
+ _renderDogPicker();
+ } else {
+ await _renderHealth();
+ }
+ }
+
+ // ----------------------------------------------------------
+ // HUNDE-PICKER
+ // ----------------------------------------------------------
+ function _renderDogPicker() {
+ const activeDogId = _appState.activeDog?.id;
+
+ const cards = _appState.dogs.map(dog => {
+ const isActive = dog.id === activeDogId;
+ const av = dog.foto_url
+ ? ``
+ : `🐕`;
+ return `
+
Wessen Gesundheitsakte?
+