{% extends '@App/app.html.twig' %}
{% block title %}Préparation manager{% endblock %}
{% block page_header %}{% endblock %}
{% block content %}
{% set employee = interview.salarie %}
{% set photo_path = employee.photo ? employee.photo|trim : null %}
{% set avatar_src = photo_path ? (photo_path starts with 'http://' or photo_path starts with 'https://' ? photo_path : asset(photo_path starts with '/' ? photo_path|slice(1) : photo_path)) : null %}
{% set initials = ((employee.prenom|default('')|first) ~ (employee.nom|default('')|first))|upper ?: 'S' %}
{% set questions_by_section = {} %}
{% set orphan_questions = [] %}
{% for question in questions %}
{% if question.section %}
{% set key = 'section_' ~ question.section.id %}
{% set questions_by_section = questions_by_section|merge({(key): (questions_by_section[key]|default([]))|merge([question])}) %}
{% else %}
{% set orphan_questions = orphan_questions|merge([question]) %}
{% endif %}
{% endfor %}
{% macro render_question(question, answers) %}
{% set answer = answers[question.id]|default(null) %}
{% set value = answer ? (answer.answerJson ?: answer.answerText) : '' %}