{% extends 'base.html.twig' %} {% set bodyClass = 'maturity_survey form edit' %} {% set menuItem = 'maturity_survey' %} {% block title %}{{ 'maturity.survey.title.show'|trans }} - {{ parent() }}{% endblock %} {% block body_head %}

{{ 'maturity.survey.title.show'|trans }} {{ object.createdAt|date("d/m/Y") }}

{% endblock %} {% block breadcrumb %} {% set breadcrumb = [ { 'name': 'maturity.survey.breadcrumb.list'|trans, 'link': path('maturity_survey_list') }, { 'name': 'maturity.survey.breadcrumb.show'|trans } ] %} {% include '_breadcrumb.html.twig' with {'breadcrumb': breadcrumb} %} {% endblock %} {% block body %} {% set submitValue = submitValue|default('maturity.survey.action.synthese_submit'|trans) %} {{ form_start(form) }}

{{ 'maturity.survey.tab.survey'|trans }}

{% if object.maturity is empty %} {{ 'global.label.no_data'|trans }} {% else %} {% if object.maturity|length >= 3 %} {% else %} {{ 'reporting.dashboard.label.maturity_referentiel_error'|trans }} {% endif %} {% endif %}
{{ 'maturity.survey.label.score'|trans }} {{ object.score/10|round(1) }}
{% do form.answerSurveys.setRendered() %} {% set showPreco = false %} {% for domain in object.referentiel.domains %} {% set domainAnswers = form.answerSurveys|filter(as => as.vars.value.answer.question.domain.id == domain.id and as.vars.value.answer.recommendation) %} {% if domainAnswers|length > 0 %} {% set showPreco = true %} {% endif %} {% endfor %} {% if showPreco %}

{{ 'maturity.survey.tab.recommendation'|trans }}

{% set colors = ['box-info','box-success','box-primary','box-warning'] %} {% for domain in object.referentiel.domains|sort((a, b) => a.position > b.position) %} {% set domainAnswers = form.answerSurveys|filter(as => as.vars.value.answer.question.domain.id == domain.id and as.vars.value.answer.recommendation) %} {% set colorSection = 0 %} {% if loop.index matches '/^\\d+$/' %} {% set colorSection = (loop.index - 1) % 4 %} {% endif %} {% if domainAnswers|length > 0 %}

{{ domain.name }}

{% if is_granted('ROLE_USER') %}
{% for answerSurvey in domainAnswers %}
{{ form_widget(answerSurvey.mesurements) }}
{% endfor %}
{% else %}
{% for answerSurvey in domainAnswers %} {% endfor %}
{% endif %}
{% endif %} {% endfor %}
{% endif %}
{{ 'global.action.back_to_list'|trans }} {% if showPreco and is_granted('ROLE_USER') %} {% endif %}
{{ form_end(form) }} {{ include('Registry/Mesurement/_modal_form.html.twig') }} {% endblock %} {% block javascripts %} {{ include('Registry/Mesurement/_modal_form_js.html.twig') }} {% endblock %}