ltx/app/templates/index.html
2023-04-29 13:15:20 -07:00

45 lines
1.5 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<title>Life Tracker Expanded</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-giJF6kkoqNQ00vy+HMDP7azOuL0xtbfIcaT9wjKHr8RbDVddVHyTfAAsrekwKmP1" crossorigin="anonymous">
<!-- HTMX -->
<script src="https://unpkg.com/htmx.org@1.5.0"></script>
<link rel="stylesheet" href="/static/ltx.css"/>
</head>
<body>
<h1>Life Tracker, Expanded</h1>
<table>
<thead>
<tr>
<th scope="col">Date</th>
<th scope="col">Day</th>
{% for m in ["am", "pm"]%}
<th scope="col">12 {{m}}</th>
{% for t in range(1,12) %}
<th scope="col">{{t}} {{m}}</th>
{% endfor %}
{% endfor %}
</tr>
</thead>
<tbody id="new-book" hx-target="closest tr" hx-swap="outerHTML swap:0.5s">
{%for book in books%}
<tr>
<td>{{book.Book.title}}</td>
<td>{{book.Author.name}}</td>
<td>
<button class="btn btn-primary"
hx-get="/get-edit-form/{{book.Book.book_id}}">
Edit Title
</button>
</td>
<td>
<button hx-delete="/delete/{{book.Book.book_id}}" class="btn btn-primary">Delete</button>
</td>
</tr>
{%endfor%}
</tbody>
</table>
</body>
</html>