microblog/app/templates/user.html

52 lines
2.2 KiB
HTML
Raw Normal View History

{% extends "base.html" %}
2017-09-27 06:43:28 +00:00
{% block app_content %}
<table class="table table-hover">
<tr>
<td width="256px"><img src="{{ user.avatar(256) }}"></td>
<td>
2017-09-30 07:21:17 +00:00
<h1>{{ _('User') }}: {{ user.username }}</h1>
{% if user.about_me %}<p>{{ user.about_me }}</p>{% endif %}
2017-09-29 05:28:20 +00:00
{% if user.last_seen %}
2017-09-30 07:21:17 +00:00
<p>{{ _('Last seen on') }}: {{ moment(user.last_seen).format('LLL') }}</p>
2017-09-29 05:28:20 +00:00
{% endif %}
2017-09-30 07:21:17 +00:00
<p>{{ _('%(count)d followers', count=user.followers.count()) }}, {{ _('%(count)d following', count=user.followed.count()) }}</p>
{% if user == current_user %}
2017-09-30 07:21:17 +00:00
<p><a href="{{ url_for('edit_profile') }}">{{ _('Edit your profile') }}</a></p>
2017-09-16 07:05:17 +00:00
{% elif not current_user.is_following(user) %}
<p>
<form action="{{ url_for('follow', username=user.username) }}" method="post">
{{ form.hidden_tag() }}
2017-09-30 07:21:17 +00:00
{{ form.submit(value=_('Follow'), class_='btn btn-default') }}
2017-09-16 07:05:17 +00:00
</form>
</p>
{% else %}
<p>
<form action="{{ url_for('unfollow', username=user.username) }}" method="post">
{{ form.hidden_tag() }}
2017-09-30 07:21:17 +00:00
{{ form.submit(value=_('Unfollow'), class_='btn btn-default') }}
2017-09-16 07:05:17 +00:00
</form>
</p>
{% endif %}
</td>
</tr>
</table>
{% for post in posts %}
{% include '_post.html' %}
{% endfor %}
2017-09-27 06:43:28 +00:00
<nav aria-label="...">
<ul class="pager">
<li class="previous{% if not prev_url %} disabled{% endif %}">
<a href="{{ prev_url or '#' }}">
2017-09-30 07:21:17 +00:00
<span aria-hidden="true">&larr;</span> {{ _('Newer posts') }}
2017-09-27 06:43:28 +00:00
</a>
</li>
<li class="next{% if not next_url %} disabled{% endif %}">
<a href="{{ next_url or '#' }}">
2017-09-30 07:21:17 +00:00
{{ _('Older posts') }} <span aria-hidden="true">&rarr;</span>
2017-09-27 06:43:28 +00:00
</a>
</li>
</ul>
</nav>
{% endblock %}