{% load i18n %}

{% trans "Send To Department" %}

{% if explanations %}
{% if can_manage_actions and complaint.is_active_status %} {% endif %}
{% for exp in explanations %}
{{ exp.staff.first_name|first }}{{ exp.staff.last_name|first }}

{{ exp.staff }}

{{ exp.staff.employee_id }} {% if exp.staff.department %} {{ exp.staff.department.name }} {% endif %}
{% if exp.is_used %}{% trans "Submitted" %}{% else %}{% trans "Pending" %}{% endif %} {% if exp.is_used %} {{ exp.get_acceptance_status_display }} {% endif %}
{% if exp.escalated_to_manager %}
{% trans "Escalated to Manager" %} ({{ exp.escalated_to_manager.staff.get_full_name }})
{% if exp.acceptance_notes %}

{{ exp.acceptance_notes }}

{% endif %}
{% endif %} {% if exp.is_used and exp.explanation %} {% with linked_dept=exp.linked_involved_department %} {% if linked_dept and linked_dept.manager_review_status == 'pending' %}
{% trans "Pending Manager Review" %}

{% trans "Awaiting department manager approval." %}

{% elif linked_dept and linked_dept.manager_review_status == 'rejected' %}
{% trans "Rejected by Manager" %}

{% trans "Champion needs to re-submit." %}

{% else %}

{{ exp.explanation }}

{% if exp.attachment_count > 0 %}
{{ exp.attachment_count }} {% trans "attachment(s)" %}
{% endif %}
{% endif %} {% endwith %} {% endif %} {% if can_manage_actions and complaint.is_active_status and exp.is_used and not exp.escalated_to_manager %} {% with linked_dept=exp.linked_involved_department %} {% if not linked_dept or linked_dept.manager_review_status == 'approved' %}
{% if exp.acceptance_status == 'pending' %}
{% if exp.staff.report_to %} {% else %} {% trans "No Manager to Escalate" %} {% endif %}
{% else %}
{% trans "Reviewed by:" %} {{ exp.accepted_by.get_full_name }} {% trans "on" %} {{ exp.accepted_at|date:"Y-m-d H:i" }}
{% endif %}
{% endif %} {% endwith %} {% endif %} {% for inv in exp.investigation.all %}
{% trans "Investigation" %} {{ inv.questions.count }} {% trans "questions" %}
{% for resp in inv.responses.all %}
{% if resp.is_completed %} {{ resp.staff.get_full_name }} {{ resp.completed_at|date:"M d, H:i" }} {% else %} {{ resp.staff.get_full_name }} {% trans "Pending" %} {% endif %}
{% endfor %}
{% if inv.status == 'answers_received' and inv.explanation.token %} {% trans "Review & Submit Reply" %} {% endif %} {% if inv.status == 'reply_submitted' and inv.final_reply %}

{% trans "Final Reply" %}

{{ inv.final_reply|truncatewords:30 }}

{% endif %}
{% endfor %} {% if can_manage_actions and complaint.is_active_status and not exp.is_used %}
{% if not exp.reminder_sent_at %} {% elif not exp.second_reminder_sent_at %} {% else %} {% trans "Reminders Sent" %} {% endif %}
{% if exp.reminder_sent_at %}
{% trans "1st reminder:" %} {{ exp.reminder_sent_at|date:"Y-m-d H:i" }} {% if exp.second_reminder_sent_at %} {% trans "2nd reminder:" %} {{ exp.second_reminder_sent_at|date:"Y-m-d H:i" }} {% endif %}
{% endif %}
{% endif %}
{% endfor %}
{% else %}

{% trans "Not requests sent yet" %}

{% if can_manage_actions and complaint.is_active_status %} {% endif %}
{% endif %}