CRM improvements

apikeys
Laurent 4 months ago
parent 5611450360
commit b1702f6557
  1. 2
      bizdev/admin.py
  2. 4
      bizdev/models.py
  3. 4
      tournaments/templates/admin/tournaments/dashboard.html

@ -375,7 +375,7 @@ class ProspectAdmin(SyncedObjectAdmin):
@admin.register(Activity) @admin.register(Activity)
class ActivityAdmin(SyncedObjectAdmin): 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') list_filter = ('status', 'type')
search_fields = ('description',) search_fields = ('description',)
filter_horizontal = ('prospects',) filter_horizontal = ('prospects',)

@ -126,6 +126,10 @@ class Activity(BaseModel):
html += '</tr></table>' html += '</tr></table>'
return 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) @receiver(m2m_changed, sender=Activity.prospects.through)
def update_prospect_last_update(sender, instance, action, pk_set, **kwargs): def update_prospect_last_update(sender, instance, action, pk_set, **kwargs):
instance.prospects.update(last_update=timezone.now()) instance.prospects.update(last_update=timezone.now())

@ -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;"> style="display: block; padding: 12px 15px; background: #17a2b8; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;">
Purchases Purchases
</a> </a>
<a href="{% url 'admin:bizdev_prospect_changelist' %}"
style="display: block; padding: 12px 15px; background: #17a2b8; color: white; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;">
Prospects
</a>
<a href="{% url 'admin:tournaments_tournament_changelist' %}" <a href="{% url 'admin:tournaments_tournament_changelist' %}"
style="display: block; padding: 12px 15px; background: #ffc107; color: #212529; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;"> style="display: block; padding: 12px 15px; background: #ffc107; color: #212529; text-decoration: none; border-radius: 8px; text-align: center; font-weight: 500;">
Tournaments Tournaments

Loading…
Cancel
Save