+ {% include "./_customer_phones.html" with phones_editable=1 %}
diff --git a/admin_panel/templatetags/custom_tags.py b/admin_panel/templatetags/custom_tags.py
index bc5d34b..a5b8c27 100644
--- a/admin_panel/templatetags/custom_tags.py
+++ b/admin_panel/templatetags/custom_tags.py
@@ -20,6 +20,19 @@ def toJalaliDT(value):
def has_group(user, group_name):
return user.groups.filter(name=group_name).exists()
+@register.simple_tag
+def customer_phones(customer):
+ """شمارههای مشتری برای ستون اطلاعات مشتری.
+
+ قبلاً این داده فقط از context view میآمد و صفحاتی که آن را پاس نمیدادند
+ «شمارهای ثبت نشده» نشان میدادند؛ حالا از خودِ شیء ``customer`` استخراج
+ میشود تا هر صفحهای که این ستون را رندر میکند یکسان باشد.
+ """
+ if not getattr(customer, 'pk', None):
+ return []
+ from admin_panel.sms.phones import customer_phone_entries
+ return customer_phone_entries(customer)
+
register.filter('has_group', has_group)
register.filter('toJalali', toJalali)
register.filter('toJalaliDT', toJalaliDT)
\ No newline at end of file