{% extends 'base.html.twig' %}

{% block title %}Intern index{% endblock %}

{% block body %}
    <h1>Intern index</h1>

    <table class="table">
        <thead>
            <tr>
                <th>Id</th>
                <th>Nickname</th>
                <th>Roles</th>
                <th>Password</th>
                <th>FirstName</th>
                <th>LastName</th>
                <th>Tel</th>
                <th>Address</th>
                <th>Mail</th>
                <th>CoverLetter</th>
                <th>Resume</th>
                <th>actions</th>
            </tr>
        </thead>
        <tbody>
        {% for intern in interns %}
            <tr>
                <td>{{ intern.id }}</td>
                <td>{{ intern.nickname }}</td>
                <td>{{ intern.roles ? intern.roles|json_encode : '' }}</td>
                <td>{{ intern.password }}</td>
                <td>{{ intern.firstName }}</td>
                <td>{{ intern.lastName }}</td>
                <td>{{ intern.tel }}</td>
                <td>{{ intern.address }}</td>
                <td>{{ intern.mail }}</td>
                <td>{{ intern.coverLetter }}</td>
                <td>{{ intern.resume }}</td>
                <td>
                    <a href="{{ path('app_intern_show', {'id': intern.id}) }}">show</a>
                    <a href="{{ path('app_intern_edit', {'id': intern.id}) }}">edit</a>
                </td>
            </tr>
        {% else %}
            <tr>
                <td colspan="12">no records found</td>
            </tr>
        {% endfor %}
        </tbody>
    </table>
    <h3 class="text-lg font-semibold mt-6">Vos compétences :</h3>
    <ul class="list-disc list-inside text-gray-800">
        {% if app.user.skills|length > 0 %}
            {% for internSkill in app.user.skills %}
                <li>{{ internSkill.skill.label }}</li>
            {% endfor %}
        {% else %}
            <li>Aucune compétence sélectionnée</li>
        {% endif %}
    </ul>

    <a class="bg-teal-500 hover:bg-teal-600 text-white py-2 px-4 rounded-full"
       href="{{ path('app_profile_pickSkill') }}">Sélectionner vos compétences</a>

{% endblock %}
