{% extends 'layout.twig' %}
     
{% block body %}

<section class="contenu titre_div">
    <h1>{{ 'Suivi' | trad }}</h1>
    
    {{ ariane() }}
    
    <header class="bs-row">
        <h2>{{ strBuild('Facture N°@1@' | trad, [facture.NUM_FACT]) }}</h2>
        <div class="bs-col text-right">
        </div>
    </header>

    {% embed '@GlobalApplication/WorkflowEvent/docWorkflowChain.twig' with {
        listWorfowItem: listWorfowItem,
        facture: facture,
    } only %}
        {% block interaction %}
            onclick="updateWorkflowDetail({{ path(
                'Facture.Workflow.detail',
                {factureId: facture.NUM_FACT, workflowId: item.id}
            ) | json | e('html_attr') }})"
        {% endblock %}
    {% endembed %}
    
    <article id="wf-list-event">
        {#- placeholder for updateWorkflowDetail() -#}
    </article>
    
</section>
<script>
function updateWorkflowDetail(path) {
    let el = document.getElementById('wf-list-event');
    ajaxHtmlUpdate(el, path, {}, function() {
        el.scrollIntoView({block: 'start'});
    });
    
}
</script>
{% endblock %}