microblog2/app/templates/index.html

30 lines
992 B
HTML
Raw Normal View History

2012-12-16 08:28:52 +00:00
<!-- extend base layout -->
2012-12-16 08:26:19 +00:00
{% extends "base.html" %}
2012-12-16 08:28:52 +00:00
2012-12-16 08:26:19 +00:00
{% block content %}
2012-12-16 08:34:46 +00:00
<h1>Hi, {{g.user.nickname}}!</h1>
<form action="" method="post" name="post">
{{form.hidden_tag()}}
<table>
<tr>
<td>Say something:</td>
<td>{{ form.post(size = 30, maxlength = 140) }}</td>
<td>
{% for error in form.errors.post %}
<span style="color: red;">[{{error}}]</span><br>
{% endfor %}
</td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Post!"></td>
<td></td>
</tr>
</table>
</form>
{% for post in posts.items %}
{% include 'post.html' %}
2012-12-16 08:26:19 +00:00
{% endfor %}
2012-12-16 08:34:46 +00:00
{% if posts.has_prev %}<a href="{{ url_for('index', page = posts.prev_num) }}"><< Newer posts</a>{% else %}<< Newer posts{% endif %} |
{% if posts.has_next %}<a href="{{ url_for('index', page = posts.next_num) }}">Older posts >></a>{% else %}Older posts >>{% endif %}
2012-12-16 08:26:19 +00:00
{% endblock %}