This commit is contained in:
@@ -12,6 +12,16 @@
|
||||
<p>{{ weight.date }}: {{ weight.weight }} kg by {{ weight.user_id }}</p>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<a href="/input">Add Weight</a>
|
||||
<button onclick="document.getElementById('inputDialog').showModal()">Add Weight</button>
|
||||
<dialog id="inputDialog">
|
||||
<h1>Add Weight</h1>
|
||||
<form hx-post="/input" hx-target="#weights" hx-swap="innerHTML" hx-on:htmx:after-request="document.getElementById('inputDialog').close()">
|
||||
<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>
|
||||
</dialog>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user