{% if not notrainings %}
    {% for training_category in trainings %}
        {% if training_category['trainings'] is not empty %}
            {% if training_category['name'] is not empty %}
                {% if show_category_name %}
                    <h4 class="mt-5 mb-3">{{ training_category['name'] }}</h4>
                {% endif %}
                {% if category_text is not empty %}
                    <p>{{ category_text|raw }}</p>
                {% endif %}
            {% endif %}
        {% endif %}
        {% for training in training_category['trainings'] %}
            {% if training.trainingEnabled() or (not training.trainingEnabled() and canSeeHiddenTrainings) %}
                {% if showalltrainings != true  %}
                    {% if (training.getFin() >0) and (training.getFin()<100) %}
                        <div class="d-flex justify-content-between mb-1"> 
                            <p class="bg-white mb-0 pe-3 hyphens-auto lesson-name mw-100">
                                {% if not training.trainingEnabled() and canSeeHiddenTrainings %}
                                    <i class="fas fa-eye-slash" aria-hidden="true" title="Training ist ausgeblendet"></i><span class="sr-only">Training ist ausgeblendet</span>&nbsp;
                                {% endif %}
                                {{training.title}}
                            </p>
                            {% if training.getLastPage() is not null and training.showResumeOption() %}
                            <p class="bg-white mb-0 pe-3 ml-2 lesson-name text-nowrap flex-shrink-0"><a class="text-color-black" href="{{training.getLastPage().getUrl()}}">fortsetzen<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a></p>
                            {% else %}
                                {% if training.showLektionsliste() %}
                                <p class="bg-white mb-0 pe-3 ml-2 lesson-name text-nowrap flex-shrink-0"><a class="text-color-black" href="{{training.url}}">Übersicht<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a></p>
                                {% else %}
                                <p class="bg-white mb-0 pe-3 ml-2 lesson-name text-nowrap flex-shrink-0"><a class="text-color-black" href="{{training.getLektionsliste()[0].getFirstPageUrl()}}">starten<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a></p>
                                {% endif %}
                            {% endif %}
                        </div>
                        <div class="progress mb-4">
                            <div class="progress-bar primary-bg-color" aria-label="Fortschritt" role="progressbar" style="width: {{training.fin}}%;" aria-valuenow="{{training.fin}}" aria-valuemin="0" aria-valuemax="100">{{training.fin}}%</div>
                        </div>
                    {% endif %}
                {% else %}
                    <div class="d-flex justify-content-between mb-1"> 
                        <p class="bg-white mb-0 pe-3 hyphens-auto lesson-name mw-100">
                            {% if not training.trainingEnabled() and canSeeHiddenTrainings %}
                                <i class="fas fa-eye-slash" aria-hidden="true" title="Training ist ausgeblendet"></i><span class="sr-only">Training ist ausgeblendet</span>&nbsp;
                            {% endif %}
                            {{training.title}}
                        </p>

                        <p class="bg-white mb-0 pe-3 ml-2 lesson-name text-nowrap flex-shrink-0">
                            {% if (training.getFin() >0) and (training.getFin() < 100) and (training.getLastPage() is not null) and (training.showResumeOption()) %}
                                {% if training.showLektionsliste() %}
                                <a class="text-color-black" href="{{training.url}}">Übersicht</a>
                                {% else %}
                                <a class="text-color-black" href="{{training.getLektionsliste()[0].getFirstPageUrl()}}">starten</a>
                                {% endif %}
                                <span aria-hidden="true"> | </span>
                                <a class="text-color-black" href="{{training.getLastPage().getUrl()}}">fortsetzen<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a>
                            {% else %}
                                {% if training.showLektionsliste() %}
                                <a class="text-color-black" href="{{training.url}}">Übersicht<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a>
                                {% else %}
                                <a class="text-color-black" href="{{training.getLektionsliste()[0].getFirstPageUrl()}}">starten<i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a>
                                {% endif %}
                            {% endif %}
                        </p>
                    </div>
                    <div class="progress mb-4">
                        <div class="progress-bar primary-bg-color" aria-label="Fortschritt" role="progressbar" style="width: {{training.fin}}%;" aria-valuenow="{{training.fin}}" aria-valuemin="0" aria-valuemax="100">{{training.fin}}%</div>
                    </div>
                {% endif %}
            {% endif %}
        {% endfor %}
    {% endfor %}
{% else %}
    {% include "dashboard/no-dashboard-item.html" with {'heading': defaultErrorSubject} %}
{% endif %}