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

{% block title %}{{ user.getLastName() ~ ' ' ~ user.getFirstName() | striptags | raw }}{% endblock %}

{% set canEdit = (app.user is not null and user.getId() == app.user.getId()) or is_granted('ROLE_ADMIN') %}

{% block content %}
    <div class="panel panel-default panel-user">
        <div class="panel-heading relative">
            <h3 class="panel-title">
                {{ 'public_profile' | trans({}, 'platform') }}
            </h3>
        </div>
        <div class="panel-body">
            <ul class="nav nav-tabs">
                <li class="active">
                    <a href="#general-profile" data-toggle="tab">{{ 'general'|trans({}, 'platform') }}</a>
                </li>
                {% for facet in facets %}
                    <li>
                        <a href="#facet-{{ facet.id }}" data-toggle="tab">{{ facet.name }}</a>
                    </li>
                {% endfor %}
            </ul>
            <div id="facet-pane" class="tab-content">
                <div class="tab-pane active" id="general-profile">
                    <div class="panel-body">
                        {% include "ClarolineCoreBundle:Profile:publicProfileGeneralTab.html.twig"
                        with {'user': user, 'publicProfilePreferences': publicProfilePreferences }
                        %}
                    </div>
                </div>
                {% for facet in facets %}
                    {% include "ClarolineCoreBundle:Profile:facetPane.html.twig"
                    with {'facet': facet, 'fieldFacetValues': fieldFacetValues, 'fieldFacets': fieldFacets}
                    %}
                {% endfor %}
            </div>
        </div>
    </div>
{% endblock %}

{% block javascripts %}
    {{ parent() }}
    <script type="text/javascript" src="{{ asset('bundles/clarolinecore/js/profile/profile.js') }}"></script>
{% endblock %}
