{% extends '_layout.html'|pjax:request %}
{% load i18n %}

{% block page_title %}{{ block.super }} | {{ item.username }} | {% trans "Profile" %}{% endblock %}

{% block main_content %}
<div class="container">
    <div class="row">
        <div class="col-sm-3 profile-sidebar">
            <div class="panel panel-primary">
                <div class="panel-heading text-center">
                    <h1 class="panel-title">{{ item.username }}</h1>
                </div>
                <div class="avatar">
                    <div class="badges">
                        {% if item.is_staff %}
                        <span class="label label-warning">
                            <i class="glyphicon glyphicon-star"></i>
                            STAFF
                        </span>
                        {% endif %}
                    </div>
                    <img src="{{ item.avatar }}" class="max-width-100" />
                </div>
                <div class="list-group">
                    <a href="{% url 'profile' item.username %}" class="list-group-item {% if section == 'summary' %}active{% endif %}">
                        {% trans "Summary" %}</a>
                    {% if item.have_volumes.count > 0 %}
                    <a href="{% url 'profile' item.username 'collection' %}" class="list-group-item {% if section == 'collection' %}active{% endif %}">
                        {% trans "Collection" %}</a>
                    {% endif %}
                    {% if item.wishlisted_volumes.count > 0 %}
                    <a href="{% url 'profile' item.username 'wishlist' %}" class="list-group-item {% if section == 'wishlist' %}active{% endif %}">
                        {% trans "Wishlist" %}</a>
                    {% endif %}
                    {% comment %}
                    <a href="{% url 'profile' item.username 'achievements' %}" class="list-group-item {% if section == 'achievements' %}active{% endif %}">
                        {% trans "Achievements" %}</a>
                    {% endcomment %}
                </div>
            </div>
            <div>
                {% if request.user.pk == item.pk %}
                <a href="{% url 'account' %}" class="btn btn-info btn-block">
                    {% trans "Edit my profile" %}
                </a>
                {% endif %}
            </div>
        </div>
        <div class="col-sm-9">
            {% block profile_content %}
                {% include "users/profile/summary.html" %}
            {% endblock %}
        </div>
    </div>
</div>
{% endblock %}
