<!--Liste an Nutzern, die vom Coach betreut werden (wird individuell für jeden Coach angezeigt)-->
<div class="card coaching-overview-coach-user-list-box">
    <div class="box-header">
        <h4>Mir zugewiesene Teilnehmende</h4>
    </div>
    <div class="box-body">

        {% if users | length > 0%}
        {% for user in users %}
        <div class="coach-user-list mb-3">
            <div class="coach-user-list-header d-flex">
                <div class="mr-auto">
                    <button type="button" class="btn btn-link ts-list-button" data-toggle="collapse" {%set rand = random()%} data-target="#demo_{{rand}}" aria-expanded="false">
                        <div class="ts-list-title-icon d-inline-block">
                            <i class="fas fa-chevron-right"></i>
                            <i class="fas fa-chevron-down"></i>
                        </div>
                        {{ user.displayName }}
                    </button>
                </div>
                <div>
                    <a href="{{ detail_page_links[user.userID] }}" class="btn btn-secondary coach-user-list-button text-nowrap">Detail-Seite</a>
                </div>
            </div>
                <div id="demo_{{rand}}" class="collapse coach-user-list-user-details">
                    <ul class="coach-user-list-info font-size-small pl-4">
                        <li>
                            <span>Studienteilnehmer-ID: {% if user.userStudID  == ""%} -{% else %}{{ user.userStudID }}{% endif%}</span>
                        </li>
                        {% if user.trainings | length == 0 %}
                            <span>Dieser Teilnehmende benötigt aktuell keine Betreuung durch einen Coach</span>
                        {% else %}
    
                        {% if user.trainings | length == 1%}
                        <li>
                            Zu betreuendes Training
                        </li>
                        {% else %}
                        <li>
                            Zu betreuende Trainings
                        </li>
                        {% endif%}
                        <ul class="font-size-small pl-4">
                            {% for training in user.trainings%}
                            <li>
                                {{training.trainingTitle}} ({%if training.coachingMode == 1%}E-Coaching bei Bedarf{%elseif training.coachingMode == 2 %}Umfassendes E-Coaching{% endif %})
                            </li>
                            {% endfor %}
                        </ul>
                        {% endif %} 
                    </ul>
                </div>
        </div>
        {% endfor %}
        {% else %}
        <div class="alert alert-info" role="alert">
            <h5><i class="fas fa-info-circle"></i>&nbsp;Hinweis</h5>
            <p>
                Aktuell gibt es keine Teilnehmenden, die du betreust.
            </p>                      
        </div>
        {% endif %}
    </div>
    <div class="box-footer">
    </div>
</div>
