{% set rand = random() %}

    <div class="indice-actu" data-ulrinfotrafic="{{ urlObjet }}">
        <h3 class="info_trafic">{{ typeActu }}
            <a class="btn btn-link pull-right" href="{{ urlObjet }}" title="{{ 'label.widget.voir_tt_info_traf'|trans }}" target="_blank" data-toggle="tooltip">
                <span class="picto-arrow-right"></span><span class="sr-only">{{ 'label.widget.voir_tt_info_traf'|trans }}</span>
            </a>
        </h3>
        <div id="{{ 'myCarousel' ~ rand }}" class="carousel slide" data-wrap="true" data-interval="6000" data-ride="carousel">
            <ol class="carousel-indicators">
                {% for key, actu in actus %}
                    <li data-target="{{ '#myCarousel' ~ rand }}" data-slide-to = "{{ key }}" class="{% if key == 0 %}active{% endif %}"></li>
                {% endfor %}
            </ol>
            <div class="carousel-inner">
                {% if actus is empty %}
                    <p>{{ 'label.widget.pas_de_perturb'|trans }}</p>
                {% else %}
                    {% for key, actu in actus %}
                        <div class="{% if key == 0 %}active{% endif %} item">
                            <div class="actu" data-lines="{% for line in actu.lignes%}{{ line.code }},{% endfor %}" {% if affichage.withGravite is defined and affichage.withGravite == "true" and  actu.gravite is not null%} data-gravite="{{ actu.gravite.id }}" {% endif %}>
                                {% if affichage.withTitreAccroche == "true" %}
                                    <a href="{{ actu.actuLink }}">
                                        {% if affichage.withIndice == "true" and lines is not empty %}
                                            {% for line in actu.lignes %}
                                                <img class="indice" data-code="{{ line.code }}" src="/photos/__IndicesLignes/{{ line.code }}.png" alt="ligne {{ line.code }}">
                                            {% endfor %}
                                        {% endif %}
                                        <strong>{{ actu.titre }}</strong>
                                        {% if affichage.withDate == "true" %}
                                            <small>{{ actu.agenda | raw }}</small>
                                        {% endif %}
                                    </a>
                                {% endif %}

                                {% if affichage.withPhraseAccroche == "true" %}
                                    <p>{{ actu.message }}</p>
                                {% endif %}
                            </div>
                        </div>
                    {% endfor %}
                {% endif %}
            </div>
            {% if actus is not empty %}
            <a href="{{ '#myCarousel' ~ rand }}" class="carousel-control left" data-slide="prev"><span class="picto-arrow-left" aria-hidden="true"></span><span class="sr-only">{{ 'label.precedent'|trans }}</span></a> <a href="{{ '#myCarousel' ~ rand }}" class="carousel-control right" data-slide="next"><span class="picto-arrow-right" aria-hidden="true"></span><span class="sr-only">{{ 'label.suivant'|trans }}</span></a>
        {% endif %}
        </div>

        
    </div>
