added flash
This commit is contained in:
@@ -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>
|
||||||
|
|||||||
@@ -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 %}
|
||||||
Reference in New Issue
Block a user