mirror of
https://github.com/rmontanana/microblog.git
synced 2025-08-17 00:05:51 +00:00
Chapter 11
This commit is contained in:
@@ -1,50 +1,49 @@
|
||||
{% extends 'base.html' %}
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block content %}
|
||||
<table>
|
||||
<tr valign="top">
|
||||
<td>
|
||||
<img src="{{ user.avatar(128) }}" />
|
||||
</td>
|
||||
<td>
|
||||
<h1>User: {{ user.username }}</h1>
|
||||
{% if user.about_me %}
|
||||
<p>{{ user.about_me }}</p>
|
||||
{% endif %}
|
||||
{% if user.last_seen %}
|
||||
<p>Last seen on: {{ user.last_seen }}</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>{{ user.followers.count() }} followers, {{ user.followed.count() }} following.</p>
|
||||
{% if user == current_user %}
|
||||
<p>
|
||||
<a href="{{ url_for('edit_profile') }}">Edit your profile</a>
|
||||
</p>
|
||||
{% elif not current_user.is_following(user) %}
|
||||
<p>
|
||||
<form action="{{ url_for('follow', username = user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value = 'Follow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
<form action="{{ url_for('unfollow', username = user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value = 'Unfollow') }}
|
||||
</form>
|
||||
</p>
|
||||
{% endif %}
|
||||
<hr />
|
||||
{% 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 %}
|
||||
{% block app_content %}
|
||||
<table class="table table-hover">
|
||||
<tr>
|
||||
<td width="256px"><img src="{{ user.avatar(256) }}"></td>
|
||||
<td>
|
||||
<h1>User: {{ user.username }}</h1>
|
||||
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
|
||||
{% if user.last_seen %}<p>Last seen on: {{ user.last_seen }}</p>{% endif %}
|
||||
<p>{{ user.followers.count() }} followers, {{ user.followed.count() }} following.</p>
|
||||
{% if user == current_user %}
|
||||
<p><a href="{{ url_for('edit_profile') }}">Edit your profile</a></p>
|
||||
{% elif not current_user.is_following(user) %}
|
||||
<p>
|
||||
<form action="{{ url_for('follow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Follow', class_='btn btn-default') }}
|
||||
</form>
|
||||
</p>
|
||||
{% else %}
|
||||
<p>
|
||||
<form action="{{ url_for('unfollow', username=user.username) }}" method="post">
|
||||
{{ form.hidden_tag() }}
|
||||
{{ form.submit(value='Unfollow', class_='btn btn-default') }}
|
||||
</form>
|
||||
</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{% for post in posts %}
|
||||
{% include '_post.html' %}
|
||||
{% endfor %}
|
||||
<nav aria-label="...">
|
||||
<ul class="pager">
|
||||
<li class="previous{% if not prev_url %} disabled{% endif %}">
|
||||
<a href="{{ prev_url or '#' }}">
|
||||
<span aria-hidden="true">←</span> Newer posts
|
||||
</a>
|
||||
</li>
|
||||
<li class="next{% if not next_url %} disabled{% endif %}">
|
||||
<a href="{{ next_url or '#' }}">
|
||||
Older posts <span aria-hidden="true">→</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
{% endblock %}
|
Reference in New Issue
Block a user