main flask-todo/templates/index.html

18 lines499 B

<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Todo</title>
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
</head>
<body>
<h1>My todos</h1>
<form action="/add" method="post"><input name="title"><button>Add</button></form>
<ul>
{% for t in todos %}
<li class="{{ 'done' if t.done }}">{{ t.title }}
<form action="/done/{{ loop.index0 }}" method="post"><button>✓</button></form></li>
{% endfor %}
</ul>
</body>
</html>