{% extends theme("user/profile_layout.html") %}
{% from theme('macros.html') import render_pagination, topic_pages %}

{% block breadcrumb %}
<ul class="breadcrumb flaskbb-breadcrumb">
    <li><a href="{{ url_for('forum.index') }}">{% trans %}Forum{% endtrans %}</a></li>
    <li><a href="{{ user.url }}">{{ user.username }}</a></li>
    <li class="active">{% trans %}Posts{% endtrans %}</li>
</ul>
{% endblock %}

{% block profile_content %}
<!-- middle column -->
<div class="col-md-9 col-sm-9 col-xs-12 profile-content">

    {% for post in posts.items %}
    <div class="panel page-panel">
        <div class="panel-heading page-head topic-head">
            <a href="{{ post.url }}">{% trans topic_title=post.topic.title %}In topic <strong>{{ topic_title }}</strong>{% endtrans %}</a>
        </div>
        <div class="panel-body page-body topic-content">
            <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="topic-created">
                    {{ post.date_created|format_datetime }}
                </div>
                <div class="topic-content">
                    {{ post.content|markup }}
                </div>
            </div>
        </div>
    </div>
    {% else %}
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="alert-message alert-message-info" role="alert">
                {% trans %}No posts yet{% endtrans %}
            </div>
        </div>
    </div>
    {% endfor %}

    {% if posts.items %}
    <div class="col-md-12 col-sm-12 col-xs-12 controls-col">
        <div class="pull-left">
            {{ render_pagination(posts, url_for('user.view_all_posts', username=user.username)) }}
        </div>
    </div>
    {% endif %}

</div>
{% endblock %}
