{% macro metadata(w, include_notif_counter = true) %}
    {% if include_notif_counter == true %}
        {% set more = [] %}
        {% for e in w.accompanyingPeriodWorkEvaluations %}
            {% for d in e.documents %}
                {% set more = more|merge([{'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id}]) %}
            {% endfor %}
        {% endfor %}

        {% set notif_counter = chill_count_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, more) %}

        {% if notif_counter.total > 0 %}
        {{ chill_counter_notifications('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, more) }}
        {% endif %}
    {% endif %}
    {% import '@ChillPerson/Macro/updatedBy.html.twig' as macro %}
    {{ macro.updatedBy(w) }}
{% endmacro %}

{% macro workflowButton(w) %}
    {% set suppEvaluations = [] %}
    {% for e in w.accompanyingPeriodWorkEvaluations %}
        {% set suppEvaluations = suppEvaluations|merge([
            {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluation', 'relatedEntityId': e.id }
        ]) %}
        {% for d in e.documents %}
            {% set suppEvaluations = suppEvaluations|merge([
                {'relatedEntityClass': 'Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWorkEvaluationDocument', 'relatedEntityId': d.id }
            ]) %}
        {% endfor %}
    {% endfor %}
    {{ chill_entity_workflow_list('Chill\\PersonBundle\\Entity\\AccompanyingPeriod\\AccompanyingPeriodWork', w.id, [], suppEvaluations) }}
{% endmacro %}
