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

<section class="contenu titre_div">
    <h1>{{ 'Suivi' |trad }}</h1>
    
    {{ ariane() }}
    
    <header class="bs-row">
        <h2>
            {{- strBuild(
                'Commande @1@ du fournisseur @2@ (@3@)' | trad,
                [
                    commande.NO_CDE,
                    commande.Fournisseur_RS,
                    commande.Fournisseur_CODE,
                ]
            ) -}}
        </h2>
        <div class="bs-col text-right">
        </div>
    </header>
        
    {% embed '@GlobalApplication/WorkflowEvent/docWorkflowChain.twig' with {
        listWorfowItem: listWorfowItem,
        commande: commande,
    } only %}
        {% block interaction %}
            onclick="updateWorkflowDetail({{ path(
                'Commande.Workflow.detail',
                {commandeId: commande.NO_CDE, 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 %}