mirror of
https://github.com/rmontanana/microblog.git
synced 2025-08-17 16:25:51 +00:00
Chapter 8
This commit is contained in:
@@ -4,7 +4,8 @@
|
||||
<img src="{{ post.author.avatar(36) }}" />
|
||||
</td>
|
||||
<td>
|
||||
{{ post.author.username }} says:<br />{{ post.body }}
|
||||
<a href="{{ url_for('user', username = post.author.username) }}">{{ post.author.username }}</a>
|
||||
says:<br />{{ post.body }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@@ -14,6 +14,7 @@
|
||||
<a href="{{ url_for('login') }}">Login</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('user', username = current_user.username) }}">Profile</a>
|
||||
<a href="{{ url_for('explore') }}">Explore</a>
|
||||
<a href="{{ url_for('logout') }}">Logout</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
@@ -2,11 +2,20 @@
|
||||
|
||||
{% block content %}
|
||||
<h1>Hi, {{ current_user.username }}!</h1>
|
||||
{% for post in posts %}
|
||||
<div>
|
||||
{% if form %}
|
||||
<form action="" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
<p>
|
||||
{{ post.author.username }} says: <b>{{ post.body }}</b>
|
||||
{{ form.post.label }}<br />
|
||||
{{ form.post(cols = 32, rows = 4) }}<br />
|
||||
{% for error in form.post.errors %}
|
||||
<span style="color: red;">[{{ error }}]</span>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
<p>{{ form.submit() }}</p>
|
||||
</form>
|
||||
{% endif %}
|
||||
{% for post in posts %}
|
||||
{% include "_post.html" %}
|
||||
{% endfor %}
|
||||
{% endblock %}
|
||||
{% endblock %}s
|
||||
|
Reference in New Issue
Block a user