{% extends "base.html" %} {% block title %}تتبع الشحنة - {{ shipment.tracking_number }}{% endblock %} {% block page_title %}تتبع الشحنة{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{{ shipment.tracking_number }}
رقم التتبع
{% set status_info = get_shipment_status_display(shipment.status) %} حالة الشحنة: {{ status_info.name }}

تتبع مراحل الشحنة

{% set status_order = ['created', 'packaged', 'dispatching', 'shipped', 'in_transit', 'received', 'delivered'] %} {% set status_names = {'created': 'تم إنشاء الشحنة', 'packaged': 'تم التغليف', 'dispatching': 'جاري الإرسال', 'shipped': 'تم الإرسال', 'in_transit': 'في الطريق', 'received': 'تم الاستلام', 'delivered': 'تم التوصيل'} %} {% for status in status_order %} {% set is_current = shipment.status == status %} {% set current_index = status_order.index(shipment.status) if shipment.status in status_order else 0 %} {% set status_index = status_order.index(status) %} {% set is_completed = current_index > status_index %}
{{ status_names[status] }}
{% if is_current or is_completed %}

{{ shipment.created_at.strftime('%m/%d %H:%M') }}

{% endif %} {% if current_user.is_authenticated and not is_current %}
{% elif current_user.is_authenticated and is_current %}
الحالة الحالية
{% endif %}
{% endfor %}
بيانات المرسل
الاسم: {{ shipment.sender_name }}
الهاتف: {{ shipment.sender_phone }}
{% if shipment.sender_address %}
العنوان في الكويت: {{ shipment.sender_address }}
{% endif %} {% if shipment.sender_email %}
البريد الإلكتروني: {{ shipment.sender_email }}
{% endif %}
بيانات المستلم
الاسم: {{ shipment.receiver_name }}
الهاتف: {{ shipment.receiver_phone }}
{% if shipment.receiver_address %}
العنوان في السودان: {{ shipment.receiver_address }}
{% endif %} {% if shipment.receiver_email %}
البريد الإلكتروني: {{ shipment.receiver_email }}
{% endif %}
تفاصيل الشحنة
الوزن: {{ shipment.weight }} كج
التكلفة: {{ "%.2f"|format(shipment.price) }} د.ك
تاريخ الإنشاء: {{ shipment.created_at.strftime('%Y-%m-%d') }}
المحتويات: {{ shipment.package_contents or 'أغراض شخصية' }}
{% if shipment.document_type %}
نوع المستند: {{ shipment.document_type }}
{% endif %} {% if shipment.notes %}
ملاحظات: {{ shipment.notes }}
{% endif %}
الحالة: {% if shipment.status == 'created' %}تم الإنشاء {% elif shipment.status == 'packaged' %}تم التغليف {% elif shipment.status == 'dispatching' %}جاري الإرسال {% elif shipment.status == 'shipped' %}تم الإرسال {% elif shipment.status == 'in_transit' %}في الطريق {% elif shipment.status == 'received' %}تم الاستلام {% elif shipment.status == 'delivered' %}تم التوصيل {% else %}{{ shipment.status }} {% endif %}
تحديث حالة الشحنة
العودة لتتبع الشحنات
{% endblock %} {% block extra_js %} {% endblock %}