mgt c9 complete
This commit is contained in:
@ -1,6 +1,13 @@
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td style="vertical-align: middle;"><img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ user.gen_avatar(write_png=False) }}"></td>
|
||||
<td>{{ post.author.username }} says:<br>{{ post.body }}</td>
|
||||
<tr style="vertical-align: top;">
|
||||
<td style="vertical-align: middle; width: 60px;">
|
||||
<img style="vertical-align: middle; width: 40px;" src="data:image/png;base64,{{ post.author.gen_avatar(write_png=False) }}">
|
||||
</td>
|
||||
<td>
|
||||
<a href="{{ url_for('user', username=post.author.username) }}">
|
||||
{{ post.author.username }}
|
||||
</a> says:<br>
|
||||
{{ post.body }}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
@ -3,19 +3,20 @@
|
||||
<head>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='simple.css') }}">
|
||||
{% if title %}
|
||||
<title>{{ title }} - blog</title>
|
||||
<title>{{ title }} - blogpage</title>
|
||||
{% else %}
|
||||
<title>Welcome to blog.</title>
|
||||
{% endif %}
|
||||
</head>
|
||||
<body>
|
||||
<div>
|
||||
blgo:
|
||||
blog:
|
||||
<a href="{{ url_for('index') }}">home</a>
|
||||
<a href="{{ url_for('explore') }}">explore</a>
|
||||
{% if current_user.is_anonymous %}
|
||||
<a href="{{ url_for('login') }}">login</a>
|
||||
{% else %}
|
||||
<a href="{{ url_for('user', username=current_user.username) }}">Profile</a>
|
||||
<a href="{{ url_for('user', username=current_user.username) }}">profile</a>
|
||||
<a href="{{ url_for('logout') }}">logout</a>
|
||||
{% endif %}
|
||||
|
||||
|
@ -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 %}
|
||||
|
||||
|
||||
|
@ -38,5 +38,8 @@
|
||||
{% for post in posts %}
|
||||
{% 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 %}
|
||||
|
||||
|
Reference in New Issue
Block a user