{% block body %}
    {% for contributor in averageContributorGradesByContributors %}
        <tr id="questionnaire_contributor_{{ idAO }}_{{ contributor.CONTRIB }}" class="questionnaire_contributor_{{ idAO }}detail">
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>    
            <td colspan="2" class="auto_width fixed-side fixed-bottom noBorderTop borderRight borderBottom" style="min-width:150px;font-weight:bold;">
                {{ contributor.NOM ~ ' (' ~ contributor.CONTRIB ~ ')' }}
            </td>
            <td class="ligne_split fixed-side fixed-bottom borderRight noBorderTop"></td>
            {% for frs in contributor.suppliers %}
                <td class="auto_width align-right borderRight borderBottom" style="min-width:150px;">
                    {{ frs.AVERAGE_GRADE | prix ~ '/10' }}
                </td>
            {% endfor %}
        </tr>
    {% else %}
        <tr id="questionnaire_contributor_{{ idAO }}_{{ contributor.CONTRIB }}" class="questionnaire_contributor_{{ idAO }}detail">
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>
            <td class="fixed-side fixed-bottom borderBottom noBorderTop"></td>    
            <td colspan="2" class="auto_width fixed-side fixed-bottom noBorderTop borderRight borderBottom" style="min-width:150px;font-weight:bold;">
                {{ 'Aucun contributeur sur cette consultation' | trad }}
            </td>
            <td class="ligne_split fixed-side fixed-bottom borderRight noBorderTop"></td>
        </tr>
    {% endfor %}
    <script type="text/javascript" src="{{ baseUrl('ext/tableHeadFixer/js/tableHeadFixer.js')~'?cache='~getSession('cache')  }}"></script>
    <script>
        $(document).ready(function() {
            $("#choixFrs").tableHeadFixer({'z-index' : 0, "head" : false, "left" : 9, "foot": {% if questionnaire %}4{% else %}3{% endif %}}); 
        });

        function showContributorQuestionnaire(object)
        {
            let id = $(object).attr("data-id");
            let contrib = $(object).attr("data-contrib");
            if ($(".questionnaire_contributor_" + id + '_' + contrib + 'detail').length) {
                $(".questionnaire_contributor_" + id + '_' + contrib + 'detail').remove();
            } else {
                $.ajax({
                    url : '{{ path('Consultation.ChoixFournisseur.ajaxDetailContributorsAnswers', {idAO: idAO}) }}',
                    type : 'POST',
                    dataType : 'html',
                    data: {'contributor' : contrib}, 
                    success : function(html){
                        $("#questionnaire_contributor_" + id + '_' + contrib).after(html);
                        $(object).attr("data-etat", 'open');
                    }
                }); 
            }
        }
    </script>                    
{% endblock %}