From b1702f6557ea60a7859da25b9ae7320fc0f1bbc1 Mon Sep 17 00:00:00 2001 From: Laurent Date: Sun, 13 Jul 2025 22:19:01 +0200 Subject: [PATCH] CRM improvements --- bizdev/admin.py | 2 +- bizdev/models.py | 4 ++++ tournaments/templates/admin/tournaments/dashboard.html | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/bizdev/admin.py b/bizdev/admin.py index 2be93d8..439303d 100644 --- a/bizdev/admin.py +++ b/bizdev/admin.py @@ -375,7 +375,7 @@ class ProspectAdmin(SyncedObjectAdmin): @admin.register(Activity) class ActivityAdmin(SyncedObjectAdmin): - list_display = ('creation_date', 'status', 'type', 'description', 'attachment_text') + list_display = ('prospect_names', 'creation_date', 'status', 'type', 'description', 'attachment_text', ) list_filter = ('status', 'type') search_fields = ('description',) filter_horizontal = ('prospects',) diff --git a/bizdev/models.py b/bizdev/models.py index 83f3f11..340db98 100644 --- a/bizdev/models.py +++ b/bizdev/models.py @@ -126,6 +126,10 @@ class Activity(BaseModel): html += '' return html + def prospect_names(self): + prospect_names = [prospect.full_name() for prospect in self.prospects.all()] + return ", ".join(prospect_names) + @receiver(m2m_changed, sender=Activity.prospects.through) def update_prospect_last_update(sender, instance, action, pk_set, **kwargs): instance.prospects.update(last_update=timezone.now()) diff --git a/tournaments/templates/admin/tournaments/dashboard.html b/tournaments/templates/admin/tournaments/dashboard.html index f0dcfeb..c0e1cb9 100644 --- a/tournaments/templates/admin/tournaments/dashboard.html +++ b/tournaments/templates/admin/tournaments/dashboard.html @@ -24,6 +24,10 @@ style="display: block; padding: 12px 15px; background: #17a2b8; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> Purchases + + Prospects + Tournaments