{% extends 'Front/Render/Modal/layout.html.twig' %}

{% set modalClass = 'itdlc ope' %}
{% set headerClass = 'bg-tangerine' %}
{% set bodyClass = '' %}
{% set footerClass = '' %}

{% set constUserTypeProf = constant('AppBundle\\Enum\\UserType::TEACHER') %}
{% set constUserTypeInge = constant('AppBundle\\Enum\\UserType::ENGINEER') %}

{% block header %}
    <div class="container">
        <div class="row">
            <div class="col-md-4">
                <div class="photo-badge" {% if ope.prof.photo is not empty %}style="background-image: url({{ ope.prof.getWebPhoto|imagine_filter('150Lx150H')|replace({' ' : '%20'}) }})"{% endif %}>
                    {% if ope.prof.photo is empty %}
                        {{ include('Front/_component/icon.html.twig', {id: 'user--user', class:'icon-profile-default'}) }}
                    {% endif %}
                </div>
            </div>
            <div class="col-md-8">
                <h3 class="item-title h6 text-no-transform">
                    {{ ope.prof.establishmentName ?? ope.prof.establishmentNameOther }}
                </h3>
                <p class="">
                    {{ ope.prof.establishmentAddress }}<br />
                    {{ ope.prof.establishmentZipcode }} {{ ope.prof.establishmentCity }}
                </p>
                <p class="text-small">
                    <strong>Intervention&nbsp;:</strong>
                    "{{ ope.goalCategory|transconst('\\AppBundle\\Enum\\ITDLCGoalCategory') }}"
                    {% if 1 == ope.availability|length -%}
                        {% set availability = ope.availability|first %}
                        
                        {% if availability.dayoftheweek is null %}
                            le <strong>{{ availability.dateVisite|date('d/m/Y') }}</strong>
                        {% else %}
                            tous les <strong>{{ availability.dayoftheweek|lower }}</strong>
                        {% endif %}
                        de <strong>{{ availability.startTime|date('H\\hi') }}</strong> à <strong>{{ availability.endTime|date('H\\hi') -}}</strong>
                    {% endif %}
                </p>
            </div>
        </div>
    </div>
{% endblock %}

{% block body %}
    <p>
        <strong>{{ 'word.teacher.label'|trans({}, 'word') }}&nbsp;:</strong>
        {{ ope.prof.firstname }} {{ ope.prof.lastname }}
    </p>
    <p>
        <strong>{{ 'form.profile.teacher.job.label'|trans({}, 'form') }}&nbsp;:</strong>
        {% if ope.prof.categoryJob is not empty %}{{ ope.prof.categoryJob|transconst('AppBundle\\Enum\\UserJobTeacherCategory') }} / {% endif %}{% if ope.prof.jobOther is not empty %}{{ ope.prof.jobOther }}{% else %}{{ ope.prof.job|transconst('AppBundle\\Enum\\UserJobTeacher') }}{% endif %}
    </p>
    <p>
        <strong>{{ 'form.itdlc.classLevel.label'|trans({}, 'form') }}&nbsp;:</strong>
        {{ ope.classLevel }} {% if ope.classOption %}({{ ope.classOption }}){% endif %}
    </p>
    <p>
        <strong>{{ 'form.itdlc.nbStudent.label'|trans({}, 'form') }}&nbsp;:</strong>
        {{ ope.nbStudent }}
    </p>
    <p>
        <strong>{{ 'form.profile.teacher.establishment.label'|trans({}, 'form') }}&nbsp;:</strong>
        {{ ope.prof.establishmentName ?? ope.prof.establishmentNameOther }}<br />
        {{ ope.prof.establishmentAddress }}<br />
        {{ ope.prof.establishmentZipcode }} {{ ope.prof.establishmentCity }}
    </p>
    {% if ope.availability|length > 1 %}
    <p>
        Différentes dates disponibles : <br />
        {% for availability in ope.availability %}
            {% if availability.dayoftheweek is null %}
                Le <strong>{{ availability.dateVisite|date('d/m/Y') }}</strong>
            {% else %}
                Tous les <strong>{{ availability.dayoftheweek|lower }}</strong> 
            {% endif %} 
            de <strong>{{ availability.startTime|date('H\\hi') }}</strong> à <strong>{{ availability.endTime|date('H\\hi') -}}</strong><br />
        {% endfor %}
    </p>
    {% endif %}
{% endblock %}

{% block footer %}
    {% if app.user.type == constUserTypeProf and app.user.id == ope.prof.id %}
           
    {% elseif app.user.type == constUserTypeInge %}
        
    {% endif %}
{% endblock %}