{% extends "main_card.html.twig" %}

{% block title %}{% trans %}user.info.label{% endtrans %}{% endblock %}

{% block card_title %}<i class="fas fa-info-circle fa-fw" aria-hidden="true"></i>
    {% trans %}user.info.label{% endtrans %}{% endblock %}

{% block card_content %}
    <div class="card-body row">
        <div class="col-md-2">
            <div class="mx-auto">
                <img class="img-fluid img-thumbnail img-rounded " alt="User avatar" src="{{ avatar }}">
            </div>
        </div>
        <div class="col-md-5">
            <div class="form form-horizontal">
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}user.firstName.label{% endtrans %}</label>
                    <div class="col-md-8">
                        <p class="form-control-plaintext">{{ user.firstName }}</p>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}user.lastName.label{% endtrans %}</label>
                    <div class="col-md-8">
                        <p class="form-control-plaintext">{{ user.lastName }}</p>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}user.email.label{% endtrans %}</label>
                    <div class="col-md-8">
                        {# <p class="form-control-plaintext">{{ user.email }}</p>#}
                        <a class="form-control-link" href="mailto:{{ user.email }}">{{ user.email }}</a>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}user.department.label{% endtrans %}</label>
                    <div class="col-md-8">
                        <p class="form-control-plaintext">{{ user.department }}</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-5">
            <div class="form form-horizontal">
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}user.username.label{% endtrans %}</label>
                    <div class="col-md-8">
                        <p class="form-control-plaintext">{{ user.name }}</p>
                    </div>
                </div>
                <div class="form-group row">
                    <label class="col-form-label col-md-4">{% trans %}group.label{% endtrans %}</label>
                    <div class="col-md-8">
                        <p class="form-control-plaintext">{{ user.group.fullPath }}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block additional_content %}
    {% if is_granted('read', user) or is_granted('show_permissions', user) %}
    <div class="card mt-3">
        <div class="card-header"><i class="fas fa-gavel fa-fw"></i>
            {% trans %}user.permissions{% endtrans %}</div>
        <div class="card-body">
            {{ form_start(form) }}
            {{ form_row(form.permissions) }}
            {{ form_end(form) }}
        </div>
    </div>
    {% endif %}
{% endblock %}