{% if has_abzeichen %}
<div id="carousel-Indicators" class="carousel slide" data-ride="carousel" data-interval="10000">
    <ol class="carousel-indicators">
    {% for training in abzeichen %}
        {% if training.fin == 100 %}
        {% if loop.first %}
        <li data-target="#carousel-Indicators" data-slide-to="{{loop.index0}}" class="active"></li>
        {% endif %}
        {% if loop.first == false  %}
        <li data-target="#carousel-Indicators" data-slide-to="{{loop.index0}}"></li>
        {% endif %}
        {% endif %}
    {% endfor %}
    </ol>
    <div class="carousel-inner w-50 mx-auto">
    {% for training in abzeichen %}
        {% if training.fin == 100 %}
        {% if loop.first %}
        <div class="carousel-item active">
            {% include "abzeichen/abzeichen-item.html" with {'training': training, 'margin': 'mb-4 mt-4'} %}
            {% if show_certificate_download %}
            <div class="mb-4 text-center">
            {% if training.zertifikat is not empty %}
                <ul class="list-unstyled">
                {% for zertifikat in training.zertifikat %}
                    {% if current_user.user_firstname is not empty and current_user.user_lastname is not empty %}
                    <li><a href="javascript:generateCertifikate({{zertifikat.certificate_header}},{{zertifikat.certificate_content}}, {{zertifikat.certificate_footer}}, '{{certFindates[zertifikat.certificate_ID]}}')" class="text-color-black"><i class="fas fa-file-pdf mr-1"></i>{% if show_certificate_title %}{{zertifikat.title}}{% else %}Teilnahmezertifikat{% endif %}</a></li>
                    {% else %}
                    <li><a href="#" id="dashboard-certificate-no-name-link" class="text-color-black"><i class="fas fa-file-pdf mr-1"></i>{% if show_certificate_title %}{{zertifikat.title}}{% else %}Teilnahmezertifikat{% endif %}</a></li>
                    {% endif %}
                {% endfor %}
                </ul>
            {% else %}
                <em>Kein Teilnahmezertifikat hinterlegt</em>
            {% endif %}
            </div>
            {% endif %}
        </div>
        {% endif %}
        {% if loop.first == false %}
        <div class="carousel-item">
            {% include "abzeichen/abzeichen-item.html" with {'training': training, 'margin': 'mb-4 mt-4'} %}
            {% if show_certificate_download %}
            <div class="mb-4 text-center">
                {% if training.zertifikat is not empty %}
                <ul class="list-unstyled">
                {% for zertifikat in training.zertifikat %}
                    {% if current_user.user_firstname is not empty and current_user.user_lastname is not empty %}
                    <li><a href="javascript:generateCertifikate({{zertifikat.certificate_header}},{{zertifikat.certificate_content}}, {{zertifikat.certificate_footer}}, '{{certFindates[zertifikat.certificate_ID]}}')" class="text-color-black"><i class="fas fa-file-pdf mr-1"></i>{% if show_certificate_title %}{{zertifikat.title}}{% else %}Teilnahmezertifikat{% endif %}</a></li>
                    {% else %}
                    <li><a href="#" id="dashboard-certificate-no-name-link" class="text-color-black"><i class="fas fa-file-pdf mr-1"></i>{% if show_certificate_title %}{{zertifikat.title}}{% else %}Teilnahmezertifikat{% endif %}</a></li>
                    {% endif %}
                {% endfor %}
                </ul>
            {% else %}
                <em>Kein Teilnahmezertifikat hinterlegt</em>
            {% endif %}
            </div>
            {% endif %}
        </div>
        {% endif %}
        {% endif %}
    {% endfor %}
    </div>
    <a class="carousel-control-prev" href="#carousel-Indicators" role="button" data-slide="prev">
        <i class="fas fa-arrow-left text-color-black"></i>
    </a>
    <a class="carousel-control-next" href="#carousel-Indicators" role="button" data-slide="next">
    <i class="fas fa-arrow-right text-color-black"></i>
    </a>

    {% include 'zertifikate/zertifikate-pdf-template.html' with{'current_user': current_user} %}
    {% include 'dashboard/dashboard-certificate-no-name-modal.html' with{'isDemoUser': isDemoUser} %}
</div>
{% else %}
    {% include "dashboard/no-dashboard-item.html" with {'heading': defaultErrorSubject} %}
{% endif %}