{% extends "PackagistWebBundle::layout.html.twig" %}

{% import "PackagistWebBundle::macros.html.twig" as macros %}

{% set isActualUser = app.user and app.user.username is sameas(user.username) %}

{% block content %}
<h2 class="title">
    {{ user.username }}
    <small>
        member since: {{ user.createdAt|date('M d, Y') }}
        {%- if is_granted('ROLE_ADMIN') %}
            <a href="mailto:{{ user.email }}">{{ user.email }}</a>
        {%- endif %}
    </small>
</h2>

<section class="row">
    <section class="col-md-12">
        {% embed "PackagistWebBundle:Web:list.html.twig" with {noLayout: 'true', showAutoUpdateWarning: isActualUser} %}
            {% block content_title %}
                <h3 class="font-normal profile-title">{{ user.username }}'s packages</h3>
            {% endblock %}
        {% endembed %}
    </section>
</section>
{% endblock %}
