added flash

This commit is contained in:
2019-08-20 18:54:13 -05:00
parent a9e86fdaab
commit bb2b3c6d35
2 changed files with 16 additions and 15 deletions

View File

@@ -13,6 +13,12 @@
<a href="/login">Login</a> <a href="/login">Login</a>
</div> </div>
<hr> <hr>
{% with messages = get_flashed_messages() %}
{% if messages %}
<ul>
{% for message in messages %}
<li>{{ message }}</li>
{% endfor %}
{% block content %}{% endblock %} {% block content %}{% endblock %}
</body> </body>
</html> </html>

View File

@@ -1,15 +1,10 @@
<html> {% extends "base.html" %}
<head>
{% if title %} {% block content %}
<title>{{ title }} - Microblog</title> <body>
{% else %} <h1>Hello, {{ user.username }}!</h1>
<title>Welcome to Microblog</title> {% for post in posts %}
{% endif %} <div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
</head>
<body>
<h1>Hello, {{ user.username }}!</h1>
{% for post in posts %}
<div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
{% endfor %} {% endfor %}
</body> </body>
</html> {% endblock %}