Code refactor and formatting

This commit is contained in:
Mikołaj Kaczmarek
2025-06-15 22:30:26 +02:00
parent 870b937bf4
commit ff6b595652
8 changed files with 85 additions and 18 deletions

33
src/templates/index.html Normal file
View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<title>Strona główna</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<h1>Witamy na stronie głównej!</h1>
<ul>
<li><a href="{{ url_for('logowanie') }}">Logowanie</a></li>
<li><a href="{{ url_for('signup') }}">Rejestracja</a></li>
<li>
<form id="pogodaForm" action="#" method="get" style="display:inline;" onsubmit="return goToWeather();">
<label for="city">Pogoda dla miasta:</label>
<input type="text" id="city" name="city" required>
<button type="submit">Sprawdź</button>
</form>
<script>
function goToWeather() {
var city = document.getElementById('city').value;
if(city) {
window.location.href = '/pogoda/' + encodeURIComponent(city);
}
return false;
}
</script>
</li>
<li><a href="{{ url_for('zaloguj') }}">Zaloguj (test sesji)</a></li>
<li><a href="{{ url_for('wyloguj') }}">Wyloguj (test sesji)</a></li>
</ul>
</body>
</html>