Files
customerTicket/templates/payments/_notice_sms.html
T
2026-10-07 13:39:29 +03:30

40 lines
4.4 KiB
HTML

{% load jalali %}
<section class="pay-card pay-sms-panel" aria-labelledby="notice-sms-title">
<h2 id="notice-sms-title">پیامک اعلامیه و سوابق ارسال</h2>
<p class="pay-section-help">پذیرش پیامک توسط سرویس به معنی رسیدن به گوشی نیست؛ وضعیت دریافت بر اساس استعلام سرویس پیامک نمایش داده می‌شود.</p>
{% if can_resend_notice_sms %}
<form method="post" action="{% url 'staff_payments:notice_resend_sms' notice.public_id %}" data-notice-sms>
{% csrf_token %}<input type="hidden" name="request_key" value="{{ notice_sms_request_key }}">
<button class="pay-button secondary" type="submit" {% if notice_sms_pending %}disabled{% endif %}>ارسال مجدد پیامک اعلامیه واریز</button>
</form>
{% if notice_sms_pending %}<p class="pay-section-help" role="status">پیامک در صف یا در حال ارسال است. نتیجه پس از پردازش سامانه و با تازه‌سازی این صفحه نمایش داده می‌شود.</p>{% endif %}
{% endif %}
<div class="pay-sms-history">
{% for notification in notifications %}
<article class="pay-sms-record">
<header><strong>{% if notification.manual_resend %}ارسال مجدد{% else %}ارسال اولیه{% endif %}</strong><time>{{ notification.job.created_at|jalali_datetime }}</time></header>
<p>وضعیت ارسال: <strong>{% if notification.job.status == 'SENT' %}پذیرفته‌شده توسط سرویس پیامک{% else %}{{ notification.job.get_status_display }}{% endif %}</strong></p>
<p>وضعیت دریافت: <span class="pay-status {{ notification.delivery_class }}">{{ notification.delivery_label }}</span></p>
{% if notification.job.staff_user %}<p>درخواست‌کننده: {{ notification.job.staff_user.staff_profile.display_name|default:notification.job.staff_user.get_full_name|default:notification.job.staff_user.username }}</p>{% endif %}
{% if notification.job.sent_at %}<p>زمان ارسال: {{ notification.job.sent_at|jalali_datetime }}</p>{% endif %}
{% if notification.job.status == 'RETRYING' %}<p>تلاش خودکار بعدی: {{ notification.job.next_attempt_at|jalali_datetime }}</p>{% endif %}
{% if notification.job.last_error %}<p class="pay-sms-error">علت خطای ارسال: {{ notification.job.last_error }}</p>{% endif %}
{% if notification.job.delivery_checked_at %}<p>آخرین استعلام: {{ notification.job.delivery_checked_at|jalali_datetime }} · {{ notification.job.delivery_check_attempts }} نوبت</p>{% endif %}
{% if notification.job.delivery_next_check_at %}<p>استعلام بعدی: {{ notification.job.delivery_next_check_at|jalali_datetime }}</p>{% endif %}
{% if notification.job.delivery_description %}<p>شرح نتیجه دریافت: {{ notification.job.delivery_description }}</p>{% endif %}
{% if notification.job.delivery_status_code %}<p>کد وضعیت دریافت: <bdi>{{ notification.job.delivery_status_code }}</bdi></p>{% endif %}
<details><summary>جزئیات پیام و تلاش‌های ارسال ({{ notification.send_attempts|length }})</summary>
{% if notification.rendered_body %}<div class="pay-sms-body">{{ notification.rendered_body|linebreaksbr }}</div>{% endif %}
{% for attempt in notification.send_attempts %}<div class="pay-sms-attempt">
<p><time>{{ attempt.started_at|jalali_datetime }}</time> · {% if attempt.success == True %}پذیرفته‌شده توسط سرویس{% elif attempt.success == False %}تلاش ناموفق{% else %}نتیجه تلاش هنوز ثبت نشده است{% endif %}</p>
{% if attempt.finished_at %}<p>پایان تلاش: {{ attempt.finished_at|jalali_datetime }}</p>{% endif %}
{% if attempt.provider_id %}<p>شناسه رهگیری: <bdi>{{ attempt.provider_id }}</bdi></p>{% endif %}
{% if attempt.provider_code %}<p>کد پاسخ سرویس: <bdi>{{ attempt.provider_code }}</bdi></p>{% endif %}
{% if attempt.error %}<p class="pay-sms-error">{{ attempt.error }}</p>{% endif %}
{% empty %}<p>هنوز تلاشی برای ارسال ثبت نشده است.</p>{% endfor %}
</details>
</article>
{% empty %}<p class="pay-section-help">اطلاع‌رسانی ثبت‌شده‌ای وجود ندارد.</p>{% endfor %}
</div>
</section>