{% extends "layouts/base.html" %} {% load i18n %} {% block title %}{{ source.name_en }} - {% trans "PX Source" %}{% endblock %} {% block content %}

{{ source.name_en }}

{% if source.is_active %} {% trans "Active" %} {% else %} {% trans "Inactive" %} {% endif %}

{% trans "Back to List" %} {% if request.user.is_px_admin %} {% trans "Edit" %} {% trans "Delete" %} {% endif %}
{% trans "Source Details" %}
{% trans "Source Details" %}
{% trans "Name (English)" %} {{ source.name_en }}
{% trans "Name (Arabic)" %} {{ source.name_ar|default:"-" }}
{% trans "Description" %} {{ source.description|default:"-"|linebreaks }}
{% trans "Status" %} {% if source.is_active %} {% trans "Active" %} {% else %} {% trans "Inactive" %} {% endif %}
{% trans "Created" %} {{ source.created_at|date:"Y-m-d H:i" }}
{% trans "Last Updated" %} {{ source.updated_at|date:"Y-m-d H:i" }}
{% trans "Quick Actions" %}
{% if request.user.is_px_admin %} {% trans "Edit Source" %} {% trans "Delete Source" %} {% endif %}

{% trans "Recent Usage" %} ({{ usage_records|length }})
{% if usage_records %}
{% for record in usage_records %} {% endfor %}
{% trans "Date" %} {% trans "Content Type" %} {% trans "Object ID" %} {% trans "Hospital" %} {% trans "User" %}
{{ record.created_at|date:"Y-m-d H:i" }} {{ record.content_type.model }} {{ record.object_id|truncatechars:20 }} {{ record.hospital.name_en|default:"-" }} {{ record.user.get_full_name|default:"-" }}
{% else %}

{% trans "No usage records found for this source." %}

{% endif %}
{% comment %} {% if request.user.is_px_admin %} {% endcomment %}
{% trans "Source Users" %} ({{ source_users|length }})
{% trans "Add Source User" %}
{% if source_users %}
{% for su in source_users %} {% endfor %}
{% trans "User" %} {% trans "Email" %} {% trans "Status" %} {% trans "Permissions" %} {% trans "Created" %} {% trans "Actions" %}
{{ su.user.get_full_name|default:"-" }} {{ su.user.email }} {% if su.is_active %} {% trans "Active" %} {% else %} {% trans "Inactive" %} {% endif %} {% if su.can_create_complaints %} {% trans "Complaints" %} {% endif %} {% if su.can_create_inquiries %} {% trans "Inquiries" %} {% endif %} {% if not su.can_create_complaints and not su.can_create_inquiries %} {% trans "None" %} {% endif %} {{ su.created_at|date:"Y-m-d" }}
{% else %}

{% trans "No source users assigned yet." %} {% trans "Add a source user" %} {% trans "to get started." %}

{% endif %}
{% comment %} {% endif %} {% endcomment %}
{% endblock %}