Skip to content

Commit 9022c42

Browse files
committed
Add layout
1 parent e4085a7 commit 9022c42

File tree

2 files changed

+22
-10
lines changed

2 files changed

+22
-10
lines changed

templates/index.html

+14-10
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<form action="{{ url_for('user') }}" method="post">
2-
<label for="name">Name</label>
3-
<input id="name" type="text" name="name" placeholder="John Smith"/>
4-
<label for="email">Email</label>
5-
<input id="email" type="text" name="email" placeholder="[email protected]"/>
6-
<button type="submit">Save</button>
7-
</form>
8-
{% for u in users %}
9-
<p>{{ u.name }} -- {{ u.email }}</p>
10-
{% endfor %}
1+
{% extends "layout.html" %}
2+
3+
{% block body %}
4+
<form action="{{ url_for('user') }}" method="post">
5+
<label for="name">Name</label>
6+
<input id="name" type="text" name="name" placeholder="John Smith"/>
7+
<label for="email">Email</label>
8+
<input id="email" type="text" name="email" placeholder="[email protected]"/>
9+
<button type="submit">Save</button>
10+
</form>
11+
{% for u in users %}
12+
<p>{{ u.name }} -- {{ u.email }}</p>
13+
{% endfor %}
14+
{% endblock %}

templates/layout.html

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
</head>
5+
<body>
6+
{% block body %}{% endblock %}
7+
</body>
8+
</html>

0 commit comments

Comments
 (0)