mgt c9 complete

This commit is contained in:
2024-08-04 13:14:58 -07:00
parent 94434d4f8e
commit 61c8cadb87
7 changed files with 75 additions and 29 deletions

View File

@ -2,9 +2,25 @@
{% block content %}
<h1>Hello, {{ current_user.username }}!</h1>
{% if form %}
<form action="" method="post">
{{ form.hidden_tag() }}
<p>
{{ form.post.label }}
{{ form.post(cols=32, rows=4) }}
{% for error in form.post.errors %}
<span style="color: red;">[{{ error }}]</span>
{% endfor %}
</p>
<p>{{ form.submit() }}</p>
</form>
{% endif %}
{% for post in posts %}
<div><p>{{ post.author.username }} says: <b>{{ post.body }}</b></p></div>
{% include '_post.html' %}
{% endfor %}
{% if prev_url %}<a href="{{ prev_url }}">Newer Posts</a>{% endif %}
{% if next_url %}<a href="{{ next_url }}">Older Posts</a>{% endif %}
{% endblock %}