OSM-Beiträge: "Hund willkommen?" 👍/👎 (dog=yes/no) + Umdrehen

- dog=no zusätzlich zu dog=yes (Pächterwechsel → Ort nicht mehr hundefreundlich).
- Map-Popup: ein "Hund willkommen?"-Block mit Daumen hoch/runter statt zwei
  Buttons. Beide rufen /dog-friendly mit welcome=true|false.
- Backend generisch: tag_value yes|no; vorhandene Markierung mit anderem Wert
  wird umgedreht (Update statt 409); submit_dog_tag(value); Confirm/Revert prüft
  gegen den jeweiligen tag_value; Changeset-Kommentar wertabhängig.
This commit is contained in:
rene 2026-06-03 21:49:44 +02:00
parent 57849515ea
commit 9afbf24535
7 changed files with 100 additions and 67 deletions

View file

@ -86,14 +86,14 @@
<title>Ban Yaro</title>
<!-- Theme + theme-color Statusleiste vor CSS setzen -->
<script src="/js/boot-early.js?v=1157"></script>
<script src="/js/boot-early.js?v=1158"></script>
<!-- CSS: Reihenfolge ist wichtig — ?v= zwingt Browser zur Neuladung -->
<link rel="stylesheet" href="/css/design-system.css?v=1157">
<link rel="stylesheet" href="/css/layout.css?v=1157">
<link rel="stylesheet" href="/css/components.css?v=1157">
<link rel="stylesheet" href="/css/utilities.css?v=1157">
<link rel="stylesheet" href="/css/lists.css?v=1157">
<link rel="stylesheet" href="/css/design-system.css?v=1158">
<link rel="stylesheet" href="/css/layout.css?v=1158">
<link rel="stylesheet" href="/css/components.css?v=1158">
<link rel="stylesheet" href="/css/utilities.css?v=1158">
<link rel="stylesheet" href="/css/lists.css?v=1158">
</head>
<body>
@ -617,11 +617,11 @@
<div id="modal-container"></div>
<!-- JS: Reihenfolge ist wichtig — erst Basis, dann Features -->
<script src="/js/api.js?v=1157"></script>
<script src="/js/ui.js?v=1157"></script>
<script src="/js/app.js?v=1157"></script>
<script src="/js/worlds.js?v=1157"></script>
<script src="/js/offline-indicator.js?v=1157"></script>
<script src="/js/api.js?v=1158"></script>
<script src="/js/ui.js?v=1158"></script>
<script src="/js/app.js?v=1158"></script>
<script src="/js/worlds.js?v=1158"></script>
<script src="/js/offline-indicator.js?v=1158"></script>
<!-- Feature-Seiten werden lazy geladen -->
@ -631,7 +631,7 @@
<!-- Boot: Offline-Banner + SW-Registration (extrahiert für CSP) -->
<script src="/js/boot.js?v=1157"></script>
<script src="/js/boot.js?v=1158"></script>
</body>

View file

@ -3,7 +3,7 @@
Router, State-Management, Navigation, Initialisierung.
============================================================ */
const APP_VER = '1157'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VER = '1158'; // ← bei jedem Deploy mit Frontend-Änderungen erhöhen
const APP_VERSION = '1.6.0'; // ← semantische Version, wird bei make release gesetzt
window.APP_VER = APP_VER; // global verfügbar für andere Module (z.B. offline-indicator)
window.APP_VERSION = APP_VERSION;

View file

@ -1103,13 +1103,21 @@ window.Page_map = (() => {
? `<button class="btn btn-danger btn-sm" id="mp-action">Löschen</button>`
: `<button class="btn btn-secondary btn-sm" id="mp-action">Als ungültig melden</button>`;
// "Hund war willkommen" (dog=yes) — nur bei OSM-POIs, wo's Sinn ergibt
// "Hund willkommen?" — 👍/👎 (dog=yes/no) bei OSM-POIs, wo's Sinn ergibt.
// dog=no nötig, weil Pächter wechseln und ein Ort nicht mehr hundefreundlich wird.
const DOG_TYPES = ['restaurant', 'hotel', 'shop', 'tierarzt', 'hundesalon'];
const dogBtn = (poi.source === 'osm' && DOG_TYPES.includes(layerKey))
? `<button class="btn btn-primary btn-sm" id="mp-dogyes" style="width:100%;margin-bottom:6px">
<svg class="ph-icon" aria-hidden="true" style="width:14px;height:14px"><use href="/icons/phosphor.svg#dog"></use></svg>
Hund war willkommen
</button>`
? `<div style="margin-bottom:8px">
<div style="font-size:11px;color:#666;margin-bottom:4px">Hund willkommen?</div>
<div style="display:flex;gap:6px">
<button class="btn btn-secondary btn-sm" id="mp-dogyes" style="flex:1" title="Hund willkommen">
<svg class="ph-icon" aria-hidden="true" style="width:15px;height:15px"><use href="/icons/phosphor.svg#thumbs-up"></use></svg>
</button>
<button class="btn btn-secondary btn-sm" id="mp-dogno" style="flex:1" title="Hund nicht willkommen">
<svg class="ph-icon" aria-hidden="true" style="width:15px;height:15px"><use href="/icons/phosphor.svg#thumbs-down"></use></svg>
</button>
</div>
</div>`
: '';
const openHours = poi.opening_hours
@ -1139,20 +1147,27 @@ window.Page_map = (() => {
if (isOwn) _deleteUserPoi(poi.user_poi_id, marker, layerKey);
else _showReportDialog(poi);
});
document.getElementById('mp-dogyes')?.addEventListener('click', async () => {
const b = document.getElementById('mp-dogyes');
b.disabled = true;
const _sendDog = async (welcome) => {
const yes = document.getElementById('mp-dogyes');
const no = document.getElementById('mp-dogno');
if (yes) yes.disabled = true;
if (no) no.disabled = true;
try {
const r = await API.post('/osm-contrib/dog-friendly', {
osm_id: poi.id, osm_type: 'node', poi_type: layerKey, lat: poi.lat, lon: poi.lon,
osm_id: poi.id, osm_type: 'node', poi_type: layerKey,
lat: poi.lat, lon: poi.lon, welcome,
});
UI.toast.success(r.submitted ? 'Eingetragen — danke! 🐾' : 'Erfasst — wird übertragen 🐾');
b.innerHTML = '✓ Eingetragen';
UI.toast.success((welcome ? 'Hund willkommen' : 'Hund nicht willkommen')
+ (r.submitted ? ' — eingetragen 🐾' : ' — wird übertragen 🐾'));
marker.closePopup();
} catch (e) {
UI.toast.error(e?.message || 'Konnte nicht eintragen.');
b.disabled = false;
if (yes) yes.disabled = false;
if (no) no.disabled = false;
}
});
};
document.getElementById('mp-dogyes')?.addEventListener('click', () => _sendDog(true));
document.getElementById('mp-dogno')?.addEventListener('click', () => _sendDog(false));
}, 50);
}

View file

@ -4,7 +4,7 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="color-scheme" content="light dark">
<script src="/js/landing-init.js?v=1157"></script>
<script src="/js/landing-init.js?v=1158"></script>
<title>Ban Yaro — Die Hunde-App für Deutschland, Österreich & Schweiz</title>
<meta name="description" content="Ban Yaro: Die kostenlose All-in-One Hunde-App für DACH. Tagebuch, Giftköder-Alarm, Training mit KI, Forum, Wurfbörse, Stammbaum, Inzucht-Check — DSGVO-konform, offline-fähig, ohne App Store.">
<meta name="keywords" content="Hunde App, Hunde Community, Wurfbörse, Züchter, Welpen kaufen, Stammbaum Hund, Inzuchtkoeffizient, Hundezucht, Impfpass Hund, Giftköder Alarm, Gassi Community, Hundetraining App, Hunde Forum, Hunde KI, Hundefilm Datenbank, Welpen Marktplatz">

View file

@ -4,7 +4,7 @@
============================================================ */
// ← EINZIGE Stelle für die Version — STATIC_ASSETS und CACHE_VERSION leiten sich ab
const VER = '1157';
const VER = '1158';
const CACHE_VERSION = `by-v${VER}`;
const CACHE_STATIC = `${CACHE_VERSION}-static`;
const CACHE_TILES = 'ban-yaro-tiles-v1'; // bleibt über SW-Updates erhalten