chore: initialized repository
This commit is contained in:
17
templates/index.html
Normal file
17
templates/index.html
Normal file
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Weight Tracker</title>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Weight Tracker</h1>
|
||||
<div id="weights">
|
||||
{% for weight in weights %}
|
||||
<p>{{ weight.date }}: {{ weight.weight }} kg by {{ weight.user_id }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a href="/input">Add Weight</a>
|
||||
</body>
|
||||
</html>
|
||||
20
templates/input.html
Normal file
20
templates/input.html
Normal file
@@ -0,0 +1,20 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Add Weight</title>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.10"></script>
|
||||
<link rel="stylesheet" href="/static/css/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<h1>Add Weight</h1>
|
||||
<form hx-post="/input" hx-target="#result" hx-swap="innerHTML">
|
||||
<label for="date">Date:</label>
|
||||
<input type="date" id="date" name="date" required><br>
|
||||
<label for="weight">Weight (kg):</label>
|
||||
<input type="number" step="0.1" id="weight" name="weight" required><br>
|
||||
<button type="submit">Submit</button>
|
||||
</form>
|
||||
<div id="result"></div>
|
||||
<a href="/">Back to Tracker</a>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user