microblog/app/templates/user.html

58 lines
2.6 KiB
HTML
Raw Permalink Normal View History

{% extends "base.html" %}
{% block content %}
2017-09-27 06:43:28 +00:00
<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.following.count()) }}</p>
{% if user == current_user %}
<p><a href="{{ url_for('main.edit_profile') }}">{{ _('Edit your profile') }}</a></p>
2017-11-20 07:57:09 +00:00
{% if not current_user.get_task_in_progress('export_posts') %}
<p><a href="{{ url_for('main.export_posts') }}">{{ _('Export your posts') }}</a></p>
{% endif %}
2017-09-16 07:05:17 +00:00
{% elif not current_user.is_following(user) %}
<p>
<form action="{{ url_for('main.follow', username=user.username) }}" method="post">
2017-09-16 07:05:17 +00:00
{{ form.hidden_tag() }}
2017-09-30 07:21:17 +00:00
{{ form.submit(value=_('Follow'), class_='btn btn-primary') }}
2017-09-16 07:05:17 +00:00
</form>
</p>
{% else %}
<p>
<form action="{{ url_for('main.unfollow', username=user.username) }}" method="post">
2017-09-16 07:05:17 +00:00
{{ form.hidden_tag() }}
2017-09-30 07:21:17 +00:00
{{ form.submit(value=_('Unfollow'), class_='btn btn-primary') }}
2017-09-16 07:05:17 +00:00
</form>
</p>
{% endif %}
2017-11-13 07:53:18 +00:00
{% if user != current_user %}
<p><a href="{{ url_for('main.send_message', recipient=user.username) }}">{{ _('Send private message') }}</a></p>
{% endif %}
</td>
</tr>
</table>
{% for post in posts %}
{% include '_post.html' %}
{% endfor %}
2017-09-27 06:43:28 +00:00
<nav aria-label="Post navigation">
<ul class="pagination">
<li class="page-item{% if not prev_url %} disabled{% endif %}">
<a class="page-link" href="#">
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="page-item{% if not next_url %} disabled{% endif %}">
<a class="page-link" href="#">
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 %}