{% load i18n %}

{% trans "Involved Departments" %}

{% if can_edit %} {% trans "Add Department" %} {% endif %}
{% if complaint.involved_departments.exists %}
{% for dept in complaint.involved_departments.all %}

{{ dept.department.name }}

{% if dept.is_primary %} {% trans "PRIMARY" %} {% endif %} {{ dept.get_role_display }}
{% if dept.assigned_to %}
{% trans "Assigned to:" %} {{ dept.assigned_to.get_full_name }} {% if dept.assigned_at %} ({{ dept.assigned_at|date:"M d, Y" }}) {% endif %}
{% endif %} {% if dept.notes %}

{{ dept.notes }}

{% endif %} {% if dept.response_submitted %}
{% trans "Response Submitted" %} {{ dept.response_submitted_at|date:"M d, Y H:i" }}
{% if dept.response_notes %}

{{ dept.response_notes }}

{% endif %}
{% endif %}
{% if can_edit %}
{% if not dept.response_submitted %}
{% csrf_token %}
{% endif %}
{% csrf_token %}
{% endif %}
{% endfor %}
{% else %}

{% trans "No departments involved yet" %}

{% if can_edit %} {% trans "Add First Department" %} {% endif %}
{% endif %}