{% load debusine %}
<details {% if work_request.workflow_data.expanded %}open{% endif %}>
    <summary>{% include "web/_work_request-workflow.html" %}</summary>
    <ul>
        {# TODO: This should be batched. #}
        {% for child in work_request_ui.workflow_children|lookup:work_request.id %}
            <li>
                {% if work_request_ui.workflow_children|lookup:child.id %}
                    {% include "web/_work_request-descendants.html" with work_request=child %}
                {% else %}
                    {% include "web/_work_request-workflow.html" with work_request=child %}
                {% endif %}
            </li>
        {% endfor %}
    </ul>
</details>
