{% import '@ChamiloTheme/Macros/box.html.twig' as macro %}
{% import '@ChamiloTheme/Macros/image.html.twig' as macro_image %}

<!-- Sidebar user panel -->
<div style="text-align:center;" id="user_image_block" class="panel panel-default">
    <div class="panel-body">
    {% if user.avatar %}
        {{ macro_image.avatar_from_media(user.avatar, user.username) }}
    {% else %}
        {{ macro_image.avatar('img/icons/128/unknown.png', user.username)  }}
    {% endif %}

    <p>{{ 'Hello, %user%'| trans( {'%user%': user.username }, 'ChamiloThemeBundle') }}</p>
    <a href="#">
        <i class="fa fa-circle text-success"></i> {{ 'Online' | trans }}
    </a>

    {% if is_granted('ROLE_PREVIOUS_ADMIN') %}
        <a href="{{ path('home', {'_switch_user': '_exit'}) }}">
            {{ 'Exit impersonation' | trans }}
        </a>
    {% endif %}
    </div>
</div>
