{% extends 'pybb/base.html' %}
{% load pybb_tags i18n thumbnail %}

{% block title %}{{ target_user.username }}{% endblock %}

{% block content %}
    <h1>{{ target_user.username }}</h1>
    <div class="userinfo">
    <div class="avatar">
        {% thumbnail target_user.get_profile.avatar "80x80" as avatar %}
            <img src="{{ avatar.url }}" alt="avatar">
        {% empty %}
            <img src="{{ PYBB_DEFAULT_AVATAR_URL }}" alt="avatar">
        {% endthumbnail %}
        </div>
        <div class="info">
            <div class="label">{% trans "Statistics" %}</div>
            <div>{% trans "Number of posts" %}: {{ target_user.posts.all.count }}.
            </div>
            <div>{% trans "Number of topics" %}: {{ topic_count }}.
                {% comment %}
                &nbsp;
                <a href="{% url pybb:user_topics profile.username %}">
                    {% trans "Find all topics" %}
                </a>
                {% endcomment %}
            </div>
            <div>{% trans "Date of registration" %}: {% pybb_time target_user.date_joined %}</div>
        </div>
        <div class="clear"></div>
    </div>
    <div class='controls'>
        {% if perms.pybb.block_users %}
            <a href='{% url pybb:block_user target_user.username %}'>{% trans 'Block' %}</a>
        {% endif %}
        {% if perms.pybb.can_edit %}
            <a href='{% url admin:pybb_profile_change target_user.pybb_profile.id %}'>{% trans 'Edit' %}</a>
        {% endif %}
    </div>

{% endblock %}
