{% if (is_boss or is_kAdmin or is_teamLeader) and showAddNameInProfileMessage %}
<div class="alert alert-info" role="alert">
    <h5><i aria-hidden="true" class="fas fa-info-circle"></i>&nbsp;Hinweis</h5>
    <p>
        Sie sind als 
        {% if is_boss and not is_kAdmin and not is_teamLeader %}Führungskraft
        {% elseif not is_boss and is_kAdmin and not is_teamLeader %}Berater/in
        {% elseif not is_boss and not is_kAdmin and is_teamLeader %}Teamleitung
        {% elseif is_boss and is_kAdmin and not is_teamLeader%}Führungskraft und Berater/in
        {% elseif is_boss and not is_kAdmin and is_teamLeader%}Führungskraft und Teamleitung
        {% elseif not is_boss and is_kAdmin and is_teamLeader%}Berater/in und Teamleitung
        {% elseif is_boss and is_kAdmin and is_teamLeader%}Führungskraft, Berater/in und Teamleitung
        {% endif %}
        im System hinterlegt. Bitte geben Sie in Ihrem <a class="alert-link" href="{{profile_link}}">Profil</a> Ihren vollständigen Namen an, sodass die Ihnen zugeordneten Mitarbeitenden diesen einsehen können.
    </p>
</div>
{% endif %}

{% if mailboxurl %}
<div class="alert alert-info p-2 d-flex justify-content-between">
    <p class="mb-0 lesson-name">{{unread_messages|length}} ungelesene Nachrichten</p>
    <p class="lesson-name"><a href="{{mailboxurl}}" class="text-color-black text-nowrap">Posteingang <i aria-hidden="true"
                class="fas fa-chevron-right ml-1"></i></a></p>
</div>
{% if unread_messages %}
<table class="table table-bordered msg-table text-break hyphens-auto mb-5">
    <caption class="sr-only">Ungelesene Nachrichten</caption>
    <thead>
        <tr>
            <th scope="col">Absender</th>
            <th class="w-75" scope="col">Betreff</th>
        </tr>
    </thead>
    <tbody>
        {% for message in unread_messages %}
        <tr>
            <td>{{ message.sender }}</td>
            <td class="hyphens-auto w-75"><a aria-label="Zum Postfach wechseln: {{ message.title }}" href="{% if mailboxurl != 0 %}{{ mailboxurl }}{% endif %}"
                    class="text-color-black">{{ message.title }}</a></td>
        </tr>
        {% endfor %}
    </tbody>
</table>
{% endif %}
{% endif %}

{% if hasNewTrainings %}
<div class="msgInfoContainer mb-3">
    <div class="alert alert-info p-2 d-flex justify-content-center">
        <p class="mb-0 lesson-name">Ihnen wurden neue Inhalte freigeschaltet.</p>
    </div>
    {% for newTraining in newTrainings %}
    <p class="lesson-name d-block mb-1"><a href="{{newTraining.url}}" class="">
        {% if not newTraining.trainingEnabled() and canSeeHiddenTrainings %}
            <i aria-hidden="true" class="fas fa-eye-slash" title="Training ist ausgeblendet"></i><span class="sr-only">Training ist ausgeblendet</span>&nbsp;
        {% endif %}
        {{newTraining.getTitle()}} <i aria-hidden="true"
                class="fas fa-chevron-right ml-1"></i></a></p>
    {% endfor %}
</div>
{% endif %}

{% if is_boss and (newContent_boss is not empty or newSurveyResults_boss is not empty) %}
<div class="msgInfoContainer mb-3">
    <div class="alert alert-info p-2 d-flex justify-content-center">
        <p class="mb-0 lesson-name">Sie sind als Führungskraft angemeldet.</p>
    </div>
    {% if newContent_boss is not empty%}
    <p class="lesson-name mb-0">Es liegen neue freigegebene Inhalte vor:</p>
    {% for bossContent in newContent_boss %}
    <p class="lesson-name d-block mb-1"><a href="{{bossContent.getUrl()}}" class="">{{bossContent.getTitle()}} <i aria-hidden="true"
                class="fas fa-chevron-right ml-1"></i></a></p>
    {% endfor %}
    {% endif %}
    {% if newSurveyResults_boss is not empty %}
    <p class="lesson-name mb-0 mt-3">Es liegen neue Befragungsergebnisse vor:</p>
    {% for bossSurveyResults in newSurveyResults_boss %}
    <p class="lesson-name d-block mb-1"><a href="{{bossSurveyResults.getUrl()}}"
            class="">{{bossSurveyResults.getTitle()}} <i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a></p>
    {% endfor %}
    {% endif %}
</div>
{% endif %}

{% if is_kAdmin and (newContent_kadmin is not empty or newSurveyResults_kadmin is not empty) %}
<div class="msgInfoContainer mb-3">
    <div class="alert alert-info p-2 d-flex justify-content-center">
        <p class="mb-0 lesson-name">Sie sind als Berater/in angemeldet.</p>
    </div>
    {% if newContent_kadmin is not empty %}
    <p class="lesson-name mb-0">Es liegen neue freigegebene Inhalte vor:</p>
    {% for kadminContent in newContent_kadmin %}
    <p class="lesson-name d-block mb-1"><a href="{{kadminContent.getUrl()}}" class="">{{kadminContent.getTitle()}} <i aria-hidden="true"
                class="fas fa-chevron-right ml-1"></i></a></p>
    {% endfor %}
    {% endif %}
    {% if newSurveyResults_kadmin is not empty %}
    <p class="lesson-name mb-0 mt-3">Es liegen neue Befragungsergebnisse vor:</p>
    {% for kadminSurveyResults in newSurveyResults_kadmin %}
    <p class="lesson-name d-block mb-1"><a href="{{kadminSurveyResults.getUrl()}}"
            class="">{{kadminSurveyResults.getTitle()}} <i aria-hidden="true" class="fas fa-chevron-right ml-1"></i></a></p>
    {% endfor %}
    {% endif %}
</div>
{% endif %}

{% if newContent_kadmin is empty and newSurveyResults_kadmin is empty and newContent_boss is empty and
newSurveyResults_boss is empty and mailboxurl == false and hasNewTrainings == false and showAddNameInProfileMessage == false %}
{% include "dashboard/no-dashboard-item.html" with {'heading': defaultErrorSubject} %}
{% endif %}