cs50/templates/index.html

64 lines
2.4 KiB
HTML
Raw Normal View History

2024-04-21 22:57:52 +03:00
<!DOCTYPE html>
<html lang="en">
2024-04-21 22:58:46 +03:00
2024-04-21 22:57:52 +03:00
<head>
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@500&display=swap" rel="stylesheet">
<link href="/static/styles.css" rel="stylesheet">
<title>Birthdays</title>
</head>
2024-04-21 22:58:46 +03:00
2024-04-21 22:57:52 +03:00
<body>
<div class="header">
<h1>Birthdays</h1>
</div>
<div class="container">
<div class="section">
<h2>Add a Birthday</h2>
<!-- Create a form for users to submit a name, a day, and a month -->
<form action="/" method="POST">
<input autocomplete="off" autofocus name="name" placeholder="Name" type="text">
<input autocomplete="off" autofocus name="day" placeholder="Day" type="number">
<input autocomplete="off" autofocus name="month" placeholder="Month" type="number">
<input type="submit" value="Add Birthday">
</form>
</div>
<div class="section">
<h2>All Birthdays</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Birthday</th>
<th>
<form action="/remove_all" method="POST">
<input type="submit" value="Remove all">
</form>
</th>
</tr>
</thead>
<tbody>
<!-- TODO: Loop through the database entries to display them in this table -->
{% for bday in bdays %}
<tr>
<td>{{ bday.name }}</td>
<td>{{ bday.day }}.{{ bday.month }}</td>
<td>
<form action="/remove" method="POST">
<input type="hidden" name="id" value="{{ bday.id }}">
<input type="submit" value="Remove">
</form>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</body>
2024-04-21 22:58:46 +03:00
2024-04-21 22:57:52 +03:00
</html>