From 22225d57175561f05dd05c2382b40e97a7af0159 Mon Sep 17 00:00:00 2001 From: rene Date: Sat, 25 Apr 2026 08:21:49 +0200 Subject: [PATCH] Pflege: Fell schneiden vs. trimmen + Tagebuch Medien-Button nach oben MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - dogs.py: Pflegeart-Filter (trimmen/schneiden) anhand Rassen-Beschreibung - dog-profile.js: Badge '✂️ Schneiden' / '✋ Trimmen' bei Fell-Kategorie - diary.js: Fotos/Videos-Button direkt nach Textfeld (vor Ort und Meilenstein) - ki.py: Standardmodell auf claude-sonnet-4-6 umgestellt --- backend/routes/dogs.py | 27 ++++++++++++++------ backend/static/js/pages/diary.js | 34 ++++++++++++-------------- backend/static/js/pages/dog-profile.js | 15 ++++++++++-- 3 files changed, 49 insertions(+), 27 deletions(-) diff --git a/backend/routes/dogs.py b/backend/routes/dogs.py index 74b6d5b..0b09ae2 100644 --- a/backend/routes/dogs.py +++ b/backend/routes/dogs.py @@ -361,8 +361,9 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)): (f"%{dog['rasse']}%",) ).fetchone() - # Fell-Typ ableiten + # Fell-Typ und Pflegeart ableiten fell_filter = None + fell_pflege_art_filter = None if rasse_info: beschr = (rasse_info["beschreibung"] or "").lower() if any(w in beschr for w in ["lockig", "wellig", "kraus", "pudel", "doodle"]): @@ -374,6 +375,12 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)): elif rasse_info["groesse"] in ("gross", "sehr_gross"): fell_filter = "doppel" + # Pflegeart: Trimmen vs. Schneiden + if any(w in beschr for w in ["trimm", "hand-stripping", "stripping", "rauhhaar", "drahthaar", "rauhaar"]): + fell_pflege_art_filter = "trimmen" + elif any(w in beschr for w in ["schneid", "geschoren", "schere", "clipper"]): + fell_pflege_art_filter = "schneiden" + with db() as conn: alle_tipps = conn.execute( "SELECT * FROM pflege_tipps ORDER BY kategorie, titel" @@ -388,10 +395,15 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)): result = [] for t in alle_tipps: t = dict(t) - # Fell-Filter + # Fell-Typ-Filter if fell_filter and t["fell_typ"] and t["fell_typ"] != "alle": if fell_filter not in t["fell_typ"].split(","): continue + # Pflegeart-Filter: Trimm-Tipps nicht bei Schneidehunden und umgekehrt + tipp_art = t.get("fell_pflege_art") + if tipp_art and tipp_art != "alle" and fell_pflege_art_filter: + if tipp_art != fell_pflege_art_filter: + continue t["schritte"] = _json.loads(t["schritte"] or "[]") t["saisonal_aktuell"] = bool(t["saison"] and heute_saison in t["saison"]) result.append(t) @@ -403,9 +415,10 @@ async def get_pflege_tipps(dog_id: int, user=Depends(get_current_user)): tipp_des_tages = (saisonal or result)[day_hash % len(saisonal or result)] if result else None return { - "dog_name": dog["name"], - "rasse_name": rasse_info["name"] if rasse_info else dog["rasse"], - "tipp_des_tages": tipp_des_tages, - "tipps": result, - "kategorien": list(dict.fromkeys(t["kategorie"] for t in result)), + "dog_name": dog["name"], + "rasse_name": rasse_info["name"] if rasse_info else dog["rasse"], + "tipp_des_tages": tipp_des_tages, + "tipps": result, + "kategorien": list(dict.fromkeys(t["kategorie"] for t in result)), + "fell_pflege_art": fell_pflege_art_filter, # 'schneiden' | 'trimmen' | None } diff --git a/backend/static/js/pages/diary.js b/backend/static/js/pages/diary.js index d21aeed..706d561 100644 --- a/backend/static/js/pages/diary.js +++ b/backend/static/js/pages/diary.js @@ -700,6 +700,22 @@ window.Page_diary = (() => { +
+ +
+ + + + + + + + + +
@@ -744,24 +760,6 @@ window.Page_diary = (() => { ${entry?.is_milestone ? 'Meilenstein ✓' : 'Als Meilenstein markieren'}
-
- - - -
- - - - - - - - - -
`; diff --git a/backend/static/js/pages/dog-profile.js b/backend/static/js/pages/dog-profile.js index 9a9df54..e9ed5b4 100644 --- a/backend/static/js/pages/dog-profile.js +++ b/backend/static/js/pages/dog-profile.js @@ -349,6 +349,16 @@ window.Page_dog_profile = (() => { 'Saisonal':'🌸','Gesundheitsvorsorge':'❤️','Welpen-Pflege':'🐶', }; + const pflegeArtBadge = data.fell_pflege_art === 'schneiden' + ? `✂️ Schneiden` + : data.fell_pflege_art === 'trimmen' + ? `✋ Trimmen` + : ''; + el.innerHTML = `
@@ -396,11 +406,12 @@ window.Page_dog_profile = (() => {