{% extends "layouts/base.html" %} {% load i18n %} {% load static %} {% block title %}{% trans "Action" %} #{{ action.id|slice:":8" }} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% trans "Back to Actions" %}

{{ action.title }}

{% if action.status == 'completed' %} {{ action.get_status_display }} {% elif action.status == 'in_progress' %} {{ action.get_status_display }} {% elif action.status == 'cancelled' %} {{ action.get_status_display }} {% else %} {{ action.get_status_display }} {% endif %} {% if action.priority == 'high' %} {{ action.get_priority_display }} {% elif action.priority == 'medium' %} {{ action.get_priority_display }} {% else %} {{ action.get_priority_display }} {% endif %} {% if action.escalation_level > 0 %} Level {{ action.escalation_level }} {% endif %}
ID: {{ action.id|slice:":8" }} {{ action.hospital.name_en }} {% if action.department %} {{ action.department.name_en }} {% endif %}
{% trans "SLA Progress" %}
{{ sla_progress }}%
{% trans "Due:" %} {{ action.due_at|date:"M d, Y H:i" }} {% if action.is_overdue %} {% trans "OVERDUE" %} {% else %} {{ action.due_at|timeuntil }} {% trans "left" %} {% endif %}

{% trans "Action Details" %}

{% trans "Category" %}
{{ action.get_category_display }}
{% trans "Priority" %}
{{ action.get_priority_display }}

{% trans "Description" %}

{{ action.description|linebreaks }}

{% if action.action_plan %}
{% trans "Action Plan" %}
{{ action.action_plan|linebreaks }}
{% endif %} {% if action.outcome %}
{% trans "Outcome" %}
{{ action.outcome|linebreaks }}
{% endif %}
{% trans "Created" %}
{{ action.created_at|date:"M d, Y H:i" }}
{% trans "Last Updated" %}
{{ action.updated_at|date:"M d, Y H:i" }}
{% if action.status == 'pending_approval' and can_approve %}

{% trans "Approval Required" %}

{% trans "This action is awaiting your approval." %}

{% csrf_token %}
{% endif %} {% if can_edit %}

{% trans "Quick Actions" %}

{% csrf_token %}
{% csrf_token %}
{% endif %} {% if user.is_px_admin or user.is_hospital_admin or user.is_department_manager %}

{% trans "QI Project" %}

{% if action.qi_projects.exists %}

{% trans "Linked to:" %}

{% else %}

{% trans "Convert this action to a QI project for long-term tracking." %}

{% endif %} {% if action.qi_projects.exists %}{% trans "Already Converted" %}{% else %}{% trans "Convert to Project" %}{% endif %}
{% endif %}

{% trans "Add Note" %}

{% csrf_token %}

{% trans "Assignment Info" %}

{% trans "Assigned To" %}
{% if action.assigned_to %}
{{ action.assigned_to.get_full_name }}
{% trans "Assigned" %} {{ action.assigned_at|date:"M d, Y H:i" }}
{% else %}
{% trans "Unassigned" %}
{% endif %}
{% if action.approved_by %}
{% trans "Approved By" %}
{{ action.approved_by.get_full_name }}
{{ action.approved_at|date:"M d, Y H:i" }}
{% endif %} {% if action.closed_by %}
{% trans "Closed By" %}
{{ action.closed_by.get_full_name }}
{{ action.closed_at|date:"M d, Y H:i" }}
{% endif %}

{% trans "SLA Information" %}

{% trans "Due Date" %}
{{ action.due_at|date:"M d, Y H:i" }}
{% if action.escalated_at %}
{% trans "Escalated" %}
{{ action.escalated_at|date:"M d, Y H:i" }} Level {{ action.escalation_level }}
{% endif %} {% if action.reminder_sent_at %}
{% trans "Reminder Sent" %}
{{ action.reminder_sent_at|date:"M d, Y H:i" }}
{% endif %}
{% endblock %}