Files
customerTicket/templates/tickets/_staff_share_audit_row.html
T
2026-10-04 16:42:19 +03:30

18 lines
2.3 KiB
HTML

{% load jalali %}
<details class="share-audit-row">
<summary>
<span class="staff-share-person"><b>{{ grant.user.staff_profile|default:grant.user.username }}</b>{% if not inline %}<small>{% if is_message %}فقط یک پیام{% else %}{{ grant.get_permission_level_display }}{% endif %}</small>{% endif %}</span>
<span class="staff-share-status {% if grant.revoked_at %}is-revoked{% elif is_message and grant.message.deleted_at %}is-revoked{% elif grant.first_viewed_at %}is-seen{% else %}is-pending{% endif %}">{% if grant.revoked_at %}لغوشده{% elif is_message and grant.message.deleted_at %}پیام حذف‌شده{% elif grant.first_viewed_at %}دیده‌شده{% else %}هنوز دیده نشده{% endif %}</span>
<span class="staff-share-chevron" aria-hidden="true"></span>
</summary>
<div class="staff-share-row-content">
{% if is_message and not inline and not grant.message.deleted_at %}<p class="staff-share-preview">{{ grant.message.body|truncatechars:100|default:'پیام دارای پیوست' }}</p>{% endif %}
<small>اشتراک توسط {{ grant.granted_by.staff_profile|default:grant.granted_by.username }} · {{ grant.created_at|jalali_datetime }}</small>
{% if grant.note %}<p class="staff-share-note">{{ grant.note }}</p>{% endif %}
{% if grant.first_viewed_at %}<small>اولین مشاهده: {{ grant.first_viewed_at|jalali_datetime }}</small><small>آخرین مشاهده: {{ grant.last_viewed_at|jalali_datetime }} · {{ grant.view_count }} بار</small>{% endif %}
{% if is_message and not inline %}<small>زمان پیام: {{ grant.message.created_at|jalali_datetime }}</small><small class="staff-share-reference" dir="ltr">{{ grant.message.public_id }}</small>{% endif %}
{% if grant.revoked_at %}<small>لغو: {{ grant.revoked_at|jalali_datetime }}{% if grant.revoked_by %} توسط {{ grant.revoked_by.staff_profile|default:grant.revoked_by.username }}{% endif %}</small>
{% else %}<form method="post" action="{% if is_message %}{% url 'staff_tickets:revoke_message_share' ticket.public_id grant.public_id %}{% else %}{% url 'staff_tickets:revoke' ticket.public_id grant.user.public_id %}{% endif %}">{% csrf_token %}<button class="staff-share-revoke" type="submit">{% if is_message %}لغو اشتراک پیام{% else %}لغو اشتراک تیکت{% endif %}</button></form>{% endif %}
</div>
</details>