From 108fd9cafa7ce1ad07ea64b81d65c1103334d809 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 9 Oct 2025 15:49:47 +0200 Subject: [PATCH] UI improvements for the prospect dashboard --- biz/models.py | 6 ++++ biz/templates/admin/biz/dashboard.html | 45 ++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/biz/models.py b/biz/models.py index b4eb180..9eb0410 100644 --- a/biz/models.py +++ b/biz/models.py @@ -89,6 +89,12 @@ class Prospect(BaseModel): return last_activity.status return Status.NONE + def current_activity_type(self): + last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() + if last_activity: + return last_activity.type + return None + def current_text(self): last_activity = self.activities.exclude(status=None).order_by('-creation_date').first() if last_activity: diff --git a/biz/templates/admin/biz/dashboard.html b/biz/templates/admin/biz/dashboard.html index 2ba1ab1..f79cc1c 100644 --- a/biz/templates/admin/biz/dashboard.html +++ b/biz/templates/admin/biz/dashboard.html @@ -58,6 +58,7 @@ .prospect-table { width: 100%; border-collapse: collapse; + table-layout: fixed; } .prospect-table thead { @@ -74,6 +75,36 @@ border-bottom: 1px solid #ddd; } + .prospect-table th:nth-child(1), + .prospect-table td:nth-child(1) { + width: 150px; + } + + .prospect-table th:nth-child(2), + .prospect-table td:nth-child(2) { + width: auto; + } + + .prospect-table th:nth-child(3), + .prospect-table td:nth-child(3) { + width: 120px; + } + + .prospect-table th:nth-child(4), + .prospect-table td:nth-child(4) { + width: 140px; + } + + .prospect-table th:nth-child(5), + .prospect-table td:nth-child(5) { + width: 130px; + } + + .prospect-table th:nth-child(6), + .prospect-table td:nth-child(6) { + width: 130px; + } + .prospect-table tbody tr { border-bottom: 1px solid #eee; transition: background-color 0.2s; @@ -104,6 +135,8 @@ .prospect-entity { color: #666; font-style: italic; + overflow: hidden; + text-overflow: ellipsis; } .prospect-date { @@ -153,6 +186,7 @@ Name Entity Phone + Activity Type Last Update @@ -166,6 +200,7 @@ {{ prospect.entity_names }} {{ prospect.phone|default:"-" }} + {{ prospect.current_activity_type|default:"-" }} {{ prospect.last_update|date:"d/m/Y H:i" }} {% endfor %} @@ -189,6 +224,7 @@ Name Entity Phone + Activity Type Last Update @@ -202,6 +238,7 @@ {{ prospect.entity_names }} {{ prospect.phone|default:"-" }} + {{ prospect.current_activity_type|default:"-" }} {{ prospect.last_update|date:"d/m/Y H:i" }} {% endfor %} @@ -225,8 +262,9 @@ Name Entity Phone - Last Update Status + Activity Type + Last Update @@ -239,8 +277,9 @@ {{ prospect.entity_names }} {{ prospect.phone|default:"-" }} - {{ prospect.last_update|date:"d/m/Y H:i" }} {{ prospect.current_status }} + {{ prospect.current_activity_type|default:"-" }} + {{ prospect.last_update|date:"d/m/Y H:i" }} {% endfor %} @@ -263,6 +302,7 @@ Name Entity Phone + Activity Type Last Update @@ -276,6 +316,7 @@ {{ prospect.entity_names }} {{ prospect.phone|default:"-" }} + {{ prospect.current_activity_type|default:"-" }} {{ prospect.last_update|date:"d/m/Y H:i" }} {% endfor %}