Feature: Tagebuch Ort/POI, Foto/Video-Edit, Modal-UX, iOS-Fixes
Tagebuch — Ort/POI (DayOne-ähnlich):
- diary.location_name Spalte, DiaryCreate/Update mit gps_lat/lon/location_name
- GET /api/dogs/{id}/diary/nearby: Overpass + Nominatim (vor {entry_id}-Route)
- Mini-Karte im Edit-Formular: Leaflet lazy, Edit-Modus, SVG-Pin
- Meilenstein-Toggle: Button statt Checkbox, Filter in Toolbar
- Datenmigration: 97 Ort-Einträge aus text → location_name
Tagebuch — Foto/Video:
- Foto/Video im Edit: Ersetzen + Löschen, DELETE media endpoint
- Media-Picker: Kamera/Mediathek/Datei Buttons
- Video-Wiedergabe (<video controls> in Detail + Edit)
Modal-UX (alle Edit-Karten vereinheitlicht):
- Footer-Pattern: [Speichern vollbreit] / [Löschen][Abbrechen]
- diary, dog-profile, events, health, places, walks, settings, sitting
- Löschen aus Detail-Modal → Edit-Form verschoben
iOS Mobile-Fixes:
- Auto-Zoom: input/select/textarea font-size 16px !important
- Scroll-Through: html.modal-open + touch-action:none auf Overlay
- Kein position:fixed mehr auf body (kein Scroll-Sprung)
PWA & Icons:
- icon-512-any.png + icon-192-any.png (quadratisch, maskable)
- manifest.json: purpose any/maskable getrennt
- Gesundheits-Icon: syringe → first-aid
Import-Fix:
- _HTMLStripper überspringt video/audio/script → kein "Video nicht gefunden" mehr
This commit is contained in:
parent
88912e2746
commit
f8d354749d
19 changed files with 963 additions and 198 deletions
|
|
@ -911,10 +911,7 @@ window.Page_health = (() => {
|
|||
: `<img src="${entry.datei_url}" style="width:100%;border-radius:var(--radius-md);margin-top:var(--space-3)" alt="Dokument">`)
|
||||
: ''}
|
||||
</div>
|
||||
<div style="display:flex;gap:var(--space-2);margin-top:var(--space-5)">
|
||||
<button class="btn btn-secondary flex-1" id="health-detail-edit">Bearbeiten</button>
|
||||
<button class="btn btn-danger flex-1" id="health-detail-delete">Löschen</button>
|
||||
</div>
|
||||
<button class="btn btn-secondary" style="width:100%;margin-top:var(--space-5)" id="health-detail-edit">Bearbeiten</button>
|
||||
`;
|
||||
|
||||
const modalTitle = entry.typ === 'gewicht'
|
||||
|
|
@ -928,25 +925,6 @@ window.Page_health = (() => {
|
|||
UI.modal.close();
|
||||
_showForm(entry, entry.typ);
|
||||
});
|
||||
document.getElementById('health-detail-delete')?.addEventListener('click', async () => {
|
||||
const ok = await UI.modal.confirm({
|
||||
title: 'Eintrag löschen?',
|
||||
message: 'Dieser Vorgang kann nicht rückgängig gemacht werden.',
|
||||
confirmText: 'Löschen',
|
||||
danger: true,
|
||||
});
|
||||
if (ok) {
|
||||
try {
|
||||
await API.health.delete(_appState.activeDog.id, entry.id);
|
||||
_data[entry.typ] = (_data[entry.typ] || []).filter(e => e.id !== entry.id);
|
||||
UI.modal.close();
|
||||
_renderTab();
|
||||
UI.toast.success('Eintrag gelöscht.');
|
||||
} catch (err) {
|
||||
UI.toast.error(err.message || 'Fehler beim Löschen.');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function _detailFields(e) {
|
||||
|
|
@ -1031,8 +1009,13 @@ window.Page_health = (() => {
|
|||
`;
|
||||
|
||||
const footer = `
|
||||
<button type="button" class="btn btn-secondary flex-1" id="health-form-cancel">Abbrechen</button>
|
||||
<button type="submit" form="health-form" class="btn btn-primary flex-1">${isEdit ? 'Speichern' : 'Erstellen'}</button>
|
||||
<div style="display:flex;flex-direction:column;gap:var(--space-2);width:100%">
|
||||
<button type="submit" form="health-form" class="btn btn-primary" style="width:100%">${isEdit ? 'Speichern' : 'Erstellen'}</button>
|
||||
<div style="display:flex;gap:var(--space-2)">
|
||||
${isEdit ? `<button type="button" class="btn btn-danger" id="health-form-delete">Löschen</button>` : ''}
|
||||
<button type="button" class="btn btn-secondary flex-1" id="health-form-cancel">Abbrechen</button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
const tabInfo = _getTabs().find(tab => tab.key === t) || BASE_TABS[0];
|
||||
|
|
@ -1051,6 +1034,21 @@ window.Page_health = (() => {
|
|||
|
||||
document.getElementById('health-form-cancel')?.addEventListener('click', UI.modal.close);
|
||||
|
||||
document.getElementById('health-form-delete')?.addEventListener('click', async () => {
|
||||
const ok = await UI.modal.confirm({
|
||||
title: 'Eintrag löschen?', message: 'Nicht rückgängig.', confirmText: 'Löschen', danger: true,
|
||||
});
|
||||
if (ok) {
|
||||
try {
|
||||
await API.health.delete(_appState.activeDog.id, entry.id);
|
||||
_data[t] = (_data[t] || []).filter(e => e.id !== entry.id);
|
||||
UI.modal.close();
|
||||
_renderTab();
|
||||
UI.toast.success('Eintrag gelöscht.');
|
||||
} catch (err) { UI.toast.error(err.message || 'Fehler.'); }
|
||||
}
|
||||
});
|
||||
|
||||
form.addEventListener('submit', async e => {
|
||||
e.preventDefault();
|
||||
const btn = document.querySelector('[form="health-form"][type="submit"]') || form.querySelector('[type="submit"]');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue