modified: app.py

modified:   templates/base.html
	modified:   templates/index.html
This commit is contained in:
simon
2026-04-27 11:20:01 +02:00
parent 68a7247938
commit 0baf55d8bc
3 changed files with 11 additions and 1 deletions

View File

@@ -15,6 +15,7 @@
<form class="nav-search" action="/wetter" method="get" autocomplete="off">
<div class="nav-search-wrap">
<svg class="nav-search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/></svg>
<input type="hidden" name="lang" value="{{ lang }}">
<input type="text" name="ort" id="nav-ort" placeholder="{{ T.nav_placeholder }}" value="{{ request.args.get('ort','') }}"/>
<ul class="ac-list" id="nav-ac"></ul>
</div>

View File

@@ -14,6 +14,7 @@
<svg class="home-search-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
<circle cx="11" cy="11" r="8"/><path d="m21 21-4.35-4.35"/>
</svg>
<input type="hidden" name="lang" value="{{ lang }}">
<input type="text" name="ort" id="home-ort" placeholder="{{ T.home_placeholder }}" required autofocus/>
<ul class="ac-list" id="home-ac"></ul>
</div>
@@ -61,7 +62,7 @@ document.getElementById("btn-location").addEventListener("click", function() {
this.textContent = _i18n.locating;
this.disabled = true;
navigator.geolocation.getCurrentPosition(
pos => { window.location = `/wetter?lat=${pos.coords.latitude}&lon=${pos.coords.longitude}&ort=Mein+Standort`; },
pos => { window.location = `/wetter?lat=${pos.coords.latitude}&lon=${pos.coords.longitude}&ort=Mein+Standort&lang={{ lang }}`; },
() => { this.textContent = _i18n.locationUnavailable; this.disabled = false; }
);
});